@embedpdf/viewer-chrome 3.0.0-next.11 → 3.0.0-next.13
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.
- package/README.md +47 -0
- package/dist/chrome.cjs +6 -0
- package/dist/chrome.cjs.map +1 -1
- package/dist/chrome.js +6 -0
- package/dist/chrome.js.map +1 -1
- package/dist/commands.cjs +62 -2
- package/dist/commands.cjs.map +1 -1
- package/dist/commands.js +62 -2
- package/dist/commands.js.map +1 -1
- package/dist/{es-B7b8KjR3.cjs → es-DYwzfxyt.cjs} +87 -3
- package/dist/es-DYwzfxyt.cjs.map +1 -0
- package/dist/{es-aQlZ3hcL.js → es-sN6uqBgD.js} +87 -3
- package/dist/es-sN6uqBgD.js.map +1 -0
- package/dist/index.cjs +1689 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +91 -18
- package/dist/index.d.ts +91 -18
- package/dist/index.js +1645 -40
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/dist/es-B7b8KjR3.cjs.map +0 -1
- package/dist/es-aQlZ3hcL.js.map +0 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["InteractionToken","defaultChrome","getMenu","getStrip","CommandsToken","resolvedCommandsEqual","StageToken","Toolbar","Fragment","AnnotationMenu","SelectionMenu","TOOL_ICONS","RedactionToken","AnnotationToken","StageToken","AnnotationToken","SearchToken","Stage","RenderLayer","StageToken","formWidgetRenderer","ShellToken","getModeBar","DocumentGate","SelectionClipboard","Stage","SelectionHandles","Scrollbar","RenderLayer","SelectionLayer","SearchLayer","LinkLayer","AnnotationLayer","defaultCommands","defaultChrome","chromeHelpers","vibrationFeedback","Viewer"],"sources":["../src/config/stage.ts","../src/config/demo-tools.plugin.ts","../src/locales/en.ts","../src/config-context.tsx","../src/handle.ts","../src/ui/icons.tsx","../src/ui/theme.tsx","../src/ui/menu.tsx","../src/ui/toolbar.tsx","../src/ui/link-editor.tsx","../src/ui/strip-bar.tsx","../src/ui/annotation-strip.tsx","../src/ui/selection-strip.tsx","../src/ui/tab-bar.tsx","../src/ui/tool-cursor.tsx","../src/ui/annotation-flags.tsx","../src/ui/annotation-style.tsx","../src/ui/comment-config.ts","../src/ui/comments-panel.tsx","../src/ui/redaction-panel.tsx","../src/ui/search-panel.tsx","../src/ui/panels.tsx","../src/ui/redact-confirm.tsx","../src/ui/document-boot.tsx","../src/Shell.tsx","../src/viewer.tsx"],"sourcesContent":["/**\n * The Stage is a LENS: one document can be viewed through several at once. The\n * thumbnail sidebar is a second lens over the SAME document — a single-column,\n * fixed-zoom grid with its own camera, fully independent of the main view.\n *\n * The token lives here (not in App.tsx) because two places need it: App wires the\n * `stagePlugin` lens with it, and the sidebar renders `<Stage token={...}>` off it.\n */\nimport { createCapabilityToken } from '@embedpdf/react/runtime';\nimport type { StageCapability } from '@embedpdf/react/stage';\n\nexport const ThumbsStageToken = createCapabilityToken<StageCapability>('stage-thumbs');\n","import { definePlugin } from '@embedpdf/react/runtime';\nimport { InteractionToken } from '@embedpdf/react/interaction';\n\n/**\n * Example-only: register the insert / redact authoring tools as INERT\n * interaction tools. v3 doesn't yet ship signature or redaction plugins, but\n * this is a CHROME demo — its job is selection state and layout, not the\n * tool's effect. Registering them as real (behaviourless) tools lets every\n * tool button in every mode band go through the SAME path\n * (`InteractionToken.activateTool`), so `active` is uniform and honest: the\n * button really is the active tool; it just has no handler behind it.\n *\n * The annotate + shapes tools are NOT here — those are real tools the\n * annotation plugin registers (highlight, ink, square, circle, …) — and\n * neither are the form palette tools (the form plugin's draw-to-place).\n */\nconst INERT_TOOLS: ReadonlyArray<{ id: string; cursor: string }> = [\n // insert mode (redact is REAL now — plugin-annotation ships the composed\n // tool and plugin-redaction the destructive apply)\n { id: 'signature', cursor: 'copy' },\n { id: 'image', cursor: 'copy' },\n];\n\nexport const demoToolsPlugin = () =>\n definePlugin({\n id: 'demo-tools',\n scope: 'document',\n requires: [InteractionToken],\n init: (ctx) => {\n const interaction = ctx.get(InteractionToken);\n for (const tool of INERT_TOOLS) {\n // No `enables` → no gesture/handler wakes up: the tool is selectable\n // (cursor + active state) but behaviourless. Exactly what a chrome demo\n // needs from form/redact/signature tools v3 doesn't ship yet.\n interaction.registerTool({ id: tool.id, cursor: tool.cursor, enables: new Set<string>() });\n }\n },\n });\n","import type { Locale } from '@embedpdf/react/i18n';\n\n/**\n * English pack. Strings belong to the PRODUCT, not the plugins — the\n * `commands.*` namespace mirrors the v2 snippet packs so translations carry\n * over; `demo.*` is this example's own chrome.\n */\nexport const en: Locale = {\n code: 'en',\n name: 'English',\n translations: {\n commands: {\n zoom: {\n in: 'Zoom In',\n out: 'Zoom Out',\n fitPage: 'Fit to Page',\n fitWidth: 'Fit to Width',\n automatic: 'Automatic',\n menu: 'Zoom',\n level: 'Zoom Level',\n p50: '50%',\n p100: '100%',\n p150: '150%',\n p200: '200%',\n p400: '400%',\n },\n pan: 'Pan',\n pointer: 'Pointer',\n sidebar: 'Sidebar',\n search: 'Search',\n comment: 'Comment',\n style: 'Style',\n menu: 'Menu',\n viewControls: 'View Controls',\n download: 'Download',\n print: 'Print',\n fullscreen: 'Full Screen',\n spread: { group: 'Page Layout', none: 'Single Page', odd: 'Two Page', even: 'Cover Page' },\n scroll: { group: 'Scrolling', vertical: 'Vertical', horizontal: 'Horizontal' },\n rotate: {\n group: 'Rotate',\n clockwise: 'Rotate Clockwise',\n counterclockwise: 'Rotate Counter-Clockwise',\n },\n mode: {\n group: 'Mode',\n view: 'View',\n annotate: 'Annotate',\n shapes: 'Shapes',\n insert: 'Insert',\n form: 'Form',\n redact: 'Redact',\n },\n annotate: {\n highlight: 'Highlight',\n strikeout: 'Strikeout',\n underline: 'Underline',\n squiggly: 'Squiggly',\n ink: 'Draw',\n inkHighlight: 'Ink Highlighter',\n text: 'Text',\n insertText: 'Insert Text',\n replaceText: 'Replace Text',\n callout: 'Callout',\n note: 'Comment',\n link: 'Link',\n gotoLink: 'Go to link',\n removeLink: 'Remove link',\n delete: 'Delete',\n group: 'Group',\n ungroup: 'Ungroup',\n strip: 'Annotation actions',\n },\n selection: {\n copy: 'Copy',\n strip: 'Text selection actions',\n },\n shapes: {\n rectangle: 'Rectangle',\n circle: 'Circle',\n line: 'Line',\n arrow: 'Arrow',\n polygon: 'Polygon',\n polyline: 'Polyline',\n },\n insert: {\n stamp: 'Rubber Stamp',\n attachment: 'Attach File',\n signature: 'Signature',\n image: 'Image',\n },\n form: {\n textfield: 'Text Field',\n checkbox: 'Checkbox',\n radio: 'Radio Button',\n select: 'Dropdown',\n listbox: 'List Box',\n },\n redact: {\n mark: 'Mark for Redaction',\n applyAll: 'Apply Redactions',\n clearAll: 'Clear Marks',\n panel: 'Redactions',\n },\n undo: 'Undo',\n redo: 'Redo',\n },\n passwordPrompt: {\n title: 'Password required',\n required: 'This document is password protected. Enter the password to open it.',\n incorrect: 'The password was incorrect. Please try again.',\n incorrectWarning: 'Incorrect password',\n label: 'Password',\n placeholder: 'Enter password',\n cancel: 'Cancel',\n open: 'Open',\n opening: 'Opening…',\n },\n documentError: {\n title: 'Couldn’t open document',\n unknown: 'The document could not be opened.',\n close: 'Close document',\n },\n // Annotation type names — the comment sidebar's icon tooltips. Keys carry\n // over from the v2 packs so existing translations still resolve.\n annotation: {\n comment: 'Comment',\n highlight: 'Highlight',\n underline: 'Underline',\n squiggly: 'Squiggly',\n strikeout: 'Strikethrough',\n square: 'Square',\n circle: 'Circle',\n line: 'Line',\n polygon: 'Polygon',\n polyline: 'Polyline',\n ink: 'Ink',\n freeText: 'Text',\n stamp: 'Stamp',\n caret: 'Caret',\n redact: 'Redact',\n fileAttachment: 'Attachment',\n },\n demo: {\n starting: 'Starting viewer…',\n opening: 'Opening document…',\n more: 'More',\n thumbnails: 'Thumbnails',\n outline: 'Outline',\n searchPlaceholder: 'Search document…',\n searchTitle: 'Search',\n searchCaseSensitive: 'Case sensitive',\n searchWholeWord: 'Whole word',\n searchRegex: 'Regular expression',\n searchSearching: 'Searching…',\n searchResults: '{count} results found',\n searchNoResults: 'No results',\n searchPage: 'Page {page}',\n commentsTitle: 'Comments',\n commentsForbidden: 'You don\\u2019t have access to comments on this document.',\n commentsLoading: 'Loading comments…',\n commentsError: 'Comments failed to load.',\n commentsRetry: 'Retry',\n commentsEmpty: 'No comments yet. Use the note tool to start a thread.',\n commentsAnonymous: 'Unknown',\n commentsPage: 'Page {page}',\n commentCount: '{count} comment',\n commentCountPlural: '{count} comments',\n commentsReply: 'Reply',\n commentsReplyPlaceholder: 'Reply…',\n commentsAddPlaceholder: 'Add a comment…',\n commentsDelete: 'Delete comment',\n commentsDeleteThread: 'Delete thread',\n commentsEdit: 'Edit comment',\n commentsStatus: 'Status',\n commentsStatusNone: 'No status',\n commentsStatusAccepted: 'Accepted',\n commentsStatusRejected: 'Rejected',\n commentsStatusCancelled: 'Cancelled',\n commentsStatusCompleted: 'Completed',\n styleTitle: 'Style',\n empty: 'Nothing here yet in this demo panel.',\n page: 'Page {current} of {total}',\n cancel: 'Cancel',\n pageBadge: 'p. {page}',\n redactionTitle: 'Redactions',\n redactionEmpty: 'No pending redactions. Use the Redact tool to mark text or areas.',\n redactionArea: 'Area mark',\n redactionText: 'Text mark',\n redactionRemove: 'Remove mark',\n redactConfirmTitle: 'Apply redactions?',\n redactConfirmBody:\n 'Permanently remove the content under {count} redaction marks. This cannot be undone.',\n redactConfirmCollateral: '{count} other annotations will also be removed.',\n redactApply: 'Apply',\n redactApplying: 'Applying…',\n redactLabelTitle: 'Redaction label',\n redactLabelPlaceholder: 'e.g. REDACTED',\n redactLabelRepeat: 'Repeat label across region',\n },\n },\n};\n","/**\n * The resolved customization, as React context. The chrome schema and the\n * user's extra icons are RESOLVED ONCE in <FullViewer> and read here by the\n * shell, menus, and strips — no component imports the default schema value\n * directly, so \"the host replaced the chrome\" is invisible below this line.\n *\n * The default context value is the default config: components render correctly\n * in tests and stories without a provider.\n */\nimport { createContext, useContext } from 'react';\nimport type { BarSchema, ChromeSchema, MenuSchema } from '@embedpdf/react/toolbar';\nimport { defaultChrome, getMenu, getModeBar, getStrip } from './config/chrome';\nimport type { IconDef } from './ui/icons';\n\nexport interface ResolvedViewerConfig {\n readonly chrome: ChromeSchema;\n /** User-registered icons — additive over the built-in set. */\n readonly icons: Readonly<Record<string, IconDef>>;\n}\n\nconst DEFAULT_CONFIG: ResolvedViewerConfig = { chrome: defaultChrome, icons: {} };\n\nconst ViewerConfigContext = createContext<ResolvedViewerConfig>(DEFAULT_CONFIG);\n\nexport const ViewerConfigProvider = ViewerConfigContext.Provider;\n\nexport function useChromeSchema(): ChromeSchema {\n return useContext(ViewerConfigContext).chrome;\n}\n\nexport function useMenuSchema(id: string): MenuSchema | undefined {\n return getMenu(useContext(ViewerConfigContext).chrome, id);\n}\n\nexport function useModeBarSchema(id: string): BarSchema | undefined {\n return getModeBar(useContext(ViewerConfigContext).chrome, id);\n}\n\nexport function useStripSchema(id: string): BarSchema | undefined {\n return getStrip(useContext(ViewerConfigContext).chrome, id);\n}\n\nexport function useCustomIcons(): Readonly<Record<string, IconDef>> {\n return useContext(ViewerConfigContext).icons;\n}\n","/**\n * The viewer handle — `el.viewer`, the DRIVE door of the customization model.\n *\n * Deliberately a THIN SKIN over the kernel: `get()` returns each plugin's\n * PUBLIC capability lens exactly as the plugin defined it (the internal/public\n * two-lens split in the plugins IS the curation — this file adds no facade,\n * no second vocabulary, no second write path). `watch()` is the kernel's one\n * change stream, selector-shaped — `useSelector` without React. The command\n * trio is the UI altitude of the same system, for anything button-shaped.\n *\n * Rule of thumb (docs): buttons speak commands; code speaks capabilities.\n *\n * The chrome itself runs on these exact primitives (customer #1), so parity\n * between \"what our UI can do\" and \"what el.viewer can do\" is structural.\n */\nimport type {\n CapabilityToken,\n DocumentsCapability,\n Kernel,\n Unsubscribe,\n} from '@embedpdf/react/runtime';\nimport { CommandsToken, resolvedCommandsEqual } from '@embedpdf/react/commands';\nimport type { ResolvedCommand } from '@embedpdf/react/commands';\n\n/** `get`/`tryGet` bound to one document (see {@link ViewerHandle.forDocument}). */\nexport interface ScopedViewerHandle {\n get<T>(token: CapabilityToken<T>): T;\n tryGet<T>(token: CapabilityToken<T>): T | null;\n}\n\nexport interface ViewerHandle extends ScopedViewerHandle {\n /** The document registry — the tab model: list/open/close/setActive/…. */\n readonly documents: DocumentsCapability;\n\n /** `get`/`tryGet` with document-scoped tokens bound to `documentId`\n * instead of the active document. */\n forDocument(documentId: string): ScopedViewerHandle;\n\n /**\n * Re-run `select` on every kernel change; call `cb` when the selected value\n * really changed (`isEqual`, default `Object.is` — capability getters return\n * stable references between model changes, so identity works). Returns the\n * unsubscribe. This is the ONLY reactivity primitive; DOM events on the\n * element are sugar over it.\n */\n watch<T>(\n select: () => T,\n cb: (value: T, previous: T) => void,\n isEqual?: (a: T, b: T) => boolean,\n ): Unsubscribe;\n\n // ── commands: the UI vocabulary layered on the same capabilities ──────────\n execute(id: string, documentId?: string): void;\n resolve(id: string, documentId?: string): ResolvedCommand | null;\n /** `watch` sugar for one command's resolved state (label/icon/enabled/active). */\n watchCommand(id: string, cb: (cmd: ResolvedCommand | null) => void): Unsubscribe;\n}\n\nexport function createViewerHandle(kernel: Kernel): ViewerHandle {\n const watch = <T>(\n select: () => T,\n cb: (value: T, previous: T) => void,\n isEqual: (a: T, b: T) => boolean = Object.is,\n ): Unsubscribe => {\n let previous = select();\n return kernel.subscribe(() => {\n const next = select();\n if (isEqual(previous, next)) return;\n const before = previous;\n previous = next;\n cb(next, before);\n });\n };\n\n const commands = () => kernel.capability(CommandsToken);\n\n return {\n documents: kernel.documents,\n get: (token) => kernel.capability(token),\n tryGet: (token) => kernel.tryCapability(token),\n forDocument: (documentId) => ({\n get: (token) => kernel.capability(token, documentId),\n tryGet: (token) => kernel.tryCapability(token, documentId),\n }),\n watch,\n execute: (id, documentId) => commands().execute(id, documentId),\n resolve: (id, documentId) => commands().resolve(id, documentId) ?? null,\n watchCommand: (id, cb) =>\n watch(() => commands().resolve(id) ?? null, cb, resolvedCommandsEqual),\n };\n}\n","/**\n * Icon set — the snippet's Tabler-style stroke icons, extracted to path data\n * (from viewers/snippet/src/components/icons) and rendered by one <Icon>\n * component. Names match the snippet's icon registry so command `icon` ids\n * carry over verbatim. Stroke-based (currentColor); a few glyphs carry filled\n * sub-paths, marked `fill: true`.\n *\n * ACCENT SLOTS: a tool glyph tags the sub-paths that preview the tool's\n * drawing defaults — `stroke`/`fill: 'primary' | 'secondary'` paint from the\n * command's resolved `iconAccent` (slot placement ported 1:1 from the v2\n * hand-authored components). With no accent, a slotted stroke inherits\n * currentColor and a slotted fill renders nothing — pixel-identical to the\n * untagged glyph, so non-tool surfaces never change.\n *\n * GENERATED by scratchpad/extract-icons.mjs — 93 icons (slot tags by hand).\n */\nimport * as React from 'react';\nimport { useCustomIcons } from '../config-context';\n\nexport type PathSpec =\n | string\n | {\n d: string;\n /** Fill paint: `true` = currentColor (a filled glyph part); a slot\n * name = that accent color (nothing when the accent is absent). */\n fill?: boolean | 'primary' | 'secondary';\n /** Stroke paint: a slot name = that accent color (currentColor when\n * the accent is absent). */\n stroke?: 'primary' | 'secondary';\n };\n\n/** A registrable icon: 24×24 stroke path data (Tabler/Lucide-style), exactly\n * the shape of the built-in set — user icons are not a lesser kind. */\nexport type IconDef = readonly PathSpec[];\n\n/** The two tintable slots — structurally identical to plugin-commands'\n * IconAccent, kept local so the icon set stays dependency-free. */\nexport interface IconAccent {\n primary?: string;\n secondary?: string;\n}\n\nexport const ICON_PATHS: Record<string, readonly PathSpec[]> = {\n alertTriangle: [\n 'M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z',\n ],\n alignBottom: [\n 'M3 19v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z',\n 'M11 17h2',\n 'M9 14h6',\n 'M10 11h4',\n ],\n alignCenter: ['M4 6l16 0', 'M8 12l8 0', 'M6 18l12 0'],\n alignLeft: ['M4 6l16 0', 'M4 12l10 0', 'M4 18l14 0'],\n alignMiddle: [\n 'M3 19v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z',\n 'M11 15h2',\n 'M9 12h6',\n 'M10 9h4',\n ],\n alignRight: ['M4 6l16 0', 'M10 12l10 0', 'M6 18l14 0'],\n alignTop: [\n 'M3 19v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z',\n 'M11 13h2',\n 'M9 10h6',\n 'M10 7h4',\n ],\n arrowBackUp: ['M9 14l-4 -4l4 -4', 'M5 10h11a4 4 0 1 1 0 8h-1'],\n arrowForwardUp: ['M15 14l4 -4l-4 -4', 'M19 10h-11a4 4 0 1 0 0 8h1'],\n bold: ['M7 5h6a3.5 3.5 0 0 1 0 7h-6z', 'M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7'],\n book: [\n 'M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0',\n 'M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0',\n 'M3 6l0 13',\n 'M12 6l0 13',\n 'M21 6l0 13',\n ],\n book2: [\n 'M19 4v16h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12z',\n 'M19 16h-12a2 2 0 0 0 -2 2',\n 'M9 8h6',\n ],\n callout: [\n {\n d: 'M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1',\n stroke: 'primary',\n fill: 'secondary',\n },\n { d: 'M17 11v6h-9', stroke: 'primary' },\n { d: 'M8 15l-2 2l2 2', stroke: 'primary' },\n ],\n check: ['M5 12l5 5l10 -10'],\n chevronDown: ['M6 9l6 6l6 -6'],\n chevronLeft: ['M15 6l-6 6l6 6'],\n chevronRight: ['M9 6l6 6l-6 6'],\n circle: [\n { d: 'M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0', stroke: 'primary', fill: 'secondary' },\n ],\n comment: [\n 'M12 11v.01',\n 'M8 11v.01',\n 'M16 11v.01',\n 'M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3z',\n ],\n copy: [\n 'M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z',\n 'M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1',\n ],\n deviceFloppy: [\n 'M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2',\n 'M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M14 4l0 4l-6 0l0 -4',\n ],\n dots: [\n 'M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n ],\n doublePage: [\n 'M3 3m0 1a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1zm9 -1v18',\n ],\n download: ['M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2', 'M7 11l5 5l5 -5', 'M12 4l0 12'],\n externalLink: [\n 'M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6',\n 'M11 13l9 -9',\n 'M15 4h5v5',\n ],\n eye: ['M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'],\n file: ['M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'],\n fileImport: [\n 'M14 3v4a1 1 0 0 0 1 1h4',\n 'M5 13v-8a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-5.5m-9.5 -2h7m-3 -3l3 3l-3 3',\n ],\n fitToPage: [\n 'M12 20h-6a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h6',\n 'M18 14v7',\n 'M18 3v7',\n 'M15 18l3 3l3 -3',\n 'M15 6l3 -3l3 3',\n ],\n fitToWidth: [\n 'M4 12v-6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v6',\n 'M10 18h-7',\n 'M21 18h-7',\n 'M6 15l-3 3l3 3',\n 'M18 15l3 3l-3 3',\n ],\n formCheckbox: [\n 'M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14',\n 'M9 12l2 2l4 -4',\n ],\n formListbox: [\n 'M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14',\n 'M11 8h6',\n 'M11 12h6',\n 'M11 16h6',\n 'M7 8l0 .01',\n 'M7 12l0 .01',\n 'M7 16l0 .01',\n ],\n formRadio: [\n { d: 'M9 12a2 2 0 1 0 6 0a2 2 0 1 0 -6 0', fill: true },\n 'M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0',\n ],\n formSelect: [\n 'M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14',\n 'M9 11l3 3l3 -3',\n ],\n formTextfield: [\n 'M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3',\n 'M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3',\n 'M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7',\n 'M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1',\n 'M17 12h.01',\n 'M13 12h.01',\n ],\n freeText: [\n { d: 'M4 7v-2h12v2', stroke: 'primary' },\n { d: 'M10 5v14', stroke: 'primary' },\n { d: 'M12 19h-4', stroke: 'primary' },\n { d: 'M15 13v-1h6v1', stroke: 'primary' },\n { d: 'M18 12v7', stroke: 'primary' },\n { d: 'M17 19h2', stroke: 'primary' },\n ],\n fullscreen: [\n 'M4 8v-2a2 2 0 0 1 2 -2h2',\n 'M4 16v2a2 2 0 0 0 2 2h2',\n 'M16 4h2a2 2 0 0 1 2 2v2',\n 'M16 20h2a2 2 0 0 0 2 -2v-2',\n ],\n fullscreenExit: [\n 'M4 8v-2c0 -.551 .223 -1.05 .584 -1.412',\n 'M4 16v2a2 2 0 0 0 2 2h2',\n 'M16 4h2a2 2 0 0 1 2 2v2',\n 'M16 20h2c.545 0 1.04 -.218 1.4 -.572',\n 'M3 3l18 18',\n ],\n group: [\n 'M3 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M17 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M3 19a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M17 19a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M5 7v10',\n 'M19 7v10',\n 'M7 5h10',\n 'M7 19h10',\n 'M8 8H12.8V11.2H16V16H11.2V12.8H8V8Z',\n ],\n hand: [\n 'M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5',\n 'M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5',\n 'M14 5.5a1.5 1.5 0 0 1 3 0v6.5',\n 'M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47',\n ],\n highlight: [\n // the v2 marker block behind the \"A\" — visible only when accented\n {\n d: 'M4 6h16a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2H4a2 2 0 0 1 -2 -2V8a2 2 0 0 1 2 -2z',\n fill: 'primary',\n },\n 'M8 16v-8a4 4 0 1 1 8 0v8',\n 'M8 10h8',\n ],\n horizontal: ['M7 8l-4 4l4 4', 'M17 8l4 4l-4 4', 'M3 12l18 0'],\n inkHighlighter: [\n 'M3 19h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4',\n 'M12.5 5.5l4 4',\n 'M4.5 13.5l4 4',\n { d: 'M21 15v4h-8l4 -4l4 0', stroke: 'primary', fill: 'primary' },\n ],\n insertText: [\n { d: 'M3 7v-2h12v2', stroke: 'primary' },\n { d: 'M9 5v14', stroke: 'primary' },\n { d: 'M7 19h4', stroke: 'primary' },\n { d: 'M18 15l2 2h-5', stroke: 'primary' },\n { d: 'M18 19l2 -2', stroke: 'primary' },\n ],\n italic: ['M11 5l6 0', 'M7 19l6 0', 'M14 5l-4 14'],\n line: [{ d: 'M20 4l-16 16', stroke: 'primary' }],\n // Both strokes tag the `primary` accent slot so the arrow glyph previews the\n // tool's stroke colour (like the plain `line` icon); with no accent they render\n // as currentColor — identical to the untagged glyph.\n lineArrow: [\n { d: 'M20 4l-16 16', stroke: 'primary' },\n { d: 'M16 3h5v5', stroke: 'primary' },\n ],\n link: [\n 'M9 15l6 -6',\n 'M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464',\n 'M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463',\n ],\n linkOff: [\n 'M9 15l3 -3m2 -2l1 -1',\n 'M11 6l.463 -.536a5 5 0 0 1 7.072 7.071l-.534 .464',\n 'M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463',\n 'M3 3l18 18',\n ],\n listTree: ['M9 6h11', 'M12 12h8', 'M15 18h5', 'M5 6v.01', 'M8 12v.01', 'M11 18v.01'],\n lock: [\n 'M5 11h14a2 2 0 0 1 2 2v7a2 2 0 0 1 -2 2H5a2 2 0 0 1 -2 -2v-7a2 2 0 0 1 2 -2z',\n 'M7 11V7a5 5 0 0 1 10 0v4',\n ],\n marqueeSelect: [\n 'M17 20h6',\n 'M20 17v6',\n 'M4 13v-2',\n 'M4 6v-1a1 1 0 0 1 1 -1h1',\n 'M6 20h-1a1 1 0 0 1 -1 -1v-1',\n 'M11 4h2',\n 'M11 20h2',\n 'M18 4h1a1 1 0 0 1 1 1v1',\n 'M20 11v2',\n ],\n menu: ['M4 8l16 0', 'M4 16l16 0'],\n message: [\n 'M8 9h8',\n 'M8 13h6',\n 'M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12',\n ],\n palette: [\n 'M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25',\n 'M8.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M12.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M16.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n ],\n paperclip: [\n 'M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5',\n ],\n pencilMarker: [\n 'm9.109 16.275 8.856-8.097c.812-.743.87-2.014.127-2.826s-2.014-.869-2.826-.127L6.41 13.322l-.127 2.826zM13.79 6.575l2.7 2.952',\n {\n d: 'M19.375 20.125c.569.063-4.05-.562-6.412-.437s-4.759 1.229-6.857 1.625c-1.764.687-3.404-.938-1.981-2.5',\n stroke: 'primary',\n },\n ],\n photo: [\n 'M15 8h.01',\n 'M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z',\n 'M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5',\n 'M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3',\n ],\n // hand-added: the v2 file draws <line> primitives the extractor skips\n plus: ['M12 5l0 14', 'M5 12l14 0'],\n pointer: [\n 'M7.904 17.563a1.2 1.2 0 0 0 2.228 .308l2.09 -3.093l4.907 4.907a1.067 1.067 0 0 0 1.509 0l1.047 -1.047a1.067 1.067 0 0 0 0 -1.509l-4.907 -4.907l3.113 -2.09a1.2 1.2 0 0 0 -.309 -2.228l-13.582 -3.904l3.904 13.563z',\n ],\n polygon: [\n {\n d: 'M13.163 2.168l8.021 5.828c.694 .504 .984 1.397 .719 2.212l-3.064 9.43a1.978 1.978 0 0 1 -1.881 1.367h-9.916a1.978 1.978 0 0 1 -1.881 -1.367l-3.064 -9.43a1.978 1.978 0 0 1 .719 -2.212l8.021 -5.828a1.978 1.978 0 0 1 2.326 0z',\n stroke: 'primary',\n fill: 'secondary',\n },\n ],\n print: [\n 'M17 17h2a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-14a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2',\n 'M17 9v-4a2 2 0 0 0 -2 -2h-6a2 2 0 0 0 -2 2v4',\n 'M7 13m0 2a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z',\n ],\n redact: [\n 'M7 4h10',\n 'M12 4v8',\n 'M-7 24l12 -12',\n 'M-3 24l12 -12',\n 'M1 24l12 -12',\n 'M5 24l12 -12',\n 'M9 24l12 -12',\n 'M13 24l12 -12',\n 'M17 24l12 -12',\n 'M21 24l12 -12',\n 'M25 24l12 -12',\n ],\n // v2 parity: dashed frame + a SMALL rounded hatched box (v2 clips the\n // hatch via <clipPath>; this icon system is plain paths, so the hatch\n // segments are pre-clipped to the 10..22 box analytically).\n redactArea: [\n 'M6 20h-1a2 2 0 0 1 -2 -2v-1',\n 'M3 13v-3',\n 'M3 6v-1a2 2 0 0 1 2 -2h1',\n 'M10 3h3',\n 'M17 3h1a2 2 0 0 1 2 2v1',\n 'M12 10h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-8a2 2 0 0 1 2 -2z',\n 'M10 12l2 -2',\n 'M10 16l6 -6',\n 'M10 20l10 -10',\n 'M12 22l10 -10',\n 'M16 22l6 -6',\n 'M20 22l2 -2',\n ],\n redactCombined: [\n 'M6 20h-1a2 2 0 0 1 -2 -2v-1',\n 'M3 13v-3',\n 'M20 13v-3',\n 'M3 6v-1a2 2 0 0 1 2 -2h1',\n 'M10 3h3',\n 'M17 3h1a2 2 0 0 1 2 2v1',\n 'M8 8h8',\n 'M12 8v7',\n 'M6 19l12 -12',\n 'M6 23l12 -12',\n 'M10 23l12 -12',\n 'M14 27l12 -12',\n 'M14 23l12 -12',\n ],\n redactionSidebar: [\n 'M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z',\n 'M15 4v16',\n 'M7 8h5',\n 'M7 11h5',\n 'M7 14h4',\n ],\n replaceText: [\n { d: 'M3 7v-2h12v2', stroke: 'primary' },\n { d: 'M9 5v14', stroke: 'primary' },\n { d: 'M7 19h4', stroke: 'primary' },\n { d: 'M20 14l2 2h-3', stroke: 'primary' },\n { d: 'M20 18l2 -2', stroke: 'primary' },\n { d: 'M19 16a3 3 0 1 0 2 5.236', stroke: 'primary' },\n ],\n rotateClockwise: ['M4.05 11a8 8 0 1 1 .5 4m-.5 5v-5h5'],\n rotateCounterClockwise: ['M19.95 11a8 8 0 1 0 -.5 4m.5 5v-5h-5'],\n rubberStamp: [\n 'M21 17.85h-18c0 -4.05 1.421 -4.05 3.79 -4.05c5.21 0 1.21 -4.59 1.21 -6.8a4 4 0 1 1 8 0c0 2.21 -4 6.8 1.21 6.8c2.369 0 3.79 0 3.79 4.05',\n 'M5 21h14',\n ],\n rubberStampPlus: [\n 'M21 17.85h-18c0 -4.05 1.421 -4.05 3.79 -4.05c5.21 0 1.21 -4.59 1.21 -6.8a4 4 0 0 1 4.9 -4.1',\n 'M16 10c0 1.2 -4 3.8 1.21 3.8c2.369 0 3.79 0 3.79 4.05',\n 'M5 21h14',\n 'M16 5h6',\n 'M19 2v6',\n ],\n save: [\n 'M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2',\n 'M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M14 4l0 4l-6 0l0 -4',\n ],\n screenshot: [\n 'M7 19a2 2 0 0 1 -2 -2',\n 'M5 13v-2',\n 'M5 7a2 2 0 0 1 2 -2',\n 'M11 5h2',\n 'M17 5a2 2 0 0 1 2 2',\n 'M19 11v2',\n 'M19 17v4',\n 'M21 19h-4',\n 'M13 19h-2',\n ],\n search: ['M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0', 'M21 21l-6 -6'],\n settings: [\n 'M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z',\n 'M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0',\n ],\n sidebar: [\n 'M4 18v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z',\n 'M10 18v-12a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z',\n ],\n signature: [\n 'M3 17c3.333 -3.333 5 -6 5 -8c0 -3 -1 -3 -2 -3s-2.032 1.085 -2 3c.034 2.048 1.658 4.877 2.5 6c1.5 2 2.5 2.5 3.5 1l2 -3c.333 2.667 1.333 4 3 4c.53 0 2.639 -2 3 -2c.517 0 1.517 .667 3 2',\n ],\n singlePage: ['M5 3m0 1a1 1 0 0 1 1 -1h12a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-12a1 1 0 0 1 -1 -1z'],\n square: [\n {\n d: 'M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z',\n stroke: 'primary',\n fill: 'secondary',\n },\n ],\n squares: [\n 'M8 10a2 2 0 0 1 2 -2h9a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-9a2 2 0 0 1 -2 -2z',\n 'M16 8v-3a2 2 0 0 0 -2 -2h-9a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h3',\n ],\n squiggly: [\n 'M8 16v-8a4 4 0 1 1 8 0v8',\n 'M8 10h8',\n { d: 'M4 20c1.5 -1.5 3.5 -1.5 5 0s3.5 1.5 5 0 3.5 -1.5 5 0', stroke: 'primary' },\n ],\n strikethrough: ['M8 16v-8a4 4 0 1 1 8 0v8', { d: 'M4 10h16', stroke: 'primary' }],\n text: [\n 'M6.5 15.5m-3.5 0a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0',\n 'M14 19v-10.5a3.5 3.5 0 0 1 7 0v10.5',\n 'M14 13h7',\n 'M10 12v7',\n ],\n trash: [\n 'M4 7l16 0',\n 'M10 11l0 6',\n 'M14 11l0 6',\n 'M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12',\n 'M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3',\n ],\n underline: [{ d: 'M4 20h16', stroke: 'primary' }, 'M8 16v-8a4 4 0 1 1 8 0v8', 'M8 10h8'],\n // the v2 ungroup glyph: two separated rounded rects\n ungroup: [\n 'M4 5a1 1 0 0 1 1 -1h5a1 1 0 0 1 1 1v5a1 1 0 0 1 -1 1h-5a1 1 0 0 1 -1 -1z',\n 'M13 14a1 1 0 0 1 1 -1h5a1 1 0 0 1 1 1v5a1 1 0 0 1 -1 1h-5a1 1 0 0 1 -1 -1z',\n ],\n unlock: ['M7 11V7a5 5 0 0 1 9.9-1'],\n vertical: ['M8 7l4 -4l4 4', 'M8 17l4 4l4 -4', 'M12 3l0 18'],\n viewSettings: [\n 'M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M12 10.5v1.5',\n 'M12 16v1.5',\n 'M15.031 12.25l-1.299 .75',\n 'M10.268 15l-1.3 .75',\n 'M15 15.803l-1.285 -.773',\n 'M10.285 12.97l-1.285 -.773',\n 'M14 3v4a1 1 0 0 0 1 1h4',\n 'M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z',\n ],\n widgetEdit: [\n 'M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1',\n 'M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415',\n 'M16 5l3 3',\n ],\n x: ['M18 6l-12 12', 'M6 6l12 12'],\n zigzag: [{ d: 'M12 2.4L21.36 11.76L2.64 12.24L12 21.6', stroke: 'primary' }],\n zoomIn: ['M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0', 'M9 12h6', 'M12 9v6'],\n zoomInArea: [\n 'M15 13v4',\n 'M13 15h4',\n 'M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0',\n 'M22 22l-3 -3',\n 'M6 18h-1a2 2 0 0 1 -2 -2v-1',\n 'M3 11v-1',\n 'M3 6v-1a2 2 0 0 1 2 -2h1',\n 'M10 3h1',\n 'M15 3h1a2 2 0 0 1 2 2v1',\n ],\n zoomOut: ['M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0', 'M9 12l6 0'],\n};\n\nexport type IconName = keyof typeof ICON_PATHS;\n\nexport interface IconProps {\n name: string;\n size?: number;\n strokeWidth?: number;\n className?: string;\n title?: string;\n /** Paints the glyph's slot-tagged sub-paths (a tool previewing its\n * drawing defaults). Absent → the plain, untinted glyph. */\n accent?: IconAccent;\n}\n\n/** One SVG renderer for every icon. Unknown names render nothing (caller shows\n * a text fallback), so a missing glyph never throws. */\nexport function Icon({ name, size = 20, strokeWidth = 2, className, title, accent }: IconProps) {\n // Registry semantics: user icons are additive and a colliding name WINS —\n // re-skinning a built-in glyph is a supported move, not an accident.\n const custom = useCustomIcons();\n const paths = custom[name] ?? ICON_PATHS[name];\n if (!paths) return null;\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n role=\"img\"\n aria-hidden={title ? undefined : true}\n aria-label={title}\n >\n {paths.map((p, i) => {\n if (typeof p === 'string') return <path key={i} d={p} />;\n const fill = p.fill === true ? 'currentColor' : p.fill ? accent?.[p.fill] : undefined;\n // a stroke slot paints from the accent, inheriting currentColor\n // without one; a fill-ONLY path never gets an outline (the v2 look)\n const stroke = p.stroke ? accent?.[p.stroke] : p.fill ? 'none' : undefined;\n return <path key={i} d={p.d} fill={fill ?? 'none'} stroke={stroke} />;\n })}\n </svg>\n );\n}\n\nexport const hasIcon = (name: string): boolean => name in ICON_PATHS;\n","/**\n * Light/dark theme — one class, and the CSS variables in styles.css do the\n * rest (both toolbars, sidebars, popovers, and the canvas re-theme from it).\n * The mode comes from the embedder's `theme` preference; the chrome ships no\n * switch of its own, so a host that wants one drives this through `set`. The\n * class lands on <html> by default; a delivery that must not touch the page\n * (the <embedpdf-viewer> shadow root) passes `target` and the class stays\n * inside its own subtree. An explicit preference outranks the OS setting.\n */\nimport { createContext, useContext, useEffect, useMemo, useState } from 'react';\n\nexport type ThemeMode = 'light' | 'dark';\nexport type ThemePreference = ThemeMode | 'system';\n\nconst ThemeCtx = createContext<{\n mode: ThemeMode;\n toggle: () => void;\n set: (m: ThemeMode) => void;\n} | null>(null);\n\nconst systemMode = (): ThemeMode =>\n typeof window !== 'undefined' && window.matchMedia?.('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light';\n\nexport function ThemeProvider({\n children,\n preference = 'system',\n target,\n}: {\n children: React.ReactNode;\n /** Initial mode; 'system' (default) follows the OS setting. */\n preference?: ThemePreference;\n /** Where the `.dark` class goes. Default: document.documentElement. */\n target?: HTMLElement | null;\n}) {\n const [mode, setMode] = useState<ThemeMode>(() =>\n preference === 'system' ? systemMode() : preference,\n );\n useEffect(() => {\n (target ?? document.documentElement).classList.toggle('dark', mode === 'dark');\n }, [mode, target]);\n const value = useMemo(\n () => ({ mode, toggle: () => setMode((m) => (m === 'dark' ? 'light' : 'dark')), set: setMode }),\n [mode],\n );\n return <ThemeCtx.Provider value={value}>{children}</ThemeCtx.Provider>;\n}\n\nexport function useTheme() {\n const ctx = useContext(ThemeCtx);\n if (!ctx) throw new Error('useTheme must be used within <ThemeProvider>');\n return ctx;\n}\n","/**\n * Menu rendering — a MenuSchema (a tree of command ids) rendered as rows.\n * Reused by the toolbar dropdowns (document / zoom / page-settings) AND by the\n * overflow menu's inline submenu expansion, so a command's menu form is\n * identical wherever it surfaces. Rows resolve live through the command\n * registry: label, icon, active tick, enabled state.\n */\nimport { useState } from 'react';\nimport { useCommand, useCommands } from '@embedpdf/react/commands';\nimport { useT } from '@embedpdf/react/i18n';\nimport type { MenuSchema } from '@embedpdf/react/toolbar';\nimport { Icon } from './icons';\nimport { useMenuSchema } from '../config-context';\n\nexport function MenuRow({ commandId, onRun }: { commandId: string; onRun?: () => void }) {\n const cmd = useCommand(commandId);\n const commands = useCommands();\n if (!cmd || !cmd.visible) return null;\n return (\n <button\n type=\"button\"\n role={cmd.active ? 'menuitemradio' : 'menuitem'}\n part={cmd.active ? 'menu-item menu-item-active' : 'menu-item'}\n aria-checked={cmd.active || undefined}\n disabled={!cmd.enabled}\n onClick={() => {\n commands.execute(commandId);\n onRun?.();\n }}\n // v2 shows selection as a blue-tinted row (bg-interactive-selected +\n // text-accent), never a checkmark — the icon column stays the command's\n // own icon.\n className={`flex w-full items-center gap-3 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors disabled:pointer-events-none disabled:opacity-40 ${\n cmd.active ? 'bg-selected text-accent' : 'text-fg-secondary hover:bg-hover'\n }`}\n >\n {cmd.icon && (\n <Icon\n name={cmd.icon}\n size={16}\n accent={cmd.iconAccent}\n className={cmd.active ? '' : 'text-fg-muted'}\n />\n )}\n <span className=\"flex-1 truncate\">{cmd.label}</span>\n </button>\n );\n}\n\n/** One section-separated menu, by schema id. */\nexport function MenuBody({ menuId, onRun }: { menuId: string; onRun?: () => void }) {\n const t = useT();\n const menu: MenuSchema | undefined = useMenuSchema(menuId);\n if (!menu) return null;\n return (\n <div className=\"min-w-52 p-1\">\n {menu.sections.map((section, i) => (\n <div key={i}>\n {i > 0 && <div className=\"bg-border-subtle my-1 h-px\" />}\n {section.labelKey && (\n <div className=\"text-fg-muted px-2.5 pb-1 pt-1.5 text-[11px] font-semibold uppercase tracking-wide\">\n {t(section.labelKey)}\n </div>\n )}\n {section.items.map((id) => (\n <MenuRow key={id} commandId={id} onRun={onRun} />\n ))}\n </div>\n ))}\n </div>\n );\n}\n\n/** The popover shell: a floating surface + click-away scrim. */\nexport function Popover({\n children,\n onClose,\n align = 'start',\n}: {\n children: React.ReactNode;\n onClose: () => void;\n align?: 'start' | 'end';\n}) {\n return (\n <>\n <div className=\"fixed inset-0 z-40\" onClick={onClose} />\n <div\n part=\"menu\"\n className={`border-border-subtle bg-elevated absolute top-full z-50 mt-1 rounded-lg border shadow-xl ${\n align === 'end' ? 'right-0' : 'left-0'\n }`}\n >\n {children}\n </div>\n </>\n );\n}\n\n/** A menu dropdown that expands inline (used inside the overflow menu, where a\n * submenu can't anchor to an off-screen trigger). */\nexport function InlineSubmenu({ menuId, label }: { menuId: string; label: string }) {\n const [open, setOpen] = useState(false);\n return (\n <div>\n <button\n type=\"button\"\n onClick={() => setOpen((o) => !o)}\n className=\"text-fg-secondary hover:bg-hover flex w-full items-center gap-3 rounded-md px-2.5 py-1.5 text-left text-sm\"\n >\n <span className=\"flex-1 truncate\">{label}</span>\n <Icon name={open ? 'chevronDown' : 'chevronRight'} size={16} />\n </button>\n {open && (\n <div className=\"border-border-subtle ml-3 border-l pl-1\">\n <MenuBody menuId={menuId} />\n </div>\n )}\n </div>\n );\n}\n","/**\n * The app's toolbar look — Tailwind render props over the headless <Toolbar>.\n * The app owns the pixels; ui-core owns the physics (measure → solve →\n * overflow). Nothing here knows about breakpoints or widths.\n *\n * Styling is a 1:1 port of the v2 snippet's components:\n * Button → viewers/snippet/src/components/ui/button.tsx\n * TabButton → viewers/snippet/src/components/ui/tab-button.tsx (underline)\n * zoom widget → viewers/snippet/src/components/custom-zoom-toolbar.tsx\n * mode select → viewers/snippet/src/components/mode-select-button.tsx\n */\nimport { useEffect, useState } from 'react';\nimport { useOptionalCapability, useOptionalSelector } from '@embedpdf/react/runtime';\nimport { Toolbar } from '@embedpdf/react/toolbar';\nimport type {\n BarSchema,\n CollapsedGroupView,\n GroupDisclosureView,\n OverflowMenuView,\n} from '@embedpdf/react/toolbar';\nimport { useCommands } from '@embedpdf/react/commands';\nimport type { ResolvedCommand } from '@embedpdf/react/commands';\nimport { useMenus } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\nimport { StageToken } from '@embedpdf/react/stage';\nimport { Icon } from './icons';\nimport { MenuBody, Popover, InlineSubmenu } from './menu';\n\n// ── the v2 Button recipe ──────────────────────────────────────────────────────\nconst BTN_BASE =\n 'flex h-8 w-auto min-w-8 cursor-pointer items-center justify-center rounded-md p-[5px] transition-colors';\nconst BTN_HOVER = 'hover:bg-hover hover:ring hover:ring-accent';\nconst BTN_ACTIVE = 'border-none bg-selected text-accent shadow ring ring-accent';\nconst BTN_DISABLED = 'cursor-not-allowed opacity-50 hover:bg-transparent hover:ring-0';\n\nexport const buttonClass = (active: boolean, enabled = true): string =>\n `${BTN_BASE} ${active ? BTN_ACTIVE : BTN_HOVER} ${enabled ? '' : BTN_DISABLED}`;\n\n// ── the v2 TabButton recipe (the underline) ───────────────────────────────────\nconst TAB_BASE =\n 'flex h-8 w-auto min-w-8 cursor-pointer items-center justify-center rounded-none border-b-2 px-2 py-1 text-sm transition-colors hover:bg-transparent hover:border-b-fg-muted';\nconst TAB_ACTIVE = 'border-b-accent text-accent hover:border-b-accent';\nconst TAB_INACTIVE = 'border-b-transparent';\n\nconst tabClass = (active: boolean, enabled = true): string =>\n `${TAB_BASE} ${active ? TAB_ACTIVE : TAB_INACTIVE} ${enabled ? '' : 'cursor-not-allowed opacity-50'}`;\n\n// ── a single command button (icon / icon+label / label=tab) ──────────────────\nfunction CommandButton({\n cmd,\n variant,\n run,\n}: {\n cmd: ResolvedCommand;\n variant: string;\n run: () => void;\n}) {\n const isTab = variant === 'label';\n\n // v2 buttons carry NO caret — a menu command is a plain icon button; the\n // `menu:` declaration still drives aria-haspopup and the anchored popover.\n const button = (\n <button\n type=\"button\"\n onClick={run}\n disabled={!cmd.enabled}\n aria-pressed={cmd.active || undefined}\n aria-haspopup={cmd.menu ? 'menu' : undefined}\n aria-label={cmd.label}\n title={cmd.label}\n // Shadow parts — the RESTYLE door: page CSS reaches these via\n // `embedpdf-viewer::part(toolbar-button)` etc. Part names are public\n // API; the vocabulary is deliberately small (see README).\n part={\n isTab\n ? `mode-tab${cmd.active ? ' mode-tab-active' : ''}`\n : `toolbar-button${cmd.active ? ' toolbar-button-active' : ''}`\n }\n className={isTab ? tabClass(cmd.active, cmd.enabled) : buttonClass(cmd.active, cmd.enabled)}\n >\n {isTab ? (\n <span className=\"whitespace-nowrap px-1\">{cmd.label}</span>\n ) : variant === 'icon+label' ? (\n <span className=\"flex items-center whitespace-nowrap text-sm\">\n {cmd.icon && (\n <Icon name={cmd.icon} size={20} accent={cmd.iconAccent} className=\"mr-1.5 shrink-0\" />\n )}\n <span>{cmd.label}</span>\n </span>\n ) : cmd.icon ? (\n <Icon name={cmd.icon} size={20} accent={cmd.iconAccent} />\n ) : (\n <span className=\"text-sm\">{cmd.label}</span>\n )}\n </button>\n );\n\n if (!cmd.menu) return button;\n return <MenuAnchoredButton cmd={cmd}>{button}</MenuAnchoredButton>;\n}\n\nfunction MenuAnchoredButton({\n cmd,\n children,\n}: {\n cmd: ResolvedCommand;\n children: React.ReactNode;\n}) {\n const menus = useMenus();\n const open = cmd.menu ? menus.isOpen(cmd.menu) : false;\n return (\n <span className=\"relative inline-flex\">\n {children}\n {open && cmd.menu && (\n <Popover onClose={() => menus.close(cmd.menu!)}>\n <MenuBody menuId={cmd.menu} onRun={() => menus.close(cmd.menu!)} />\n </Popover>\n )}\n </span>\n );\n}\n\n// ── the inline zoom widget — v2's custom-zoom-toolbar, 1:1 ───────────────────\nfunction ZoomControls() {\n const commands = useCommands();\n const menus = useMenus();\n const stage = useOptionalCapability(StageToken);\n // Null-safe: the zoom strip is main-toolbar chrome, mounted before any\n // document exists — it reads 100% until a Stage is there to ask.\n const level = useOptionalSelector(StageToken, (c) => c.zoomLevel(), 1);\n const pct = Math.round((level ?? 1) * 100);\n const [inputValue, setInputValue] = useState(String(pct));\n useEffect(() => setInputValue(String(pct)), [pct]);\n\n const submit = (e: React.FormEvent) => {\n e.preventDefault();\n const value = parseFloat(inputValue);\n if (!isNaN(value) && value > 0) stage?.zoomTo({ level: value / 100 });\n };\n\n return (\n <div className=\"relative\">\n <div className=\"bg-hover flex items-center rounded\">\n {/* editable zoom percentage */}\n <form\n onSubmit={submit}\n className=\"flex min-w-0 flex-nowrap items-center overflow-hidden whitespace-nowrap\"\n >\n <input\n name=\"zoom\"\n type=\"text\"\n inputMode=\"numeric\"\n pattern=\"\\d*\"\n aria-label=\"Set zoom\"\n className=\"h-6 w-8 min-w-0 shrink border-0 bg-transparent p-0 text-right text-sm outline-none focus:outline-none\"\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value.replace(/[^0-9]/g, ''))}\n onBlur={() => {\n if (!inputValue || parseFloat(inputValue) <= 0) setInputValue(String(pct));\n }}\n />\n <span className=\"shrink-0 text-sm\">%</span>\n </form>\n {/* zoom menu chevron */}\n <button\n type=\"button\"\n aria-haspopup=\"menu\"\n aria-expanded={menus.isOpen('zoom')}\n title=\"Zoom options\"\n className={buttonClass(false)}\n onClick={() => menus.toggle('zoom')}\n >\n <Icon name=\"chevronDown\" size={20} />\n </button>\n <button\n type=\"button\"\n title=\"Zoom out\"\n className={buttonClass(false)}\n onClick={() => commands.execute('zoom:out')}\n >\n <Icon name=\"zoomOut\" size={20} />\n </button>\n <button\n type=\"button\"\n title=\"Zoom in\"\n className={buttonClass(false)}\n onClick={() => commands.execute('zoom:in')}\n >\n <Icon name=\"zoomIn\" size={20} />\n </button>\n </div>\n {menus.isOpen('zoom') && (\n <Popover onClose={() => menus.close('zoom')}>\n <MenuBody menuId=\"zoom\" onRun={() => menus.close('zoom')} />\n </Popover>\n )}\n </div>\n );\n}\n\n/** The 'button' variant of the zoom slot — a single icon that opens the menu. */\nfunction ZoomButton() {\n const menus = useMenus();\n return (\n <span className=\"relative inline-flex\">\n <button\n type=\"button\"\n title=\"Zoom\"\n aria-haspopup=\"menu\"\n aria-expanded={menus.isOpen('zoom')}\n className={buttonClass(menus.isOpen('zoom'))}\n onClick={() => menus.toggle('zoom')}\n >\n <Icon name=\"zoomIn\" size={20} />\n </button>\n {menus.isOpen('zoom') && (\n <Popover onClose={() => menus.close('zoom')}>\n <MenuBody menuId=\"zoom\" onRun={() => menus.close('zoom')} />\n </Popover>\n )}\n </span>\n );\n}\n\n// ── a shed group's in-strip disclosure (v2's overflow-tabs-button, derived) ──\nfunction GroupTrigger({ view }: { view: GroupDisclosureView }) {\n const [open, setOpen] = useState(false);\n // The active tab may be hiding behind the chevron — hint at it, tab-style.\n const activeHidden = view.commands.some((c) => c.active);\n return (\n <span className=\"relative inline-flex\">\n <button\n type=\"button\"\n onClick={() => setOpen((o) => !o)}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n className={tabClass(activeHidden)}\n >\n <Icon name=\"chevronDown\" size={18} />\n </button>\n {open && (\n <Popover onClose={() => setOpen(false)}>\n <div className=\"min-w-44 p-1\">\n {view.commands.map((c) => (\n <button\n key={c.id}\n type=\"button\"\n role={view.role === 'tabs' ? 'menuitemradio' : 'menuitem'}\n aria-checked={view.role === 'tabs' ? c.active : undefined}\n disabled={!c.enabled}\n onClick={() => {\n view.execute(c.id);\n setOpen(false);\n }}\n className={`flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm disabled:cursor-not-allowed disabled:opacity-50 ${\n c.active ? 'bg-selected text-accent' : 'text-fg-secondary hover:bg-hover'\n }`}\n >\n {c.label}\n </button>\n ))}\n </div>\n </Popover>\n )}\n </span>\n );\n}\n\n// ── the collapsed modes group — v2's mode-select-button, 1:1 ─────────────────\nfunction CollapsedModes({ view }: { view: CollapsedGroupView }) {\n const [open, setOpen] = useState(false);\n const active = view.commands.find((c) => c.active) ?? view.commands[0];\n // v2 highlights the control whenever a non-default mode is active.\n const isActive = Boolean(active?.active && active.id !== 'mode:view');\n return (\n <div style={{ width: 100 }} className=\"relative\">\n <button\n type=\"button\"\n onClick={() => setOpen((o) => !o)}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n className=\"bg-surface hover:bg-hover flex w-full cursor-pointer appearance-none items-center rounded-md py-1.5 pl-3 pr-2 text-[13px] transition-colors\"\n >\n <span\n className={`min-w-0 flex-1 truncate text-left ${isActive ? 'text-accent' : 'text-fg'}`}\n >\n {active?.label}\n </span>\n <Icon\n name=\"chevronDown\"\n size={16}\n className={isActive ? 'text-accent' : 'text-fg-secondary'}\n />\n </button>\n {open && (\n <Popover onClose={() => setOpen(false)}>\n <div className=\"min-w-44 p-1\">\n {view.commands.map((c) => (\n <button\n key={c.id}\n type=\"button\"\n role=\"menuitemradio\"\n aria-checked={c.active}\n onClick={() => {\n view.execute(c.id);\n setOpen(false);\n }}\n className={`flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm ${\n c.active ? 'bg-selected text-accent' : 'text-fg-secondary hover:bg-hover'\n }`}\n >\n {c.label}\n </button>\n ))}\n </div>\n </Popover>\n )}\n </div>\n );\n}\n\n// ── the derived overflow menu ────────────────────────────────────────────────\nfunction OverflowMenu({ view }: { view: OverflowMenuView }) {\n const t = useT();\n if (!view.isOpen) return null;\n return (\n <Popover onClose={view.close} align=\"end\">\n <div className=\"min-w-56 p-1\">\n {view.sections.map((section, i) => (\n <div key={i}>\n {i > 0 && <div className=\"bg-border-subtle my-1 h-px\" />}\n {section.labelKey && (\n <div className=\"text-fg-muted px-2.5 pb-1 pt-1.5 text-[11px] font-semibold uppercase tracking-wide\">\n {t(section.labelKey)}\n </div>\n )}\n {section.rows.map((row) => {\n const cmd = view.resolve(row.command);\n if (!cmd) return null;\n if (row.type === 'submenu') {\n return <InlineSubmenu key={row.command} menuId={row.menu} label={cmd.label} />;\n }\n return (\n <button\n key={row.command}\n type=\"button\"\n role={section.role === 'radio' ? 'menuitemradio' : 'menuitem'}\n aria-checked={section.role === 'radio' ? cmd.active : undefined}\n disabled={!cmd.enabled}\n onClick={() => {\n view.execute(row.command);\n view.close();\n }}\n // Same blue-highlight selection as the dropdown menus — no\n // checkmark; the icon column stays the command's own icon.\n className={`flex w-full items-center gap-3 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${\n cmd.active ? 'bg-selected text-accent' : 'text-fg-secondary hover:bg-hover'\n }`}\n >\n {cmd.icon && (\n <Icon name={cmd.icon} size={16} className={cmd.active ? '' : 'text-fg-muted'} />\n )}\n <span className=\"flex-1 truncate\">{cmd.label}</span>\n </button>\n );\n })}\n </div>\n ))}\n </div>\n </Popover>\n );\n}\n\nfunction OverflowTrigger({ isOpen, toggle }: { isOpen: boolean; toggle: () => void }) {\n const t = useT();\n return (\n <button\n type=\"button\"\n onClick={toggle}\n aria-haspopup=\"menu\"\n aria-expanded={isOpen}\n title={t('demo.more')}\n className={buttonClass(isOpen)}\n >\n <Icon name=\"dots\" size={20} />\n </button>\n );\n}\n\n// ── the assembled toolbar ────────────────────────────────────────────────────\nexport function AppToolbar({ bar, className }: { bar: BarSchema; className?: string }) {\n return (\n <Toolbar\n bar={bar}\n gap={8} // v2 toolbar gap-2\n separatorWidth={1}\n className={className}\n renderCommand={(cmd, variant, run) => <CommandButton cmd={cmd} variant={variant} run={run} />}\n renderCustom={{\n 'zoom-controls': (variant) => (variant === 'inline' ? <ZoomControls /> : <ZoomButton />),\n }}\n renderCollapsed={(view) => (view.id === 'modes' ? <CollapsedModes view={view} /> : undefined)}\n renderGroupTrigger={(view) => <GroupTrigger view={view} />}\n renderSeparator={() => <span className=\"bg-border h-6 w-px self-center\" />}\n renderOverflowTrigger={(isOpen, toggle) => (\n <OverflowTrigger isOpen={isOpen} toggle={toggle} />\n )}\n renderOverflowMenu={(view) => <OverflowMenu view={view} />}\n />\n );\n}\n","/**\n * The link editor POPOVER — v2's \"add a link\" popup, reborn. It rides the\n * SAME selection anchor as the action strip (`<AnnotationMenu>` solves\n * WHERE), opening from the strip's link icon (`annotation:link` toggles the\n * `link-editor` shell surface) and rendering IN PLACE of the strip while\n * open — one anchored card at a time.\n *\n * Reads the selection's current target from selection props (the `linkOf`\n * lens — parents derive from their committed child annotations) and writes\n * through the ONE `updateSelection({ link })` path; the plugin's reconciler\n * materializes/retargets the attached children. Links are a VERB on the\n * selection, not a style — which is why this is a popover, not a sidebar\n * section.\n */\nimport { useState, type ReactNode } from 'react';\nimport { useAnnotation, useSelectionProps } from '@embedpdf/react/annotation';\nimport type { PdfLinkTarget } from '@embedpdf/react/link';\nimport { useKernel } from '@embedpdf/react/runtime';\nimport { useT } from '@embedpdf/react/i18n';\nimport { Icon } from './icons';\n\nfunction ModeToggle({\n active,\n title,\n onClick,\n children,\n}: {\n active: boolean;\n title: string;\n onClick: () => void;\n children: ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n title={title}\n onClick={onClick}\n className={`rounded border px-2.5 py-1 text-xs font-medium transition-colors ${\n active\n ? 'border-accent bg-accent text-on-accent'\n : 'border-border bg-surface text-fg hover:bg-hover'\n }`}\n >\n {children}\n </button>\n );\n}\n\nexport function LinkEditorCard({ onClose }: { onClose: () => void }) {\n const t = useT();\n const kernel = useKernel();\n const anno = useAnnotation();\n const props = useSelectionProps();\n const value = (props.values.link ?? null) as PdfLinkTarget | null;\n const [mode, setMode] = useState<'uri' | 'page'>(value?.kind === 'goto' ? 'page' : 'uri');\n const [uri, setUri] = useState(value?.kind === 'uri' ? value.uri : '');\n const [pageNo, setPageNo] = useState('1');\n\n const apply = () => {\n if (mode === 'uri') {\n const trimmed = uri.trim();\n if (!trimmed) return;\n anno.updateSelection({ link: { kind: 'uri', uri: trimmed } });\n onClose();\n return;\n }\n // Page number (1-based) → the page's OBJECT NUMBER (stable across moves).\n const activeId = kernel.documents.activeId();\n const meta = activeId ? kernel.getState().core.documents[activeId] : null;\n const layout = meta?.pages[Math.max(0, Number(pageNo) - 1)];\n if (!layout) return;\n anno.updateSelection({\n link: { kind: 'goto', destination: { kind: 'fit', pageObjectNumber: layout.pageObjectNumber } },\n });\n onClose();\n };\n\n const inputCls =\n 'border-border bg-surface text-fg focus:border-accent w-full rounded border px-2.5 py-1.5 text-sm outline-none';\n return (\n <div className=\"border-border bg-surface w-64 rounded-lg border p-3 shadow-lg\">\n <div className=\"mb-2 flex items-center justify-between\">\n <span className=\"text-fg text-sm font-semibold\">{t('commands.annotate.link')}</span>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"text-fg-muted hover:bg-hover grid h-6 w-6 place-items-center rounded\"\n >\n <Icon name=\"x\" size={14} />\n </button>\n </div>\n <div className=\"mb-2 flex gap-1.5\">\n <ModeToggle title=\"Link to a URL\" active={mode === 'uri'} onClick={() => setMode('uri')}>\n URL\n </ModeToggle>\n <ModeToggle title=\"Link to a page\" active={mode === 'page'} onClick={() => setMode('page')}>\n Page\n </ModeToggle>\n </div>\n {mode === 'uri' ? (\n <input\n type=\"url\"\n className={inputCls}\n placeholder=\"https://…\"\n autoFocus\n value={uri}\n onChange={(e) => setUri(e.target.value)}\n onKeyDown={(e) => e.key === 'Enter' && apply()}\n />\n ) : (\n <input\n type=\"number\"\n min={1}\n className={inputCls}\n placeholder=\"Page number\"\n autoFocus\n value={pageNo}\n onChange={(e) => setPageNo(e.target.value)}\n onKeyDown={(e) => e.key === 'Enter' && apply()}\n />\n )}\n <button\n type=\"button\"\n className=\"bg-accent text-on-accent mt-2.5 w-full rounded px-2 py-1.5 text-sm font-medium\"\n onClick={apply}\n >\n {value == null ? 'Add link' : 'Update link'}\n </button>\n </div>\n );\n}\n","/**\n * The floating strip's PIXELS, shared by every contextual strip (annotation\n * selection, text selection, …): a rounded toolbar of command buttons with\n * derived group separators. The WHERE is each strip's menu component\n * (`<AnnotationMenu>`, `<SelectionMenu>`); the WHICH is the commands'\n * `visible`/`enabled` derivations via `useStripView`. This file only draws.\n */\nimport { Fragment } from 'react';\nimport type { ResolvedCommand } from '@embedpdf/react/commands';\nimport type { useStripView } from '@embedpdf/react/toolbar';\nimport { buttonClass } from './toolbar';\nimport { Icon } from './icons';\n\nfunction StripButton({ cmd, run }: { cmd: ResolvedCommand; run: () => void }) {\n return (\n <button\n type=\"button\"\n onClick={run}\n disabled={!cmd.enabled}\n aria-pressed={cmd.active || undefined}\n aria-label={cmd.label}\n title={cmd.label}\n className={buttonClass(cmd.active, cmd.enabled)}\n >\n {cmd.icon && <Icon name={cmd.icon} size={20} accent={cmd.iconAccent} />}\n </button>\n );\n}\n\nexport function StripBar({\n view,\n label,\n}: {\n view: NonNullable<ReturnType<typeof useStripView>>;\n label: string;\n}) {\n return (\n <div\n role=\"toolbar\"\n aria-label={label}\n className=\"border-border-subtle bg-elevated flex items-center gap-1 rounded-lg border p-1 shadow-xl\"\n >\n {view.groups.map((g, i) => (\n <Fragment key={g.id}>\n {i > 0 && <span aria-hidden className=\"bg-border h-5 w-px\" />}\n {g.commands.map((cmd) => (\n <StripButton key={cmd.id} cmd={cmd} run={() => view.execute(cmd.id)} />\n ))}\n </Fragment>\n ))}\n </div>\n );\n}\n","/**\n * The ANNOTATION-selection floating strip:\n *\n * config/chrome.ts `strips.annotation` declares WHAT may appear\n * each command's visible/enabled decides WHICH items show\n * <AnnotationMenu> solves WHERE (camera transform,\n * rotate-knob dodging, pointer isolation)\n *\n * useStripView is the live intersection: hidden commands drop out, empty\n * groups vanish, null when nothing applies. Mounted in the Stage `overlay`\n * slot. The pixels are the shared <StripBar>.\n */\nimport { useEffect } from 'react';\nimport { AnnotationMenu } from '@embedpdf/react/annotation-menu';\nimport { useAnnotationSelection } from '@embedpdf/react/annotation';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { useStripView } from '@embedpdf/react/toolbar';\nimport { useT } from '@embedpdf/react/i18n';\nimport { useStripSchema } from '../config-context';\nimport { LinkEditorCard } from './link-editor';\nimport { StripBar } from './strip-bar';\n\nexport function AnnotationStrip() {\n const t = useT();\n const view = useStripView(useStripSchema('annotation'));\n // The link editor popover rides the SAME anchor and REPLACES the strip\n // while open — one anchored card at a time (v2's popup, on the projector).\n const editor = useSurface('link-editor');\n const selection = useAnnotationSelection();\n // A stale editor never outlives its selection.\n useEffect(() => {\n if (!selection.length && editor.isOpen) editor.close();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selection.length, editor.isOpen]);\n if (!view) return null;\n return (\n <AnnotationMenu placement=\"bottom\" gap={15}>\n {editor.isOpen ? (\n <LinkEditorCard onClose={editor.close} />\n ) : (\n <StripBar view={view} label={t('commands.annotate.strip')} />\n )}\n </AnnotationMenu>\n );\n}\n","/**\n * The TEXT-SELECTION floating strip:\n *\n * config/chrome.ts `strips.selection` declares WHAT may appear\n * each command's visible/enabled decides WHICH items show\n * <SelectionMenu> solves WHERE (settles on pointer-up,\n * camera transform, pointer isolation)\n *\n * `useStripView` is the live intersection: with copy denied (no\n * doc.text.copy) every command drops out and this renders nothing — no\n * empty bubble. Mounted in the Stage `overlay` slot.\n */\nimport { SelectionMenu } from '@embedpdf/react/selection';\nimport { useStripView } from '@embedpdf/react/toolbar';\nimport { useT } from '@embedpdf/react/i18n';\nimport { useStripSchema } from '../config-context';\nimport { StripBar } from './strip-bar';\n\nexport function SelectionStrip() {\n const t = useT();\n const view = useStripView(useStripSchema('selection'));\n if (!view) return null;\n return (\n <SelectionMenu placement=\"bottom\" gap={12}>\n <StripBar view={view} label={t('commands.selection.strip')} />\n </SelectionMenu>\n );\n}\n","/**\n * The document tab bar — a 1:1 port of v2's tab-bar.tsx\n * (viewers/snippet/src/components/tab-bar.tsx): rounded-top tabs on the\n * surface-alt strip, the active tab merging into the toolbar surface below,\n * close-× on the active tab, and a + button opening a real file dialog.\n *\n * v2 needed a DocumentManager capability; here the kernel's document registry\n * (useDocuments) already is the tab model — open/close/setActive, reactive.\n */\nimport { useRef } from 'react';\nimport { useDocuments } from '@embedpdf/react/runtime';\nimport type { OpenInput } from '@embedpdf/react/runtime';\nimport { Icon } from './icons';\n\nexport type TabBarVisibility = 'always' | 'multiple' | 'never';\n\nexport function TabBar({\n visibility = 'always',\n allowOpenFile = true,\n}: {\n visibility?: TabBarVisibility;\n allowOpenFile?: boolean;\n}) {\n const { docs, activeId, setActive, close, open } = useDocuments();\n const fileInput = useRef<HTMLInputElement>(null);\n\n const shouldShow = visibility === 'always' || (visibility === 'multiple' && docs.length > 1);\n if (!shouldShow) return null;\n\n const openFile = async (file: File) => {\n const bytes = new Uint8Array(await file.arrayBuffer());\n const source: OpenInput = { kind: 'bytes', id: `${file.name}-${Date.now()}`, bytes };\n await open(source, { name: file.name });\n };\n\n return (\n <div className=\"bg-surface-alt flex items-end pr-2 pt-2\">\n <div className=\"flex flex-1 items-end overflow-x-auto pl-4\">\n {docs.map((doc) => {\n const isActive = activeId === doc.id;\n return (\n <div\n key={doc.id}\n onClick={() => setActive(doc.id)}\n role=\"tab\"\n part={isActive ? 'tab tab-active' : 'tab'}\n tabIndex={0}\n aria-selected={isActive}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n setActive(doc.id);\n }\n }}\n className={`group relative flex min-w-[120px] max-w-[240px] cursor-pointer items-center gap-2 rounded-t-lg px-4 py-2 text-sm font-medium transition-all ${\n isActive\n ? 'bg-surface text-fg z-10'\n : 'bg-surface-alt text-fg-secondary hover:bg-hover hover:text-fg'\n }`}\n >\n {/* lifecycle glyphs — the tab exists from the moment open()\n was called; these show what its document is doing */}\n {doc.status === 'loading' && (\n <span\n className=\"border-border-subtle border-t-accent h-3 w-3 flex-shrink-0 animate-spin rounded-full border\"\n aria-label=\"Loading\"\n />\n )}\n {doc.status === 'locked' && (\n <Icon name=\"lock\" size={13} className=\"text-fg-muted flex-shrink-0\" />\n )}\n {doc.status === 'error' && (\n <Icon name=\"alertTriangle\" size={13} className=\"flex-shrink-0 text-red-500\" />\n )}\n <span className=\"min-w-0 flex-1 truncate\">\n {doc.name ?? `Document ${doc.id.slice(0, 8)}`}\n </span>\n\n {/* close — on the active tab, and never the last document\n (an empty workspace is designable, but not this demo's goal) */}\n {isActive && docs.length > 1 && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n void close(doc.id);\n }}\n aria-label={`Close ${doc.name ?? 'document'}`}\n className=\"hover:bg-hover flex-shrink-0 cursor-pointer rounded-full p-1 opacity-100 transition-all\"\n >\n <Icon name=\"x\" size={14} />\n </button>\n )}\n </div>\n );\n })}\n\n {allowOpenFile && (\n <>\n <button\n type=\"button\"\n onClick={() => fileInput.current?.click()}\n aria-label=\"Open File\"\n title=\"Open File\"\n className=\"text-fg-secondary hover:bg-hover hover:text-fg mb-1.5 ml-1 flex-shrink-0 cursor-pointer rounded p-1.5 transition-colors\"\n >\n <Icon name=\"plus\" size={14} />\n </button>\n <input\n ref={fileInput}\n type=\"file\"\n accept=\".pdf,application/pdf\"\n className=\"hidden\"\n onChange={(e) => {\n const file = e.target.files?.[0];\n if (file) void openFile(file);\n e.target.value = '';\n }}\n />\n </>\n )}\n </div>\n </div>\n );\n}\n","/**\n * THIS viewer's armed-tool cursor: the toolbar's own icon riding the pointer\n * as a real CSS cursor (OS-composited — zero lag, unlike any DOM follower).\n * The library owns arbitration (unmapped hover claims win, page gaps fall\n * back to the arrow — see `useToolCursor`); this module only decides what the\n * cursor LOOKS like. It reuses the SAME icon set and the SAME accent\n * derivation as the toolbar buttons (TOOL_ICONS is recorded by the command\n * definitions), so the cursor is pixel-identical to the button the user just\n * pressed — recolor the tool and both follow. A tool without a command icon\n * keeps its declared keyword cursor.\n *\n * ONE table decides the shape ({@link GLYPHS}): cursor KEYWORDS are the\n * affordances — a tool declares its base ('crosshair' to draw, 'copy' to\n * place), the selection handler claims 'text' over text — and each mapped\n * keyword is redrawn as its glyph + the tool's icon. Keywords the table omits\n * stay native: a markup tool's 'default' base is the bare arrow (identity\n * appears exactly where the action is possible — over text), a foreign 'move'\n * over an annotation drops the icon. A new tool gets the right cursor from\n * what it declares; nothing tool-specific lives here.\n *\n * The image: a white-haloed glyph at the hotspot (readable on any page color)\n * with the icon at its top right — 40px, under the 128px cursor ceiling;\n * Chromium may briefly show the default arrow when a >32px cursor would\n * overlap browser UI (anti-spoofing), which is fine mid-viewport.\n */\nimport { useToolCursor, useTool } from '@embedpdf/react/interaction';\nimport { useAnnotationDefaults } from '@embedpdf/react/annotation';\nimport { TOOL_ICONS } from '../config/commands';\nimport { ICON_PATHS } from './icons';\nimport type { IconAccent } from './icons';\n\nconst SIZE = 40;\nconst HOTSPOT = { x: 8, y: 28 };\nconst INK = '#1a1a1a';\nconst HALO = '#ffffff';\n/** The drag-and-drop \"will place a copy\" green (Chrome's DnD badge). */\nconst PLACE_GREEN = '#34a853';\n\n/** The icon's paths as SVG markup — the string twin of `<Icon>`'s render loop\n * (same fill/stroke slot rules), with a white halo pass underneath so the\n * glyph stays readable over page content. */\nfunction iconGlyph(name: string, accent?: IconAccent): string | null {\n const paths = ICON_PATHS[name];\n if (!paths) return null;\n const halo: string[] = [];\n const draw: string[] = [];\n for (const p of paths) {\n const spec = typeof p === 'string' ? { d: p, fill: undefined, stroke: undefined } : p;\n // Slot rules, mirrored from <Icon>: a fill slot paints from the accent\n // (nothing without one), a stroke slot falls back to the ink, and a\n // fill-only path never gets an outline.\n const fill = spec.fill === true ? INK : spec.fill ? accent?.[spec.fill] : undefined;\n const stroke = spec.stroke ? (accent?.[spec.stroke] ?? INK) : spec.fill ? 'none' : INK;\n halo.push(`<path d=\"${spec.d}\" fill=\"none\" stroke=\"${HALO}\" stroke-width=\"3.5\"/>`);\n draw.push(`<path d=\"${spec.d}\" fill=\"${fill ?? 'none'}\" stroke=\"${stroke}\"/>`);\n }\n return halo.join('') + draw.join('');\n}\n\n/** The action glyph drawn at the hotspot: what a click DOES here. */\ntype Glyph = 'crosshair' | 'ibeam' | 'plus';\n\nconst haloed = (x1: number, y1: number, x2: number, y2: number): string =>\n `<line x1=\"${x1}\" y1=\"${y1}\" x2=\"${x2}\" y2=\"${y2}\" stroke=\"${HALO}\" stroke-width=\"3\"/>` +\n `<line x1=\"${x1}\" y1=\"${y1}\" x2=\"${x2}\" y2=\"${y2}\" stroke=\"${INK}\" stroke-width=\"1.25\"/>`;\n\nfunction actionGlyph(glyph: Glyph): string {\n const { x, y } = HOTSPOT;\n if (glyph === 'crosshair') {\n return haloed(x, y - 6, x, y + 6) + haloed(x - 6, y, x + 6, y);\n }\n if (glyph === 'ibeam') {\n return (\n haloed(x, y - 6.5, x, y + 6.5) +\n haloed(x - 2.5, y - 6.5, x + 2.5, y - 6.5) +\n haloed(x - 2.5, y + 6.5, x + 2.5, y + 6.5)\n );\n }\n // plus: the DnD copy affordance — green disc, white plus.\n return (\n `<circle cx=\"${x}\" cy=\"${y}\" r=\"7.5\" fill=\"${PLACE_GREEN}\" stroke=\"${HALO}\" stroke-width=\"1.5\"/>` +\n `<line x1=\"${x}\" y1=\"${y - 3.5}\" x2=\"${x}\" y2=\"${y + 3.5}\" stroke=\"${HALO}\" stroke-width=\"2\"/>` +\n `<line x1=\"${x - 3.5}\" y1=\"${y}\" x2=\"${x + 3.5}\" y2=\"${y}\" stroke=\"${HALO}\" stroke-width=\"2\"/>`\n );\n}\n\nfunction cursorSvg(glyph: Glyph, icon: string, accent?: IconAccent): string {\n const g = iconGlyph(icon, accent);\n return (\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${SIZE}\" height=\"${SIZE}\" ` +\n `viewBox=\"0 0 ${SIZE} ${SIZE}\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">` +\n actionGlyph(glyph) +\n (g\n ? `<g transform=\"translate(17 3) scale(${(20 / 24).toFixed(4)})\" stroke-width=\"2\">${g}</g>`\n : '') +\n `</svg>`\n );\n}\n\n/** keyword → glyph: how each affordance is drawn when a tool icon rides\n * along. Draw tools declare 'crosshair', place tools (stamp/signature/image)\n * declare 'copy', and the selection handler claims 'text' over text — which\n * keywords ever SHOW is decided by those declarations and claims, never\n * here. 'default' is deliberately absent: the bare arrow means \"no action\n * here\", so it never carries an icon. */\nconst GLYPHS: Record<string, Glyph> = {\n crosshair: 'crosshair',\n text: 'ibeam',\n copy: 'plus',\n};\n\n/** Mount once (renders nothing): keeps the armed tool's cursor skin in sync\n * with its toolbar icon + live defaults. */\nexport function ArmedToolCursor() {\n const { activeToolId } = useTool();\n // Live accent: a `setDefaults` recolor re-renders us and rebuilds the cursor.\n const d = useAnnotationDefaults(activeToolId);\n const entry = TOOL_ICONS[activeToolId];\n const accent = entry?.accent\n ? {\n primary: d[entry.accent.primary] ?? undefined,\n secondary: entry.accent.secondary ? (d[entry.accent.secondary] ?? undefined) : undefined,\n }\n : undefined;\n useToolCursor(\n entry\n ? {\n toolId: activeToolId,\n cursors: Object.fromEntries(\n Object.entries(GLYPHS).map(([keyword, glyph]) => [\n keyword,\n { svg: cursorSvg(glyph, entry.icon, accent), hotspot: HOTSPOT },\n ]),\n ),\n }\n : null,\n );\n return null;\n}\n","/**\n * The annotation FLAGS section — a live test surface for `/F` (ISO 32000\n * Table 167). Select any annotation(s) and toggle flags; the writes go through\n * the plugin's `updateSelectionFlags` (optimistic, flags-only engine patch),\n * and the reads come from `useSelectionFlags` (per-flag value, `null` when the\n * selection disagrees → indeterminate checkbox).\n *\n * Things to try:\n * - `locked`: the selection keeps its outline but loses handles/knob; move,\n * restyle and delete are refused; unchecking it here still works.\n * - `hidden` / `noView`: the annotation disappears (it stays selected, so\n * this panel can bring it back).\n * - `readOnly`: visible but no longer clickable — deselect and try.\n * - `noZoom` / `noRotate`: zoom or rotate the page; the body keeps its\n * screen size / stays upright, anchored at its top-left corner.\n * - `print`: flip it off and print/flatten elsewhere — the annotation is\n * excluded (viewer rendering is unaffected).\n */\nimport { useAnnotation, useSelectionFlags, type AnnotationFlags } from '@embedpdf/react/annotation';\nimport { useEffect, useRef } from 'react';\n\nconst FLAG_ROWS: { key: keyof AnnotationFlags; label: string; hint: string }[] = [\n { key: 'print', label: 'Print', hint: 'Include when the page is printed' },\n { key: 'hidden', label: 'Hidden', hint: 'Gone everywhere: screen, clicks, print' },\n { key: 'noView', label: 'No view', hint: 'Hidden on screen, may still print' },\n {\n key: 'toggleNoView',\n label: 'Toggle no view',\n hint: 'Reveal a no-view annotation while selected',\n },\n { key: 'readOnly', label: 'Read only', hint: 'Visible but not clickable' },\n { key: 'locked', label: 'Locked', hint: 'No move / resize / delete / restyle' },\n { key: 'lockedContents', label: 'Locked contents', hint: 'Text cannot change; geometry can' },\n { key: 'noZoom', label: 'No zoom', hint: 'Screen-constant size (anchored top-left)' },\n { key: 'noRotate', label: 'No rotate', hint: 'Stays upright when the page rotates' },\n { key: 'invisible', label: 'Invisible', hint: 'Legacy: hide unknown subtypes' },\n];\n\nfunction FlagRow({\n label,\n hint,\n value,\n onToggle,\n}: {\n label: string;\n hint: string;\n value: boolean | null;\n onToggle: (next: boolean) => void;\n}) {\n const ref = useRef<HTMLInputElement>(null);\n // `null` = the selected annotations disagree → the native indeterminate state.\n useEffect(() => {\n if (ref.current) ref.current.indeterminate = value === null;\n }, [value]);\n return (\n <label className=\"hover:bg-hover flex cursor-pointer items-start gap-2.5 rounded px-1.5 py-1.5\">\n <input\n ref={ref}\n type=\"checkbox\"\n className=\"accent-accent mt-0.5\"\n checked={value === true}\n onChange={() => onToggle(value !== true)}\n />\n <span className=\"min-w-0\">\n <span className=\"text-fg block text-sm leading-tight\">{label}</span>\n <span className=\"text-fg-muted block text-xs leading-tight\">{hint}</span>\n </span>\n </label>\n );\n}\n\n/** The `/F` flags of the current selection, live-editable. Renders nothing\n * when nothing is selected (the style panel shows its tool defaults then). */\nexport function AnnotationFlagsSection() {\n const annotation = useAnnotation();\n const flags = useSelectionFlags();\n if (!flags) return null;\n return (\n <section className=\"border-border mt-2 border-t pt-4\">\n <p className=\"text-fg-muted mb-2 text-[11px] font-semibold uppercase tracking-wide\">\n Flags (/F)\n </p>\n <div className=\"flex flex-col\">\n {FLAG_ROWS.map((row) => (\n <FlagRow\n key={row.key}\n label={row.label}\n hint={row.hint}\n value={flags[row.key]}\n onToggle={(next) => annotation.updateSelectionFlags({ [row.key]: next })}\n />\n ))}\n </div>\n </section>\n );\n}\n","/**\n * The annotation style panel — the v2 snippet's style sidebar, rebuilt the v3\n * way. The plugin owns the schema AND the state; this file owns only how each\n * PropSpec renders and the flat patch it writes back. There is NO per-subtype\n * branching here: a new annotation kind that declares its `PropSpec[]` in the\n * kind table gets a working style panel for free.\n *\n * Data flow (mirrors examples/react's AnnotationSidebar):\n * selection present → useSelectionProps() specs/values, write updateSelection()\n * nothing selected → propsForTool(tool) specs + useAnnotationDefaults(tool)\n * values, write setDefaults(tool, …)\n *\n * The look is ported 1:1 from viewers/snippet's annotation-sidebar (six-column\n * swatch grid, range slider, SVG stroke / line-ending dropdowns, font-size\n * combo, align toggles), retinted from v2's `bg-bg-input`/`text-fg-primary`\n * tokens to this app's semantic ones (bg-surface / text-fg / border-border …).\n */\nimport { useEffect, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport {\n useAnnotation,\n useSelectionProps,\n useAnnotationDefaults,\n useAnnotationSelected,\n type PropSpec,\n type AnnotationPropsPatch,\n type Border,\n type BlendMode,\n type LineEnding,\n type LineEndings,\n type TextAlign,\n} from '@embedpdf/react/annotation';\nimport { useTool } from '@embedpdf/react/interaction';\nimport { useOptionalCapability } from '@embedpdf/react/runtime';\nimport { RedactionToken } from '@embedpdf/react/redaction';\nimport { useT } from '@embedpdf/react/i18n';\nimport { Icon } from './icons';\nimport { AnnotationFlagsSection } from './annotation-flags';\n\n// ── app-level vocabulary (a viewer's decision, like v2's color presets) ──────\n// The engine schema says WHICH controls to show; these lists say what the app\n// offers inside a color / font / stroke picker.\nconst PRESET_COLORS = [\n '#000000',\n '#5f6368',\n '#e44234',\n '#ff8b00',\n '#ffd500',\n '#00cc66',\n '#00b8d9',\n '#4a90e2',\n '#9b51e0',\n '#f272c8',\n '#a0522d',\n '#ffffff',\n];\n\nconst FONT_OPTIONS: { v: string; label: string }[] = [\n { v: 'helvetica', label: 'Helvetica' },\n { v: 'helvetica-bold', label: 'Helvetica Bold' },\n { v: 'times-roman', label: 'Times Roman' },\n { v: 'courier', label: 'Courier' },\n];\n\nconst FONT_SIZES = [8, 9, 10, 11, 12, 14, 16, 18, 24, 36, 48, 72];\n\nconst BORDER_OPTS: { key: string; make: () => Border }[] = [\n { key: 'solid', make: () => ({ kind: 'solid' }) },\n { key: 'dashed-6-2', make: () => ({ kind: 'dashed', dash: [6, 2] }) },\n { key: 'dashed-3-3', make: () => ({ kind: 'dashed', dash: [3, 3] }) },\n { key: 'dashed-1-2', make: () => ({ kind: 'dashed', dash: [1, 2] }) },\n { key: 'cloudy-1', make: () => ({ kind: 'cloudy', intensity: 1 }) },\n { key: 'cloudy-2', make: () => ({ kind: 'cloudy', intensity: 2 }) },\n];\nconst borderKey = (b: Border): string =>\n b.kind === 'cloudy'\n ? `cloudy-${b.intensity >= 2 ? 2 : 1}`\n : b.kind === 'dashed'\n ? `dashed-${b.dash.join('-')}`\n : 'solid';\n\nconst LINE_ENDINGS: { v: LineEnding; label: string }[] = [\n { v: 'none', label: 'None' },\n { v: 'open-arrow', label: 'Open arrow' },\n { v: 'closed-arrow', label: 'Closed arrow' },\n { v: 'r-open-arrow', label: 'Reverse open' },\n { v: 'r-closed-arrow', label: 'Reverse closed' },\n { v: 'circle', label: 'Circle' },\n { v: 'square', label: 'Square' },\n { v: 'diamond', label: 'Diamond' },\n { v: 'butt', label: 'Butt' },\n { v: 'slash', label: 'Slash' },\n];\n\nconst BLEND_MODES: { v: BlendMode; label: string }[] = [\n { v: 'normal', label: 'Normal' },\n { v: 'multiply', label: 'Multiply' },\n { v: 'screen', label: 'Screen' },\n { v: 'overlay', label: 'Overlay' },\n { v: 'darken', label: 'Darken' },\n { v: 'lighten', label: 'Lighten' },\n { v: 'color-dodge', label: 'Color Dodge' },\n { v: 'color-burn', label: 'Color Burn' },\n { v: 'hard-light', label: 'Hard Light' },\n { v: 'soft-light', label: 'Soft Light' },\n { v: 'difference', label: 'Difference' },\n { v: 'exclusion', label: 'Exclusion' },\n { v: 'hue', label: 'Hue' },\n { v: 'saturation', label: 'Saturation' },\n { v: 'color', label: 'Color' },\n { v: 'luminosity', label: 'Luminosity' },\n];\n\n// ── layout primitives ────────────────────────────────────────────────────────\nfunction Field({\n label,\n mixed,\n children,\n}: {\n label: string;\n mixed?: boolean;\n children: ReactNode;\n}) {\n return (\n <section className=\"mb-5\">\n <label className=\"text-fg mb-2 block text-sm font-medium\">\n {label}\n {mixed && <span className=\"text-fg-muted ml-1.5 text-xs font-normal\">(mixed)</span>}\n </label>\n {children}\n </section>\n );\n}\n\n// ── color swatch grid ────────────────────────────────────────────────────────\nconst isTransparent = (c: string | null) =>\n c == null ||\n c === 'transparent' ||\n (/^#([0-9a-f]{8})$/i.test(c) && c.slice(-2).toLowerCase() === '00');\n\nfunction Swatch({\n color,\n active,\n onSelect,\n}: {\n color: string;\n active: boolean;\n onSelect: (c: string) => void;\n}) {\n const style = isTransparent(color)\n ? {\n backgroundColor: '#fff',\n backgroundImage:\n 'linear-gradient(45deg, transparent 40%, #ef4444 40%, #ef4444 60%, transparent 60%)',\n backgroundSize: '100% 100%',\n }\n : { backgroundColor: color };\n return (\n <button\n type=\"button\"\n title={color}\n onClick={() => onSelect(color)}\n className={`border-border-strong h-5 w-5 rounded-full border ${active ? 'outline-accent outline outline-2 outline-offset-2' : ''}`}\n style={style}\n />\n );\n}\n\nfunction SwatchGrid({\n value,\n onSelect,\n allowTransparent,\n}: {\n value: string | null | undefined;\n onSelect: (c: string) => void;\n allowTransparent?: boolean;\n}) {\n const active = (c: string) => c.toLowerCase() === (value ?? '').toLowerCase();\n return (\n <div className=\"grid grid-cols-6 gap-x-1 gap-y-3\">\n {PRESET_COLORS.map((c) => (\n <Swatch key={c} color={c} active={active(c)} onSelect={onSelect} />\n ))}\n {allowTransparent && (\n <Swatch color=\"transparent\" active={isTransparent(value ?? null)} onSelect={onSelect} />\n )}\n </div>\n );\n}\n\n// ── range slider ─────────────────────────────────────────────────────────────\nfunction RangeSlider({\n value,\n min,\n max,\n step,\n onChange,\n}: {\n value: number;\n min: number;\n max: number;\n step: number;\n onChange: (n: number) => void;\n}) {\n return (\n <input\n type=\"range\"\n className=\"accent-accent mb-1.5 h-1 w-full cursor-pointer\"\n value={value}\n min={min}\n max={max}\n step={step}\n onChange={(e) => onChange(parseFloat(e.target.value))}\n />\n );\n}\n\n// ── dropdown shell (open state, outside-click, trigger + panel) ───────────────\nfunction useOutsideClose(open: boolean, close: () => void) {\n const rootRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (!open) return;\n const onDoc = (e: MouseEvent) => {\n // composedPath, NOT contains(e.target): at the document level an event\n // from inside the viewer's shadow root retargets to the host element, so\n // contains() reads every inside click as outside and unmounts the panel\n // on mousedown — before the option's click can fire.\n if (rootRef.current && !e.composedPath().includes(rootRef.current)) close();\n };\n document.addEventListener('mousedown', onDoc);\n return () => document.removeEventListener('mousedown', onDoc);\n }, [open, close]);\n return rootRef;\n}\n\nfunction DropdownShell({\n trigger,\n children,\n}: {\n trigger: ReactNode;\n children: (close: () => void) => ReactNode;\n}) {\n const [open, setOpen] = useState(false);\n const rootRef = useOutsideClose(open, () => setOpen(false));\n return (\n <div ref={rootRef} className=\"relative w-full\">\n <button\n type=\"button\"\n onClick={() => setOpen((o) => !o)}\n className=\"border-border bg-surface text-fg flex w-full items-center justify-between gap-2 rounded border px-3 py-1.5\"\n >\n {trigger}\n <Icon name=\"chevronDown\" size={16} className=\"text-fg-secondary shrink-0\" />\n </button>\n {open && (\n <div className=\"border-border bg-elevated absolute z-10 mt-1 max-h-60 w-full overflow-y-auto rounded border p-1 shadow-lg\">\n {children(() => setOpen(false))}\n </div>\n )}\n </div>\n );\n}\n\nfunction OptionRow({\n selected,\n onClick,\n children,\n}: {\n selected: boolean;\n onClick: () => void;\n children: ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={`hover:bg-hover flex w-full items-center rounded px-2 py-1.5 text-left text-sm ${selected ? 'bg-selected text-accent' : 'text-fg'}`}\n >\n {children}\n </button>\n );\n}\n\n// ── stroke / border preview + picker ─────────────────────────────────────────\nfunction borderSvg(b: Border): ReactNode {\n if (b.kind === 'cloudy') {\n const r = b.intensity >= 2 ? 5 : 3;\n const n = Math.ceil(80 / (r * 2));\n const step = 80 / n;\n const baseline = r + 1;\n const viewH = r * 2 + 2;\n const parts = [`M 0 ${baseline}`];\n for (let i = 0; i < n; i++) parts.push(`A ${r} ${r} 0 0 1 ${step * (i + 1)} ${baseline}`);\n return (\n <svg width=\"80\" height={viewH} viewBox={`0 0 80 ${viewH}`}>\n <path\n d={parts.join(' ')}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n }\n const dash = b.kind === 'dashed' ? b.dash.join(' ') : undefined;\n return (\n <svg width=\"80\" height=\"8\" viewBox=\"0 0 80 8\">\n <line\n x1=\"0\"\n y1=\"4\"\n x2=\"80\"\n y2=\"4\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeDasharray={dash}\n />\n </svg>\n );\n}\n\nfunction BorderSelect({\n value,\n cloudy,\n onChange,\n}: {\n value: Border;\n cloudy: boolean;\n onChange: (b: Border) => void;\n}) {\n const opts = cloudy ? BORDER_OPTS : BORDER_OPTS.filter((o) => !o.key.startsWith('cloudy'));\n return (\n <DropdownShell trigger={<span className=\"text-fg-secondary\">{borderSvg(value)}</span>}>\n {(close) =>\n opts.map((o) => {\n const b = o.make();\n return (\n <OptionRow\n key={o.key}\n selected={borderKey(value) === o.key}\n onClick={() => {\n onChange(b);\n close();\n }}\n >\n <span className=\"text-fg-secondary\">{borderSvg(b)}</span>\n </OptionRow>\n );\n })\n }\n </DropdownShell>\n );\n}\n\n// ── line-ending preview + picker ─────────────────────────────────────────────\nconst LE_MARKERS: Partial<Record<LineEnding, ReactNode>> = {\n square: <path d=\"M68 -4 L76 -4 L76 4 L68 4 Z\" />,\n circle: <circle cx=\"72\" cy=\"0\" r=\"4\" />,\n diamond: <path d=\"M72 -5 L77 0 L72 5 L67 0 Z\" />,\n 'open-arrow': <path d=\"M67 -5 L77 0 L67 5\" fill=\"none\" />,\n 'closed-arrow': <path d=\"M67 -5 L77 0 L67 5 Z\" />,\n 'r-open-arrow': <path d=\"M77 -5 L67 0 L77 5\" fill=\"none\" />,\n 'r-closed-arrow': <path d=\"M77 -5 L67 0 L77 5 Z\" />,\n butt: <path d=\"M72 -5 L72 5\" fill=\"none\" />,\n slash: <path d=\"M67 -5 L77 5\" fill=\"none\" />,\n};\nconst LE_LINE_END: Partial<Record<LineEnding, number>> = {\n square: 68,\n circle: 68,\n diamond: 67,\n 'open-arrow': 76,\n 'closed-arrow': 67,\n 'r-open-arrow': 67,\n 'r-closed-arrow': 67,\n butt: 72,\n slash: 72,\n};\n\nfunction LineEndingPreview({ name, side }: { name: LineEnding; side: 'start' | 'end' }) {\n const marker = LE_MARKERS[name];\n const lineEndX = LE_LINE_END[name] ?? 77;\n const transform = side === 'start' ? 'rotate(180 40 10)' : undefined;\n return (\n <svg width=\"80\" height=\"20\" viewBox=\"0 0 80 20\" className=\"text-fg\">\n <g transform={transform}>\n <line x1=\"4\" y1=\"10\" x2={lineEndX} y2=\"10\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n {marker && (\n <g\n transform=\"translate(0, 10)\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n >\n {marker}\n </g>\n )}\n </g>\n </svg>\n );\n}\n\nfunction LineEndingSelect({\n side,\n value,\n onChange,\n}: {\n side: 'start' | 'end';\n value: LineEnding;\n onChange: (v: LineEnding) => void;\n}) {\n return (\n <DropdownShell trigger={<LineEndingPreview name={value} side={side} />}>\n {(close) =>\n LINE_ENDINGS.map((o) => (\n <OptionRow\n key={o.v}\n selected={value === o.v}\n onClick={() => {\n onChange(o.v);\n close();\n }}\n >\n <LineEndingPreview name={o.v} side={side} />\n </OptionRow>\n ))\n }\n </DropdownShell>\n );\n}\n\n// ── font family picker ───────────────────────────────────────────────────────\nfunction FontFamilySelect({ value, onChange }: { value: string; onChange: (v: string) => void }) {\n const current = FONT_OPTIONS.find((o) => o.v === value);\n return (\n <DropdownShell trigger={<span className=\"text-fg text-sm\">{current?.label ?? value}</span>}>\n {(close) =>\n FONT_OPTIONS.map((o) => (\n <OptionRow\n key={o.v}\n selected={o.v === value}\n onClick={() => {\n onChange(o.v);\n close();\n }}\n >\n {o.label}\n </OptionRow>\n ))\n }\n </DropdownShell>\n );\n}\n\n// ── font-size combo (number input + preset dropdown) ─────────────────────────\nfunction FontSizeCombo({ value, onChange }: { value: number; onChange: (n: number) => void }) {\n const [open, setOpen] = useState(false);\n const rootRef = useOutsideClose(open, () => setOpen(false));\n return (\n <div ref={rootRef} className=\"relative w-full\">\n <input\n type=\"number\"\n min={1}\n value={value}\n onChange={(e) => {\n const n = parseInt(e.target.value, 10);\n if (Number.isFinite(n) && n > 0) onChange(n);\n }}\n onClick={() => setOpen(true)}\n className=\"border-border bg-surface text-fg w-full rounded border px-2 py-1.5 pr-7 text-sm\"\n />\n <button\n type=\"button\"\n tabIndex={-1}\n onClick={() => setOpen((o) => !o)}\n className=\"absolute inset-y-0 right-1 flex items-center\"\n >\n <Icon name=\"chevronDown\" size={16} className=\"text-fg-secondary\" />\n </button>\n {open && (\n <div className=\"border-border bg-elevated absolute z-10 mt-1 max-h-48 w-full overflow-y-auto rounded border p-1 shadow-lg\">\n {FONT_SIZES.map((sz) => (\n <OptionRow\n key={sz}\n selected={sz === value}\n onClick={() => {\n onChange(sz);\n setOpen(false);\n }}\n >\n {sz}\n </OptionRow>\n ))}\n </div>\n )}\n </div>\n );\n}\n\nfunction BlendModeSelect({\n value,\n onChange,\n}: {\n value: BlendMode;\n onChange: (mode: BlendMode) => void;\n}) {\n return (\n <select\n value={value}\n onChange={(event) => onChange(event.target.value as BlendMode)}\n className=\"border-border bg-surface text-fg w-full rounded border px-3 py-1.5 text-sm\"\n >\n {BLEND_MODES.map((mode) => (\n <option key={mode.v} value={mode.v}>\n {mode.label}\n </option>\n ))}\n </select>\n );\n}\n\n// ── align toggle ─────────────────────────────────────────────────────────────\nfunction Toggle({\n active,\n title,\n onClick,\n children,\n}: {\n active: boolean;\n title: string;\n onClick: () => void;\n children: ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n title={title}\n onClick={onClick}\n className={`flex h-9 w-9 items-center justify-center rounded border transition-colors ${\n active\n ? 'border-accent bg-accent text-on-accent'\n : 'border-border bg-surface text-fg hover:bg-hover'\n }`}\n >\n {children}\n </button>\n );\n}\n\n// ── one control per PropSpec — the entire surface an app customizes ──────────\nfunction PropControl({\n spec,\n value,\n mixed,\n onChange,\n}: {\n spec: PropSpec;\n value: unknown;\n mixed: boolean;\n onChange: (patch: AnnotationPropsPatch) => void;\n}) {\n switch (spec.key) {\n case 'color':\n case 'fontColor':\n return (\n <Field label={spec.label} mixed={mixed}>\n <SwatchGrid\n value={value as string}\n onSelect={(c) => onChange({ [spec.key]: c } as AnnotationPropsPatch)}\n />\n </Field>\n );\n case 'interiorColor':\n return (\n <Field label={spec.label} mixed={mixed}>\n <SwatchGrid\n value={value as string | null}\n allowTransparent\n onSelect={(c) => onChange({ interiorColor: c === 'transparent' ? null : c })}\n />\n </Field>\n );\n case 'opacity': {\n const v = (value as number) ?? 1;\n return (\n <Field label={spec.label} mixed={mixed}>\n <RangeSlider\n value={v}\n min={spec.min}\n max={spec.max}\n step={spec.step}\n onChange={(n) => onChange({ opacity: n })}\n />\n <span className=\"text-fg-muted text-xs\">{Math.round(v * 100)}%</span>\n </Field>\n );\n }\n case 'strokeWidth': {\n const v = (value as number) ?? spec.min;\n return (\n <Field label={spec.label} mixed={mixed}>\n <RangeSlider\n value={v}\n min={spec.min}\n max={spec.max}\n step={spec.step}\n onChange={(n) => onChange({ strokeWidth: n })}\n />\n <span className=\"text-fg-muted text-xs\">{v}px</span>\n </Field>\n );\n }\n case 'fontSize':\n return (\n <Field label={spec.label} mixed={mixed}>\n <FontSizeCombo\n value={(value as number) ?? 12}\n onChange={(n) => onChange({ fontSize: n })}\n />\n </Field>\n );\n case 'border':\n return (\n <Field label={spec.label} mixed={mixed}>\n <BorderSelect\n value={(value as Border) ?? { kind: 'solid' }}\n cloudy={spec.cloudy}\n onChange={(b) => onChange({ border: b })}\n />\n </Field>\n );\n case 'lineEndings': {\n const le = (value as LineEndings) ?? { start: 'none', end: 'none' };\n return (\n <Field label={spec.label} mixed={mixed}>\n <div className=\"grid grid-cols-2 gap-3\">\n <div>\n <div className=\"text-fg-muted mb-1.5 text-xs\">Start</div>\n <LineEndingSelect\n side=\"start\"\n value={le.start}\n onChange={(v) => onChange({ lineEndings: { start: v } })}\n />\n </div>\n <div>\n <div className=\"text-fg-muted mb-1.5 text-xs\">End</div>\n <LineEndingSelect\n side=\"end\"\n value={le.end}\n onChange={(v) => onChange({ lineEndings: { end: v } })}\n />\n </div>\n </div>\n </Field>\n );\n }\n case 'fontFamily':\n return (\n <Field label={spec.label} mixed={mixed}>\n <FontFamilySelect\n value={(value as string) ?? 'helvetica'}\n onChange={(v) => onChange({ fontFamily: v })}\n />\n </Field>\n );\n case 'textAlign': {\n const alignIcon: Record<TextAlign, string> = {\n left: 'alignLeft',\n center: 'alignCenter',\n right: 'alignRight',\n };\n return (\n <Field label={spec.label} mixed={mixed}>\n <div className=\"flex gap-2\">\n {(['left', 'center', 'right'] as TextAlign[]).map((al) => (\n <Toggle\n key={al}\n title={`Align ${al}`}\n active={value === al}\n onClick={() => onChange({ textAlign: al })}\n >\n <Icon name={alignIcon[al]} size={18} />\n </Toggle>\n ))}\n </div>\n </Field>\n );\n }\n case 'blendMode':\n return (\n <Field label={spec.label} mixed={mixed}>\n <BlendModeSelect\n value={(value as BlendMode) ?? 'normal'}\n onChange={(blendMode) => onChange({ blendMode })}\n />\n </Field>\n );\n // `link` deliberately renders NOTHING here: a link is a verb on the\n // selection, edited in the anchored popover (see ui/link-editor.tsx) —\n // never a style-panel section.\n case 'link':\n return null;\n default:\n return null;\n }\n}\n\n// ── the panel ────────────────────────────────────────────────────────────────\nfunction EmptyState() {\n return (\n <div className=\"text-fg-muted flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center\">\n <Icon name=\"palette\" size={40} className=\"text-fg-disabled\" />\n <p className=\"max-w-[180px] text-sm\">\n Pick a draw tool or select an annotation to edit its style.\n </p>\n </div>\n );\n}\n\n/**\n * The schema-driven style panel. Rendered inside the right sidebar's\n * `annotation-style` surface (see ui/panels.tsx). Owns its own scroll.\n */\nexport function AnnotationStylePanel() {\n const annotation = useAnnotation();\n const { activeToolId } = useTool();\n const sel = useSelectionProps();\n const defaults = useAnnotationDefaults(activeToolId);\n const selected = useAnnotationSelected();\n\n const hasSel = sel.specs.length > 0;\n const specs = hasSel ? sel.specs : annotation.propsForTool(activeToolId);\n const values = hasSel ? sel.values : defaults;\n const write = (patch: AnnotationPropsPatch) =>\n hasSel ? annotation.updateSelection(patch) : annotation.setDefaults(activeToolId, patch);\n\n // A selection with no editable props (e.g. a stamp, or a LOCKED annotation —\n // its style is frozen) still shows its flags: that's how you unlock it.\n if (specs.length === 0 && selected.length === 0) return <EmptyState />;\n\n const context = hasSel ? `${selected.length} selected` : `${activeToolId} defaults`;\n\n return (\n <div className=\"flex-1 overflow-y-auto p-4\">\n <p className=\"text-fg-muted mb-4 text-[11px] font-semibold uppercase tracking-wide\">\n {context}\n </p>\n {specs.map((spec) => (\n <PropControl\n key={spec.key}\n spec={spec}\n value={values[spec.key]}\n mixed={hasSel && sel.mixed.includes(spec.key)}\n onChange={write}\n />\n ))}\n {/* Redaction label (`/OverlayText` + `/Repeat`) — kind content, not a\n style prop, so it writes through the redaction plugin's setLabel. */}\n <RedactionLabelSection />\n {/* `/F` flags for whatever is selected — the live flags test surface. */}\n <AnnotationFlagsSection />\n </div>\n );\n}\n\n/**\n * Label editor shown when exactly one redaction mark is selected. The text is\n * what the destructive apply paints over the region (white-on-black by the\n * tool defaults); `repeat` tiles it. Writes ride the annotation update verb\n * via the redaction plugin, which preserves the label's `/DA` styling.\n */\nfunction RedactionLabelSection() {\n const t = useT();\n const redaction = useOptionalCapability(RedactionToken);\n const selected = useAnnotationSelected();\n const mark = selected.length === 1 && selected[0]!.subtype === 'redact' ? selected[0]! : null;\n const [draft, setDraft] = useState<string | null>(null);\n useEffect(() => setDraft(null), [mark?.ref && refKeyOfRedact(mark.ref)]);\n if (!redaction || !mark || mark.subtype !== 'redact') return null;\n\n const value = draft ?? mark.overlayText ?? '';\n const commit = () => {\n if (draft === null) return;\n void redaction.setLabel(mark.ref, { overlayText: draft.length > 0 ? draft : null });\n setDraft(null);\n };\n\n return (\n <div className=\"border-border-subtle mt-4 border-t pt-4\">\n <p className=\"text-fg-muted mb-2 text-[11px] font-semibold uppercase tracking-wide\">\n {t('demo.redactLabelTitle')}\n </p>\n <input\n type=\"text\"\n value={value}\n placeholder={t('demo.redactLabelPlaceholder')}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={commit}\n onKeyDown={(e) => e.key === 'Enter' && commit()}\n className=\"border-border bg-surface text-fg w-full rounded-md border px-2 py-1.5 text-sm\"\n />\n <label className=\"text-fg mt-2 flex items-center gap-2 text-sm\">\n <input\n type=\"checkbox\"\n checked={mark.repeat}\n onChange={(e) => void redaction.setLabel(mark.ref, { repeat: e.target.checked })}\n />\n {t('demo.redactLabelRepeat')}\n </label>\n </div>\n );\n}\n\n/** Stable key for the effect dep — mirrors the annotation model's ref keys. */\nfunction refKeyOfRedact(ref: { kind: string } & Record<string, unknown>): string {\n return JSON.stringify(ref);\n}\n","import type { AnnotationDTO, Color } from '@embedpdf/react/annotation';\n\n/**\n * How a comment card identifies its annotation at a glance: the type's glyph,\n * tinted with THAT annotation's own colors. Ported from v2's comment-sidebar\n * config onto the v3 vocabulary — the icon names carry over verbatim (the\n * chrome icon set kept the v2 registry names and accent slots), while the\n * color model is v3's ISO-faithful one: there is exactly one `/C` (\"color\")\n * and one `/IC` (\"interiorColor\") in the spec, so `primary` is the annotation's\n * `/C` and `secondary` its interior fill where the family has one.\n */\n\nexport interface IconAccent {\n primary?: string;\n secondary?: string;\n}\n\nexport interface CommentTypeConfig {\n /** Icon name in the chrome registry. */\n icon: string;\n /** i18n key for the type's display name (tooltip). */\n labelKey: string;\n /** Fallback when the locale has no entry. */\n label: string;\n}\n\n/** `/C`-style Color → CSS. */\nexport const cssColor = (c: Color | null | undefined): string | undefined =>\n c ? `rgb(${c.r}, ${c.g}, ${c.b})` : undefined;\n\nconst TYPE_CONFIG: Record<string, CommentTypeConfig> = {\n text: { icon: 'message', labelKey: 'annotation.comment', label: 'Comment' },\n highlight: { icon: 'highlight', labelKey: 'annotation.highlight', label: 'Highlight' },\n underline: { icon: 'underline', labelKey: 'annotation.underline', label: 'Underline' },\n squiggly: { icon: 'squiggly', labelKey: 'annotation.squiggly', label: 'Squiggly' },\n strikeout: { icon: 'strikethrough', labelKey: 'annotation.strikeout', label: 'Strikethrough' },\n square: { icon: 'square', labelKey: 'annotation.square', label: 'Square' },\n circle: { icon: 'circle', labelKey: 'annotation.circle', label: 'Circle' },\n line: { icon: 'line', labelKey: 'annotation.line', label: 'Line' },\n polygon: { icon: 'polygon', labelKey: 'annotation.polygon', label: 'Polygon' },\n polyline: { icon: 'zigzag', labelKey: 'annotation.polyline', label: 'Polyline' },\n ink: { icon: 'pencilMarker', labelKey: 'annotation.ink', label: 'Ink' },\n 'free-text': { icon: 'freeText', labelKey: 'annotation.freeText', label: 'Text' },\n stamp: { icon: 'rubberStamp', labelKey: 'annotation.stamp', label: 'Stamp' },\n caret: { icon: 'insertText', labelKey: 'annotation.caret', label: 'Caret' },\n redact: { icon: 'redact', labelKey: 'annotation.redact', label: 'Redact' },\n 'file-attachment': {\n icon: 'paperclip',\n labelKey: 'annotation.fileAttachment',\n label: 'Attachment',\n },\n};\n\nconst FALLBACK: CommentTypeConfig = {\n icon: 'message',\n labelKey: 'annotation.comment',\n label: 'Comment',\n};\n\nexport const commentTypeConfig = (a: AnnotationDTO): CommentTypeConfig =>\n TYPE_CONFIG[a.subtype] ?? FALLBACK;\n\n/**\n * The glyph's tint slots, read off the annotation itself — this is what makes\n * a card recognizable as \"that yellow highlight on page 3\". Free-text prefers\n * its `fontColor` override, since that is the color a reader actually sees.\n */\nexport const commentIconAccent = (a: AnnotationDTO): IconAccent => {\n const anyA = a as { color?: Color; interiorColor?: Color | null; fontColor?: Color };\n const primary = cssColor(anyA.fontColor ?? anyA.color);\n const secondary = cssColor(anyA.interiorColor);\n return {\n ...(primary ? { primary } : {}),\n ...(secondary ? { secondary } : {}),\n };\n};\n","import { useEffect, useMemo, useRef, useState } from 'react';\nimport { useCapability } from '@embedpdf/react/runtime';\nimport {\n AnnotationToken,\n refKey,\n useAnnotationSelection,\n useComments,\n useCommentThreads,\n useCommentsHydration,\n type AnnotationDTO,\n type AnnotationRef,\n type CommentThreadView,\n} from '@embedpdf/react/annotation';\nimport { StageToken } from '@embedpdf/react/stage';\nimport { useT } from '@embedpdf/react/i18n';\nimport { Icon } from './icons';\nimport { commentIconAccent, commentTypeConfig } from './comment-config';\n\n/**\n * The comments sidebar (right panel): a live view over the conversation\n * plane, in the shape v2's reviewers knew — page-grouped sections, and a\n * card that identifies its annotation at a glance by the type's glyph tinted\n * with that annotation's own colors. What v2 lacked, and this adds, is the\n * ISO 32000 §12.5.6.3 review status per thread.\n *\n * There is no per-page loading dance: the plugin hydrates the WHOLE document\n * at open (`listRawAll`), so the list is complete the moment `hydration()`\n * says so, whether or not a page was ever scrolled to.\n *\n * Selection is two-way, as in v2: clicking a card selects the annotation and\n * flies the camera to it (`stage.reveal`, the same verb search hits use);\n * selecting in the document scrolls that card into view here.\n *\n * Every action routes through the `comments` verbs — plain annotation writes\n * on the one optimistic pipeline — and every control is gated by\n * `permissionsFor`, the engine's own collab-resolver mirrors: what shows here\n * is what the engine will allow.\n */\n\nconst REVIEW_STATES = ['none', 'accepted', 'rejected', 'cancelled', 'completed'] as const;\n\nconst dateLabel = (iso: string | null): string => {\n if (!iso) return '';\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return '';\n return d.toLocaleDateString(undefined, { month: 'short', day: 'numeric' });\n};\n\nexport function CommentsPanel() {\n const t = useT();\n const hydration = useCommentsHydration();\n const comments = useComments();\n const threads = useCommentThreads();\n const anno = useCapability(AnnotationToken);\n const stage = useCapability(StageToken);\n const selection = useAnnotationSelection();\n const scrollRef = useRef<HTMLDivElement>(null);\n const cardRefs = useRef<Record<string, HTMLLIElement | null>>({});\n\n /** Which thread the document's selection points at — ANY member counts, so\n * selecting a reply's parent shape highlights the same card. */\n const selectedThreadKey = useMemo(() => {\n for (const id of selection) {\n const dto = anno.getSelected().find((a) => refKey(a.ref) === id || a.nm === id);\n const ref = dto?.ref ?? null;\n const thread = ref ? comments.thread(ref) : null;\n if (thread) return refKey(thread.root.ref);\n }\n return null;\n // `selection` identity changes on every selection write — the right key.\n }, [selection, anno, comments]);\n\n // Reverse sync: the selected card scrolls itself into view (v2 centered it).\n useEffect(() => {\n if (!selectedThreadKey || !scrollRef.current) return;\n const el = cardRefs.current[selectedThreadKey];\n if (!el) return;\n const container = scrollRef.current;\n const top =\n el.offsetTop - container.clientHeight / 2 + el.clientHeight / 2 - container.offsetTop;\n container.scrollTo({ top, behavior: 'smooth' });\n }, [selectedThreadKey]);\n\n /** Click a card: select the annotation AND fly the camera to it. */\n const goTo = (view: CommentThreadView) => {\n anno.select(view.root.ref);\n if (view.pageIndex < 0) return;\n // Anchor values are viewport FRACTIONS (0–1), not v2's percentages:\n // the annotation lands a third down the viewport, the find-bar feel.\n stage?.reveal(view.pageIndex, {\n ...(view.contentRect ? { rect: view.contentRect } : {}),\n anchor: { x: 'center', y: 0.35 },\n behavior: 'smooth',\n });\n };\n\n // Page-grouped, preserving the lens's display order within each page.\n const byPage = useMemo(() => {\n const groups = new Map<number, CommentThreadView[]>();\n for (const v of threads) {\n const arr = groups.get(v.pageIndex);\n if (arr) arr.push(v);\n else groups.set(v.pageIndex, [v]);\n }\n return [...groups.entries()].sort((a, b) => a[0] - b[0]);\n }, [threads]);\n\n if (hydration.status === 'loading') return <Empty icon=\"comment\" text={t('demo.commentsLoading')} />;\n if (hydration.status === 'forbidden')\n return <Empty icon=\"lock\" text={t('demo.commentsForbidden')} />;\n if (hydration.status === 'error') {\n return (\n <Empty icon=\"alertTriangle\" text={t('demo.commentsError')}>\n <button\n type=\"button\"\n onClick={() => void comments.rehydrate()}\n className=\"bg-accent text-on-accent rounded-md px-3 py-1.5 text-sm font-medium\"\n >\n {t('demo.commentsRetry')}\n </button>\n </Empty>\n );\n }\n if (threads.length === 0) return <Empty icon=\"comment\" text={t('demo.commentsEmpty')} />;\n\n return (\n <div ref={scrollRef} className=\"min-h-0 flex-1 overflow-y-auto\">\n <div className=\"flex flex-col gap-5 p-3\">\n {byPage.map(([pageIndex, group]) => (\n <div key={pageIndex} className=\"flex flex-col gap-2\">\n <div className=\"bg-surface sticky top-0 z-10\">\n <div className=\"border-border-subtle border-b pb-1.5\">\n <h3 className=\"text-fg text-sm font-semibold\">\n {t('demo.commentsPage', { params: { page: group[0]!.pageLabel } })}\n </h3>\n <p className=\"text-fg-muted text-xs\">\n {t(group.length === 1 ? 'demo.commentCount' : 'demo.commentCountPlural', {\n params: { count: String(group.length) },\n })}\n </p>\n </div>\n </div>\n <ul className=\"flex flex-col gap-2\">\n {group.map((view) => {\n const key = refKey(view.root.ref);\n return (\n <ThreadCard\n key={key}\n view={view}\n selected={selectedThreadKey === key}\n onSelect={() => goTo(view)}\n cardRef={(el) => {\n cardRefs.current[key] = el;\n }}\n />\n );\n })}\n </ul>\n </div>\n ))}\n </div>\n </div>\n );\n}\n\nfunction Empty({\n icon,\n text,\n children,\n}: {\n icon: string;\n text: string;\n children?: React.ReactNode;\n}) {\n return (\n <div className=\"flex flex-col items-center gap-3 px-4 py-10 text-center\">\n <Icon name={icon} size={32} className=\"text-fg-muted\" />\n <p className=\"text-fg-muted text-sm\">{text}</p>\n {children}\n </div>\n );\n}\n\nfunction ThreadCard({\n view,\n selected,\n onSelect,\n cardRef,\n}: {\n view: CommentThreadView;\n selected: boolean;\n onSelect: () => void;\n cardRef: (el: HTMLLIElement | null) => void;\n}) {\n const t = useT();\n const comments = useComments();\n const [reply, setReply] = useState('');\n const perms = comments.permissionsFor(view.root.ref);\n const config = commentTypeConfig(view.root);\n const status = view.review.mine?.state ?? 'none';\n const latest = view.review.lastChange;\n\n const sendReply = () => {\n const text = reply.trim();\n if (!text) return;\n setReply('');\n void comments.reply(view.root.ref, text);\n };\n\n return (\n <li\n ref={cardRef}\n onClick={onSelect}\n className={`bg-surface cursor-pointer rounded-lg border shadow-sm transition-all hover:shadow-md ${\n selected ? 'border-accent ring-accent/40 ring-2' : 'border-border-subtle'\n }`}\n >\n <div className=\"flex flex-col gap-2 p-3\">\n {/* identity row: the annotation's own glyph + color is the anchor */}\n <div className=\"flex items-start gap-2.5\">\n <div\n className=\"bg-hover mt-0.5 grid h-8 w-8 shrink-0 place-items-center rounded-full\"\n title={t(config.labelKey, { fallback: config.label })}\n >\n <Icon name={config.icon} size={18} accent={commentIconAccent(view.root)} />\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"text-fg truncate text-sm font-medium\">\n {view.root.author ?? t('demo.commentsAnonymous')}\n </span>\n <span className=\"text-fg-muted ml-auto shrink-0 text-xs\">\n {dateLabel(view.root.modified ?? view.root.created)}\n </span>\n </div>\n {latest && (\n <span className=\"bg-accent-light text-accent mt-1 inline-block rounded px-1.5 py-0.5 text-[11px] font-medium\">\n {statusLabel(t, latest.state)}\n {latest.by ? ` — ${latest.by}` : ''}\n </span>\n )}\n </div>\n {perms.canDeleteThread && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n void comments.removeThread(view.root.ref);\n }}\n className=\"text-fg-muted hover:text-fg grid h-6 w-6 shrink-0 place-items-center rounded\"\n title={t('demo.commentsDeleteThread')}\n >\n <Icon name=\"trash\" size={14} />\n </button>\n )}\n </div>\n\n <CommentBody annotationRef={view.root.ref} text={view.root.contents ?? ''} deletable={false} />\n\n {view.replies.length > 0 && (\n <div className=\"border-border-subtle flex flex-col gap-2 border-t pt-2\">\n {view.replies.map((r) => (\n <Reply key={refKey(r.ref)} dto={r} />\n ))}\n </div>\n )}\n\n <div className=\"border-border-subtle flex flex-col gap-1.5 border-t pt-2\">\n {perms.canSetStatus && (\n <label\n className=\"text-fg-muted flex items-center gap-2 text-xs\"\n onClick={(e) => e.stopPropagation()}\n >\n {t('demo.commentsStatus')}\n <select\n value={status}\n onChange={(e) => void comments.setStatus(view.root.ref, e.target.value)}\n className=\"border-border bg-surface text-fg flex-1 rounded-md border px-1.5 py-1 text-xs outline-none\"\n >\n {REVIEW_STATES.map((s) => (\n <option key={s} value={s}>\n {statusLabel(t, s)}\n </option>\n ))}\n </select>\n </label>\n )}\n {perms.canReply && (\n <div className=\"flex items-center gap-1.5\" onClick={(e) => e.stopPropagation()}>\n <input\n type=\"text\"\n value={reply}\n placeholder={\n view.root.contents || view.replies.length\n ? t('demo.commentsReplyPlaceholder')\n : t('demo.commentsAddPlaceholder')\n }\n onChange={(e) => setReply(e.target.value)}\n onKeyDown={(e) => e.key === 'Enter' && sendReply()}\n className=\"border-border bg-surface text-fg focus:border-accent w-full min-w-0 flex-1 rounded-md border px-2 py-1 text-sm outline-none\"\n />\n <button\n type=\"button\"\n onClick={sendReply}\n disabled={!reply.trim()}\n className=\"text-accent disabled:text-fg-muted grid h-7 w-7 shrink-0 place-items-center rounded-md\"\n title={t('demo.commentsReply')}\n >\n <Icon name=\"arrowForwardUp\" size={16} />\n </button>\n </div>\n )}\n </div>\n </div>\n </li>\n );\n}\n\nfunction Reply({ dto }: { dto: AnnotationDTO }) {\n const t = useT();\n return (\n <div className=\"border-border-subtle ml-1 border-l-2 pl-2\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"text-fg-secondary text-xs font-medium\">\n {dto.author ?? t('demo.commentsAnonymous')}\n </span>\n <span className=\"text-fg-muted text-[11px]\">\n {dateLabel(dto.modified ?? dto.created)}\n </span>\n </div>\n <CommentBody annotationRef={dto.ref} text={dto.contents ?? ''} deletable />\n </div>\n );\n}\n\n/** One comment's text with inline edit (own, unlocked) and delete (replies). */\nfunction CommentBody({\n annotationRef,\n text,\n deletable,\n}: {\n annotationRef: AnnotationRef;\n text: string;\n deletable: boolean;\n}) {\n const t = useT();\n const comments = useComments();\n const perms = comments.permissionsFor(annotationRef);\n const [draft, setDraft] = useState<string | null>(null);\n\n if (draft !== null) {\n const save = () => {\n const next = draft.trim();\n setDraft(null);\n if (next && next !== text) void comments.edit(annotationRef, next);\n };\n return (\n <textarea\n value={draft}\n autoFocus\n rows={2}\n onClick={(e) => e.stopPropagation()}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={save}\n onKeyDown={(e) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n save();\n }\n if (e.key === 'Escape') setDraft(null);\n }}\n className=\"border-accent bg-surface text-fg w-full resize-none rounded-md border px-2 py-1 text-sm outline-none\"\n />\n );\n }\n if (!text && !perms.canEditText && !deletable) return null;\n return (\n <div className=\"group/body flex items-start gap-1\">\n <p className=\"text-fg min-w-0 flex-1 whitespace-pre-wrap text-sm\">{text}</p>\n {perms.canEditText && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n setDraft(text);\n }}\n className=\"text-fg-muted hover:text-fg grid h-5 w-5 shrink-0 place-items-center rounded opacity-0 group-hover/body:opacity-100\"\n title={t('demo.commentsEdit')}\n >\n <Icon name=\"pencilMarker\" size={12} />\n </button>\n )}\n {deletable && perms.canDelete && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n void comments.remove(annotationRef);\n }}\n className=\"text-fg-muted hover:text-fg grid h-5 w-5 shrink-0 place-items-center rounded opacity-0 group-hover/body:opacity-100\"\n title={t('demo.commentsDelete')}\n >\n <Icon name=\"trash\" size={12} />\n </button>\n )}\n </div>\n );\n}\n\nfunction statusLabel(t: ReturnType<typeof useT>, state: string): string {\n switch (state) {\n case 'none':\n return t('demo.commentsStatusNone');\n case 'accepted':\n return t('demo.commentsStatusAccepted');\n case 'rejected':\n return t('demo.commentsStatusRejected');\n case 'cancelled':\n return t('demo.commentsStatusCancelled');\n case 'completed':\n return t('demo.commentsStatusCompleted');\n default:\n return state; // custom vocabularies render verbatim\n }\n}\n","import { useEffect } from 'react';\nimport { useCapability } from '@embedpdf/react/runtime';\nimport { AnnotationToken } from '@embedpdf/react/annotation';\nimport { usePendingRedactions, useRedaction } from '@embedpdf/react/redaction';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\nimport { Icon } from './icons';\n\n/**\n * The pending-redactions review panel (right sidebar). The list is a LIVE view\n * over the annotation plane — deleting a mark here is deleting the annotation.\n * \"Apply all\" routes through the confirm modal: the apply is irreversible.\n */\nexport function RedactionPanel() {\n const t = useT();\n const redaction = useRedaction();\n const pending = usePendingRedactions();\n const anno = useCapability(AnnotationToken);\n const confirm = useSurface('redact-confirm');\n\n // The annotation plane loads lazily per page; pull every page in so the\n // panel shows marks on pages never scrolled to.\n useEffect(() => {\n void redaction.preparePending();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <div className=\"flex min-h-0 flex-1 flex-col\">\n <div className=\"min-h-0 flex-1 overflow-y-auto p-2\">\n {pending.length === 0 ? (\n <div className=\"flex flex-col items-center gap-3 px-4 py-10 text-center\">\n <Icon name=\"redactionSidebar\" size={32} className=\"text-fg-muted\" />\n <p className=\"text-fg-muted text-sm\">{t('demo.redactionEmpty')}</p>\n </div>\n ) : (\n <ul className=\"flex flex-col gap-1\">\n {pending.map((item) => (\n <li key={item.id}>\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => anno.select(item.ref)}\n onKeyDown={(e) => e.key === 'Enter' && anno.select(item.ref)}\n className=\"hover:bg-hover group flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left\"\n >\n <Icon\n name={item.kind === 'area' ? 'redactArea' : 'redact'}\n size={16}\n className=\"text-fg-muted shrink-0\"\n />\n <span className=\"text-fg min-w-0 flex-1 truncate text-sm\">\n {item.overlayText ??\n t(item.kind === 'area' ? 'demo.redactionArea' : 'demo.redactionText')}\n </span>\n <span className=\"text-fg-muted shrink-0 text-xs\">\n {t('demo.pageBadge', {\n params: { page: item.pageIndex >= 0 ? String(item.pageIndex + 1) : '?' },\n })}\n </span>\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n void anno.delete(item.ref);\n }}\n className=\"text-fg-muted hover:text-fg grid h-6 w-6 shrink-0 place-items-center rounded opacity-0 group-hover:opacity-100\"\n title={t('demo.redactionRemove')}\n >\n <Icon name=\"trash\" size={14} />\n </button>\n </div>\n </li>\n ))}\n </ul>\n )}\n </div>\n <div className=\"border-border-subtle flex shrink-0 gap-2 border-t p-3\">\n <button\n type=\"button\"\n disabled={pending.length === 0}\n onClick={() => {\n for (const item of pending) void anno.delete(item.ref);\n }}\n className=\"border-border text-fg hover:bg-hover flex-1 rounded-md border px-3 py-1.5 text-sm disabled:opacity-40\"\n >\n {t('commands.redact.clearAll')}\n </button>\n <button\n type=\"button\"\n disabled={pending.length === 0 || !redaction.canApply() || redaction.applying}\n onClick={() => confirm.open()}\n className=\"flex-1 rounded-md bg-red-600 px-3 py-1.5 text-sm text-white hover:bg-red-700 disabled:opacity-40\"\n >\n {t('commands.redact.applyAll')}\n </button>\n </div>\n </div>\n );\n}\n","/**\n * The search panel — the v2 snippet's search sidebar on the v3 plugin-search\n * capability. ONE shape end to end: the flat `SearchQuery` {text, regex,\n * matchCase, wholeWord} is what the engine matches, what the plugin stores\n * (document-scoped, survives the sidebar closing), and what this box renders.\n * The panel keeps only a DRAFT of it for keystroke/debounce echo.\n *\n * Data flow:\n * type / toggle → validateSearchQuery → (debounced) search(draftQuery)\n * useSearchState() → query / status / hitCount / activeIndex (reactive)\n * useSelector(SearchToken, c => c.hits()) → the streamed hit list\n * click a hit / prev / next → goTo/prev/next (capability reveals it on-page)\n *\n * The look is ported 1:1 from viewers/snippet's search-sidebar (magnifier\n * input with clear button, option checkboxes, results-found counter with\n * prev/next, per-page grouped snippet list with the match bolded and the\n * active hit accented), retinted to this app's semantic tokens. The regex\n * toggle is new in v3 (v2 had no pattern search); matchDiacritics exists in\n * the engine but is deliberately not exposed here — v2 parity.\n */\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport {\n useSearch,\n useSearchState,\n validateSearchQuery,\n SearchToken,\n} from '@embedpdf/react/search';\nimport type { SearchHit, SearchQuery, SearchSnippet } from '@embedpdf/react/search';\nimport { useSelector } from '@embedpdf/react/runtime';\nimport { useT } from '@embedpdf/react/i18n';\nimport { Icon } from './icons';\nimport { buttonClass } from './toolbar';\n\nconst DEBOUNCE_MS = 300;\n\n/** Field-wise equality on the flat query — the mount/echo no-op guard. */\nconst sameQuery = (a: SearchQuery | null, b: SearchQuery) =>\n a != null &&\n a.text === b.text &&\n !!a.regex === !!b.regex &&\n !!a.matchCase === !!b.matchCase &&\n !!a.wholeWord === !!b.wholeWord;\n\n// ── option checkbox (v2's peer-checked custom box) ───────────────────────────\nfunction Checkbox({\n label,\n checked,\n onChange,\n}: {\n label: string;\n checked: boolean;\n onChange: (v: boolean) => void;\n}) {\n return (\n <label className=\"text-fg-secondary flex cursor-pointer select-none items-center gap-2 text-xs font-medium\">\n <span className=\"relative flex h-4 w-4 items-center justify-center\">\n <input\n type=\"checkbox\"\n checked={checked}\n onChange={(e) => onChange(e.target.checked)}\n className=\"border-border bg-surface checked:border-accent checked:bg-accent peer h-4 w-4 shrink-0 appearance-none rounded-[3px] border transition-colors\"\n />\n <svg\n viewBox=\"0 0 24 24\"\n className=\"text-on-accent pointer-events-none absolute h-3 w-3 opacity-0 peer-checked:opacity-100\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={3}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </span>\n {label}\n </label>\n );\n}\n\n// ── one result row: a snippet with the match bolded, active = accented ───────\nfunction renderSnippet(s: SearchSnippet | undefined) {\n if (!s) return null;\n const end = s.matchStart + s.matchLength;\n return (\n <>\n {s.text.slice(0, s.matchStart)}\n <span className=\"text-accent font-semibold\">{s.text.slice(s.matchStart, end)}</span>\n {s.text.slice(end)}\n </>\n );\n}\n\nfunction HitLine({\n hit,\n active,\n onClick,\n}: {\n hit: SearchHit;\n active: boolean;\n onClick: () => void;\n}) {\n const ref = useRef<HTMLButtonElement>(null);\n // Keep the active hit visible as prev/next walks the list.\n useEffect(() => {\n if (active) ref.current?.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n }, [active]);\n return (\n <button\n ref={ref}\n type=\"button\"\n onClick={onClick}\n className={`w-full rounded border p-2 text-left text-sm transition-colors ${\n active\n ? 'border-accent bg-accent-light text-fg'\n : 'border-border-subtle bg-surface text-fg-secondary hover:bg-hover'\n }`}\n >\n <span>{renderSnippet(hit.snippet)}</span>\n </button>\n );\n}\n\n// ── the panel ────────────────────────────────────────────────────────────────\nexport function SearchPanel() {\n const t = useT();\n const search = useSearch();\n const { query, status, hitCount, activeIndex } = useSearchState();\n const hits = useSelector(SearchToken, (c) => c.hits());\n\n // `query` is the document-scoped stored search (survives the sidebar\n // closing). The box is a controlled draft that STARTS from it; the panel is\n // keyed on the document (see panels.tsx), so this one-time seed is always\n // the right document's query — switching tabs remounts and reseeds.\n const [draft, setDraft] = useState(() => query?.text ?? '');\n const [matchCase, setMatchCase] = useState(() => query?.matchCase ?? false);\n const [wholeWord, setWholeWord] = useState(() => query?.wholeWord ?? false);\n const [regex, setRegex] = useState(() => query?.regex ?? false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // The draft IS a SearchQuery — same shape the engine matches on.\n const draftQuery: SearchQuery = { text: draft, regex, matchCase, wholeWord };\n // Early feedback on keystroke: the same validator the engine enforces\n // (regex dialect). Invalid patterns never fire a query.\n const validation = draft && regex ? validateSearchQuery(draftQuery) : { ok: true as const };\n\n // Debounced query. The sameQuery guard makes the mount pass (and our own\n // echo coming back through state) a no-op — nothing re-runs until the user\n // actually changes the text or a toggle. Clearing the box clears results.\n useEffect(() => {\n // No-ops: invalid pattern, draft already the stored query (mount pass /\n // our own echo), or an empty box with nothing stored to clear.\n if (!validation.ok || sameQuery(query, draftQuery)) return;\n if (draft === '' && query === null) return;\n const id = setTimeout(() => search.search(draftQuery), DEBOUNCE_MS);\n return () => clearTimeout(id);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [draft, matchCase, wholeWord, regex, query, validation.ok, search]);\n\n // Group hits by page, preserving page order, for the sectioned list.\n const grouped = useMemo(() => {\n const map = new Map<number, { hit: SearchHit; index: number }[]>();\n hits.forEach((hit, index) => {\n const arr = map.get(hit.pageIndex);\n if (arr) arr.push({ hit, index });\n else map.set(hit.pageIndex, [{ hit, index }]);\n });\n return [...map.entries()].sort((a, b) => a[0] - b[0]);\n }, [hits]);\n\n const searching = status === 'searching';\n\n return (\n <div className=\"flex min-h-0 flex-1 flex-col\">\n <div className=\"p-3\">\n {/* input: magnifier + clear */}\n <div className=\"relative\">\n <div className=\"text-fg-muted pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2.5\">\n <Icon name=\"search\" size={16} />\n </div>\n <input\n ref={inputRef}\n type=\"text\"\n value={draft}\n placeholder={t('demo.searchPlaceholder')}\n onChange={(e) => setDraft(e.target.value)}\n className={`bg-surface text-fg w-full rounded-md border py-1.5 pl-8 pr-9 text-sm outline-none focus:ring-1 ${\n validation.ok\n ? 'border-border focus:border-accent focus:ring-accent'\n : 'border-red-400 focus:border-red-400 focus:ring-red-400'\n }`}\n />\n {draft && (\n <button\n type=\"button\"\n onClick={() => {\n setDraft('');\n inputRef.current?.focus();\n }}\n className=\"text-fg-muted hover:text-fg-secondary absolute inset-y-0 right-0 flex items-center pr-2.5\"\n >\n <Icon name=\"x\" size={16} />\n </button>\n )}\n </div>\n\n {/* the invalid-pattern message, straight from the shared validator */}\n {!validation.ok && <p className=\"mt-1.5 text-xs text-red-500\">{validation.message}</p>}\n\n {/* options — the three VS Code toggles, all composable */}\n <div className=\"mt-3 flex flex-col gap-2\">\n <Checkbox\n label={t('demo.searchCaseSensitive')}\n checked={matchCase}\n onChange={setMatchCase}\n />\n <Checkbox label={t('demo.searchWholeWord')} checked={wholeWord} onChange={setWholeWord} />\n <Checkbox label={t('demo.searchRegex')} checked={regex} onChange={setRegex} />\n </div>\n\n <hr className=\"border-border-subtle mb-2 mt-4\" />\n\n {/* results counter + prev/next */}\n {status !== 'idle' && (\n <div className=\"flex h-8 items-center justify-between\">\n <div className=\"text-fg-muted text-xs\">\n {hitCount === 0\n ? t(searching ? 'demo.searchSearching' : 'demo.searchNoResults')\n : t('demo.searchResults', { params: { count: hitCount } })}\n </div>\n {hitCount > 1 && (\n <div className=\"flex items-center\">\n <button\n type=\"button\"\n title=\"Previous\"\n className={buttonClass(false)}\n onClick={() => search.prev()}\n >\n <Icon name=\"chevronLeft\" size={20} />\n </button>\n <button\n type=\"button\"\n title=\"Next\"\n className={buttonClass(false)}\n onClick={() => search.next()}\n >\n <Icon name=\"chevronRight\" size={20} />\n </button>\n </div>\n )}\n </div>\n )}\n </div>\n\n {/* per-page grouped results */}\n <div className=\"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-3 pb-3\">\n {grouped.map(([pageIndex, items]) => (\n <div key={pageIndex} className=\"mt-2 first:mt-0\">\n <div className=\"bg-surface/80 text-fg-muted py-2 text-xs backdrop-blur\">\n {t('demo.searchPage', { params: { page: pageIndex + 1 } })}\n </div>\n <div className=\"flex flex-col gap-2\">\n {items.map(({ hit, index }) => (\n <HitLine\n key={index}\n hit={hit}\n active={index === activeIndex}\n onClick={() => search.goTo(index)}\n />\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n}\n","/**\n * The static chrome around the toolbars: the left/right sidebars (shell\n * surfaces) and the bottom page-controls overlay. Deliberately minimal —\n * chrome-parity scope. Panels read their open state from plugin-shell; the\n * app owns their DOM.\n *\n * There is no built-in header: branding, a locale picker and a theme switch\n * are the EMBEDDER's chrome, not the viewer's. The frame keeps a `header`\n * socket for a slotted one (see Shell).\n */\nimport { useEffect } from 'react';\nimport { useSelector, useDocumentId } from '@embedpdf/react/runtime';\nimport { Stage, StageToken, usePages } from '@embedpdf/react/stage';\nimport { RenderLayer } from '@embedpdf/react/render';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\nimport { ThumbsStageToken } from '../config/stage';\nimport { Icon } from './icons';\nimport { AnnotationStylePanel } from './annotation-style';\nimport { CommentsPanel } from './comments-panel';\nimport { RedactionPanel } from './redaction-panel';\nimport { SearchPanel } from './search-panel';\n\n// ── left sidebar (thumbnails / outline tabs) ─────────────────────────────────\nexport function LeftSidebar() {\n const t = useT();\n const sidebar = useSurface('sidebar');\n if (!sidebar.isOpen) return null;\n return (\n <aside className=\"border-border-subtle bg-surface flex w-60 shrink-0 flex-col border-r\">\n <div className=\"border-border-subtle flex items-center gap-1 border-b p-2\">\n <span className=\"bg-accent-light text-accent rounded-md px-2 py-1 text-xs font-medium\">\n {t('demo.thumbnails')}\n </span>\n <span className=\"text-fg-muted rounded-md px-2 py-1 text-xs font-medium\">\n {t('demo.outline')}\n </span>\n <div className=\"flex-1\" />\n <button\n type=\"button\"\n onClick={sidebar.close}\n className=\"text-fg-muted hover:bg-hover grid h-7 w-7 place-items-center rounded-md\"\n >\n <Icon name=\"x\" size={16} />\n </button>\n </div>\n <ThumbnailList />\n </aside>\n );\n}\n\n// The thumbnail rail: the SAME document through the thumbnail Stage lens (a\n// single-column, fixed-zoom grid — see App's `stage-thumbs` plugin). Click a\n// thumb to navigate the MAIN lens; the rail follows the main view. Read-only —\n// no page edits (rotate/move/delete), just the page bitmap and its number.\nfunction ThumbnailList() {\n const { currentPage, goToPage } = usePages(); // the MAIN lens\n const { reveal } = usePages(ThumbsStageToken); // the SIDEBAR lens\n // Follow the main view: when its current page changes, make that thumb visible —\n // minimal movement, zero when it's already on screen.\n useEffect(() => reveal(currentPage), [currentPage, reveal]);\n return (\n <Stage\n token={ThumbsStageToken}\n zoomGestures={false} // fixed-magnification rail: cmd+wheel/pinch scrolls, never zooms\n className=\"flex-1\"\n style={{ position: 'relative' }}\n pageChrome={(page) => (\n <>\n {/* BOX-SPACE chrome: the click target + selection border hug the page\n box; the number sits in the reserved bottom band. Neither rotates. */}\n <button\n type=\"button\"\n onClick={() => goToPage(page.pageIndex)}\n title={`Page ${page.pageIndex + 1}`}\n style={{\n position: 'absolute',\n top: page.frame.top,\n left: page.frame.left,\n right: page.frame.right,\n bottom: page.frame.bottom,\n cursor: 'pointer',\n boxSizing: 'border-box',\n borderRadius: 4,\n border:\n page.pageIndex === currentPage\n ? '2px solid var(--ep-accent)'\n : '1px solid var(--ep-border-subtle)',\n boxShadow:\n page.pageIndex === currentPage ? '0 0 0 2px var(--ep-accent-light)' : 'none',\n }}\n />\n <div\n style={{\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n height: page.frame.bottom,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontSize: 11,\n color: 'var(--ep-fg-muted)',\n pointerEvents: 'none',\n }}\n >\n {page.pageIndex + 1}\n </div>\n </>\n )}\n >\n {/* page-space content: the bitmap, which rotates with the page */}\n {() => <RenderLayer />}\n </Stage>\n );\n}\n\n// ── right sidebar (search / comment / style) ─────────────────────────────────\nexport function RightSidebar() {\n const t = useT();\n // Keys the SearchPanel below: the panel seeds its query box from the active\n // document's search state on mount, so it must remount when the active\n // document changes (switching tabs with the sidebar open) to re-seed.\n const documentId = useDocumentId();\n const search = useSurface('search');\n const comment = useSurface('comment');\n const style = useSurface('annotation-style');\n const redaction = useSurface('redaction');\n const active = search.isOpen\n ? 'search'\n : comment.isOpen\n ? 'comment'\n : style.isOpen\n ? 'style'\n : redaction.isOpen\n ? 'redaction'\n : null;\n if (!active) return null;\n\n const titleKey =\n active === 'search'\n ? 'demo.searchTitle'\n : active === 'comment'\n ? 'demo.commentsTitle'\n : active === 'redaction'\n ? 'demo.redactionTitle'\n : 'demo.styleTitle';\n const close =\n active === 'search'\n ? search.close\n : active === 'comment'\n ? comment.close\n : active === 'redaction'\n ? redaction.close\n : style.close;\n\n return (\n <aside className=\"border-border-subtle bg-surface flex w-72 shrink-0 flex-col border-l\">\n <div className=\"border-border-subtle flex items-center justify-between border-b p-3\">\n <span className=\"text-fg text-sm font-semibold\">{t(titleKey)}</span>\n <button\n type=\"button\"\n onClick={close}\n className=\"text-fg-muted hover:bg-hover grid h-7 w-7 place-items-center rounded-md\"\n >\n <Icon name=\"x\" size={16} />\n </button>\n </div>\n {active === 'style' ? (\n <AnnotationStylePanel />\n ) : active === 'search' ? (\n <SearchPanel key={documentId ?? 'none'} />\n ) : active === 'redaction' ? (\n <RedactionPanel />\n ) : (\n <CommentsPanel key={documentId ?? 'none'} />\n )}\n </aside>\n );\n}\n\n// ── bottom page-controls overlay ─────────────────────────────────────────────\nexport function PageControls() {\n const t = useT();\n // the Stage cursor is a 0-based display index; people count from 1\n const current = useSelector(StageToken, (c) => c.currentPage() + 1);\n const total = useSelector(StageToken, (c) => c.pageCount());\n if (!total) return null;\n return (\n <div className=\"pointer-events-none absolute inset-x-0 bottom-5 flex justify-center\">\n <div className=\"border-border-subtle bg-elevated/95 text-fg-secondary pointer-events-auto rounded-full border px-4 py-1.5 text-sm shadow-lg backdrop-blur\">\n {t('demo.page', { params: { current, total } })}\n </div>\n </div>\n );\n}\n","import { useState } from 'react';\nimport { useRedaction } from '@embedpdf/react/redaction';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\n\n/**\n * The apply-all confirm modal (`redact-confirm` shell surface, `exclusive:\n * 'modal'` via the command router). Shows the pending count and the\n * CLIENT-SIDE collateral estimate — other annotations the apply will destroy —\n * before anything irreversible happens. The authoritative collateral count\n * comes back on the result.\n */\nexport function RedactConfirmModal() {\n const t = useT();\n const surface = useSurface('redact-confirm');\n const redaction = useRedaction();\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n if (!surface.isOpen) return null;\n\n const count = redaction.pendingCount();\n const collateral = redaction.estimateCollateral();\n\n const apply = async () => {\n setBusy(true);\n setError(null);\n try {\n await redaction.applyAll();\n surface.close();\n } catch (err) {\n setError(err instanceof Error ? err.message : String(err));\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <div className=\"fixed inset-0 z-50 grid place-items-center bg-black/40\">\n <div className=\"border-border bg-surface w-96 rounded-lg border p-4 shadow-xl\">\n <h2 className=\"text-fg text-base font-semibold\">{t('demo.redactConfirmTitle')}</h2>\n <p className=\"text-fg-muted mt-2 text-sm\">\n {t('demo.redactConfirmBody', { params: { count } })}\n </p>\n {collateral > 0 ? (\n <p className=\"mt-2 text-sm font-medium text-red-600\">\n {t('demo.redactConfirmCollateral', { params: { count: collateral } })}\n </p>\n ) : null}\n {error ? <p className=\"mt-2 text-sm text-red-600\">{error}</p> : null}\n <div className=\"mt-4 flex justify-end gap-2\">\n <button\n type=\"button\"\n disabled={busy}\n onClick={surface.close}\n className=\"border-border text-fg hover:bg-hover rounded-md border px-3 py-1.5 text-sm\"\n >\n {t('demo.cancel')}\n </button>\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => void apply()}\n className=\"rounded-md bg-red-600 px-3 py-1.5 text-sm text-white hover:bg-red-700 disabled:opacity-60\"\n >\n {busy ? t('demo.redactApplying') : t('demo.redactApply')}\n </button>\n </div>\n </div>\n </div>\n );\n}\n","/**\n * Boot-state panes for the document area — what renders INSTEAD of the Stage\n * while the selected tab's document isn't ready:\n *\n * `locked` → <PasswordPrompt/> (per-tab, v2's document-password-prompt port)\n * `error` → <DocumentError/>\n *\n * Both are per-TAB, not modal: several tabs can be locked/broken at once and\n * switching tabs stays free. The prompt drives ONE call —\n * `documents.unlock(id, { password })` — identical on the local (worker loads\n * the parked bytes) and cloud (/access grant) engines. The \"incorrect\" copy\n * keys on a real rejection: either this session's failed attempt, or\n * `passwordProvided` (a config-supplied password the engine already rejected).\n */\nimport { useState } from 'react';\nimport { useDocumentId, useDocuments } from '@embedpdf/react/runtime';\nimport { useT } from '@embedpdf/react/i18n';\nimport { Icon } from './icons';\n\nexport function PasswordPrompt() {\n const docId = useDocumentId();\n const { docs, unlock, close } = useDocuments();\n const t = useT();\n const [password, setPassword] = useState('');\n const [rejected, setRejected] = useState(false);\n const [busy, setBusy] = useState(false);\n\n const doc = docs.find((d) => d.id === docId);\n if (!docId || !doc) return null;\n const incorrect = rejected || doc.passwordProvided === true;\n\n const submit = async () => {\n if (busy || !password.trim()) return;\n setBusy(true);\n try {\n await unlock(docId, { password });\n // success → the tab promotes to ready and this pane unmounts\n } catch {\n setRejected(true);\n setPassword('');\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <div className=\"bg-app flex h-full w-full items-center justify-center p-8\">\n <div className=\"bg-surface border-border w-full max-w-sm rounded-xl border p-6 shadow-lg\">\n <div className=\"flex flex-col items-center text-center\">\n <div className=\"bg-accent-light mb-4 rounded-full p-4\">\n <Icon name=\"lock\" size={28} className=\"text-accent\" />\n </div>\n <h3 className=\"text-fg text-lg font-semibold\">{t('passwordPrompt.title')}</h3>\n {doc.name && <p className=\"text-fg-muted mt-1 text-sm\">{doc.name}</p>}\n </div>\n\n <p className=\"text-fg-secondary mt-4 text-center text-sm\">\n {incorrect ? t('passwordPrompt.incorrect') : t('passwordPrompt.required')}\n </p>\n\n <div className=\"mt-5\">\n <label className=\"text-fg mb-1.5 block text-sm font-medium\" htmlFor=\"doc-password\">\n {t('passwordPrompt.label')}\n </label>\n <input\n id=\"doc-password\"\n type=\"password\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n onKeyDown={(e) => e.key === 'Enter' && void submit()}\n disabled={busy}\n placeholder={t('passwordPrompt.placeholder')}\n className=\"bg-surface border-border focus:border-accent focus:ring-accent text-fg placeholder:text-fg-muted block w-full rounded-md border px-3 py-2.5 text-sm focus:outline-none focus:ring-1 disabled:opacity-50\"\n autoFocus\n />\n </div>\n\n {incorrect && (\n <div className=\"mt-3 flex items-center gap-2 rounded-md border border-red-500/40 bg-red-500/10 p-3\">\n <Icon name=\"alertTriangle\" size={16} className=\"flex-shrink-0 text-red-500\" />\n <p className=\"text-sm text-red-500\">{t('passwordPrompt.incorrectWarning')}</p>\n </div>\n )}\n\n <div className=\"mt-6 flex gap-3\">\n <button\n type=\"button\"\n onClick={() => void close(docId)}\n disabled={busy}\n className=\"border-border text-fg-secondary hover:bg-hover flex-1 cursor-pointer rounded-md border px-4 py-2.5 text-sm font-medium transition-colors disabled:opacity-50\"\n >\n {t('passwordPrompt.cancel')}\n </button>\n <button\n type=\"button\"\n onClick={() => void submit()}\n disabled={busy || !password.trim()}\n className=\"bg-accent text-on-accent flex-1 cursor-pointer rounded-md px-4 py-2.5 text-sm font-medium transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {busy ? t('passwordPrompt.opening') : t('passwordPrompt.open')}\n </button>\n </div>\n </div>\n </div>\n );\n}\n\nexport function DocumentError() {\n const docId = useDocumentId();\n const { docs, close } = useDocuments();\n const t = useT();\n const doc = docs.find((d) => d.id === docId);\n if (!docId || !doc) return null;\n\n return (\n <div className=\"bg-app flex h-full w-full items-center justify-center p-8\">\n <div className=\"bg-surface border-border flex max-w-sm flex-col items-center rounded-xl border p-6 text-center shadow-lg\">\n <div className=\"mb-4 rounded-full bg-red-500/10 p-4\">\n <Icon name=\"alertTriangle\" size={28} className=\"text-red-500\" />\n </div>\n <h3 className=\"text-fg text-lg font-semibold\">{t('documentError.title')}</h3>\n {doc.name && <p className=\"text-fg-muted mt-1 text-sm\">{doc.name}</p>}\n <p className=\"text-fg-secondary mt-2 text-sm\">{t('documentError.unknown')}</p>\n <button\n type=\"button\"\n onClick={() => void close(docId)}\n className=\"bg-accent text-on-accent mt-5 w-full cursor-pointer rounded-md px-4 py-2.5 text-sm font-medium transition-colors hover:opacity-90\"\n >\n {t('documentError.close')}\n </button>\n </div>\n </div>\n );\n}\n","/**\n * The viewer shell — the snippet's layout, driven entirely by the v3 commands\n * + measured-toolbar system.\n *\n * ── header socket (empty unless a child fills it) ─────────\n * ── main toolbar (measured; auto-overflows) ───────────────\n * ── mode band (DERIVED from the shell's open mode surface) ─\n * left sidebar │ Stage (pages) │ right sidebar\n * ──────────── page-controls overlay ──────────────────────\n *\n * The workspace/document split is structural: header + toolbars are\n * workspace-scoped and render at t≈0 (translated, measured) while the wasm\n * engine still boots; everything document-scoped sits inside <DocumentGate>,\n * whose fallback is the empty-workspace state (v2's loader, but UNDER a live\n * toolbar instead of replacing the whole app).\n *\n * Which mode band shows is not stored anywhere: it's a projection of\n * plugin-shell's exclusive 'mode' surface, read null-safely so the band simply\n * doesn't exist without a document.\n */\nimport { useMemo, type ReactNode } from 'react';\nimport {\n DocumentGate,\n useDocumentId,\n useDocumentStatus,\n useOptionalSelector,\n} from '@embedpdf/react/runtime';\nimport { Stage } from '@embedpdf/react/stage';\nimport { Scrollbar } from '@embedpdf/react/scrollbar';\nimport { RenderLayer } from '@embedpdf/react/render';\nimport { SelectionClipboard, SelectionHandles, SelectionLayer } from '@embedpdf/react/selection';\nimport { AnnotationLayer, useFilePickerProvider } from '@embedpdf/react/annotation';\nimport { LinkLayer } from '@embedpdf/react/link';\nimport type { AnnotationRenderer } from '@embedpdf/react/annotation';\nimport { useActionsUiAdapter } from '@embedpdf/react/actions';\nimport { formWidgetRenderer } from '@embedpdf/react/form';\nimport { SearchLayer } from '@embedpdf/react/search';\nimport { useCommandShortcuts } from '@embedpdf/react/commands';\nimport { ShellToken } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\nimport { getModeBar } from './config/chrome';\nimport { useChromeSchema } from './config-context';\nimport { AppToolbar } from './ui/toolbar';\nimport { AnnotationStrip } from './ui/annotation-strip';\nimport { SelectionStrip } from './ui/selection-strip';\nimport { TabBar } from './ui/tab-bar';\nimport { ArmedToolCursor } from './ui/tool-cursor';\nimport { LeftSidebar, RightSidebar, PageControls } from './ui/panels';\nimport { RedactConfirmModal } from './ui/redact-confirm';\nimport { DocumentError, PasswordPrompt } from './ui/document-boot';\n\n// Annotation renderers — module scope, per the AnnotationRenderer identity\n// rule. One entry today: form widgets render as fill controls while the form\n// plugin's Behavior is engaged.\nconst ANNOTATION_RENDERERS: AnnotationRenderer[] = [formWidgetRenderer];\n\nfunction ModeBand({ edge }: { edge: 'top' | 'bottom' }) {\n const schema = useChromeSchema();\n // The mode list is DERIVED from the chrome's modeBars keys — adding a custom\n // mode is one command + one bar schema in config, not a shell change.\n const modeSurfaces = useMemo(() => Object.keys(schema.modeBars ?? {}), [schema]);\n const activeMode = useOptionalSelector(\n ShellToken,\n (s) => modeSurfaces.find((m) => s.isOpen(m)) ?? null,\n null,\n );\n if (!activeMode) return null;\n const bar = getModeBar(schema, activeMode);\n if (!bar) return null;\n return (\n <div\n className={`border-border bg-surface-alt flex shrink-0 items-center px-4 py-2 ${\n edge === 'top' ? 'border-b' : 'border-t'\n }`}\n >\n <AppToolbar bar={bar} className=\"w-full\" />\n </div>\n );\n}\n\n/** The empty-workspace state: shown while the initial documents (and the\n * engine behind them) are still loading — or if the user closes every tab. */\nfunction OpeningDocuments() {\n const t = useT();\n return (\n <div className=\"grid h-full w-full place-items-center\">\n <div className=\"text-fg-muted flex flex-col items-center gap-3\">\n <div className=\"border-border-subtle border-t-accent h-8 w-8 animate-spin rounded-full border-2\" />\n <div className=\"text-sm\">{t('demo.opening')}</div>\n </div>\n </div>\n );\n}\n\n/**\n * The document area's lifecycle switch. A `locked` tab shows its password\n * prompt, an `error` tab its error pane — per TAB (keyed by document), so\n * several can coexist and tab switching stays free. Everything else is the\n * ready-gated Stage; the gate's fallback covers `loading`.\n */\nfunction DocumentArea({ children }: { children: ReactNode }) {\n const docId = useDocumentId();\n const status = useDocumentStatus();\n if (status === 'locked') return <PasswordPrompt key={docId} />;\n if (status === 'error') return <DocumentError key={docId} />;\n return <DocumentGate fallback={<OpeningDocuments />}>{children}</DocumentGate>;\n}\n\nexport function Shell() {\n useCommandShortcuts();\n // Click-then-pick tools (stamp, file attachment) → click a page → file dialog\n // opens → the file lands where you clicked. One line: the default provider is\n // the built-in file picker honouring each tool's `accept` filter (swap it for\n // a custom picker, or pass null to disable). The plugin stays DOM-free.\n useFilePickerProvider();\n // The ONE UI port for the action engine AND every script-produced effect:\n // sanitized URI opens, Named `Print`, script alerts (boot/lifecycle nags\n // suppressed by default), and script page navigation.\n useActionsUiAdapter();\n const schema = useChromeSchema();\n\n // The FRAME: region arrangement & visibility from the chrome value (see\n // FrameSchema). Regions render as named <slot> sockets with the built-ins\n // as fallback — light-DOM children of <embedpdf-viewer> replace them; in\n // plain light DOM a slot just displays its fallback (UA display:contents),\n // so this package's direct React consumers see no difference. A region\n // hidden by the frame hides its socket too: visibility outranks content.\n const frame = schema.frame ?? {};\n const toolbarEdge = frame.toolbar ?? 'top';\n\n // main toolbar — measured; degrades + overflows with zero config.\n // Deliberately OUTSIDE the gate: chrome renders before any document.\n // Bar id 'main' is the shell's one structural expectation — an owned\n // chrome without it simply has no main toolbar. Its mode band rides the\n // CONTENT side, whichever edge the frame picked.\n const toolbarBand = schema.bars.main && (\n <div\n part=\"toolbar\"\n className={`border-border bg-surface flex shrink-0 items-center px-4 py-2 ${\n toolbarEdge === 'top' ? 'border-b' : 'border-t'\n }`}\n >\n <AppToolbar bar={schema.bars.main} className=\"w-full\" />\n </div>\n );\n\n return (\n <div className=\"bg-app text-fg flex h-full flex-col\">\n {/* The header socket. The chrome ships NO header of its own — branding,\n locale pickers and theme switches are the embedder's chrome, not the\n viewer's — so this renders nothing until a child fills the slot. */}\n {(frame.header ?? true) && <slot name=\"header\" />}\n\n {/* the v2 document tab bar — the kernel's document registry IS the tab model */}\n {(frame.tabs ?? 'always') !== 'never' && (\n <slot name=\"tabs\">\n <TabBar visibility={frame.tabs ?? 'always'} />\n </slot>\n )}\n\n {toolbarEdge === 'top' && (\n <>\n {toolbarBand}\n <ModeBand edge=\"top\" />\n </>\n )}\n\n <div className=\"relative flex min-h-0 flex-1\">\n <DocumentArea>\n <LeftSidebar />\n <div className=\"relative min-w-0 flex-1\">\n {/* the armed tool's cursor: its toolbar icon as a real CSS cursor\n (zero-lag; the hub hides it over annotations/fields/gaps) */}\n <ArmedToolCursor />\n {/* ctrl/cmd+C and native Edit→Copy for the text selection —\n prefetches on commit so the copy event answers synchronously.\n Renders nothing; mount ONCE per document view. */}\n <SelectionClipboard />\n <Stage\n overlay={\n <>\n <AnnotationStrip />\n <SelectionStrip />\n {/* touch: draggable start/end selection handles (long-press\n selects a word; the lollipops grow it from there) */}\n <SelectionHandles />\n {/* headless scrollbars: geometry/behavior from the stage's\n scroller contract; the look is index.css (data-attrs) */}\n <Scrollbar axis=\"y\" />\n <Scrollbar axis=\"x\" />\n </>\n }\n className=\"h-full w-full\"\n style={{ background: 'var(--ep-canvas)' }}\n >\n {() => (\n <>\n {/* Base + deep-zoom tiles in one layer. Tiles engage by\n demand arithmetic when the view wants more pixels than\n the base budget supplies — the thumbnail rail's demand\n never does, so it mounts the same layer for free. */}\n <RenderLayer annotations={false} />\n <SelectionLayer />\n <SearchLayer />\n {/* Clickable links (nav plane): anchors under the default\n pointer/pan tools; stands down whenever an authoring\n tool is active (the annotation plane owns links then).\n Below the AnnotationLayer so an editing free-text box\n wins pointer hits; the annotation layer's own surface\n is pointer-events: none, so clicks fall through to the\n anchors everywhere else. */}\n <LinkLayer />\n {/* Form widgets plug into the annotation stack: engaged\n (fill mode) they render as fill controls over the baked\n appearance; under the Form tab they're plain editable\n annotations. */}\n <AnnotationLayer renderers={ANNOTATION_RENDERERS} />\n </>\n )}\n </Stage>\n <PageControls />\n </div>\n <RightSidebar />\n <RedactConfirmModal />\n </DocumentArea>\n </div>\n\n {toolbarEdge === 'bottom' && (\n <>\n <ModeBand edge=\"bottom\" />\n {toolbarBand}\n </>\n )}\n </div>\n );\n}\n","/**\n * The full viewer, as a component — and the customization CONTRACT. The\n * `ViewerCustomization` surface here is the exact shape that later powers\n * `EmbedPDF.init({...})` and every framework wrapper, because all of it is\n * plain data (see README.md).\n *\n * Two semantics, on purpose:\n * - REGISTRIES (commands / icons / strings) merge ADDITIVELY over the\n * defaults by id; a colliding id overrides.\n * - STRUCTURE (chrome) is an owned VALUE: the default, a transform of it,\n * or the host's own schema — never merged.\n *\n * The engine stays a prop — choosing local-wasm vs cloud is the host's\n * decision, and each delivery wires its own. The chrome —\n * toolbars, translations, theme — renders at t≈0; only the pages wait on\n * the engine. Customization is mount-time (exactly like v2's init config);\n * changing these props on a mounted viewer does not rebuild the workspace.\n */\n// One import line per feature: each subpath carries the\n// plugin AND its UI; delete a line and the feature leaves the bundle.\nimport { useEffect, useState, type ReactNode } from 'react';\nimport { Viewer, useKernel } from '@embedpdf/react/runtime';\nimport type { Engine, EngineFactory, InitialDocument } from '@embedpdf/react/runtime';\nimport { stagePlugin } from '@embedpdf/react/stage';\nimport { renderPlugin } from '@embedpdf/react/render';\nimport { pageEditPlugin } from '@embedpdf/react/page-edit';\nimport { feedbackPlugin, interactionPlugin, vibrationFeedback } from '@embedpdf/react/interaction';\nimport { selectionPlugin } from '@embedpdf/react/selection';\nimport { annotationPlugin } from '@embedpdf/react/annotation';\nimport { redactionPlugin } from '@embedpdf/react/redaction';\nimport { actionsPlugin } from '@embedpdf/react/actions';\nimport { formPlugin } from '@embedpdf/react/form';\nimport { linkPlugin } from '@embedpdf/react/link';\nimport { searchPlugin } from '@embedpdf/react/search';\nimport { i18nPlugin, negotiateLocale, useT } from '@embedpdf/react/i18n';\nimport type { Locale, TranslationDictionary } from '@embedpdf/react/i18n';\nimport { commandsPlugin } from '@embedpdf/react/commands';\nimport type { CommandDef } from '@embedpdf/react/commands';\nimport { shellPlugin } from '@embedpdf/react/shell';\nimport { chromeHelpers, validateChrome } from '@embedpdf/react/toolbar';\nimport type { ChromeHelpers, ChromeSchema } from '@embedpdf/react/toolbar';\nimport { ThumbsStageToken } from './config/stage';\nimport { defaultChrome } from './config/chrome';\nimport { defaultCommands } from './config/commands';\nimport { demoToolsPlugin } from './config/demo-tools.plugin';\nimport { en } from './locales/en';\nimport { ViewerConfigProvider, type ResolvedViewerConfig } from './config-context';\nimport { createViewerHandle, type ViewerHandle } from './handle';\nimport { ICON_PATHS, type IconDef } from './ui/icons';\nimport { ThemeProvider, type ThemePreference } from './ui/theme';\nimport { Shell } from './Shell';\n\n/** Lazy built-in packs — a strings override for one of these wraps its loader. */\nconst BUILTIN_LOADERS: Record<string, () => Promise<Locale>> = {\n es: () => import('./locales/es').then((m) => m.es),\n};\n\nconst isDict = (v: unknown): v is TranslationDictionary => typeof v === 'object' && v !== null;\n\n/**\n * Deep-merge `over` into `base` (immutably), expanding dotted keys —\n * `{ 'acme.send': 'X' }` and `{ acme: { send: 'X' } }` are the same override.\n */\nfunction mergeTranslations(\n base: TranslationDictionary,\n over: TranslationDictionary,\n): TranslationDictionary {\n const out: Record<string, string | TranslationDictionary> = { ...base };\n for (const [key, value] of Object.entries(over)) {\n const path = key.split('.');\n let node = out;\n for (let i = 0; i < path.length - 1; i++) {\n const prev = node[path[i]];\n node = (node[path[i]] = isDict(prev) ? { ...prev } : {}) as Record<\n string,\n string | TranslationDictionary\n >;\n }\n const leaf = path[path.length - 1];\n const prev = node[leaf];\n node[leaf] =\n typeof value === 'string' ? value : mergeTranslations(isDict(prev) ? prev : {}, value);\n }\n return out;\n}\n\nconst mergeLocale = (pack: Locale, over?: TranslationDictionary): Locale =>\n over ? { ...pack, translations: mergeTranslations(pack.translations, over) } : pack;\n\n/**\n * The customization surface — identical in the vanilla snippet and every\n * framework wrapper. See README.md for the ladder this implements.\n */\nexport interface ViewerCustomization {\n /** ADDITIVE over the default vocabulary; a colliding id overrides. */\n commands?: readonly CommandDef[];\n /** ADDITIVE 24×24 stroke icons by name; a colliding name overrides. */\n icons?: Readonly<Record<string, IconDef>>;\n /** Per-locale translation overrides/additions; dotted keys expand. A code\n * with no built-in pack becomes a new locale (falls back to English). */\n strings?: Readonly<Record<string, TranslationDictionary>>;\n /** 'auto' (default) negotiates from the browser languages. */\n locale?: 'auto' | (string & {});\n /** Feature gating: a disabled category vanishes from every surface. */\n disabledCategories?: readonly string[];\n /** The structure — a value you OWN: the default (pass nothing), a transform\n * of it, or your own schema. Never merged. */\n chrome?: ChromeSchema | ((base: ChromeSchema, helpers: ChromeHelpers) => ChromeSchema);\n /** Light/dark preference (string shorthand), or the full theme config with\n * `--ep-*` token overrides. Tokens are applied by the DELIVERY (the custom\n * element adopts them into its shadow root); direct consumers of this\n * package set the `--ep-*` variables in their own CSS instead. */\n theme?: ThemePreference | ThemeConfig;\n}\n\n/** Token overrides — names WITHOUT the `--ep-` prefix ('accent', 'surface'…). */\nexport type ThemeTokens = Readonly<Record<string, string>>;\n\nexport interface ThemeConfig {\n /** 'system' (default) follows the OS. */\n preference?: ThemePreference;\n /** Applied in BOTH modes (a later sheet: wins over the defaults). */\n tokens?: ThemeTokens;\n /** Dark-mode-only overrides, applied over `tokens`. */\n dark?: ThemeTokens;\n}\n\n/** Normalize the shorthand — deliveries use this to read one shape. */\nexport const themeConfigOf = (theme: ThemePreference | ThemeConfig | undefined): ThemeConfig =>\n typeof theme === 'string' ? { preference: theme } : (theme ?? {});\n\nexport interface FullViewerProps extends ViewerCustomization {\n /** Instance (borrowed) or thunk (viewer-owned) — the Viewer's own contract. */\n engine: Engine | EngineFactory;\n /** Documents to open at mount; more arrive via the tab bar's open button. */\n initialDocuments?: InitialDocument[];\n /** Shown while the workspace boots. Default: a translated pulse line. */\n fallback?: ReactNode;\n /** Where the theme's `.dark` class goes — a DELIVERY concern, not user\n * config: the custom element passes its shadow wrapper so theming never\n * touches the host page. Default: document.documentElement. */\n themeTarget?: HTMLElement | null;\n /** Called once the workspace kernel is live, with the viewer handle — the\n * DRIVE surface (`el.viewer` on the custom element, `onReady` on the\n * wrappers). Capabilities resolve from the moment this fires; document-\n * scoped calls simply await their document. */\n onViewer?: (viewer: ViewerHandle) => void;\n}\n\n/** Inside <Viewer>: mints the handle from the live kernel, reports it up. */\nfunction HandleBridge({ onViewer }: { onViewer: (viewer: ViewerHandle) => void }) {\n const kernel = useKernel();\n useEffect(() => {\n onViewer(createViewerHandle(kernel));\n // Init-only like everything else: re-fires only if the KERNEL changes\n // (a remount), never because the callback prop identity churned.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [kernel]);\n return null;\n}\n\nfunction Booting() {\n const t = useT();\n return (\n <div className=\"bg-app text-fg-muted grid h-full place-items-center\">\n <div className=\"animate-pulse text-sm\">{t('demo.starting')}</div>\n </div>\n );\n}\n\nexport function FullViewer({\n engine,\n initialDocuments,\n fallback,\n commands,\n icons,\n strings,\n locale = 'auto',\n disabledCategories,\n chrome,\n theme,\n themeTarget,\n onViewer,\n}: FullViewerProps) {\n // Customization is INIT-ONLY, exactly like v2's `EmbedPDF.init` (and like\n // the Viewer's own engine/plugins contract): the whole config resolves ONCE\n // from the mount-time props, so inline literals — the idiomatic way to pass\n // it — never churn plugin identities. Later prop changes are ignored.\n const [resolved] = useState(() => {\n // ── registries: additive, user wins by id ───────────────────────────────\n const byId = new Map(defaultCommands.map((c) => [c.id, c]));\n for (const c of commands ?? []) byId.set(c.id, c);\n const resolvedCommands = [...byId.values()];\n\n // ── structure: an owned value (default | transform | replacement) ───────\n const resolvedChrome =\n typeof chrome === 'function'\n ? chrome(defaultChrome, chromeHelpers)\n : (chrome ?? defaultChrome);\n\n // ── locale packs: overrides merge into built-ins; unknown codes become\n // new locales that fall back to English ──────────────────────────────\n const overrides = strings ?? {};\n const locales: Locale[] = [mergeLocale(en, overrides.en)];\n const loaders: Record<string, () => Promise<Locale>> = {};\n for (const [code, load] of Object.entries(BUILTIN_LOADERS)) {\n const over = overrides[code];\n loaders[code] = over ? () => load().then((pack) => mergeLocale(pack, over)) : load;\n }\n for (const [code, over] of Object.entries(overrides)) {\n if (code === 'en' || code in BUILTIN_LOADERS) continue;\n locales.push({ code, name: code, translations: mergeTranslations({}, over) });\n }\n const codes = [...new Set(['en', ...Object.keys(BUILTIN_LOADERS), ...Object.keys(overrides)])];\n const initial =\n locale === 'auto'\n ? (negotiateLocale(codes, typeof navigator !== 'undefined' ? navigator.languages : []) ??\n 'en')\n : locale;\n\n return {\n commands: resolvedCommands,\n chrome: resolvedChrome,\n icons: icons ?? {},\n i18n: { locales, loaders, initial },\n };\n });\n\n // Dev guardrail: every id the chrome references must exist; every icon a\n // command names must resolve. Warnings name the exact id (README promise).\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') return;\n const ids = new Set(resolved.commands.map((c) => c.id));\n for (const problem of validateChrome(resolved.chrome, ids)) {\n console.warn(`[embedpdf] chrome: ${problem}`);\n }\n for (const c of resolved.commands) {\n if (c.icon && !(c.icon in ICON_PATHS) && !(c.icon in resolved.icons)) {\n console.warn(`[embedpdf] command \"${c.id}\": unknown icon \"${c.icon}\"`);\n }\n }\n }, [resolved]);\n\n const [plugins] = useState(() => [\n stagePlugin({ layout: 'vertical' }), // main lens (tools engage via interactionPlugin below)\n // Thumbnail lens over the SAME document: a single-column grid at a fixed small\n // zoom, its own camera. Click a thumb to navigate the main lens; the sidebar\n // follows the main view (see ui/panels ThumbnailList).\n stagePlugin({\n id: 'stage-thumbs',\n token: ThumbsStageToken,\n layout: 'grid',\n columns: 1, // single column, like the v2 snippet's thumbnail rail\n sizing: 'uniform', // equalize pages so the pixel target hits every thumb\n zoom: { pageWidth: 150 }, // thumbs are 150 SCREEN px wide — for ANY document\n padding: 12,\n gap: { px: 16 }, // UI-stable spacing between thumbs\n pageFrame: { top: 0, right: 0, bottom: 20, left: 0 }, // reserved label band (screen px)\n fitAlign: { x: 'center', y: 'start' }, // few pages? thumbs hug the TOP\n scrollBehavior: 'instant',\n }),\n renderPlugin(),\n pageEditPlugin(),\n interactionPlugin(),\n // Platform haptics, default-on: the Vibration API where it exists\n // (Android), a safe silent no-op elsewhere — iOS Safari included, until\n // Apple ships a haptics API. Native shells swap in their own provider\n // (`wkFeedback`) instead.\n feedbackPlugin({ provider: vibrationFeedback }),\n selectionPlugin(),\n // The arrow tool is a `line` preset — same subtype, an arrowhead default. This is\n // the whole integration for a new tool: one `tools` entry + a command/toolbar\n // slot (see config/commands.ts + config/chrome.ts).\n annotationPlugin({\n tools: [\n {\n id: 'arrow',\n extends: 'line',\n defaults: { lineEndings: { start: 'none', end: 'open-arrow' } },\n },\n ],\n }),\n // The action engine: /A and /AA trees dispatch through one policy-gated\n // executor spine, and THE JavaScript switch lives here (the per-document\n // ScriptHost realm; form's K/V/C/F pipeline rides its transaction port).\n actionsPlugin({ javascript: { enabled: true } }),\n // Forms: fillable under the default pointer/pan (widgets render as fill\n // controls), editable under the Form tab's 'form-edit' + palette tools.\n formPlugin(),\n // Links: navigable under the default pointer/pan ('link-nav'), editable\n // under the link tool — the annotation plane then owns them (select, move,\n // retarget via the style panel's Link control).\n linkPlugin(),\n // Redaction: marking is the annotation plane's composed `redact` tool; this\n // plugin adds the pending-queue view + the destructive apply.\n redactionPlugin(),\n searchPlugin(),\n demoToolsPlugin(),\n i18nPlugin({\n locale: resolved.i18n.initial,\n fallbackLocale: 'en',\n locales: resolved.i18n.locales,\n loaders: resolved.i18n.loaders,\n }),\n commandsPlugin({\n commands: resolved.commands,\n disabledCategories: disabledCategories ? [...disabledCategories] : undefined,\n }),\n shellPlugin(),\n ]);\n\n // Structural subset of `resolved`, identity-stable across renders.\n const config: ResolvedViewerConfig = resolved;\n\n return (\n <ThemeProvider preference={themeConfigOf(theme).preference} target={themeTarget}>\n <Viewer\n engine={engine}\n plugins={plugins}\n initialDocuments={initialDocuments}\n fallback={fallback ?? <Booting />}\n >\n <ViewerConfigProvider value={config}>\n {onViewer && <HandleBridge onViewer={onViewer} />}\n <Shell />\n </ViewerConfigProvider>\n </Viewer>\n </ThemeProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAA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;EACJ;EACA;EACA;CACF;CACA,YAAY,CACV,yFACF;CACA,UAAU;EAAC;EAA8C;EAAkB;CAAY;CACvF,cAAc;EACZ;EACA;EACA;CACF;CACA,KAAK,CAAC,8CAA8C;CACpD,MAAM,CAAC,4DAA4D;CACnE,YAAY,CACV,2BACA,+EACF;CACA,WAAW;EACT;EACA;EACA;EACA;EACA;CACF;CACA,YAAY;EACV;EACA;EACA;EACA;EACA;CACF;CACA,cAAc,CACZ,kFACA,gBACF;CACA,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,WAAW,CACT;EAAE,GAAG;EAAsC,MAAM;CAAK,GACtD,sCACF;CACA,YAAY,CACV,kFACA,gBACF;CACA,eAAe;EACb;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR;GAAE,GAAG;GAAgB,QAAQ;EAAU;EACvC;GAAE,GAAG;GAAY,QAAQ;EAAU;EACnC;GAAE,GAAG;GAAa,QAAQ;EAAU;EACpC;GAAE,GAAG;GAAiB,QAAQ;EAAU;EACxC;GAAE,GAAG;GAAY,QAAQ;EAAU;EACnC;GAAE,GAAG;GAAY,QAAQ;EAAU;CACrC;CACA,YAAY;EACV;EACA;EACA;EACA;CACF;CACA,gBAAgB;EACd;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM;EACJ;EACA;EACA;EACA;CACF;CACA,WAAW;EAET;GACE,GAAG;GACH,MAAM;EACR;EACA;EACA;CACF;CACA,YAAY;EAAC;EAAiB;EAAkB;CAAY;CAC5D,gBAAgB;EACd;EACA;EACA;EACA;GAAE,GAAG;GAAwB,QAAQ;GAAW,MAAM;EAAU;CAClE;CACA,YAAY;EACV;GAAE,GAAG;GAAgB,QAAQ;EAAU;EACvC;GAAE,GAAG;GAAW,QAAQ;EAAU;EAClC;GAAE,GAAG;GAAW,QAAQ;EAAU;EAClC;GAAE,GAAG;GAAiB,QAAQ;EAAU;EACxC;GAAE,GAAG;GAAe,QAAQ;EAAU;CACxC;CACA,QAAQ;EAAC;EAAa;EAAa;CAAa;CAChD,MAAM,CAAC;EAAE,GAAG;EAAgB,QAAQ;CAAU,CAAC;CAI/C,WAAW,CACT;EAAE,GAAG;EAAgB,QAAQ;CAAU,GACvC;EAAE,GAAG;EAAa,QAAQ;CAAU,CACtC;CACA,MAAM;EACJ;EACA;EACA;CACF;CACA,SAAS;EACP;EACA;EACA;EACA;CACF;CACA,UAAU;EAAC;EAAW;EAAY;EAAY;EAAY;EAAa;CAAY;CACnF,MAAM,CACJ,gFACA,0BACF;CACA,eAAe;EACb;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM,CAAC,aAAa,YAAY;CAChC,SAAS;EACP;EACA;EACA;CACF;CACA,SAAS;EACP;EACA;EACA;EACA;CACF;CACA,WAAW,CACT,+FACF;CACA,cAAc,CACZ,gIACA;EACE,GAAG;EACH,QAAQ;CACV,CACF;CACA,OAAO;EACL;EACA;EACA;EACA;CACF;CAEA,MAAM,CAAC,cAAc,YAAY;CACjC,SAAS,CACP,oNACF;CACA,SAAS,CACP;EACE,GAAG;EACH,QAAQ;EACR,MAAM;CACR,CACF;CACA,OAAO;EACL;EACA;EACA;CACF;CACA,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CAIA,YAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,gBAAgB;EACd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,kBAAkB;EAChB;EACA;EACA;EACA;EACA;CACF;CACA,aAAa;EACX;GAAE,GAAG;GAAgB,QAAQ;EAAU;EACvC;GAAE,GAAG;GAAW,QAAQ;EAAU;EAClC;GAAE,GAAG;GAAW,QAAQ;EAAU;EAClC;GAAE,GAAG;GAAiB,QAAQ;EAAU;EACxC;GAAE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sBAAA,YAAA,CAAA;CACd,CAAC;CAGD,MAAM,SAA+B;CAErC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD;EAAe,YAAY,cAAc,KAAK,CAAC,CAAC;EAAY,QAAQ;EAClE,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,wBAAAA,QAAD;GACU;GACC;GACS;GAClB,UAAU,YAAY,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD,CAAU,CAAA;GAEhC,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAAC,sBAAD;IAAsB,OAAO;IAA7B,UAAA,CACG,YAAY,iBAAA,GAAA,kBAAA,IAAA,CAAC,cAAD,EAAwB,SAAW,CAAA,GAChD,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD,CAAQ,CAAA,CACY;;EAChB,CAAA;CACK,CAAA;AAEnB"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["InteractionToken","defaultChrome","getMenu","getStrip","CommandsToken","resolvedCommandsEqual","LOCALES","InteractionToken","StampToken","StageToken","Toolbar","Fragment","AnnotationMenu","SelectionMenu","TOOL_ICONS","RedactionToken","AnnotationToken","StageToken","AnnotationToken","SearchToken","Stage","RenderLayer","StageToken","FormToken","Anchored","INITIALS_MARK_NAME","SIGNATURES_LIBRARY_KIND","SIGNATURE_MARK_NAME","formWidgetRenderer","ShellToken","getModeBar","DocumentGate","SelectionClipboard","Stage","SelectionHandles","Scrollbar","RenderLayer","SelectionLayer","SearchLayer","LinkLayer","AnnotationLayer","defaultCommands","defaultChrome","chromeHelpers","vibrationFeedback","Viewer"],"sources":["../src/config/stage.ts","../src/config/demo-tools.plugin.ts","../src/locales/en.ts","../src/config-context.tsx","../src/handle.ts","../src/ui/icons.tsx","../src/ui/theme.tsx","../src/config/default-stamps.ts","../src/ui/stamp-store.tsx","../src/ui/quick-stamps.tsx","../src/ui/menu.tsx","../src/ui/toolbar.tsx","../src/ui/annotation-fonts.tsx","../src/ui/link-editor.tsx","../src/ui/strip-bar.tsx","../src/ui/annotation-strip.tsx","../src/ui/selection-strip.tsx","../src/ui/tab-bar.tsx","../src/ui/tool-cursor.tsx","../src/ui/annotation-flags.tsx","../src/ui/annotation-style.tsx","../src/ui/comment-config.ts","../src/ui/comments-panel.tsx","../src/ui/redaction-panel.tsx","../src/ui/search-panel.tsx","../src/ui/stamps-panel.tsx","../src/ui/signatures-panel.tsx","../src/ui/panels.tsx","../src/ui/redact-confirm.tsx","../src/ui/sign-dialog.tsx","../src/ui/signature-bridge.tsx","../src/ui/signature-inspector.tsx","../src/ui/signature-maker.tsx","../src/ui/document-boot.tsx","../src/Shell.tsx","../src/viewer.tsx"],"sourcesContent":["/**\n * The Stage is a LENS: one document can be viewed through several at once. The\n * thumbnail sidebar is a second lens over the SAME document — a single-column,\n * fixed-zoom grid with its own camera, fully independent of the main view.\n *\n * The token lives here (not in App.tsx) because two places need it: App wires the\n * `stagePlugin` lens with it, and the sidebar renders `<Stage token={...}>` off it.\n */\nimport { createCapabilityToken } from '@embedpdf/react/runtime';\nimport type { StageCapability } from '@embedpdf/react/stage';\n\nexport const ThumbsStageToken = createCapabilityToken<StageCapability>('stage-thumbs');\n","import { definePlugin } from '@embedpdf/react/runtime';\nimport { InteractionToken } from '@embedpdf/react/interaction';\n\n/**\n * Example-only: register the still-unimplemented authoring tools as INERT\n * interaction tools. v3 doesn't yet ship a signature plugin, but this is a\n * CHROME demo — its job is selection state and layout, not the tool's effect.\n * Registering them as real (behaviourless) tools lets every tool button in\n * every mode band go through the SAME path (`InteractionToken.activateTool`),\n * so `active` is uniform and honest: the button really is the active tool; it\n * just has no handler behind it.\n *\n * Everything else in the Insert band is REAL now: stamps come from the stamp\n * plugin's libraries (armed by the stamps sidebar), and image/attachment are\n * the annotation plugin's click-then-pick tools. The annotate + shapes tools\n * were never here either — nor the form palette (the form plugin's\n * draw-to-place).\n */\nconst INERT_TOOLS: ReadonlyArray<{ id: string; cursor: string }> = [\n // insert mode (redact is REAL now — plugin-annotation ships the composed\n // tool and plugin-redaction the destructive apply; `image` is a real\n // click-then-pick stamp preset, see viewer.tsx)\n { id: 'signature', cursor: 'copy' },\n];\n\nexport const demoToolsPlugin = () =>\n definePlugin({\n id: 'demo-tools',\n scope: 'document',\n requires: [InteractionToken],\n init: (ctx) => {\n const interaction = ctx.get(InteractionToken);\n for (const tool of INERT_TOOLS) {\n // No `enables` → no gesture/handler wakes up: the tool is selectable\n // (cursor + active state) but behaviourless. Exactly what a chrome demo\n // needs from the signature tool v3 doesn't ship yet.\n interaction.registerTool({ id: tool.id, cursor: tool.cursor, enables: new Set<string>() });\n }\n },\n });\n","import type { Locale } from '@embedpdf/react/i18n';\n\n/**\n * English pack. Strings belong to the PRODUCT, not the plugins — the\n * `commands.*` namespace mirrors the v2 snippet packs so translations carry\n * over; `demo.*` is this example's own chrome.\n */\nexport const en: Locale = {\n code: 'en',\n name: 'English',\n translations: {\n commands: {\n zoom: {\n in: 'Zoom In',\n out: 'Zoom Out',\n fitPage: 'Fit to Page',\n fitWidth: 'Fit to Width',\n automatic: 'Automatic',\n menu: 'Zoom',\n level: 'Zoom Level',\n p50: '50%',\n p100: '100%',\n p150: '150%',\n p200: '200%',\n p400: '400%',\n },\n pan: 'Pan',\n pointer: 'Pointer',\n sidebar: 'Sidebar',\n search: 'Search',\n comment: 'Comment',\n style: 'Style',\n menu: 'Menu',\n viewControls: 'View Controls',\n download: 'Download',\n print: 'Print',\n fullscreen: 'Full Screen',\n spread: { group: 'Page Layout', none: 'Single Page', odd: 'Two Page', even: 'Cover Page' },\n scroll: { group: 'Scrolling', vertical: 'Vertical', horizontal: 'Horizontal' },\n rotate: {\n group: 'Rotate',\n clockwise: 'Rotate Clockwise',\n counterclockwise: 'Rotate Counter-Clockwise',\n },\n mode: {\n group: 'Mode',\n view: 'View',\n annotate: 'Annotate',\n shapes: 'Shapes',\n insert: 'Insert',\n form: 'Form',\n redact: 'Redact',\n },\n annotate: {\n highlight: 'Highlight',\n strikeout: 'Strikeout',\n underline: 'Underline',\n squiggly: 'Squiggly',\n ink: 'Draw',\n inkHighlight: 'Ink Highlighter',\n text: 'Text',\n insertText: 'Insert Text',\n replaceText: 'Replace Text',\n callout: 'Callout',\n note: 'Comment',\n link: 'Link',\n gotoLink: 'Go to link',\n removeLink: 'Remove link',\n delete: 'Delete',\n group: 'Group',\n ungroup: 'Ungroup',\n stampFromSelection: 'Make stamp',\n strip: 'Annotation actions',\n },\n selection: {\n copy: 'Copy',\n strip: 'Text selection actions',\n },\n shapes: {\n rectangle: 'Rectangle',\n circle: 'Circle',\n line: 'Line',\n arrow: 'Arrow',\n polygon: 'Polygon',\n polyline: 'Polyline',\n },\n insert: {\n stamp: 'Rubber Stamp',\n attachment: 'Attach File',\n signature: 'Signature',\n image: 'Image',\n },\n form: {\n textfield: 'Text Field',\n checkbox: 'Checkbox',\n radio: 'Radio Button',\n select: 'Dropdown',\n listbox: 'List Box',\n signature: 'Signature Field',\n },\n redact: {\n mark: 'Mark for Redaction',\n applyAll: 'Apply Redactions',\n clearAll: 'Clear Marks',\n panel: 'Redactions',\n },\n undo: 'Undo',\n redo: 'Redo',\n },\n passwordPrompt: {\n title: 'Password required',\n required: 'This document is password protected. Enter the password to open it.',\n incorrect: 'The password was incorrect. Please try again.',\n incorrectWarning: 'Incorrect password',\n label: 'Password',\n placeholder: 'Enter password',\n cancel: 'Cancel',\n open: 'Open',\n opening: 'Opening…',\n },\n documentError: {\n title: 'Couldn’t open document',\n unknown: 'The document could not be opened.',\n close: 'Close document',\n },\n // Annotation type names — the comment sidebar's icon tooltips. Keys carry\n // over from the v2 packs so existing translations still resolve.\n annotation: {\n comment: 'Comment',\n highlight: 'Highlight',\n underline: 'Underline',\n squiggly: 'Squiggly',\n strikeout: 'Strikethrough',\n square: 'Square',\n circle: 'Circle',\n line: 'Line',\n polygon: 'Polygon',\n polyline: 'Polyline',\n ink: 'Ink',\n freeText: 'Text',\n stamp: 'Stamp',\n caret: 'Caret',\n redact: 'Redact',\n fileAttachment: 'Attachment',\n },\n demo: {\n starting: 'Starting viewer…',\n opening: 'Opening document…',\n more: 'More',\n thumbnails: 'Thumbnails',\n outline: 'Outline',\n searchPlaceholder: 'Search document…',\n searchTitle: 'Search',\n searchCaseSensitive: 'Case sensitive',\n searchWholeWord: 'Whole word',\n searchRegex: 'Regular expression',\n searchSearching: 'Searching…',\n searchResults: '{count} results found',\n searchNoResults: 'No results',\n searchPage: 'Page {page}',\n commentsTitle: 'Comments',\n commentsForbidden: 'You don\\u2019t have access to comments on this document.',\n commentsLoading: 'Loading comments…',\n commentsError: 'Comments failed to load.',\n commentsRetry: 'Retry',\n commentsEmpty: 'No comments yet. Use the note tool to start a thread.',\n commentsAnonymous: 'Unknown',\n commentsPage: 'Page {page}',\n commentCount: '{count} comment',\n commentCountPlural: '{count} comments',\n commentsReply: 'Reply',\n commentsReplyPlaceholder: 'Reply…',\n commentsAddPlaceholder: 'Add a comment…',\n commentsDelete: 'Delete comment',\n commentsDeleteThread: 'Delete thread',\n commentsEdit: 'Edit comment',\n commentsStatus: 'Status',\n commentsStatusNone: 'No status',\n commentsStatusAccepted: 'Accepted',\n commentsStatusRejected: 'Rejected',\n commentsStatusCancelled: 'Cancelled',\n commentsStatusCompleted: 'Completed',\n styleTitle: 'Style',\n empty: 'Nothing here yet in this demo panel.',\n page: 'Page {current} of {total}',\n cancel: 'Cancel',\n pageBadge: 'p. {page}',\n redactionTitle: 'Redactions',\n redactionEmpty: 'No pending redactions. Use the Redact tool to mark text or areas.',\n redactionArea: 'Area mark',\n redactionText: 'Text mark',\n redactionRemove: 'Remove mark',\n redactConfirmTitle: 'Apply redactions?',\n redactConfirmBody:\n 'Permanently remove the content under {count} redaction marks. This cannot be undone.',\n redactConfirmCollateral: '{count} other annotations will also be removed.',\n redactApply: 'Apply',\n redactApplying: 'Applying…',\n formatLabel: 'Format',\n redactLabelTitle: 'Redaction label',\n redactLabelPlaceholder: 'e.g. REDACTED',\n redactLabelRepeat: 'Repeat label across region',\n stampsTitle: 'Stamps',\n stampsAll: 'All stamps',\n stampsLoading: 'Loading stamps…',\n stampsEmpty: 'No stamps yet. Import a PDF to turn each of its pages into a stamp.',\n stampsRemoveStamp: 'Remove stamp',\n stampsArmedHint: 'Click a page to place the stamp.',\n stampsImport: 'Import PDF…',\n stampsImporting: 'Importing…',\n stampsImportHint: 'Import a PDF as a stamp library — each page becomes one stamp.',\n stampsRemoveLibrary: 'Remove library',\n stampsExportLibrary: 'Export library as PDF',\n stampsCustomLibrary: 'My stamps',\n stampsCustomLabel: 'Custom stamp',\n stampsError: 'The built-in stamps could not be loaded.',\n stampsArmError: 'That stamp could not be armed.',\n stampsImportError: 'That PDF could not be imported as a stamp library.',\n quickStampsLabel: 'Quick stamps',\n signaturesTitle: 'Signatures',\n signaturesEmpty: 'No signatures yet. Create one to sign with.',\n signaturesNew: 'New signature…',\n signaturesArmedHint:\n 'Click a signature field to sign it, or anywhere on a page to place the mark.',\n signaturesTargetHint: 'Pick a mark for the selected field.',\n signaturesInDocument: 'In this document',\n signaturesNone: 'This document has no signature fields.',\n signaturesValidate: 'Validate',\n signaturesValidating: 'Validating…',\n signaturesSigned: 'Signed',\n signaturesUnsigned: 'Unsigned',\n signaturesRename: 'Rename',\n signaturesRemove: 'Remove',\n signaturesExport: 'Export as PDF',\n signaturesAddInitials: 'Add initials',\n signatureLabel: 'Signature',\n initialsLabel: 'Initials',\n makerTitle: 'New signature',\n makerName: 'Name',\n makerNamePlaceholder: 'Your name',\n makerDraw: 'Draw',\n makerType: 'Type',\n makerUpload: 'Upload',\n makerTypePlaceholder: 'Type your name',\n makerFont: 'Font',\n makerUploadHint: 'Choose a PNG, JPEG, or one-page PDF',\n makerClear: 'Clear',\n makerOptional: '(optional)',\n makerSave: 'Save',\n makerSaving: 'Saving…',\n makerError: 'The signature could not be saved.',\n signTitle: 'Sign this field',\n signReason: 'Reason',\n signLocation: 'Location',\n signKind: 'What may change afterwards',\n signKindApproval: 'Approval signature — form filling and more signatures stay valid',\n signKindCertifyAnnotate: 'Certify — allow comments, form filling and signatures',\n signKindCertifyFill: 'Certify — allow form filling and signatures only',\n signKindCertifyLocked: 'Certify — allow no changes',\n signButton: 'Sign',\n signSigning: 'Signing…',\n signFill: 'Place without signing',\n signError: 'The field could not be signed.',\n inspectTitle: 'Signature',\n inspectSigner: 'Signed by',\n inspectReason: 'Reason',\n inspectLocation: 'Location',\n inspectTime: 'Time',\n inspectIntegrity: 'Document',\n inspectCryptography: 'Signature',\n inspectTrust: 'Signer',\n inspectChanges: 'Changes since',\n inspectDownload: 'Download signed version',\n verdictValid: 'Valid',\n verdictValidUntrusted: 'Valid, signer not trusted',\n verdictInvalid: 'Invalid — modified after signing',\n verdictWillInvalidate: 'Valid, invalid once saved',\n signaturesInvalidating:\n 'This change will invalidate {field} when the document is saved. Undo it to keep the signature.',\n verdictIndeterminate: 'Could not be verified',\n verdictUnchanged: 'None',\n verdictRestored: 'Changed, then restored',\n inspectLaterRevisions: 'Revisions after signing',\n verdictPermitted: 'Permitted',\n verdictForbidden: 'Not permitted',\n },\n },\n};\n","/**\n * The resolved customization, as React context. The chrome schema and the\n * user's extra icons are RESOLVED ONCE in <FullViewer> and read here by the\n * shell, menus, and strips — no component imports the default schema value\n * directly, so \"the host replaced the chrome\" is invisible below this line.\n *\n * The default context value is the default config: components render correctly\n * in tests and stories without a provider.\n */\nimport { createContext, useContext } from 'react';\nimport type { BarSchema, ChromeSchema, MenuSchema } from '@embedpdf/react/toolbar';\nimport { defaultChrome, getMenu, getModeBar, getStrip } from './config/chrome';\nimport type { IconDef } from './ui/icons';\nimport type { SignatureMode, SignerPort, TrustPort } from '@embedpdf/react/signature';\n\nexport interface StampsCustomization {\n /** `false`: no built-in library. A string: URL template with `{locale}`. */\n readonly defaultLibrary?: false | string;\n /** Library kinds the stamps sidebar lists. Default `['stamps']`. */\n readonly sidebar?: ReadonlyArray<string>;\n /** Quick marks in the Insert toolbar: asset ids (`library:name`) from any\n * library, or one library's whole set. Default none. */\n readonly toolbar?: ReadonlyArray<string> | { readonly library: string };\n}\n\nexport interface SignaturesCustomization {\n /** Which marks a person keeps. Default both. */\n readonly kinds?: ReadonlyArray<'signature' | 'initials'>;\n /** `'one'`: a single person per browser (no \"new signature\" once one exists). Default `'many'`. */\n readonly libraries?: 'one' | 'many';\n /** What placing a mark on a field does; default `sign` with a signer, else `visual`. */\n readonly mode?: SignatureMode;\n /** The key holder — `webCryptoSigner`, `remoteSigner`, `personalSigner`, or a thunk resolving one per signing. */\n readonly signer?: SignerPort | (() => Promise<SignerPort>);\n /** Trust anchors for validation; none → verdicts top out at \"valid, signer unknown\". */\n readonly trust?: TrustPort;\n /** Offer a certification (first signature, DocMDP) in the sign dialog. Default false. */\n readonly allowCertify?: boolean;\n /** Script faces for typed marks: registered on the viewer's engine on first use. */\n readonly fonts?: ReadonlyArray<{\n readonly key: string;\n readonly url: string;\n readonly label: string;\n }>;\n}\n\n/** A font for free-text annotations beyond the standard 14. */\nexport interface AnnotationFontSpec {\n /** The stable id a free-text `fontFamily` carries — the engine key AND the\n * CSS family the live editor renders with. Not one of the 14 standard names. */\n readonly key: string;\n /** Where the TTF/OTF bytes come from (same-origin or CORS-enabled). */\n readonly url: string;\n /** The picker's label. */\n readonly label: string;\n /** Family / style refinements for fallback matching; inferred from the file\n * when omitted. */\n readonly familyName?: string;\n readonly weight?: number;\n readonly italic?: boolean;\n}\n\nexport interface AnnotationsCustomization {\n /**\n * Fonts the free-text style panel offers beyond the standard 14. Each is\n * fetched once when the viewer mounts, registered on the viewer's engine\n * under its `key`, and mounted as a `@font-face` of the same name — so the\n * DOM editor shows the face the appearance stream will bake. A font whose\n * URL fails is skipped with a console warning. On the cloud engine (no\n * `engine.fonts`) they are not offered: fonts there are a server policy.\n */\n readonly fonts?: ReadonlyArray<AnnotationFontSpec>;\n}\n\nexport interface ResolvedViewerConfig {\n readonly chrome: ChromeSchema;\n /** User-registered icons — additive over the built-in set. */\n readonly icons: Readonly<Record<string, IconDef>>;\n readonly stamps: StampsCustomization;\n readonly signatures: SignaturesCustomization;\n readonly annotations: AnnotationsCustomization;\n}\n\nconst DEFAULT_CONFIG: ResolvedViewerConfig = {\n chrome: defaultChrome,\n icons: {},\n stamps: {},\n signatures: {},\n annotations: {},\n};\n\nconst ViewerConfigContext = createContext<ResolvedViewerConfig>(DEFAULT_CONFIG);\n\nexport const ViewerConfigProvider = ViewerConfigContext.Provider;\n\nexport function useChromeSchema(): ChromeSchema {\n return useContext(ViewerConfigContext).chrome;\n}\n\nexport function useMenuSchema(id: string): MenuSchema | undefined {\n return getMenu(useContext(ViewerConfigContext).chrome, id);\n}\n\nexport function useModeBarSchema(id: string): BarSchema | undefined {\n return getModeBar(useContext(ViewerConfigContext).chrome, id);\n}\n\nexport function useStripSchema(id: string): BarSchema | undefined {\n return getStrip(useContext(ViewerConfigContext).chrome, id);\n}\n\nexport function useCustomIcons(): Readonly<Record<string, IconDef>> {\n return useContext(ViewerConfigContext).icons;\n}\n\nexport function useStampsConfig(): StampsCustomization {\n return useContext(ViewerConfigContext).stamps;\n}\n\nexport function useSignaturesConfig(): SignaturesCustomization {\n return useContext(ViewerConfigContext).signatures;\n}\n\nexport function useAnnotationsConfig(): AnnotationsCustomization {\n return useContext(ViewerConfigContext).annotations;\n}\n","/**\n * The viewer handle — `el.viewer`, the DRIVE door of the customization model.\n *\n * Deliberately a THIN SKIN over the kernel: `get()` returns each plugin's\n * PUBLIC capability lens exactly as the plugin defined it (the internal/public\n * two-lens split in the plugins IS the curation — this file adds no facade,\n * no second vocabulary, no second write path). `watch()` is the kernel's one\n * change stream, selector-shaped — `useSelector` without React. The command\n * trio is the UI altitude of the same system, for anything button-shaped.\n *\n * Rule of thumb (docs): buttons speak commands; code speaks capabilities.\n *\n * The chrome itself runs on these exact primitives (customer #1), so parity\n * between \"what our UI can do\" and \"what el.viewer can do\" is structural.\n */\nimport type {\n CapabilityToken,\n DocumentsCapability,\n Kernel,\n Unsubscribe,\n} from '@embedpdf/react/runtime';\nimport { CommandsToken, resolvedCommandsEqual } from '@embedpdf/react/commands';\nimport type { ResolvedCommand } from '@embedpdf/react/commands';\n\n/** `get`/`tryGet` bound to one document (see {@link ViewerHandle.forDocument}). */\nexport interface ScopedViewerHandle {\n get<T>(token: CapabilityToken<T>): T;\n tryGet<T>(token: CapabilityToken<T>): T | null;\n}\n\nexport interface ViewerHandle extends ScopedViewerHandle {\n /** The document registry — the tab model: list/open/close/setActive/…. */\n readonly documents: DocumentsCapability;\n\n /** `get`/`tryGet` with document-scoped tokens bound to `documentId`\n * instead of the active document. */\n forDocument(documentId: string): ScopedViewerHandle;\n\n /**\n * Re-run `select` on every kernel change; call `cb` when the selected value\n * really changed (`isEqual`, default `Object.is` — capability getters return\n * stable references between model changes, so identity works). Returns the\n * unsubscribe. This is the ONLY reactivity primitive; DOM events on the\n * element are sugar over it.\n */\n watch<T>(\n select: () => T,\n cb: (value: T, previous: T) => void,\n isEqual?: (a: T, b: T) => boolean,\n ): Unsubscribe;\n\n // ── commands: the UI vocabulary layered on the same capabilities ──────────\n execute(id: string, documentId?: string): void;\n resolve(id: string, documentId?: string): ResolvedCommand | null;\n /** `watch` sugar for one command's resolved state (label/icon/enabled/active). */\n watchCommand(id: string, cb: (cmd: ResolvedCommand | null) => void): Unsubscribe;\n}\n\nexport function createViewerHandle(kernel: Kernel): ViewerHandle {\n const watch = <T>(\n select: () => T,\n cb: (value: T, previous: T) => void,\n isEqual: (a: T, b: T) => boolean = Object.is,\n ): Unsubscribe => {\n let previous = select();\n return kernel.subscribe(() => {\n const next = select();\n if (isEqual(previous, next)) return;\n const before = previous;\n previous = next;\n cb(next, before);\n });\n };\n\n const commands = () => kernel.capability(CommandsToken);\n\n return {\n documents: kernel.documents,\n get: (token) => kernel.capability(token),\n tryGet: (token) => kernel.tryCapability(token),\n forDocument: (documentId) => ({\n get: (token) => kernel.capability(token, documentId),\n tryGet: (token) => kernel.tryCapability(token, documentId),\n }),\n watch,\n execute: (id, documentId) => commands().execute(id, documentId),\n resolve: (id, documentId) => commands().resolve(id, documentId) ?? null,\n watchCommand: (id, cb) =>\n watch(() => commands().resolve(id) ?? null, cb, resolvedCommandsEqual),\n };\n}\n","/**\n * Icon set — the snippet's Tabler-style stroke icons, extracted to path data\n * (from viewers/snippet/src/components/icons) and rendered by one <Icon>\n * component. Names match the snippet's icon registry so command `icon` ids\n * carry over verbatim. Stroke-based (currentColor); a few glyphs carry filled\n * sub-paths, marked `fill: true`.\n *\n * ACCENT SLOTS: a tool glyph tags the sub-paths that preview the tool's\n * drawing defaults — `stroke`/`fill: 'primary' | 'secondary'` paint from the\n * command's resolved `iconAccent` (slot placement ported 1:1 from the v2\n * hand-authored components). With no accent, a slotted stroke inherits\n * currentColor and a slotted fill renders nothing — pixel-identical to the\n * untagged glyph, so non-tool surfaces never change.\n *\n * GENERATED by scratchpad/extract-icons.mjs — 93 icons (slot tags by hand).\n */\nimport * as React from 'react';\nimport { useCustomIcons } from '../config-context';\n\nexport type PathSpec =\n | string\n | {\n d: string;\n /** Fill paint: `true` = currentColor (a filled glyph part); a slot\n * name = that accent color (nothing when the accent is absent). */\n fill?: boolean | 'primary' | 'secondary';\n /** Stroke paint: a slot name = that accent color (currentColor when\n * the accent is absent). */\n stroke?: 'primary' | 'secondary';\n };\n\n/** A registrable icon: 24×24 stroke path data (Tabler/Lucide-style), exactly\n * the shape of the built-in set — user icons are not a lesser kind. */\nexport type IconDef = readonly PathSpec[];\n\n/** The two tintable slots — structurally identical to plugin-commands'\n * IconAccent, kept local so the icon set stays dependency-free. */\nexport interface IconAccent {\n primary?: string;\n secondary?: string;\n}\n\nexport const ICON_PATHS: Record<string, readonly PathSpec[]> = {\n alertTriangle: [\n 'M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z',\n ],\n alignBottom: [\n 'M3 19v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z',\n 'M11 17h2',\n 'M9 14h6',\n 'M10 11h4',\n ],\n alignCenter: ['M4 6l16 0', 'M8 12l8 0', 'M6 18l12 0'],\n alignLeft: ['M4 6l16 0', 'M4 12l10 0', 'M4 18l14 0'],\n alignMiddle: [\n 'M3 19v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z',\n 'M11 15h2',\n 'M9 12h6',\n 'M10 9h4',\n ],\n alignRight: ['M4 6l16 0', 'M10 12l10 0', 'M6 18l14 0'],\n alignTop: [\n 'M3 19v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z',\n 'M11 13h2',\n 'M9 10h6',\n 'M10 7h4',\n ],\n arrowBackUp: ['M9 14l-4 -4l4 -4', 'M5 10h11a4 4 0 1 1 0 8h-1'],\n arrowForwardUp: ['M15 14l4 -4l-4 -4', 'M19 10h-11a4 4 0 1 0 0 8h1'],\n bold: ['M7 5h6a3.5 3.5 0 0 1 0 7h-6z', 'M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7'],\n book: [\n 'M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0',\n 'M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0',\n 'M3 6l0 13',\n 'M12 6l0 13',\n 'M21 6l0 13',\n ],\n book2: [\n 'M19 4v16h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12z',\n 'M19 16h-12a2 2 0 0 0 -2 2',\n 'M9 8h6',\n ],\n callout: [\n {\n d: 'M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1',\n stroke: 'primary',\n fill: 'secondary',\n },\n { d: 'M17 11v6h-9', stroke: 'primary' },\n { d: 'M8 15l-2 2l2 2', stroke: 'primary' },\n ],\n check: ['M5 12l5 5l10 -10'],\n chevronDown: ['M6 9l6 6l6 -6'],\n chevronLeft: ['M15 6l-6 6l6 6'],\n chevronRight: ['M9 6l6 6l-6 6'],\n circle: [\n { d: 'M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0', stroke: 'primary', fill: 'secondary' },\n ],\n comment: [\n 'M12 11v.01',\n 'M8 11v.01',\n 'M16 11v.01',\n 'M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3z',\n ],\n copy: [\n 'M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z',\n 'M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1',\n ],\n deviceFloppy: [\n 'M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2',\n 'M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M14 4l0 4l-6 0l0 -4',\n ],\n dots: [\n 'M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n ],\n doublePage: [\n 'M3 3m0 1a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1zm9 -1v18',\n ],\n download: ['M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2', 'M7 11l5 5l5 -5', 'M12 4l0 12'],\n externalLink: [\n 'M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6',\n 'M11 13l9 -9',\n 'M15 4h5v5',\n ],\n eye: ['M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'],\n file: ['M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'],\n fileImport: [\n 'M14 3v4a1 1 0 0 0 1 1h4',\n 'M5 13v-8a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-5.5m-9.5 -2h7m-3 -3l3 3l-3 3',\n ],\n fitToPage: [\n 'M12 20h-6a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h6',\n 'M18 14v7',\n 'M18 3v7',\n 'M15 18l3 3l3 -3',\n 'M15 6l3 -3l3 3',\n ],\n fitToWidth: [\n 'M4 12v-6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v6',\n 'M10 18h-7',\n 'M21 18h-7',\n 'M6 15l-3 3l3 3',\n 'M18 15l3 3l-3 3',\n ],\n formCheckbox: [\n 'M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14',\n 'M9 12l2 2l4 -4',\n ],\n formListbox: [\n 'M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14',\n 'M11 8h6',\n 'M11 12h6',\n 'M11 16h6',\n 'M7 8l0 .01',\n 'M7 12l0 .01',\n 'M7 16l0 .01',\n ],\n formRadio: [\n { d: 'M9 12a2 2 0 1 0 6 0a2 2 0 1 0 -6 0', fill: true },\n 'M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0',\n ],\n formSelect: [\n 'M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14',\n 'M9 11l3 3l3 -3',\n ],\n formTextfield: [\n 'M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3',\n 'M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3',\n 'M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7',\n 'M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1',\n 'M17 12h.01',\n 'M13 12h.01',\n ],\n freeText: [\n { d: 'M4 7v-2h12v2', stroke: 'primary' },\n { d: 'M10 5v14', stroke: 'primary' },\n { d: 'M12 19h-4', stroke: 'primary' },\n { d: 'M15 13v-1h6v1', stroke: 'primary' },\n { d: 'M18 12v7', stroke: 'primary' },\n { d: 'M17 19h2', stroke: 'primary' },\n ],\n fullscreen: [\n 'M4 8v-2a2 2 0 0 1 2 -2h2',\n 'M4 16v2a2 2 0 0 0 2 2h2',\n 'M16 4h2a2 2 0 0 1 2 2v2',\n 'M16 20h2a2 2 0 0 0 2 -2v-2',\n ],\n fullscreenExit: [\n 'M4 8v-2c0 -.551 .223 -1.05 .584 -1.412',\n 'M4 16v2a2 2 0 0 0 2 2h2',\n 'M16 4h2a2 2 0 0 1 2 2v2',\n 'M16 20h2c.545 0 1.04 -.218 1.4 -.572',\n 'M3 3l18 18',\n ],\n group: [\n 'M3 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M17 5a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M3 19a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M17 19a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M5 7v10',\n 'M19 7v10',\n 'M7 5h10',\n 'M7 19h10',\n 'M8 8H12.8V11.2H16V16H11.2V12.8H8V8Z',\n ],\n hand: [\n 'M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5',\n 'M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5',\n 'M14 5.5a1.5 1.5 0 0 1 3 0v6.5',\n 'M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47',\n ],\n highlight: [\n // the v2 marker block behind the \"A\" — visible only when accented\n {\n d: 'M4 6h16a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2H4a2 2 0 0 1 -2 -2V8a2 2 0 0 1 2 -2z',\n fill: 'primary',\n },\n 'M8 16v-8a4 4 0 1 1 8 0v8',\n 'M8 10h8',\n ],\n horizontal: ['M7 8l-4 4l4 4', 'M17 8l4 4l-4 4', 'M3 12l18 0'],\n inkHighlighter: [\n 'M3 19h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4',\n 'M12.5 5.5l4 4',\n 'M4.5 13.5l4 4',\n { d: 'M21 15v4h-8l4 -4l4 0', stroke: 'primary', fill: 'primary' },\n ],\n insertText: [\n { d: 'M3 7v-2h12v2', stroke: 'primary' },\n { d: 'M9 5v14', stroke: 'primary' },\n { d: 'M7 19h4', stroke: 'primary' },\n { d: 'M18 15l2 2h-5', stroke: 'primary' },\n { d: 'M18 19l2 -2', stroke: 'primary' },\n ],\n italic: ['M11 5l6 0', 'M7 19l6 0', 'M14 5l-4 14'],\n line: [{ d: 'M20 4l-16 16', stroke: 'primary' }],\n // Both strokes tag the `primary` accent slot so the arrow glyph previews the\n // tool's stroke colour (like the plain `line` icon); with no accent they render\n // as currentColor — identical to the untagged glyph.\n lineArrow: [\n { d: 'M20 4l-16 16', stroke: 'primary' },\n { d: 'M16 3h5v5', stroke: 'primary' },\n ],\n link: [\n 'M9 15l6 -6',\n 'M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464',\n 'M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463',\n ],\n linkOff: [\n 'M9 15l3 -3m2 -2l1 -1',\n 'M11 6l.463 -.536a5 5 0 0 1 7.072 7.071l-.534 .464',\n 'M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463',\n 'M3 3l18 18',\n ],\n listTree: ['M9 6h11', 'M12 12h8', 'M15 18h5', 'M5 6v.01', 'M8 12v.01', 'M11 18v.01'],\n lock: [\n 'M5 11h14a2 2 0 0 1 2 2v7a2 2 0 0 1 -2 2H5a2 2 0 0 1 -2 -2v-7a2 2 0 0 1 2 -2z',\n 'M7 11V7a5 5 0 0 1 10 0v4',\n ],\n marqueeSelect: [\n 'M17 20h6',\n 'M20 17v6',\n 'M4 13v-2',\n 'M4 6v-1a1 1 0 0 1 1 -1h1',\n 'M6 20h-1a1 1 0 0 1 -1 -1v-1',\n 'M11 4h2',\n 'M11 20h2',\n 'M18 4h1a1 1 0 0 1 1 1v1',\n 'M20 11v2',\n ],\n menu: ['M4 8l16 0', 'M4 16l16 0'],\n message: [\n 'M8 9h8',\n 'M8 13h6',\n 'M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12',\n ],\n palette: [\n 'M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25',\n 'M8.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M12.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M16.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n ],\n paperclip: [\n 'M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5',\n ],\n pencilMarker: [\n 'm9.109 16.275 8.856-8.097c.812-.743.87-2.014.127-2.826s-2.014-.869-2.826-.127L6.41 13.322l-.127 2.826zM13.79 6.575l2.7 2.952',\n {\n d: 'M19.375 20.125c.569.063-4.05-.562-6.412-.437s-4.759 1.229-6.857 1.625c-1.764.687-3.404-.938-1.981-2.5',\n stroke: 'primary',\n },\n ],\n photo: [\n 'M15 8h.01',\n 'M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z',\n 'M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5',\n 'M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3',\n ],\n // hand-added: the v2 file draws <line> primitives the extractor skips\n plus: ['M12 5l0 14', 'M5 12l14 0'],\n pointer: [\n 'M7.904 17.563a1.2 1.2 0 0 0 2.228 .308l2.09 -3.093l4.907 4.907a1.067 1.067 0 0 0 1.509 0l1.047 -1.047a1.067 1.067 0 0 0 0 -1.509l-4.907 -4.907l3.113 -2.09a1.2 1.2 0 0 0 -.309 -2.228l-13.582 -3.904l3.904 13.563z',\n ],\n polygon: [\n {\n d: 'M13.163 2.168l8.021 5.828c.694 .504 .984 1.397 .719 2.212l-3.064 9.43a1.978 1.978 0 0 1 -1.881 1.367h-9.916a1.978 1.978 0 0 1 -1.881 -1.367l-3.064 -9.43a1.978 1.978 0 0 1 .719 -2.212l8.021 -5.828a1.978 1.978 0 0 1 2.326 0z',\n stroke: 'primary',\n fill: 'secondary',\n },\n ],\n print: [\n 'M17 17h2a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-14a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2',\n 'M17 9v-4a2 2 0 0 0 -2 -2h-6a2 2 0 0 0 -2 2v4',\n 'M7 13m0 2a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z',\n ],\n redact: [\n 'M7 4h10',\n 'M12 4v8',\n 'M-7 24l12 -12',\n 'M-3 24l12 -12',\n 'M1 24l12 -12',\n 'M5 24l12 -12',\n 'M9 24l12 -12',\n 'M13 24l12 -12',\n 'M17 24l12 -12',\n 'M21 24l12 -12',\n 'M25 24l12 -12',\n ],\n // v2 parity: dashed frame + a SMALL rounded hatched box (v2 clips the\n // hatch via <clipPath>; this icon system is plain paths, so the hatch\n // segments are pre-clipped to the 10..22 box analytically).\n redactArea: [\n 'M6 20h-1a2 2 0 0 1 -2 -2v-1',\n 'M3 13v-3',\n 'M3 6v-1a2 2 0 0 1 2 -2h1',\n 'M10 3h3',\n 'M17 3h1a2 2 0 0 1 2 2v1',\n 'M12 10h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-8a2 2 0 0 1 2 -2z',\n 'M10 12l2 -2',\n 'M10 16l6 -6',\n 'M10 20l10 -10',\n 'M12 22l10 -10',\n 'M16 22l6 -6',\n 'M20 22l2 -2',\n ],\n redactCombined: [\n 'M6 20h-1a2 2 0 0 1 -2 -2v-1',\n 'M3 13v-3',\n 'M20 13v-3',\n 'M3 6v-1a2 2 0 0 1 2 -2h1',\n 'M10 3h3',\n 'M17 3h1a2 2 0 0 1 2 2v1',\n 'M8 8h8',\n 'M12 8v7',\n 'M6 19l12 -12',\n 'M6 23l12 -12',\n 'M10 23l12 -12',\n 'M14 27l12 -12',\n 'M14 23l12 -12',\n ],\n redactionSidebar: [\n 'M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z',\n 'M15 4v16',\n 'M7 8h5',\n 'M7 11h5',\n 'M7 14h4',\n ],\n replaceText: [\n { d: 'M3 7v-2h12v2', stroke: 'primary' },\n { d: 'M9 5v14', stroke: 'primary' },\n { d: 'M7 19h4', stroke: 'primary' },\n { d: 'M20 14l2 2h-3', stroke: 'primary' },\n { d: 'M20 18l2 -2', stroke: 'primary' },\n { d: 'M19 16a3 3 0 1 0 2 5.236', stroke: 'primary' },\n ],\n rotateClockwise: ['M4.05 11a8 8 0 1 1 .5 4m-.5 5v-5h5'],\n rotateCounterClockwise: ['M19.95 11a8 8 0 1 0 -.5 4m.5 5v-5h-5'],\n rubberStamp: [\n 'M21 17.85h-18c0 -4.05 1.421 -4.05 3.79 -4.05c5.21 0 1.21 -4.59 1.21 -6.8a4 4 0 1 1 8 0c0 2.21 -4 6.8 1.21 6.8c2.369 0 3.79 0 3.79 4.05',\n 'M5 21h14',\n ],\n rubberStampPlus: [\n 'M21 17.85h-18c0 -4.05 1.421 -4.05 3.79 -4.05c5.21 0 1.21 -4.59 1.21 -6.8a4 4 0 0 1 4.9 -4.1',\n 'M16 10c0 1.2 -4 3.8 1.21 3.8c2.369 0 3.79 0 3.79 4.05',\n 'M5 21h14',\n 'M16 5h6',\n 'M19 2v6',\n ],\n save: [\n 'M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2',\n 'M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M14 4l0 4l-6 0l0 -4',\n ],\n screenshot: [\n 'M7 19a2 2 0 0 1 -2 -2',\n 'M5 13v-2',\n 'M5 7a2 2 0 0 1 2 -2',\n 'M11 5h2',\n 'M17 5a2 2 0 0 1 2 2',\n 'M19 11v2',\n 'M19 17v4',\n 'M21 19h-4',\n 'M13 19h-2',\n ],\n search: ['M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0', 'M21 21l-6 -6'],\n settings: [\n 'M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z',\n 'M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0',\n ],\n sidebar: [\n 'M4 18v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z',\n 'M10 18v-12a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2z',\n ],\n signature: [\n 'M3 17c3.333 -3.333 5 -6 5 -8c0 -3 -1 -3 -2 -3s-2.032 1.085 -2 3c.034 2.048 1.658 4.877 2.5 6c1.5 2 2.5 2.5 3.5 1l2 -3c.333 2.667 1.333 4 3 4c.53 0 2.639 -2 3 -2c.517 0 1.517 .667 3 2',\n ],\n singlePage: ['M5 3m0 1a1 1 0 0 1 1 -1h12a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-12a1 1 0 0 1 -1 -1z'],\n square: [\n {\n d: 'M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z',\n stroke: 'primary',\n fill: 'secondary',\n },\n ],\n squares: [\n 'M8 10a2 2 0 0 1 2 -2h9a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-9a2 2 0 0 1 -2 -2z',\n 'M16 8v-3a2 2 0 0 0 -2 -2h-9a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h3',\n ],\n squiggly: [\n 'M8 16v-8a4 4 0 1 1 8 0v8',\n 'M8 10h8',\n { d: 'M4 20c1.5 -1.5 3.5 -1.5 5 0s3.5 1.5 5 0 3.5 -1.5 5 0', stroke: 'primary' },\n ],\n strikethrough: ['M8 16v-8a4 4 0 1 1 8 0v8', { d: 'M4 10h16', stroke: 'primary' }],\n text: [\n 'M6.5 15.5m-3.5 0a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0',\n 'M14 19v-10.5a3.5 3.5 0 0 1 7 0v10.5',\n 'M14 13h7',\n 'M10 12v7',\n ],\n trash: [\n 'M4 7l16 0',\n 'M10 11l0 6',\n 'M14 11l0 6',\n 'M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12',\n 'M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3',\n ],\n underline: [{ d: 'M4 20h16', stroke: 'primary' }, 'M8 16v-8a4 4 0 1 1 8 0v8', 'M8 10h8'],\n // the v2 ungroup glyph: two separated rounded rects\n ungroup: [\n 'M4 5a1 1 0 0 1 1 -1h5a1 1 0 0 1 1 1v5a1 1 0 0 1 -1 1h-5a1 1 0 0 1 -1 -1z',\n 'M13 14a1 1 0 0 1 1 -1h5a1 1 0 0 1 1 1v5a1 1 0 0 1 -1 1h-5a1 1 0 0 1 -1 -1z',\n ],\n unlock: ['M7 11V7a5 5 0 0 1 9.9-1'],\n vertical: ['M8 7l4 -4l4 4', 'M8 17l4 4l4 -4', 'M12 3l0 18'],\n viewSettings: [\n 'M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0',\n 'M12 10.5v1.5',\n 'M12 16v1.5',\n 'M15.031 12.25l-1.299 .75',\n 'M10.268 15l-1.3 .75',\n 'M15 15.803l-1.285 -.773',\n 'M10.285 12.97l-1.285 -.773',\n 'M14 3v4a1 1 0 0 0 1 1h4',\n 'M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z',\n ],\n widgetEdit: [\n 'M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1',\n 'M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415',\n 'M16 5l3 3',\n ],\n x: ['M18 6l-12 12', 'M6 6l12 12'],\n zigzag: [{ d: 'M12 2.4L21.36 11.76L2.64 12.24L12 21.6', stroke: 'primary' }],\n zoomIn: ['M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0', 'M9 12h6', 'M12 9v6'],\n zoomInArea: [\n 'M15 13v4',\n 'M13 15h4',\n 'M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0',\n 'M22 22l-3 -3',\n 'M6 18h-1a2 2 0 0 1 -2 -2v-1',\n 'M3 11v-1',\n 'M3 6v-1a2 2 0 0 1 2 -2h1',\n 'M10 3h1',\n 'M15 3h1a2 2 0 0 1 2 2v1',\n ],\n zoomOut: ['M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0', 'M9 12l6 0'],\n};\n\nexport type IconName = keyof typeof ICON_PATHS;\n\nexport interface IconProps {\n name: string;\n size?: number;\n strokeWidth?: number;\n className?: string;\n title?: string;\n /** Paints the glyph's slot-tagged sub-paths (a tool previewing its\n * drawing defaults). Absent → the plain, untinted glyph. */\n accent?: IconAccent;\n}\n\n/** One SVG renderer for every icon. Unknown names render nothing (caller shows\n * a text fallback), so a missing glyph never throws. */\nexport function Icon({ name, size = 20, strokeWidth = 2, className, title, accent }: IconProps) {\n // Registry semantics: user icons are additive and a colliding name WINS —\n // re-skinning a built-in glyph is a supported move, not an accident.\n const custom = useCustomIcons();\n const paths = custom[name] ?? ICON_PATHS[name];\n if (!paths) return null;\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n role=\"img\"\n aria-hidden={title ? undefined : true}\n aria-label={title}\n >\n {paths.map((p, i) => {\n if (typeof p === 'string') return <path key={i} d={p} />;\n const fill = p.fill === true ? 'currentColor' : p.fill ? accent?.[p.fill] : undefined;\n // a stroke slot paints from the accent, inheriting currentColor\n // without one; a fill-ONLY path never gets an outline (the v2 look)\n const stroke = p.stroke ? accent?.[p.stroke] : p.fill ? 'none' : undefined;\n return <path key={i} d={p.d} fill={fill ?? 'none'} stroke={stroke} />;\n })}\n </svg>\n );\n}\n\nexport const hasIcon = (name: string): boolean => name in ICON_PATHS;\n","/**\n * Light/dark theme — one class, and the CSS variables in styles.css do the\n * rest (both toolbars, sidebars, popovers, and the canvas re-theme from it).\n * The mode comes from the embedder's `theme` preference; the chrome ships no\n * switch of its own, so a host that wants one drives this through `set`. The\n * class lands on <html> by default; a delivery that must not touch the page\n * (the <embedpdf-viewer> shadow root) passes `target` and the class stays\n * inside its own subtree. An explicit preference outranks the OS setting.\n */\nimport { createContext, useContext, useEffect, useMemo, useState } from 'react';\n\nexport type ThemeMode = 'light' | 'dark';\nexport type ThemePreference = ThemeMode | 'system';\n\nconst ThemeCtx = createContext<{\n mode: ThemeMode;\n toggle: () => void;\n set: (m: ThemeMode) => void;\n} | null>(null);\n\nconst systemMode = (): ThemeMode =>\n typeof window !== 'undefined' && window.matchMedia?.('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light';\n\nexport function ThemeProvider({\n children,\n preference = 'system',\n target,\n}: {\n children: React.ReactNode;\n /** Initial mode; 'system' (default) follows the OS setting. */\n preference?: ThemePreference;\n /** Where the `.dark` class goes. Default: document.documentElement. */\n target?: HTMLElement | null;\n}) {\n const [mode, setMode] = useState<ThemeMode>(() =>\n preference === 'system' ? systemMode() : preference,\n );\n useEffect(() => {\n (target ?? document.documentElement).classList.toggle('dark', mode === 'dark');\n }, [mode, target]);\n const value = useMemo(\n () => ({ mode, toggle: () => setMode((m) => (m === 'dark' ? 'light' : 'dark')), set: setMode }),\n [mode],\n );\n return <ThemeCtx.Provider value={value}>{children}</ThemeCtx.Provider>;\n}\n\nexport function useTheme() {\n const ctx = useContext(ThemeCtx);\n if (!ctx) throw new Error('useTheme must be used within <ThemeProvider>');\n return ctx;\n}\n","/**\n * The viewer's BUILT-IN stamp library: `@embedpdf/default-stamps`, the\n * standard rubber stamps as one Acrobat-compatible PDF per locale.\n *\n * Delivery: the library ships INSIDE whatever ships this viewer. The package\n * exposes each locale as a lazy ES module (`@embedpdf/default-stamps/library`),\n * so it travels through the module graph like any other code — every bundler\n * splits it into a chunk served from the app's own origin, the CDN snippet\n * carries it as a sibling chunk in its folder, and nothing is fetched from a\n * third party. `stamps.defaultLibrary` overrides that:\n * - `false` → no built-in library, no request (air-gapped);\n * - a URL template → exactly that (`{locale}` slot), for self-hosted copies.\n *\n * Loading is LAZY (first open of the stamps panel, never at boot) and\n * locale-aware: the chrome locale leads, the browser languages break ties\n * for the locales the chrome does not translate itself, and a locale change\n * while a default library is loaded swaps it for the new one. The file names\n * itself (`/Title`, `Id: embedpdf-standard`), so no overrides are passed.\n */\nimport { LOCALES, loadDefaultLibrary } from '@embedpdf/default-stamps/library';\nimport { negotiateLocale } from '@embedpdf/react/i18n';\nimport type { StampCapability } from '@embedpdf/react/stamp';\n\n/** The built-in library's PieceInfo id — excluded from persistence (it is\n * loaded again on every first open, in the locale of that moment). */\nexport const DEFAULT_LIBRARY_ID = 'embedpdf-standard';\n\nexport type DefaultLibrarySource = false | string | undefined;\n\n/** Which shipped locale to show for the chrome's locale + the browser's. */\nexport function resolveStampsLocale(chromeLocale: string): string {\n const languages = typeof navigator !== 'undefined' ? (navigator.languages ?? []) : [];\n return negotiateLocale(LOCALES, [chromeLocale, ...languages]) ?? 'en';\n}\n\nconst fetchBytes = async (url: string): Promise<Uint8Array> => {\n const response = await fetch(url);\n if (!response.ok) throw new Error(`${url}: HTTP ${response.status}`);\n return new Uint8Array(await response.arrayBuffer());\n};\n\n/** The library bytes for `locale`: your URL when you gave one, otherwise the\n * copy that shipped with the viewer. Never anything else. */\nconst defaultLibraryBytes = (locale: string, source: string | undefined) =>\n source ? fetchBytes(source.replace('{locale}', locale)) : loadDefaultLibrary(locale);\n\n/** Per workspace: the locale the default library was last brought to, and\n * the in-flight work — the panel mounts and unmounts with the sidebar, so\n * this cannot live in component state. */\nconst loads = new WeakMap<StampCapability, { locale: string; promise: Promise<void> }>();\n\n/**\n * Bring the built-in library to `locale`. Idempotent per workspace and\n * locale; a locale change swaps the loaded default (remove, then import);\n * a default the user removed in this session stays removed — the locale is\n * recorded, nothing is re-added. An embedder that seeded a library under\n * the same id is left alone.\n */\nexport function ensureDefaultLibrary(\n stamp: StampCapability,\n locale: string,\n source: DefaultLibrarySource,\n): Promise<void> {\n if (source === false) return Promise.resolve();\n const current = loads.get(stamp);\n if (current?.locale === locale) return current.promise;\n const run = async () => {\n await current?.promise.catch(() => undefined);\n const loaded = stamp.library(DEFAULT_LIBRARY_ID);\n if (loaded?.locale === locale) return;\n if (current && !loaded) return; // removed by the user this session\n if (loaded) await stamp.removeLibrary(DEFAULT_LIBRARY_ID);\n await stamp.importLibraryPdf(await defaultLibraryBytes(locale, source));\n };\n const promise = run();\n loads.set(stamp, { locale, promise });\n return promise;\n}\n","/**\n * The user's stamp libraries live in the browser (IndexedDB): restored ONCE\n * per workspace, written on every change, for as long as the viewer lives —\n * a signature made while the stamps sidebar is closed is persisted exactly\n * like a stamp imported while it is open. The built-in library is never\n * stored (it is fetched again next time, in the locale of that moment); the\n * panels that need it bring it in lazily through `ensureDefaultLibrary`.\n *\n * Mounted once in the Shell, workspace-scoped (the stamp plugin is).\n */\nimport { useEffect } from 'react';\nimport {\n indexedDbByteStore,\n persistStampLibraries,\n restoreStampLibraries,\n useStamp,\n type StampCapability,\n} from '@embedpdf/react/stamp';\nimport { DEFAULT_LIBRARY_ID } from '../config/default-stamps';\n\nconst store =\n typeof indexedDB === 'undefined'\n ? null\n : indexedDbByteStore('embedpdf-stamps', { storeName: 'libraries' });\n\nconst restored = new WeakMap<StampCapability, Promise<unknown>>();\n\n/** Bring the stored libraries back — once per workspace, whoever asks first. */\nexport const restoreStampLibrariesOnce = (stamp: StampCapability): Promise<unknown> => {\n let pending = restored.get(stamp);\n if (!pending) {\n pending = store ? restoreStampLibraries(stamp, store) : Promise.resolve();\n restored.set(stamp, pending);\n }\n return pending;\n};\n\nexport function StampLibraryStore() {\n const stamp = useStamp();\n useEffect(() => {\n void restoreStampLibrariesOnce(stamp);\n return store\n ? persistStampLibraries(stamp, store, { except: [DEFAULT_LIBRARY_ID] })\n : undefined;\n }, [stamp]);\n return null;\n}\n","/**\n * Quick marks in the toolbar: a row of stamp thumbnails that ARM on click —\n * the checkmark, the cross, whatever the embedder configured\n * (`stamps.toolbar`: asset ids, or one library's assets). The hover ghost and\n * the click placement are the annotation plugin's, exactly as from the\n * sidebar; only the picker moved. Renders nothing until the assets exist.\n * Lives in the workspace toolbar, so it reads the ACTIVE document's tool.\n */\nimport { useEffect } from 'react';\nimport { InteractionToken } from '@embedpdf/react/interaction';\nimport { useLocale, useT } from '@embedpdf/react/i18n';\nimport { useDocumentId, useOptionalSelector } from '@embedpdf/react/runtime';\nimport {\n StampToken,\n useArmStampAsset,\n useStamp,\n useStampAssetPreviewUrl,\n useStampAssets,\n type StampAsset,\n} from '@embedpdf/react/stamp';\nimport { useStampsConfig } from '../config-context';\nimport {\n DEFAULT_LIBRARY_ID,\n ensureDefaultLibrary,\n resolveStampsLocale,\n} from '../config/default-stamps';\nimport { restoreStampLibrariesOnce } from './stamp-store';\nimport { buttonClass } from './toolbar';\n\nexport function QuickStamps() {\n const t = useT();\n const stamp = useStamp();\n const config = useStampsConfig();\n const { locale } = useLocale();\n const assets = useStampAssets();\n const documentId = useDocumentId();\n const { armAsset } = useArmStampAsset();\n const activeToolId = useOptionalSelector(InteractionToken, (c) => c.activeToolId(), null);\n const armedId = useOptionalSelector(\n StampToken,\n (c) => (documentId ? (c.armedAsset(documentId)?.id ?? null) : null),\n null,\n );\n const ids = Array.isArray(config.toolbar)\n ? config.toolbar\n : config.toolbar && 'library' in config.toolbar\n ? (stamp.library(config.toolbar.library)?.assetIds ?? [])\n : [];\n\n // A quick mark from the built-in library needs that library loaded — the\n // one case the toolbar pays for it at boot. The user's own libraries are\n // restored by the workspace store.\n const wantsDefault = ids.some((id) => id.startsWith(`${DEFAULT_LIBRARY_ID}:`));\n useEffect(() => {\n if (!wantsDefault) return;\n restoreStampLibrariesOnce(stamp)\n .then(() => ensureDefaultLibrary(stamp, resolveStampsLocale(locale), config.defaultLibrary))\n .catch((err) => console.error('[embedpdf] quick stamps failed:', err));\n // `config` is init-stable; only the locale re-runs this.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [stamp, locale, wantsDefault]);\n\n const shown = ids\n .map((id) => assets.find((a) => a.id === id))\n .filter((a): a is StampAsset => !!a);\n if (shown.length === 0 || !documentId) return null;\n return (\n <div className=\"flex items-center gap-1\" role=\"group\" aria-label={t('demo.quickStampsLabel')}>\n {shown.map((asset) => (\n <QuickStampButton\n key={asset.id}\n asset={asset}\n active={activeToolId === 'stamp' && armedId === asset.id}\n onArm={() =>\n void armAsset(asset.id).catch((e) => console.error('[embedpdf] arm failed', e))\n }\n />\n ))}\n </div>\n );\n}\n\nfunction QuickStampButton({\n asset,\n active,\n onArm,\n}: {\n asset: StampAsset;\n active: boolean;\n onArm: () => void;\n}) {\n const url = useStampAssetPreviewUrl(asset.id);\n return (\n <button\n type=\"button\"\n onClick={onArm}\n title={asset.label}\n aria-label={asset.label}\n aria-pressed={active || undefined}\n className={buttonClass(active, true)}\n >\n {url ? (\n <img src={url} alt=\"\" className=\"h-5 w-5 object-contain\" draggable={false} />\n ) : (\n <span className=\"text-xs\">{asset.label}</span>\n )}\n </button>\n );\n}\n","/**\n * Menu rendering — a MenuSchema (a tree of command ids) rendered as rows.\n * Reused by the toolbar dropdowns (document / zoom / page-settings) AND by the\n * overflow menu's inline submenu expansion, so a command's menu form is\n * identical wherever it surfaces. Rows resolve live through the command\n * registry: label, icon, active tick, enabled state.\n */\nimport { useState } from 'react';\nimport { useCommand, useCommands } from '@embedpdf/react/commands';\nimport { useT } from '@embedpdf/react/i18n';\nimport type { MenuSchema } from '@embedpdf/react/toolbar';\nimport { Icon } from './icons';\nimport { useMenuSchema } from '../config-context';\n\nexport function MenuRow({ commandId, onRun }: { commandId: string; onRun?: () => void }) {\n const cmd = useCommand(commandId);\n const commands = useCommands();\n if (!cmd || !cmd.visible) return null;\n return (\n <button\n type=\"button\"\n role={cmd.active ? 'menuitemradio' : 'menuitem'}\n part={cmd.active ? 'menu-item menu-item-active' : 'menu-item'}\n aria-checked={cmd.active || undefined}\n disabled={!cmd.enabled}\n onClick={() => {\n commands.execute(commandId);\n onRun?.();\n }}\n // v2 shows selection as a blue-tinted row (bg-interactive-selected +\n // text-accent), never a checkmark — the icon column stays the command's\n // own icon.\n className={`flex w-full items-center gap-3 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors disabled:pointer-events-none disabled:opacity-40 ${\n cmd.active ? 'bg-selected text-accent' : 'text-fg-secondary hover:bg-hover'\n }`}\n >\n {cmd.icon && (\n <Icon\n name={cmd.icon}\n size={16}\n accent={cmd.iconAccent}\n className={cmd.active ? '' : 'text-fg-muted'}\n />\n )}\n <span className=\"flex-1 truncate\">{cmd.label}</span>\n </button>\n );\n}\n\n/** One section-separated menu, by schema id. */\nexport function MenuBody({ menuId, onRun }: { menuId: string; onRun?: () => void }) {\n const t = useT();\n const menu: MenuSchema | undefined = useMenuSchema(menuId);\n if (!menu) return null;\n return (\n <div className=\"min-w-52 p-1\">\n {menu.sections.map((section, i) => (\n <div key={i}>\n {i > 0 && <div className=\"bg-border-subtle my-1 h-px\" />}\n {section.labelKey && (\n <div className=\"text-fg-muted px-2.5 pb-1 pt-1.5 text-[11px] font-semibold uppercase tracking-wide\">\n {t(section.labelKey)}\n </div>\n )}\n {section.items.map((id) => (\n <MenuRow key={id} commandId={id} onRun={onRun} />\n ))}\n </div>\n ))}\n </div>\n );\n}\n\n/** The popover shell: a floating surface + click-away scrim. */\nexport function Popover({\n children,\n onClose,\n align = 'start',\n}: {\n children: React.ReactNode;\n onClose: () => void;\n align?: 'start' | 'end';\n}) {\n return (\n <>\n <div className=\"fixed inset-0 z-40\" onClick={onClose} />\n <div\n part=\"menu\"\n className={`border-border-subtle bg-elevated absolute top-full z-50 mt-1 rounded-lg border shadow-xl ${\n align === 'end' ? 'right-0' : 'left-0'\n }`}\n >\n {children}\n </div>\n </>\n );\n}\n\n/** A menu dropdown that expands inline (used inside the overflow menu, where a\n * submenu can't anchor to an off-screen trigger). */\nexport function InlineSubmenu({ menuId, label }: { menuId: string; label: string }) {\n const [open, setOpen] = useState(false);\n return (\n <div>\n <button\n type=\"button\"\n onClick={() => setOpen((o) => !o)}\n className=\"text-fg-secondary hover:bg-hover flex w-full items-center gap-3 rounded-md px-2.5 py-1.5 text-left text-sm\"\n >\n <span className=\"flex-1 truncate\">{label}</span>\n <Icon name={open ? 'chevronDown' : 'chevronRight'} size={16} />\n </button>\n {open && (\n <div className=\"border-border-subtle ml-3 border-l pl-1\">\n <MenuBody menuId={menuId} />\n </div>\n )}\n </div>\n );\n}\n","/**\n * The app's toolbar look — Tailwind render props over the headless <Toolbar>.\n * The app owns the pixels; ui-core owns the physics (measure → solve →\n * overflow). Nothing here knows about breakpoints or widths.\n *\n * Styling is a 1:1 port of the v2 snippet's components:\n * Button → viewers/snippet/src/components/ui/button.tsx\n * TabButton → viewers/snippet/src/components/ui/tab-button.tsx (underline)\n * zoom widget → viewers/snippet/src/components/custom-zoom-toolbar.tsx\n * mode select → viewers/snippet/src/components/mode-select-button.tsx\n */\nimport { useEffect, useState } from 'react';\nimport { useOptionalCapability, useOptionalSelector } from '@embedpdf/react/runtime';\nimport { Toolbar } from '@embedpdf/react/toolbar';\nimport type {\n BarSchema,\n CollapsedGroupView,\n GroupDisclosureView,\n OverflowMenuView,\n} from '@embedpdf/react/toolbar';\nimport { useCommands } from '@embedpdf/react/commands';\nimport type { ResolvedCommand } from '@embedpdf/react/commands';\nimport { QuickStamps } from './quick-stamps';\nimport { useMenus } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\nimport { StageToken } from '@embedpdf/react/stage';\nimport { Icon } from './icons';\nimport { MenuBody, Popover, InlineSubmenu } from './menu';\n\n// ── the v2 Button recipe ──────────────────────────────────────────────────────\nconst BTN_BASE =\n 'flex h-8 w-auto min-w-8 cursor-pointer items-center justify-center rounded-md p-[5px] transition-colors';\nconst BTN_HOVER = 'hover:bg-hover hover:ring hover:ring-accent';\nconst BTN_ACTIVE = 'border-none bg-selected text-accent shadow ring ring-accent';\nconst BTN_DISABLED = 'cursor-not-allowed opacity-50 hover:bg-transparent hover:ring-0';\n\nexport const buttonClass = (active: boolean, enabled = true): string =>\n `${BTN_BASE} ${active ? BTN_ACTIVE : BTN_HOVER} ${enabled ? '' : BTN_DISABLED}`;\n\n// ── the v2 TabButton recipe (the underline) ───────────────────────────────────\nconst TAB_BASE =\n 'flex h-8 w-auto min-w-8 cursor-pointer items-center justify-center rounded-none border-b-2 px-2 py-1 text-sm transition-colors hover:bg-transparent hover:border-b-fg-muted';\nconst TAB_ACTIVE = 'border-b-accent text-accent hover:border-b-accent';\nconst TAB_INACTIVE = 'border-b-transparent';\n\nconst tabClass = (active: boolean, enabled = true): string =>\n `${TAB_BASE} ${active ? TAB_ACTIVE : TAB_INACTIVE} ${enabled ? '' : 'cursor-not-allowed opacity-50'}`;\n\n// ── a single command button (icon / icon+label / label=tab) ──────────────────\nfunction CommandButton({\n cmd,\n variant,\n run,\n}: {\n cmd: ResolvedCommand;\n variant: string;\n run: () => void;\n}) {\n const isTab = variant === 'label';\n\n // v2 buttons carry NO caret — a menu command is a plain icon button; the\n // `menu:` declaration still drives aria-haspopup and the anchored popover.\n const button = (\n <button\n type=\"button\"\n onClick={run}\n disabled={!cmd.enabled}\n aria-pressed={cmd.active || undefined}\n aria-haspopup={cmd.menu ? 'menu' : undefined}\n aria-label={cmd.label}\n title={cmd.label}\n // Shadow parts — the RESTYLE door: page CSS reaches these via\n // `embedpdf-viewer::part(toolbar-button)` etc. Part names are public\n // API; the vocabulary is deliberately small (see README).\n part={\n isTab\n ? `mode-tab${cmd.active ? ' mode-tab-active' : ''}`\n : `toolbar-button${cmd.active ? ' toolbar-button-active' : ''}`\n }\n className={isTab ? tabClass(cmd.active, cmd.enabled) : buttonClass(cmd.active, cmd.enabled)}\n >\n {isTab ? (\n <span className=\"whitespace-nowrap px-1\">{cmd.label}</span>\n ) : variant === 'icon+label' ? (\n <span className=\"flex items-center whitespace-nowrap text-sm\">\n {cmd.icon && (\n <Icon name={cmd.icon} size={20} accent={cmd.iconAccent} className=\"mr-1.5 shrink-0\" />\n )}\n <span>{cmd.label}</span>\n </span>\n ) : cmd.icon ? (\n <Icon name={cmd.icon} size={20} accent={cmd.iconAccent} />\n ) : (\n <span className=\"text-sm\">{cmd.label}</span>\n )}\n </button>\n );\n\n if (!cmd.menu) return button;\n return <MenuAnchoredButton cmd={cmd}>{button}</MenuAnchoredButton>;\n}\n\nfunction MenuAnchoredButton({\n cmd,\n children,\n}: {\n cmd: ResolvedCommand;\n children: React.ReactNode;\n}) {\n const menus = useMenus();\n const open = cmd.menu ? menus.isOpen(cmd.menu) : false;\n return (\n <span className=\"relative inline-flex\">\n {children}\n {open && cmd.menu && (\n <Popover onClose={() => menus.close(cmd.menu!)}>\n <MenuBody menuId={cmd.menu} onRun={() => menus.close(cmd.menu!)} />\n </Popover>\n )}\n </span>\n );\n}\n\n// ── the inline zoom widget — v2's custom-zoom-toolbar, 1:1 ───────────────────\nfunction ZoomControls() {\n const commands = useCommands();\n const menus = useMenus();\n const stage = useOptionalCapability(StageToken);\n // Null-safe: the zoom strip is main-toolbar chrome, mounted before any\n // document exists — it reads 100% until a Stage is there to ask.\n const level = useOptionalSelector(StageToken, (c) => c.zoomLevel(), 1);\n const pct = Math.round((level ?? 1) * 100);\n const [inputValue, setInputValue] = useState(String(pct));\n useEffect(() => setInputValue(String(pct)), [pct]);\n\n const submit = (e: React.FormEvent) => {\n e.preventDefault();\n const value = parseFloat(inputValue);\n if (!isNaN(value) && value > 0) stage?.zoomTo({ level: value / 100 });\n };\n\n return (\n <div className=\"relative\">\n <div className=\"bg-hover flex items-center rounded\">\n {/* editable zoom percentage */}\n <form\n onSubmit={submit}\n className=\"flex min-w-0 flex-nowrap items-center overflow-hidden whitespace-nowrap\"\n >\n <input\n name=\"zoom\"\n type=\"text\"\n inputMode=\"numeric\"\n pattern=\"\\d*\"\n aria-label=\"Set zoom\"\n className=\"h-6 w-8 min-w-0 shrink border-0 bg-transparent p-0 text-right text-sm outline-none focus:outline-none\"\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value.replace(/[^0-9]/g, ''))}\n onBlur={() => {\n if (!inputValue || parseFloat(inputValue) <= 0) setInputValue(String(pct));\n }}\n />\n <span className=\"shrink-0 text-sm\">%</span>\n </form>\n {/* zoom menu chevron */}\n <button\n type=\"button\"\n aria-haspopup=\"menu\"\n aria-expanded={menus.isOpen('zoom')}\n title=\"Zoom options\"\n className={buttonClass(false)}\n onClick={() => menus.toggle('zoom')}\n >\n <Icon name=\"chevronDown\" size={20} />\n </button>\n <button\n type=\"button\"\n title=\"Zoom out\"\n className={buttonClass(false)}\n onClick={() => commands.execute('zoom:out')}\n >\n <Icon name=\"zoomOut\" size={20} />\n </button>\n <button\n type=\"button\"\n title=\"Zoom in\"\n className={buttonClass(false)}\n onClick={() => commands.execute('zoom:in')}\n >\n <Icon name=\"zoomIn\" size={20} />\n </button>\n </div>\n {menus.isOpen('zoom') && (\n <Popover onClose={() => menus.close('zoom')}>\n <MenuBody menuId=\"zoom\" onRun={() => menus.close('zoom')} />\n </Popover>\n )}\n </div>\n );\n}\n\n/** The 'button' variant of the zoom slot — a single icon that opens the menu. */\nfunction ZoomButton() {\n const menus = useMenus();\n return (\n <span className=\"relative inline-flex\">\n <button\n type=\"button\"\n title=\"Zoom\"\n aria-haspopup=\"menu\"\n aria-expanded={menus.isOpen('zoom')}\n className={buttonClass(menus.isOpen('zoom'))}\n onClick={() => menus.toggle('zoom')}\n >\n <Icon name=\"zoomIn\" size={20} />\n </button>\n {menus.isOpen('zoom') && (\n <Popover onClose={() => menus.close('zoom')}>\n <MenuBody menuId=\"zoom\" onRun={() => menus.close('zoom')} />\n </Popover>\n )}\n </span>\n );\n}\n\n// ── a shed group's in-strip disclosure (v2's overflow-tabs-button, derived) ──\nfunction GroupTrigger({ view }: { view: GroupDisclosureView }) {\n const [open, setOpen] = useState(false);\n // The active tab may be hiding behind the chevron — hint at it, tab-style.\n const activeHidden = view.commands.some((c) => c.active);\n return (\n <span className=\"relative inline-flex\">\n <button\n type=\"button\"\n onClick={() => setOpen((o) => !o)}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n className={tabClass(activeHidden)}\n >\n <Icon name=\"chevronDown\" size={18} />\n </button>\n {open && (\n <Popover onClose={() => setOpen(false)}>\n <div className=\"min-w-44 p-1\">\n {view.commands.map((c) => (\n <button\n key={c.id}\n type=\"button\"\n role={view.role === 'tabs' ? 'menuitemradio' : 'menuitem'}\n aria-checked={view.role === 'tabs' ? c.active : undefined}\n disabled={!c.enabled}\n onClick={() => {\n view.execute(c.id);\n setOpen(false);\n }}\n className={`flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm disabled:cursor-not-allowed disabled:opacity-50 ${\n c.active ? 'bg-selected text-accent' : 'text-fg-secondary hover:bg-hover'\n }`}\n >\n {c.label}\n </button>\n ))}\n </div>\n </Popover>\n )}\n </span>\n );\n}\n\n// ── the collapsed modes group — v2's mode-select-button, 1:1 ─────────────────\nfunction CollapsedModes({ view }: { view: CollapsedGroupView }) {\n const [open, setOpen] = useState(false);\n const active = view.commands.find((c) => c.active) ?? view.commands[0];\n // v2 highlights the control whenever a non-default mode is active.\n const isActive = Boolean(active?.active && active.id !== 'mode:view');\n return (\n <div style={{ width: 100 }} className=\"relative\">\n <button\n type=\"button\"\n onClick={() => setOpen((o) => !o)}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n className=\"bg-surface hover:bg-hover flex w-full cursor-pointer appearance-none items-center rounded-md py-1.5 pl-3 pr-2 text-[13px] transition-colors\"\n >\n <span\n className={`min-w-0 flex-1 truncate text-left ${isActive ? 'text-accent' : 'text-fg'}`}\n >\n {active?.label}\n </span>\n <Icon\n name=\"chevronDown\"\n size={16}\n className={isActive ? 'text-accent' : 'text-fg-secondary'}\n />\n </button>\n {open && (\n <Popover onClose={() => setOpen(false)}>\n <div className=\"min-w-44 p-1\">\n {view.commands.map((c) => (\n <button\n key={c.id}\n type=\"button\"\n role=\"menuitemradio\"\n aria-checked={c.active}\n onClick={() => {\n view.execute(c.id);\n setOpen(false);\n }}\n className={`flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm ${\n c.active ? 'bg-selected text-accent' : 'text-fg-secondary hover:bg-hover'\n }`}\n >\n {c.label}\n </button>\n ))}\n </div>\n </Popover>\n )}\n </div>\n );\n}\n\n// ── the derived overflow menu ────────────────────────────────────────────────\nfunction OverflowMenu({ view }: { view: OverflowMenuView }) {\n const t = useT();\n if (!view.isOpen) return null;\n return (\n <Popover onClose={view.close} align=\"end\">\n <div className=\"min-w-56 p-1\">\n {view.sections.map((section, i) => (\n <div key={i}>\n {i > 0 && <div className=\"bg-border-subtle my-1 h-px\" />}\n {section.labelKey && (\n <div className=\"text-fg-muted px-2.5 pb-1 pt-1.5 text-[11px] font-semibold uppercase tracking-wide\">\n {t(section.labelKey)}\n </div>\n )}\n {section.rows.map((row) => {\n const cmd = view.resolve(row.command);\n if (!cmd) return null;\n if (row.type === 'submenu') {\n return <InlineSubmenu key={row.command} menuId={row.menu} label={cmd.label} />;\n }\n return (\n <button\n key={row.command}\n type=\"button\"\n role={section.role === 'radio' ? 'menuitemradio' : 'menuitem'}\n aria-checked={section.role === 'radio' ? cmd.active : undefined}\n disabled={!cmd.enabled}\n onClick={() => {\n view.execute(row.command);\n view.close();\n }}\n // Same blue-highlight selection as the dropdown menus — no\n // checkmark; the icon column stays the command's own icon.\n className={`flex w-full items-center gap-3 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${\n cmd.active ? 'bg-selected text-accent' : 'text-fg-secondary hover:bg-hover'\n }`}\n >\n {cmd.icon && (\n <Icon name={cmd.icon} size={16} className={cmd.active ? '' : 'text-fg-muted'} />\n )}\n <span className=\"flex-1 truncate\">{cmd.label}</span>\n </button>\n );\n })}\n </div>\n ))}\n </div>\n </Popover>\n );\n}\n\nfunction OverflowTrigger({ isOpen, toggle }: { isOpen: boolean; toggle: () => void }) {\n const t = useT();\n return (\n <button\n type=\"button\"\n onClick={toggle}\n aria-haspopup=\"menu\"\n aria-expanded={isOpen}\n title={t('demo.more')}\n className={buttonClass(isOpen)}\n >\n <Icon name=\"dots\" size={20} />\n </button>\n );\n}\n\n// ── the assembled toolbar ────────────────────────────────────────────────────\nexport function AppToolbar({ bar, className }: { bar: BarSchema; className?: string }) {\n return (\n <Toolbar\n bar={bar}\n gap={8} // v2 toolbar gap-2\n separatorWidth={1}\n className={className}\n renderCommand={(cmd, variant, run) => <CommandButton cmd={cmd} variant={variant} run={run} />}\n renderCustom={{\n 'zoom-controls': (variant) => (variant === 'inline' ? <ZoomControls /> : <ZoomButton />),\n 'quick-stamps': () => <QuickStamps />,\n }}\n renderCollapsed={(view) => (view.id === 'modes' ? <CollapsedModes view={view} /> : undefined)}\n renderGroupTrigger={(view) => <GroupTrigger view={view} />}\n renderSeparator={() => <span className=\"bg-border h-6 w-px self-center\" />}\n renderOverflowTrigger={(isOpen, toggle) => (\n <OverflowTrigger isOpen={isOpen} toggle={toggle} />\n )}\n renderOverflowMenu={(view) => <OverflowMenu view={view} />}\n />\n );\n}\n","/**\n * The configured annotation fonts (`annotations.fonts`), loaded once per\n * viewer: fetch the bytes → register them on the viewer's engine under the\n * key (what a free-text `fontFamily` carries and what the engine embeds) →\n * mount the same bytes as a `@font-face` named by that key (what the plugin's\n * `cssFontFamily` emits for a registered font, so the live editor renders the\n * face the appearance stream will bake). The style panel lists a font only\n * once BOTH have happened — an offered key always resolves on write.\n */\nimport { createContext, useContext, useEffect, useState, type ReactNode } from 'react';\nimport { useKernel } from '@embedpdf/react/runtime';\nimport { mountWebFont } from '@embedpdf/web';\nimport { useAnnotationsConfig } from '../config-context';\n\nexport interface LoadedAnnotationFont {\n readonly key: string;\n readonly label: string;\n}\n\nconst LoadedFontsContext = createContext<readonly LoadedAnnotationFont[]>([]);\n\nexport function AnnotationFontsProvider({ children }: { children: ReactNode }) {\n const kernel = useKernel();\n const { fonts } = useAnnotationsConfig();\n const [loaded, setLoaded] = useState<readonly LoadedAnnotationFont[]>([]);\n\n useEffect(() => {\n const engineFonts = kernel.engine.fonts;\n // The cloud engine registers no fonts (a server policy), so a key could\n // never resolve on write: offer nothing rather than a font that fails.\n if (!fonts?.length || !engineFonts) return;\n let cancelled = false;\n const unmounts: Array<() => void> = [];\n void (async () => {\n for (const font of fonts) {\n try {\n const response = await fetch(font.url);\n if (!response.ok) throw new Error(`${font.url}: HTTP ${response.status}`);\n const bytes = new Uint8Array(await response.arrayBuffer());\n if (cancelled) return;\n await engineFonts.register({\n key: font.key,\n familyName: font.familyName,\n weight: font.weight,\n italic: font.italic,\n data: bytes,\n });\n const unmount = await mountWebFont(font.key, bytes, {\n weight: font.weight,\n style: font.italic ? 'italic' : 'normal',\n });\n if (cancelled) {\n unmount();\n return;\n }\n unmounts.push(unmount);\n setLoaded((prev) =>\n prev.some((f) => f.key === font.key)\n ? prev\n : [...prev, { key: font.key, label: font.label }],\n );\n } catch (error) {\n console.warn(`[embedpdf] annotation font \"${font.key}\" was not loaded:`, error);\n }\n }\n })();\n return () => {\n cancelled = true;\n for (const unmount of unmounts) unmount();\n };\n }, [kernel, fonts]);\n\n return <LoadedFontsContext.Provider value={loaded}>{children}</LoadedFontsContext.Provider>;\n}\n\n/** The configured fonts that are registered AND mounted, in config order. */\nexport function useAnnotationFonts(): readonly LoadedAnnotationFont[] {\n return useContext(LoadedFontsContext);\n}\n","/**\n * The link editor POPOVER — v2's \"add a link\" popup, reborn. It rides the\n * SAME selection anchor as the action strip (`<AnnotationMenu>` solves\n * WHERE), opening from the strip's link icon (`annotation:link` toggles the\n * `link-editor` shell surface) and rendering IN PLACE of the strip while\n * open — one anchored card at a time.\n *\n * Reads the selection's current target from selection props (the `linkOf`\n * lens — parents derive from their committed child annotations) and writes\n * through the ONE `updateSelection({ link })` path; the plugin's reconciler\n * materializes/retargets the attached children. Links are a VERB on the\n * selection, not a style — which is why this is a popover, not a sidebar\n * section.\n */\nimport { useState, type ReactNode } from 'react';\nimport { useAnnotation, useSelectionProps } from '@embedpdf/react/annotation';\nimport type { PdfLinkTarget } from '@embedpdf/react/link';\nimport { useKernel } from '@embedpdf/react/runtime';\nimport { useT } from '@embedpdf/react/i18n';\nimport { Icon } from './icons';\n\nfunction ModeToggle({\n active,\n title,\n onClick,\n children,\n}: {\n active: boolean;\n title: string;\n onClick: () => void;\n children: ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n title={title}\n onClick={onClick}\n className={`rounded border px-2.5 py-1 text-xs font-medium transition-colors ${\n active\n ? 'border-accent bg-accent text-on-accent'\n : 'border-border bg-surface text-fg hover:bg-hover'\n }`}\n >\n {children}\n </button>\n );\n}\n\nexport function LinkEditorCard({ onClose }: { onClose: () => void }) {\n const t = useT();\n const kernel = useKernel();\n const anno = useAnnotation();\n const props = useSelectionProps();\n const value = (props.values.link ?? null) as PdfLinkTarget | null;\n const [mode, setMode] = useState<'uri' | 'page'>(value?.kind === 'goto' ? 'page' : 'uri');\n const [uri, setUri] = useState(value?.kind === 'uri' ? value.uri : '');\n const [pageNo, setPageNo] = useState('1');\n\n const apply = () => {\n if (mode === 'uri') {\n const trimmed = uri.trim();\n if (!trimmed) return;\n anno.updateSelection({ link: { kind: 'uri', uri: trimmed } });\n onClose();\n return;\n }\n // Page number (1-based) → the page's OBJECT NUMBER (stable across moves).\n const activeId = kernel.documents.activeId();\n const meta = activeId ? kernel.getState().core.documents[activeId] : null;\n const layout = meta?.pages[Math.max(0, Number(pageNo) - 1)];\n if (!layout) return;\n anno.updateSelection({\n link: { kind: 'goto', destination: { kind: 'fit', pageObjectNumber: layout.pageObjectNumber } },\n });\n onClose();\n };\n\n const inputCls =\n 'border-border bg-surface text-fg focus:border-accent w-full rounded border px-2.5 py-1.5 text-sm outline-none';\n return (\n <div className=\"border-border bg-surface w-64 rounded-lg border p-3 shadow-lg\">\n <div className=\"mb-2 flex items-center justify-between\">\n <span className=\"text-fg text-sm font-semibold\">{t('commands.annotate.link')}</span>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"text-fg-muted hover:bg-hover grid h-6 w-6 place-items-center rounded\"\n >\n <Icon name=\"x\" size={14} />\n </button>\n </div>\n <div className=\"mb-2 flex gap-1.5\">\n <ModeToggle title=\"Link to a URL\" active={mode === 'uri'} onClick={() => setMode('uri')}>\n URL\n </ModeToggle>\n <ModeToggle title=\"Link to a page\" active={mode === 'page'} onClick={() => setMode('page')}>\n Page\n </ModeToggle>\n </div>\n {mode === 'uri' ? (\n <input\n type=\"url\"\n className={inputCls}\n placeholder=\"https://…\"\n autoFocus\n value={uri}\n onChange={(e) => setUri(e.target.value)}\n onKeyDown={(e) => e.key === 'Enter' && apply()}\n />\n ) : (\n <input\n type=\"number\"\n min={1}\n className={inputCls}\n placeholder=\"Page number\"\n autoFocus\n value={pageNo}\n onChange={(e) => setPageNo(e.target.value)}\n onKeyDown={(e) => e.key === 'Enter' && apply()}\n />\n )}\n <button\n type=\"button\"\n className=\"bg-accent text-on-accent mt-2.5 w-full rounded px-2 py-1.5 text-sm font-medium\"\n onClick={apply}\n >\n {value == null ? 'Add link' : 'Update link'}\n </button>\n </div>\n );\n}\n","/**\n * The floating strip's PIXELS, shared by every contextual strip (annotation\n * selection, text selection, …): a rounded toolbar of command buttons with\n * derived group separators. The WHERE is each strip's menu component\n * (`<AnnotationMenu>`, `<SelectionMenu>`); the WHICH is the commands'\n * `visible`/`enabled` derivations via `useStripView`. This file only draws.\n */\nimport { Fragment } from 'react';\nimport type { ResolvedCommand } from '@embedpdf/react/commands';\nimport type { useStripView } from '@embedpdf/react/toolbar';\nimport { buttonClass } from './toolbar';\nimport { Icon } from './icons';\n\nfunction StripButton({ cmd, run }: { cmd: ResolvedCommand; run: () => void }) {\n return (\n <button\n type=\"button\"\n onClick={run}\n disabled={!cmd.enabled}\n aria-pressed={cmd.active || undefined}\n aria-label={cmd.label}\n title={cmd.label}\n className={buttonClass(cmd.active, cmd.enabled)}\n >\n {cmd.icon && <Icon name={cmd.icon} size={20} accent={cmd.iconAccent} />}\n </button>\n );\n}\n\nexport function StripBar({\n view,\n label,\n}: {\n view: NonNullable<ReturnType<typeof useStripView>>;\n label: string;\n}) {\n return (\n <div\n role=\"toolbar\"\n aria-label={label}\n className=\"border-border-subtle bg-elevated flex items-center gap-1 rounded-lg border p-1 shadow-xl\"\n >\n {view.groups.map((g, i) => (\n <Fragment key={g.id}>\n {i > 0 && <span aria-hidden className=\"bg-border h-5 w-px\" />}\n {g.commands.map((cmd) => (\n <StripButton key={cmd.id} cmd={cmd} run={() => view.execute(cmd.id)} />\n ))}\n </Fragment>\n ))}\n </div>\n );\n}\n","/**\n * The ANNOTATION-selection floating strip:\n *\n * config/chrome.ts `strips.annotation` declares WHAT may appear\n * each command's visible/enabled decides WHICH items show\n * <AnnotationMenu> solves WHERE (camera transform,\n * rotate-knob dodging, pointer isolation)\n *\n * useStripView is the live intersection: hidden commands drop out, empty\n * groups vanish, null when nothing applies. Mounted in the Stage `overlay`\n * slot. The pixels are the shared <StripBar>.\n */\nimport { useEffect } from 'react';\nimport { AnnotationMenu } from '@embedpdf/react/annotation-menu';\nimport { useAnnotationSelection } from '@embedpdf/react/annotation';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { useStripView } from '@embedpdf/react/toolbar';\nimport { useT } from '@embedpdf/react/i18n';\nimport { useStripSchema } from '../config-context';\nimport { LinkEditorCard } from './link-editor';\nimport { StripBar } from './strip-bar';\n\nexport function AnnotationStrip() {\n const t = useT();\n const view = useStripView(useStripSchema('annotation'));\n // The link editor popover rides the SAME anchor and REPLACES the strip\n // while open — one anchored card at a time (v2's popup, on the projector).\n const editor = useSurface('link-editor');\n const selection = useAnnotationSelection();\n // A stale editor never outlives its selection.\n useEffect(() => {\n if (!selection.length && editor.isOpen) editor.close();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selection.length, editor.isOpen]);\n if (!view) return null;\n return (\n <AnnotationMenu placement=\"bottom\" gap={15}>\n {editor.isOpen ? (\n <LinkEditorCard onClose={editor.close} />\n ) : (\n <StripBar view={view} label={t('commands.annotate.strip')} />\n )}\n </AnnotationMenu>\n );\n}\n","/**\n * The TEXT-SELECTION floating strip:\n *\n * config/chrome.ts `strips.selection` declares WHAT may appear\n * each command's visible/enabled decides WHICH items show\n * <SelectionMenu> solves WHERE (settles on pointer-up,\n * camera transform, pointer isolation)\n *\n * `useStripView` is the live intersection: with copy denied (no\n * doc.text.copy) every command drops out and this renders nothing — no\n * empty bubble. Mounted in the Stage `overlay` slot.\n */\nimport { SelectionMenu } from '@embedpdf/react/selection';\nimport { useStripView } from '@embedpdf/react/toolbar';\nimport { useT } from '@embedpdf/react/i18n';\nimport { useStripSchema } from '../config-context';\nimport { StripBar } from './strip-bar';\n\nexport function SelectionStrip() {\n const t = useT();\n const view = useStripView(useStripSchema('selection'));\n if (!view) return null;\n return (\n <SelectionMenu placement=\"bottom\" gap={12}>\n <StripBar view={view} label={t('commands.selection.strip')} />\n </SelectionMenu>\n );\n}\n","/**\n * The document tab bar — a 1:1 port of v2's tab-bar.tsx\n * (viewers/snippet/src/components/tab-bar.tsx): rounded-top tabs on the\n * surface-alt strip, the active tab merging into the toolbar surface below,\n * close-× on the active tab, and a + button opening a real file dialog.\n *\n * v2 needed a DocumentManager capability; here the kernel's document registry\n * (useDocuments) already is the tab model — open/close/setActive, reactive.\n */\nimport { useRef } from 'react';\nimport { useDocuments } from '@embedpdf/react/runtime';\nimport type { OpenInput } from '@embedpdf/react/runtime';\nimport { Icon } from './icons';\n\nexport type TabBarVisibility = 'always' | 'multiple' | 'never';\n\nexport function TabBar({\n visibility = 'always',\n allowOpenFile = true,\n}: {\n visibility?: TabBarVisibility;\n allowOpenFile?: boolean;\n}) {\n const { docs, activeId, setActive, close, open } = useDocuments();\n const fileInput = useRef<HTMLInputElement>(null);\n\n const shouldShow = visibility === 'always' || (visibility === 'multiple' && docs.length > 1);\n if (!shouldShow) return null;\n\n const openFile = async (file: File) => {\n const bytes = new Uint8Array(await file.arrayBuffer());\n const source: OpenInput = { kind: 'bytes', id: `${file.name}-${Date.now()}`, bytes };\n await open(source, { name: file.name });\n };\n\n return (\n <div className=\"bg-surface-alt flex items-end pr-2 pt-2\">\n <div className=\"flex flex-1 items-end overflow-x-auto pl-4\">\n {docs.map((doc) => {\n const isActive = activeId === doc.id;\n return (\n <div\n key={doc.id}\n onClick={() => setActive(doc.id)}\n role=\"tab\"\n part={isActive ? 'tab tab-active' : 'tab'}\n tabIndex={0}\n aria-selected={isActive}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n setActive(doc.id);\n }\n }}\n className={`group relative flex min-w-[120px] max-w-[240px] cursor-pointer items-center gap-2 rounded-t-lg px-4 py-2 text-sm font-medium transition-all ${\n isActive\n ? 'bg-surface text-fg z-10'\n : 'bg-surface-alt text-fg-secondary hover:bg-hover hover:text-fg'\n }`}\n >\n {/* lifecycle glyphs — the tab exists from the moment open()\n was called; these show what its document is doing */}\n {doc.status === 'loading' && (\n <span\n className=\"border-border-subtle border-t-accent h-3 w-3 flex-shrink-0 animate-spin rounded-full border\"\n aria-label=\"Loading\"\n />\n )}\n {doc.status === 'locked' && (\n <Icon name=\"lock\" size={13} className=\"text-fg-muted flex-shrink-0\" />\n )}\n {doc.status === 'error' && (\n <Icon name=\"alertTriangle\" size={13} className=\"flex-shrink-0 text-red-500\" />\n )}\n <span className=\"min-w-0 flex-1 truncate\">\n {doc.name ?? `Document ${doc.id.slice(0, 8)}`}\n </span>\n\n {/* close — on the active tab, and never the last document\n (an empty workspace is designable, but not this demo's goal) */}\n {isActive && docs.length > 1 && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n void close(doc.id);\n }}\n aria-label={`Close ${doc.name ?? 'document'}`}\n className=\"hover:bg-hover flex-shrink-0 cursor-pointer rounded-full p-1 opacity-100 transition-all\"\n >\n <Icon name=\"x\" size={14} />\n </button>\n )}\n </div>\n );\n })}\n\n {allowOpenFile && (\n <>\n <button\n type=\"button\"\n onClick={() => fileInput.current?.click()}\n aria-label=\"Open File\"\n title=\"Open File\"\n className=\"text-fg-secondary hover:bg-hover hover:text-fg mb-1.5 ml-1 flex-shrink-0 cursor-pointer rounded p-1.5 transition-colors\"\n >\n <Icon name=\"plus\" size={14} />\n </button>\n <input\n ref={fileInput}\n type=\"file\"\n accept=\".pdf,application/pdf\"\n className=\"hidden\"\n onChange={(e) => {\n const file = e.target.files?.[0];\n if (file) void openFile(file);\n e.target.value = '';\n }}\n />\n </>\n )}\n </div>\n </div>\n );\n}\n","/**\n * THIS viewer's armed-tool cursor: the toolbar's own icon riding the pointer\n * as a real CSS cursor (OS-composited — zero lag, unlike any DOM follower).\n * The library owns arbitration (unmapped hover claims win, page gaps fall\n * back to the arrow — see `useToolCursor`); this module only decides what the\n * cursor LOOKS like. It reuses the SAME icon set and the SAME accent\n * derivation as the toolbar buttons (TOOL_ICONS is recorded by the command\n * definitions), so the cursor is pixel-identical to the button the user just\n * pressed — recolor the tool and both follow. A tool without a command icon\n * keeps its declared keyword cursor.\n *\n * ONE table decides the shape ({@link GLYPHS}): cursor KEYWORDS are the\n * affordances — a tool declares its base ('crosshair' to draw, 'copy' to\n * place), the selection handler claims 'text' over text — and each mapped\n * keyword is redrawn as its glyph + the tool's icon. Keywords the table omits\n * stay native: a markup tool's 'default' base is the bare arrow (identity\n * appears exactly where the action is possible — over text), a foreign 'move'\n * over an annotation drops the icon. A new tool gets the right cursor from\n * what it declares; nothing tool-specific lives here.\n *\n * The image: a white-haloed glyph at the hotspot (readable on any page color)\n * with the icon at its top right — 40px, under the 128px cursor ceiling;\n * Chromium may briefly show the default arrow when a >32px cursor would\n * overlap browser UI (anti-spoofing), which is fine mid-viewport.\n */\nimport { useToolCursor, useTool } from '@embedpdf/react/interaction';\nimport { useAnnotationDefaults } from '@embedpdf/react/annotation';\nimport { TOOL_ICONS } from '../config/commands';\nimport { ICON_PATHS } from './icons';\nimport type { IconAccent } from './icons';\n\nconst SIZE = 40;\nconst HOTSPOT = { x: 8, y: 28 };\nconst INK = '#1a1a1a';\nconst HALO = '#ffffff';\n/** The drag-and-drop \"will place a copy\" green (Chrome's DnD badge). */\nconst PLACE_GREEN = '#34a853';\n\n/** The icon's paths as SVG markup — the string twin of `<Icon>`'s render loop\n * (same fill/stroke slot rules), with a white halo pass underneath so the\n * glyph stays readable over page content. */\nfunction iconGlyph(name: string, accent?: IconAccent): string | null {\n const paths = ICON_PATHS[name];\n if (!paths) return null;\n const halo: string[] = [];\n const draw: string[] = [];\n for (const p of paths) {\n const spec = typeof p === 'string' ? { d: p, fill: undefined, stroke: undefined } : p;\n // Slot rules, mirrored from <Icon>: a fill slot paints from the accent\n // (nothing without one), a stroke slot falls back to the ink, and a\n // fill-only path never gets an outline.\n const fill = spec.fill === true ? INK : spec.fill ? accent?.[spec.fill] : undefined;\n const stroke = spec.stroke ? (accent?.[spec.stroke] ?? INK) : spec.fill ? 'none' : INK;\n halo.push(`<path d=\"${spec.d}\" fill=\"none\" stroke=\"${HALO}\" stroke-width=\"3.5\"/>`);\n draw.push(`<path d=\"${spec.d}\" fill=\"${fill ?? 'none'}\" stroke=\"${stroke}\"/>`);\n }\n return halo.join('') + draw.join('');\n}\n\n/** The action glyph drawn at the hotspot: what a click DOES here. */\ntype Glyph = 'crosshair' | 'ibeam' | 'plus';\n\nconst haloed = (x1: number, y1: number, x2: number, y2: number): string =>\n `<line x1=\"${x1}\" y1=\"${y1}\" x2=\"${x2}\" y2=\"${y2}\" stroke=\"${HALO}\" stroke-width=\"3\"/>` +\n `<line x1=\"${x1}\" y1=\"${y1}\" x2=\"${x2}\" y2=\"${y2}\" stroke=\"${INK}\" stroke-width=\"1.25\"/>`;\n\nfunction actionGlyph(glyph: Glyph): string {\n const { x, y } = HOTSPOT;\n if (glyph === 'crosshair') {\n return haloed(x, y - 6, x, y + 6) + haloed(x - 6, y, x + 6, y);\n }\n if (glyph === 'ibeam') {\n return (\n haloed(x, y - 6.5, x, y + 6.5) +\n haloed(x - 2.5, y - 6.5, x + 2.5, y - 6.5) +\n haloed(x - 2.5, y + 6.5, x + 2.5, y + 6.5)\n );\n }\n // plus: the DnD copy affordance — green disc, white plus.\n return (\n `<circle cx=\"${x}\" cy=\"${y}\" r=\"7.5\" fill=\"${PLACE_GREEN}\" stroke=\"${HALO}\" stroke-width=\"1.5\"/>` +\n `<line x1=\"${x}\" y1=\"${y - 3.5}\" x2=\"${x}\" y2=\"${y + 3.5}\" stroke=\"${HALO}\" stroke-width=\"2\"/>` +\n `<line x1=\"${x - 3.5}\" y1=\"${y}\" x2=\"${x + 3.5}\" y2=\"${y}\" stroke=\"${HALO}\" stroke-width=\"2\"/>`\n );\n}\n\nfunction cursorSvg(glyph: Glyph, icon: string, accent?: IconAccent): string {\n const g = iconGlyph(icon, accent);\n return (\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${SIZE}\" height=\"${SIZE}\" ` +\n `viewBox=\"0 0 ${SIZE} ${SIZE}\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">` +\n actionGlyph(glyph) +\n (g\n ? `<g transform=\"translate(17 3) scale(${(20 / 24).toFixed(4)})\" stroke-width=\"2\">${g}</g>`\n : '') +\n `</svg>`\n );\n}\n\n/** keyword → glyph: how each affordance is drawn when a tool icon rides\n * along. Draw tools declare 'crosshair', place tools (stamp/signature/image)\n * declare 'copy', and the selection handler claims 'text' over text — which\n * keywords ever SHOW is decided by those declarations and claims, never\n * here. 'default' is deliberately absent: the bare arrow means \"no action\n * here\", so it never carries an icon. */\nconst GLYPHS: Record<string, Glyph> = {\n crosshair: 'crosshair',\n text: 'ibeam',\n copy: 'plus',\n};\n\n/** Mount once (renders nothing): keeps the armed tool's cursor skin in sync\n * with its toolbar icon + live defaults. */\nexport function ArmedToolCursor() {\n const { activeToolId } = useTool();\n // Live accent: a `setDefaults` recolor re-renders us and rebuilds the cursor.\n const d = useAnnotationDefaults(activeToolId);\n const entry = TOOL_ICONS[activeToolId];\n const accent = entry?.accent\n ? {\n primary: d[entry.accent.primary] ?? undefined,\n secondary: entry.accent.secondary ? (d[entry.accent.secondary] ?? undefined) : undefined,\n }\n : undefined;\n useToolCursor(\n entry\n ? {\n toolId: activeToolId,\n cursors: Object.fromEntries(\n Object.entries(GLYPHS).map(([keyword, glyph]) => [\n keyword,\n { svg: cursorSvg(glyph, entry.icon, accent), hotspot: HOTSPOT },\n ]),\n ),\n }\n : null,\n );\n return null;\n}\n","/**\n * The annotation FLAGS section — a live test surface for `/F` (ISO 32000\n * Table 167). Select any annotation(s) and toggle flags; the writes go through\n * the plugin's `updateSelectionFlags` (optimistic, flags-only engine patch),\n * and the reads come from `useSelectionFlags` (per-flag value, `null` when the\n * selection disagrees → indeterminate checkbox).\n *\n * Things to try:\n * - `locked`: the selection keeps its outline but loses handles/knob; move,\n * restyle and delete are refused; unchecking it here still works.\n * - `hidden` / `noView`: the annotation disappears (it stays selected, so\n * this panel can bring it back).\n * - `readOnly`: visible but no longer clickable — deselect and try.\n * - `noZoom` / `noRotate`: zoom or rotate the page; the body keeps its\n * screen size / stays upright, anchored at its top-left corner.\n * - `print`: flip it off and print/flatten elsewhere — the annotation is\n * excluded (viewer rendering is unaffected).\n */\nimport { useAnnotation, useSelectionFlags, type AnnotationFlags } from '@embedpdf/react/annotation';\nimport { useEffect, useRef } from 'react';\n\nconst FLAG_ROWS: { key: keyof AnnotationFlags; label: string; hint: string }[] = [\n { key: 'print', label: 'Print', hint: 'Include when the page is printed' },\n { key: 'hidden', label: 'Hidden', hint: 'Gone everywhere: screen, clicks, print' },\n { key: 'noView', label: 'No view', hint: 'Hidden on screen, may still print' },\n {\n key: 'toggleNoView',\n label: 'Toggle no view',\n hint: 'Reveal a no-view annotation while selected',\n },\n { key: 'readOnly', label: 'Read only', hint: 'Visible but not clickable' },\n { key: 'locked', label: 'Locked', hint: 'No move / resize / delete / restyle' },\n { key: 'lockedContents', label: 'Locked contents', hint: 'Text cannot change; geometry can' },\n { key: 'noZoom', label: 'No zoom', hint: 'Screen-constant size (anchored top-left)' },\n { key: 'noRotate', label: 'No rotate', hint: 'Stays upright when the page rotates' },\n { key: 'invisible', label: 'Invisible', hint: 'Legacy: hide unknown subtypes' },\n];\n\nfunction FlagRow({\n label,\n hint,\n value,\n onToggle,\n}: {\n label: string;\n hint: string;\n value: boolean | null;\n onToggle: (next: boolean) => void;\n}) {\n const ref = useRef<HTMLInputElement>(null);\n // `null` = the selected annotations disagree → the native indeterminate state.\n useEffect(() => {\n if (ref.current) ref.current.indeterminate = value === null;\n }, [value]);\n return (\n <label className=\"hover:bg-hover flex cursor-pointer items-start gap-2.5 rounded px-1.5 py-1.5\">\n <input\n ref={ref}\n type=\"checkbox\"\n className=\"accent-accent mt-0.5\"\n checked={value === true}\n onChange={() => onToggle(value !== true)}\n />\n <span className=\"min-w-0\">\n <span className=\"text-fg block text-sm leading-tight\">{label}</span>\n <span className=\"text-fg-muted block text-xs leading-tight\">{hint}</span>\n </span>\n </label>\n );\n}\n\n/** The `/F` flags of the current selection, live-editable. Renders nothing\n * when nothing is selected (the style panel shows its tool defaults then). */\nexport function AnnotationFlagsSection() {\n const annotation = useAnnotation();\n const flags = useSelectionFlags();\n if (!flags) return null;\n return (\n <section className=\"border-border mt-2 border-t pt-4\">\n <p className=\"text-fg-muted mb-2 text-[11px] font-semibold uppercase tracking-wide\">\n Flags (/F)\n </p>\n <div className=\"flex flex-col\">\n {FLAG_ROWS.map((row) => (\n <FlagRow\n key={row.key}\n label={row.label}\n hint={row.hint}\n value={flags[row.key]}\n onToggle={(next) => annotation.updateSelectionFlags({ [row.key]: next })}\n />\n ))}\n </div>\n </section>\n );\n}\n","/**\n * The annotation style panel — the v2 snippet's style sidebar, rebuilt the v3\n * way. The plugin owns the schema AND the state; this file owns only how each\n * PropSpec renders and the flat patch it writes back. There is NO per-subtype\n * branching here: a new annotation kind that declares its `PropSpec[]` in the\n * kind table gets a working style panel for free.\n *\n * Data flow (mirrors examples/react's AnnotationSidebar):\n * selection present → useSelectionProps() specs/values, write updateSelection()\n * nothing selected → propsForTool(tool) specs + useAnnotationDefaults(tool)\n * values, write setDefaults(tool, …)\n *\n * The look is ported 1:1 from viewers/snippet's annotation-sidebar (six-column\n * swatch grid, range slider, SVG stroke / line-ending dropdowns, font-size\n * combo, align toggles), retinted from v2's `bg-bg-input`/`text-fg-primary`\n * tokens to this app's semantic ones (bg-surface / text-fg / border-border …).\n */\nimport { useEffect, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport {\n useAnnotation,\n useSelectionProps,\n useAnnotationDefaults,\n useAnnotationSelected,\n type PropKey,\n type PropSpec,\n type AnnotationPropsPatch,\n type Border,\n type BlendMode,\n type LineEnding,\n type LineEndings,\n type TextAlign,\n} from '@embedpdf/react/annotation';\nimport { useTool } from '@embedpdf/react/interaction';\nimport { useOptionalCapability } from '@embedpdf/react/runtime';\nimport { RedactionToken } from '@embedpdf/react/redaction';\nimport { useT } from '@embedpdf/react/i18n';\nimport { Icon } from './icons';\nimport { useAnnotationFonts } from './annotation-fonts';\nimport { AnnotationFlagsSection } from './annotation-flags';\n\n// ── app-level vocabulary (a viewer's decision, like v2's color presets) ──────\n// The engine schema says WHICH controls to show; these lists say what the app\n// offers inside a color / font / stroke picker.\nconst PRESET_COLORS = [\n '#000000',\n '#5f6368',\n '#e44234',\n '#ff8b00',\n '#ffd500',\n '#00cc66',\n '#00b8d9',\n '#4a90e2',\n '#9b51e0',\n '#f272c8',\n '#a0522d',\n '#ffffff',\n];\n\nconst FONT_OPTIONS: { v: string; label: string }[] = [\n { v: 'helvetica', label: 'Helvetica' },\n { v: 'helvetica-bold', label: 'Helvetica Bold' },\n { v: 'times-roman', label: 'Times Roman' },\n { v: 'courier', label: 'Courier' },\n];\n\nconst FONT_SIZES = [8, 9, 10, 11, 12, 14, 16, 18, 24, 36, 48, 72];\n\nconst BORDER_OPTS: { key: string; make: () => Border }[] = [\n { key: 'solid', make: () => ({ kind: 'solid' }) },\n { key: 'dashed-6-2', make: () => ({ kind: 'dashed', dash: [6, 2] }) },\n { key: 'dashed-3-3', make: () => ({ kind: 'dashed', dash: [3, 3] }) },\n { key: 'dashed-1-2', make: () => ({ kind: 'dashed', dash: [1, 2] }) },\n { key: 'cloudy-1', make: () => ({ kind: 'cloudy', intensity: 1 }) },\n { key: 'cloudy-2', make: () => ({ kind: 'cloudy', intensity: 2 }) },\n];\nconst borderKey = (b: Border): string =>\n b.kind === 'cloudy'\n ? `cloudy-${b.intensity >= 2 ? 2 : 1}`\n : b.kind === 'dashed'\n ? `dashed-${b.dash.join('-')}`\n : 'solid';\n\nconst LINE_ENDINGS: { v: LineEnding; label: string }[] = [\n { v: 'none', label: 'None' },\n { v: 'open-arrow', label: 'Open arrow' },\n { v: 'closed-arrow', label: 'Closed arrow' },\n { v: 'r-open-arrow', label: 'Reverse open' },\n { v: 'r-closed-arrow', label: 'Reverse closed' },\n { v: 'circle', label: 'Circle' },\n { v: 'square', label: 'Square' },\n { v: 'diamond', label: 'Diamond' },\n { v: 'butt', label: 'Butt' },\n { v: 'slash', label: 'Slash' },\n];\n\nconst BLEND_MODES: { v: BlendMode; label: string }[] = [\n { v: 'normal', label: 'Normal' },\n { v: 'multiply', label: 'Multiply' },\n { v: 'screen', label: 'Screen' },\n { v: 'overlay', label: 'Overlay' },\n { v: 'darken', label: 'Darken' },\n { v: 'lighten', label: 'Lighten' },\n { v: 'color-dodge', label: 'Color Dodge' },\n { v: 'color-burn', label: 'Color Burn' },\n { v: 'hard-light', label: 'Hard Light' },\n { v: 'soft-light', label: 'Soft Light' },\n { v: 'difference', label: 'Difference' },\n { v: 'exclusion', label: 'Exclusion' },\n { v: 'hue', label: 'Hue' },\n { v: 'saturation', label: 'Saturation' },\n { v: 'color', label: 'Color' },\n { v: 'luminosity', label: 'Luminosity' },\n];\n\n// ── layout primitives ────────────────────────────────────────────────────────\nfunction Field({\n label,\n mixed,\n children,\n}: {\n label: string;\n mixed?: boolean;\n children: ReactNode;\n}) {\n return (\n <section className=\"mb-5\">\n <label className=\"text-fg mb-2 block text-sm font-medium\">\n {label}\n {mixed && <span className=\"text-fg-muted ml-1.5 text-xs font-normal\">(mixed)</span>}\n </label>\n {children}\n </section>\n );\n}\n\n// ── color swatch grid ────────────────────────────────────────────────────────\nconst isTransparent = (c: string | null) =>\n c == null ||\n c === 'transparent' ||\n (/^#([0-9a-f]{8})$/i.test(c) && c.slice(-2).toLowerCase() === '00');\n\nfunction Swatch({\n color,\n active,\n onSelect,\n}: {\n color: string;\n active: boolean;\n onSelect: (c: string) => void;\n}) {\n const style = isTransparent(color)\n ? {\n backgroundColor: '#fff',\n backgroundImage:\n 'linear-gradient(45deg, transparent 40%, #ef4444 40%, #ef4444 60%, transparent 60%)',\n backgroundSize: '100% 100%',\n }\n : { backgroundColor: color };\n return (\n <button\n type=\"button\"\n title={color}\n onClick={() => onSelect(color)}\n className={`border-border-strong h-5 w-5 rounded-full border ${active ? 'outline-accent outline outline-2 outline-offset-2' : ''}`}\n style={style}\n />\n );\n}\n\nfunction SwatchGrid({\n value,\n onSelect,\n allowTransparent,\n}: {\n value: string | null | undefined;\n onSelect: (c: string) => void;\n allowTransparent?: boolean;\n}) {\n const active = (c: string) => c.toLowerCase() === (value ?? '').toLowerCase();\n return (\n <div className=\"grid grid-cols-6 gap-x-1 gap-y-3\">\n {PRESET_COLORS.map((c) => (\n <Swatch key={c} color={c} active={active(c)} onSelect={onSelect} />\n ))}\n {allowTransparent && (\n <Swatch color=\"transparent\" active={isTransparent(value ?? null)} onSelect={onSelect} />\n )}\n </div>\n );\n}\n\n// ── range slider ─────────────────────────────────────────────────────────────\nfunction RangeSlider({\n value,\n min,\n max,\n step,\n onChange,\n}: {\n value: number;\n min: number;\n max: number;\n step: number;\n onChange: (n: number) => void;\n}) {\n return (\n <input\n type=\"range\"\n className=\"accent-accent mb-1.5 h-1 w-full cursor-pointer\"\n value={value}\n min={min}\n max={max}\n step={step}\n onChange={(e) => onChange(parseFloat(e.target.value))}\n />\n );\n}\n\n// ── dropdown shell (open state, outside-click, trigger + panel) ───────────────\nfunction useOutsideClose(open: boolean, close: () => void) {\n const rootRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (!open) return;\n const onDoc = (e: MouseEvent) => {\n // composedPath, NOT contains(e.target): at the document level an event\n // from inside the viewer's shadow root retargets to the host element, so\n // contains() reads every inside click as outside and unmounts the panel\n // on mousedown — before the option's click can fire.\n if (rootRef.current && !e.composedPath().includes(rootRef.current)) close();\n };\n document.addEventListener('mousedown', onDoc);\n return () => document.removeEventListener('mousedown', onDoc);\n }, [open, close]);\n return rootRef;\n}\n\nfunction DropdownShell({\n trigger,\n children,\n}: {\n trigger: ReactNode;\n children: (close: () => void) => ReactNode;\n}) {\n const [open, setOpen] = useState(false);\n const rootRef = useOutsideClose(open, () => setOpen(false));\n return (\n <div ref={rootRef} className=\"relative w-full\">\n <button\n type=\"button\"\n onClick={() => setOpen((o) => !o)}\n className=\"border-border bg-surface text-fg flex w-full items-center justify-between gap-2 rounded border px-3 py-1.5\"\n >\n {trigger}\n <Icon name=\"chevronDown\" size={16} className=\"text-fg-secondary shrink-0\" />\n </button>\n {open && (\n <div className=\"border-border bg-elevated absolute z-10 mt-1 max-h-60 w-full overflow-y-auto rounded border p-1 shadow-lg\">\n {children(() => setOpen(false))}\n </div>\n )}\n </div>\n );\n}\n\nfunction OptionRow({\n selected,\n onClick,\n children,\n}: {\n selected: boolean;\n onClick: () => void;\n children: ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={`hover:bg-hover flex w-full items-center rounded px-2 py-1.5 text-left text-sm ${selected ? 'bg-selected text-accent' : 'text-fg'}`}\n >\n {children}\n </button>\n );\n}\n\n// ── stroke / border preview + picker ─────────────────────────────────────────\nfunction borderSvg(b: Border): ReactNode {\n if (b.kind === 'cloudy') {\n const r = b.intensity >= 2 ? 5 : 3;\n const n = Math.ceil(80 / (r * 2));\n const step = 80 / n;\n const baseline = r + 1;\n const viewH = r * 2 + 2;\n const parts = [`M 0 ${baseline}`];\n for (let i = 0; i < n; i++) parts.push(`A ${r} ${r} 0 0 1 ${step * (i + 1)} ${baseline}`);\n return (\n <svg width=\"80\" height={viewH} viewBox={`0 0 80 ${viewH}`}>\n <path\n d={parts.join(' ')}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n }\n const dash = b.kind === 'dashed' ? b.dash.join(' ') : undefined;\n return (\n <svg width=\"80\" height=\"8\" viewBox=\"0 0 80 8\">\n <line\n x1=\"0\"\n y1=\"4\"\n x2=\"80\"\n y2=\"4\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeDasharray={dash}\n />\n </svg>\n );\n}\n\nfunction BorderSelect({\n value,\n cloudy,\n onChange,\n}: {\n value: Border;\n cloudy: boolean;\n onChange: (b: Border) => void;\n}) {\n const opts = cloudy ? BORDER_OPTS : BORDER_OPTS.filter((o) => !o.key.startsWith('cloudy'));\n return (\n <DropdownShell trigger={<span className=\"text-fg-secondary\">{borderSvg(value)}</span>}>\n {(close) =>\n opts.map((o) => {\n const b = o.make();\n return (\n <OptionRow\n key={o.key}\n selected={borderKey(value) === o.key}\n onClick={() => {\n onChange(b);\n close();\n }}\n >\n <span className=\"text-fg-secondary\">{borderSvg(b)}</span>\n </OptionRow>\n );\n })\n }\n </DropdownShell>\n );\n}\n\n// ── line-ending preview + picker ─────────────────────────────────────────────\nconst LE_MARKERS: Partial<Record<LineEnding, ReactNode>> = {\n square: <path d=\"M68 -4 L76 -4 L76 4 L68 4 Z\" />,\n circle: <circle cx=\"72\" cy=\"0\" r=\"4\" />,\n diamond: <path d=\"M72 -5 L77 0 L72 5 L67 0 Z\" />,\n 'open-arrow': <path d=\"M67 -5 L77 0 L67 5\" fill=\"none\" />,\n 'closed-arrow': <path d=\"M67 -5 L77 0 L67 5 Z\" />,\n 'r-open-arrow': <path d=\"M77 -5 L67 0 L77 5\" fill=\"none\" />,\n 'r-closed-arrow': <path d=\"M77 -5 L67 0 L77 5 Z\" />,\n butt: <path d=\"M72 -5 L72 5\" fill=\"none\" />,\n slash: <path d=\"M67 -5 L77 5\" fill=\"none\" />,\n};\nconst LE_LINE_END: Partial<Record<LineEnding, number>> = {\n square: 68,\n circle: 68,\n diamond: 67,\n 'open-arrow': 76,\n 'closed-arrow': 67,\n 'r-open-arrow': 67,\n 'r-closed-arrow': 67,\n butt: 72,\n slash: 72,\n};\n\nfunction LineEndingPreview({ name, side }: { name: LineEnding; side: 'start' | 'end' }) {\n const marker = LE_MARKERS[name];\n const lineEndX = LE_LINE_END[name] ?? 77;\n const transform = side === 'start' ? 'rotate(180 40 10)' : undefined;\n return (\n <svg width=\"80\" height=\"20\" viewBox=\"0 0 80 20\" className=\"text-fg\">\n <g transform={transform}>\n <line x1=\"4\" y1=\"10\" x2={lineEndX} y2=\"10\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n {marker && (\n <g\n transform=\"translate(0, 10)\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n >\n {marker}\n </g>\n )}\n </g>\n </svg>\n );\n}\n\nfunction LineEndingSelect({\n side,\n value,\n onChange,\n}: {\n side: 'start' | 'end';\n value: LineEnding;\n onChange: (v: LineEnding) => void;\n}) {\n return (\n <DropdownShell trigger={<LineEndingPreview name={value} side={side} />}>\n {(close) =>\n LINE_ENDINGS.map((o) => (\n <OptionRow\n key={o.v}\n selected={value === o.v}\n onClick={() => {\n onChange(o.v);\n close();\n }}\n >\n <LineEndingPreview name={o.v} side={side} />\n </OptionRow>\n ))\n }\n </DropdownShell>\n );\n}\n\n// ── font family picker ───────────────────────────────────────────────────────\nfunction FontFamilySelect({ value, onChange }: { value: string; onChange: (v: string) => void }) {\n // The standard faces plus the configured fonts that are registered and\n // mounted (`annotations.fonts`) — a registered key is a `fontFamily` value\n // like any standard name.\n const configured = useAnnotationFonts();\n const options = [...FONT_OPTIONS, ...configured.map((f) => ({ v: f.key, label: f.label }))];\n const current = options.find((o) => o.v === value);\n return (\n <DropdownShell trigger={<span className=\"text-fg text-sm\">{current?.label ?? value}</span>}>\n {(close) =>\n options.map((o) => (\n <OptionRow\n key={o.v}\n selected={o.v === value}\n onClick={() => {\n onChange(o.v);\n close();\n }}\n >\n {o.label}\n </OptionRow>\n ))\n }\n </DropdownShell>\n );\n}\n\n// ── font-size combo (number input + preset dropdown) ─────────────────────────\nfunction FontSizeCombo({ value, onChange }: { value: number; onChange: (n: number) => void }) {\n const [open, setOpen] = useState(false);\n const rootRef = useOutsideClose(open, () => setOpen(false));\n // Typed text is a DRAFT until Enter or blur (Escape discards): committing\n // per keystroke would apply \"2\" on the way to \"24\" — to the selected text\n // while editing. Presets commit at once.\n const [draft, setDraft] = useState<string | null>(null);\n const commit = () => {\n if (draft === null) return;\n const n = parseInt(draft, 10);\n setDraft(null);\n if (Number.isFinite(n) && n > 0 && n !== value) onChange(n);\n };\n return (\n <div ref={rootRef} className=\"relative w-full\">\n <input\n type=\"number\"\n min={1}\n value={draft ?? value}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={commit}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n commit();\n setOpen(false);\n } else if (e.key === 'Escape') {\n setDraft(null);\n setOpen(false);\n }\n }}\n onClick={() => setOpen(true)}\n className=\"border-border bg-surface text-fg w-full rounded border px-2 py-1.5 pr-7 text-sm\"\n />\n <button\n type=\"button\"\n tabIndex={-1}\n onClick={() => setOpen((o) => !o)}\n className=\"absolute inset-y-0 right-1 flex items-center\"\n >\n <Icon name=\"chevronDown\" size={16} className=\"text-fg-secondary\" />\n </button>\n {open && (\n <div className=\"border-border bg-elevated absolute z-10 mt-1 max-h-48 w-full overflow-y-auto rounded border p-1 shadow-lg\">\n {FONT_SIZES.map((sz) => (\n <OptionRow\n key={sz}\n selected={sz === value}\n onClick={() => {\n setDraft(null);\n onChange(sz);\n setOpen(false);\n }}\n >\n {sz}\n </OptionRow>\n ))}\n </div>\n )}\n </div>\n );\n}\n\nfunction BlendModeSelect({\n value,\n onChange,\n}: {\n value: BlendMode;\n onChange: (mode: BlendMode) => void;\n}) {\n return (\n <select\n value={value}\n onChange={(event) => onChange(event.target.value as BlendMode)}\n className=\"border-border bg-surface text-fg w-full rounded border px-3 py-1.5 text-sm\"\n >\n {BLEND_MODES.map((mode) => (\n <option key={mode.v} value={mode.v}>\n {mode.label}\n </option>\n ))}\n </select>\n );\n}\n\n// ── align toggle ─────────────────────────────────────────────────────────────\nfunction Toggle({\n active,\n title,\n onClick,\n keepFocus,\n children,\n}: {\n active: boolean;\n title: string;\n onClick: () => void;\n /** Don't take focus on press — a text editor's selection survives the click. */\n keepFocus?: boolean;\n children: ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n title={title}\n onClick={onClick}\n onMouseDown={keepFocus ? (e) => e.preventDefault() : undefined}\n className={`flex h-9 w-9 items-center justify-center rounded border transition-colors ${\n active\n ? 'border-accent bg-accent text-on-accent'\n : 'border-border bg-surface text-fg hover:bg-hover'\n }`}\n >\n {children}\n </button>\n );\n}\n\n// ── rich-text formatting: bold / italic / underline in one row ──────────────\ntype FormatSpec = Extract<PropSpec, { key: 'bold' | 'italic' | 'underline' }>;\nconst isFormatSpec = (spec: PropSpec): spec is FormatSpec =>\n spec.key === 'bold' || spec.key === 'italic' || spec.key === 'underline';\n\n/**\n * The format toggles a free-text kind declares, in one row. While the text\n * editor holds a range they read and write that range's runs (the plugin\n * routes `updateSelection`); otherwise the annotation's body. The buttons\n * keep focus in the editor so the range survives the click.\n */\nfunction FormatToggles({\n specs,\n values,\n mixed,\n onChange,\n}: {\n specs: FormatSpec[];\n values: Partial<Record<PropKey, unknown>>;\n mixed: PropKey[];\n onChange: (patch: AnnotationPropsPatch) => void;\n}) {\n const t = useT();\n return (\n <Field\n label={t('demo.formatLabel', { fallback: 'Format' })}\n mixed={specs.some((s) => mixed.includes(s.key))}\n >\n <div className=\"flex gap-2\">\n {specs.map((spec) => {\n const active = values[spec.key] === true && !mixed.includes(spec.key);\n return (\n <Toggle\n key={spec.key}\n title={spec.label}\n active={active}\n keepFocus\n onClick={() => onChange({ [spec.key]: !active } as AnnotationPropsPatch)}\n >\n <Icon name={spec.key} size={18} />\n </Toggle>\n );\n })}\n </div>\n </Field>\n );\n}\n\n// ── one control per PropSpec — the entire surface an app customizes ──────────\nfunction PropControl({\n spec,\n value,\n mixed,\n onChange,\n}: {\n spec: PropSpec;\n value: unknown;\n mixed: boolean;\n onChange: (patch: AnnotationPropsPatch) => void;\n}) {\n switch (spec.key) {\n case 'color':\n case 'fontColor':\n return (\n <Field label={spec.label} mixed={mixed}>\n <SwatchGrid\n value={value as string}\n onSelect={(c) => onChange({ [spec.key]: c } as AnnotationPropsPatch)}\n />\n </Field>\n );\n case 'interiorColor':\n return (\n <Field label={spec.label} mixed={mixed}>\n <SwatchGrid\n value={value as string | null}\n allowTransparent\n onSelect={(c) => onChange({ interiorColor: c === 'transparent' ? null : c })}\n />\n </Field>\n );\n case 'opacity': {\n const v = (value as number) ?? 1;\n return (\n <Field label={spec.label} mixed={mixed}>\n <RangeSlider\n value={v}\n min={spec.min}\n max={spec.max}\n step={spec.step}\n onChange={(n) => onChange({ opacity: n })}\n />\n <span className=\"text-fg-muted text-xs\">{Math.round(v * 100)}%</span>\n </Field>\n );\n }\n case 'strokeWidth': {\n const v = (value as number) ?? spec.min;\n return (\n <Field label={spec.label} mixed={mixed}>\n <RangeSlider\n value={v}\n min={spec.min}\n max={spec.max}\n step={spec.step}\n onChange={(n) => onChange({ strokeWidth: n })}\n />\n <span className=\"text-fg-muted text-xs\">{v}px</span>\n </Field>\n );\n }\n case 'fontSize':\n return (\n <Field label={spec.label} mixed={mixed}>\n <FontSizeCombo\n value={(value as number) ?? 12}\n onChange={(n) => onChange({ fontSize: n })}\n />\n </Field>\n );\n case 'border':\n return (\n <Field label={spec.label} mixed={mixed}>\n <BorderSelect\n value={(value as Border) ?? { kind: 'solid' }}\n cloudy={spec.cloudy}\n onChange={(b) => onChange({ border: b })}\n />\n </Field>\n );\n case 'lineEndings': {\n const le = (value as LineEndings) ?? { start: 'none', end: 'none' };\n return (\n <Field label={spec.label} mixed={mixed}>\n <div className=\"grid grid-cols-2 gap-3\">\n <div>\n <div className=\"text-fg-muted mb-1.5 text-xs\">Start</div>\n <LineEndingSelect\n side=\"start\"\n value={le.start}\n onChange={(v) => onChange({ lineEndings: { start: v } })}\n />\n </div>\n <div>\n <div className=\"text-fg-muted mb-1.5 text-xs\">End</div>\n <LineEndingSelect\n side=\"end\"\n value={le.end}\n onChange={(v) => onChange({ lineEndings: { end: v } })}\n />\n </div>\n </div>\n </Field>\n );\n }\n case 'fontFamily':\n return (\n <Field label={spec.label} mixed={mixed}>\n <FontFamilySelect\n value={(value as string) ?? 'helvetica'}\n onChange={(v) => onChange({ fontFamily: v })}\n />\n </Field>\n );\n case 'textAlign': {\n const alignIcon: Record<TextAlign, string> = {\n left: 'alignLeft',\n center: 'alignCenter',\n right: 'alignRight',\n };\n return (\n <Field label={spec.label} mixed={mixed}>\n <div className=\"flex gap-2\">\n {(['left', 'center', 'right'] as TextAlign[]).map((al) => (\n <Toggle\n key={al}\n title={`Align ${al}`}\n active={value === al}\n onClick={() => onChange({ textAlign: al })}\n >\n <Icon name={alignIcon[al]} size={18} />\n </Toggle>\n ))}\n </div>\n </Field>\n );\n }\n // The rich-text format toggles render as ONE row (see `FormatToggles`);\n // each spec is still declared by the kind, so a kind without rich text\n // never shows them.\n case 'bold':\n case 'italic':\n case 'underline':\n return null;\n case 'blendMode':\n return (\n <Field label={spec.label} mixed={mixed}>\n <BlendModeSelect\n value={(value as BlendMode) ?? 'normal'}\n onChange={(blendMode) => onChange({ blendMode })}\n />\n </Field>\n );\n // `link` deliberately renders NOTHING here: a link is a verb on the\n // selection, edited in the anchored popover (see ui/link-editor.tsx) —\n // never a style-panel section.\n case 'link':\n return null;\n default:\n return null;\n }\n}\n\n// ── the panel ────────────────────────────────────────────────────────────────\nfunction EmptyState() {\n return (\n <div className=\"text-fg-muted flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center\">\n <Icon name=\"palette\" size={40} className=\"text-fg-disabled\" />\n <p className=\"max-w-[180px] text-sm\">\n Pick a draw tool or select an annotation to edit its style.\n </p>\n </div>\n );\n}\n\n/**\n * The schema-driven style panel. Rendered inside the right sidebar's\n * `annotation-style` surface (see ui/panels.tsx). Owns its own scroll.\n */\nexport function AnnotationStylePanel() {\n const annotation = useAnnotation();\n const { activeToolId } = useTool();\n const sel = useSelectionProps();\n const defaults = useAnnotationDefaults(activeToolId);\n const selected = useAnnotationSelected();\n\n const hasSel = sel.specs.length > 0;\n const specs = hasSel ? sel.specs : annotation.propsForTool(activeToolId);\n const values = hasSel ? sel.values : defaults;\n const write = (patch: AnnotationPropsPatch) =>\n hasSel ? annotation.updateSelection(patch) : annotation.setDefaults(activeToolId, patch);\n\n // A selection with no editable props (e.g. a stamp, or a LOCKED annotation —\n // its style is frozen) still shows its flags: that's how you unlock it.\n if (specs.length === 0 && selected.length === 0) return <EmptyState />;\n\n const context = hasSel ? `${selected.length} selected` : `${activeToolId} defaults`;\n\n return (\n <div className=\"flex-1 overflow-y-auto p-4\">\n <p className=\"text-fg-muted mb-4 text-[11px] font-semibold uppercase tracking-wide\">\n {context}\n </p>\n {specs.map((spec) =>\n spec.key === 'bold' ? (\n <FormatToggles\n key=\"format\"\n specs={specs.filter((s): s is FormatSpec => isFormatSpec(s))}\n values={values}\n mixed={hasSel ? sel.mixed : []}\n onChange={write}\n />\n ) : (\n <PropControl\n key={spec.key}\n spec={spec}\n value={values[spec.key]}\n mixed={hasSel && sel.mixed.includes(spec.key)}\n onChange={write}\n />\n ),\n )}\n {/* Redaction label (`/OverlayText` + `/Repeat`) — kind content, not a\n style prop, so it writes through the redaction plugin's setLabel. */}\n <RedactionLabelSection />\n {/* `/F` flags for whatever is selected — the live flags test surface. */}\n <AnnotationFlagsSection />\n </div>\n );\n}\n\n/**\n * Label editor shown when exactly one redaction mark is selected. The text is\n * what the destructive apply paints over the region (white-on-black by the\n * tool defaults); `repeat` tiles it. Writes ride the annotation update verb\n * via the redaction plugin, which preserves the label's `/DA` styling.\n */\nfunction RedactionLabelSection() {\n const t = useT();\n const redaction = useOptionalCapability(RedactionToken);\n const selected = useAnnotationSelected();\n const mark = selected.length === 1 && selected[0]!.subtype === 'redact' ? selected[0]! : null;\n const [draft, setDraft] = useState<string | null>(null);\n useEffect(() => setDraft(null), [mark?.ref && refKeyOfRedact(mark.ref)]);\n if (!redaction || !mark || mark.subtype !== 'redact') return null;\n\n const value = draft ?? mark.overlayText ?? '';\n const commit = () => {\n if (draft === null) return;\n void redaction.setLabel(mark.ref, { overlayText: draft.length > 0 ? draft : null });\n setDraft(null);\n };\n\n return (\n <div className=\"border-border-subtle mt-4 border-t pt-4\">\n <p className=\"text-fg-muted mb-2 text-[11px] font-semibold uppercase tracking-wide\">\n {t('demo.redactLabelTitle')}\n </p>\n <input\n type=\"text\"\n value={value}\n placeholder={t('demo.redactLabelPlaceholder')}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={commit}\n onKeyDown={(e) => e.key === 'Enter' && commit()}\n className=\"border-border bg-surface text-fg w-full rounded-md border px-2 py-1.5 text-sm\"\n />\n <label className=\"text-fg mt-2 flex items-center gap-2 text-sm\">\n <input\n type=\"checkbox\"\n checked={mark.repeat}\n onChange={(e) => void redaction.setLabel(mark.ref, { repeat: e.target.checked })}\n />\n {t('demo.redactLabelRepeat')}\n </label>\n </div>\n );\n}\n\n/** Stable key for the effect dep — mirrors the annotation model's ref keys. */\nfunction refKeyOfRedact(ref: { kind: string } & Record<string, unknown>): string {\n return JSON.stringify(ref);\n}\n","import type { AnnotationDTO, Color } from '@embedpdf/react/annotation';\n\n/**\n * How a comment card identifies its annotation at a glance: the type's glyph,\n * tinted with THAT annotation's own colors. Ported from v2's comment-sidebar\n * config onto the v3 vocabulary — the icon names carry over verbatim (the\n * chrome icon set kept the v2 registry names and accent slots), while the\n * color model is v3's ISO-faithful one: there is exactly one `/C` (\"color\")\n * and one `/IC` (\"interiorColor\") in the spec, so `primary` is the annotation's\n * `/C` and `secondary` its interior fill where the family has one.\n */\n\nexport interface IconAccent {\n primary?: string;\n secondary?: string;\n}\n\nexport interface CommentTypeConfig {\n /** Icon name in the chrome registry. */\n icon: string;\n /** i18n key for the type's display name (tooltip). */\n labelKey: string;\n /** Fallback when the locale has no entry. */\n label: string;\n}\n\n/** `/C`-style Color → CSS. */\nexport const cssColor = (c: Color | null | undefined): string | undefined =>\n c ? `rgb(${c.r}, ${c.g}, ${c.b})` : undefined;\n\nconst TYPE_CONFIG: Record<string, CommentTypeConfig> = {\n text: { icon: 'message', labelKey: 'annotation.comment', label: 'Comment' },\n highlight: { icon: 'highlight', labelKey: 'annotation.highlight', label: 'Highlight' },\n underline: { icon: 'underline', labelKey: 'annotation.underline', label: 'Underline' },\n squiggly: { icon: 'squiggly', labelKey: 'annotation.squiggly', label: 'Squiggly' },\n strikeout: { icon: 'strikethrough', labelKey: 'annotation.strikeout', label: 'Strikethrough' },\n square: { icon: 'square', labelKey: 'annotation.square', label: 'Square' },\n circle: { icon: 'circle', labelKey: 'annotation.circle', label: 'Circle' },\n line: { icon: 'line', labelKey: 'annotation.line', label: 'Line' },\n polygon: { icon: 'polygon', labelKey: 'annotation.polygon', label: 'Polygon' },\n polyline: { icon: 'zigzag', labelKey: 'annotation.polyline', label: 'Polyline' },\n ink: { icon: 'pencilMarker', labelKey: 'annotation.ink', label: 'Ink' },\n 'free-text': { icon: 'freeText', labelKey: 'annotation.freeText', label: 'Text' },\n stamp: { icon: 'rubberStamp', labelKey: 'annotation.stamp', label: 'Stamp' },\n caret: { icon: 'insertText', labelKey: 'annotation.caret', label: 'Caret' },\n redact: { icon: 'redact', labelKey: 'annotation.redact', label: 'Redact' },\n 'file-attachment': {\n icon: 'paperclip',\n labelKey: 'annotation.fileAttachment',\n label: 'Attachment',\n },\n};\n\nconst FALLBACK: CommentTypeConfig = {\n icon: 'message',\n labelKey: 'annotation.comment',\n label: 'Comment',\n};\n\nexport const commentTypeConfig = (a: AnnotationDTO): CommentTypeConfig =>\n TYPE_CONFIG[a.subtype] ?? FALLBACK;\n\n/**\n * The glyph's tint slots, read off the annotation itself — this is what makes\n * a card recognizable as \"that yellow highlight on page 3\". Free-text prefers\n * its `fontColor` override, since that is the color a reader actually sees.\n */\nexport const commentIconAccent = (a: AnnotationDTO): IconAccent => {\n const anyA = a as { color?: Color; interiorColor?: Color | null; fontColor?: Color };\n const primary = cssColor(anyA.fontColor ?? anyA.color);\n const secondary = cssColor(anyA.interiorColor);\n return {\n ...(primary ? { primary } : {}),\n ...(secondary ? { secondary } : {}),\n };\n};\n","import { useEffect, useMemo, useRef, useState } from 'react';\nimport { useCapability } from '@embedpdf/react/runtime';\nimport {\n AnnotationToken,\n refKey,\n useAnnotationSelection,\n useComments,\n useCommentThreads,\n useCommentsHydration,\n type AnnotationDTO,\n type AnnotationRef,\n type CommentThreadView,\n} from '@embedpdf/react/annotation';\nimport { StageToken } from '@embedpdf/react/stage';\nimport { useT } from '@embedpdf/react/i18n';\nimport { Icon } from './icons';\nimport { commentIconAccent, commentTypeConfig } from './comment-config';\n\n/**\n * The comments sidebar (right panel): a live view over the conversation\n * plane, in the shape v2's reviewers knew — page-grouped sections, and a\n * card that identifies its annotation at a glance by the type's glyph tinted\n * with that annotation's own colors. What v2 lacked, and this adds, is the\n * ISO 32000 §12.5.6.3 review status per thread.\n *\n * There is no per-page loading dance: the plugin hydrates the WHOLE document\n * at open (`listRawAll`), so the list is complete the moment `hydration()`\n * says so, whether or not a page was ever scrolled to.\n *\n * Selection is two-way, as in v2: clicking a card selects the annotation and\n * flies the camera to it (`stage.reveal`, the same verb search hits use);\n * selecting in the document scrolls that card into view here.\n *\n * Every action routes through the `comments` verbs — plain annotation writes\n * on the one optimistic pipeline — and every control is gated by\n * `permissionsFor`, the engine's own collab-resolver mirrors: what shows here\n * is what the engine will allow.\n */\n\nconst REVIEW_STATES = ['none', 'accepted', 'rejected', 'cancelled', 'completed'] as const;\n\nconst dateLabel = (iso: string | null): string => {\n if (!iso) return '';\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return '';\n return d.toLocaleDateString(undefined, { month: 'short', day: 'numeric' });\n};\n\nexport function CommentsPanel() {\n const t = useT();\n const hydration = useCommentsHydration();\n const comments = useComments();\n const threads = useCommentThreads();\n const anno = useCapability(AnnotationToken);\n const stage = useCapability(StageToken);\n const selection = useAnnotationSelection();\n const scrollRef = useRef<HTMLDivElement>(null);\n const cardRefs = useRef<Record<string, HTMLLIElement | null>>({});\n\n /** Which thread the document's selection points at — ANY member counts, so\n * selecting a reply's parent shape highlights the same card. */\n const selectedThreadKey = useMemo(() => {\n for (const id of selection) {\n const dto = anno.getSelected().find((a) => refKey(a.ref) === id || a.nm === id);\n const ref = dto?.ref ?? null;\n const thread = ref ? comments.thread(ref) : null;\n if (thread) return refKey(thread.root.ref);\n }\n return null;\n // `selection` identity changes on every selection write — the right key.\n }, [selection, anno, comments]);\n\n // Reverse sync: the selected card scrolls itself into view (v2 centered it).\n useEffect(() => {\n if (!selectedThreadKey || !scrollRef.current) return;\n const el = cardRefs.current[selectedThreadKey];\n if (!el) return;\n const container = scrollRef.current;\n const top =\n el.offsetTop - container.clientHeight / 2 + el.clientHeight / 2 - container.offsetTop;\n container.scrollTo({ top, behavior: 'smooth' });\n }, [selectedThreadKey]);\n\n /** Click a card: select the annotation AND fly the camera to it. */\n const goTo = (view: CommentThreadView) => {\n anno.select(view.root.ref);\n if (view.pageIndex < 0) return;\n // Anchor values are viewport FRACTIONS (0–1), not v2's percentages:\n // the annotation lands a third down the viewport, the find-bar feel.\n stage?.reveal(view.pageIndex, {\n ...(view.contentRect ? { rect: view.contentRect } : {}),\n anchor: { x: 'center', y: 0.35 },\n behavior: 'smooth',\n });\n };\n\n // Page-grouped, preserving the lens's display order within each page.\n const byPage = useMemo(() => {\n const groups = new Map<number, CommentThreadView[]>();\n for (const v of threads) {\n const arr = groups.get(v.pageIndex);\n if (arr) arr.push(v);\n else groups.set(v.pageIndex, [v]);\n }\n return [...groups.entries()].sort((a, b) => a[0] - b[0]);\n }, [threads]);\n\n if (hydration.status === 'loading') return <Empty icon=\"comment\" text={t('demo.commentsLoading')} />;\n if (hydration.status === 'forbidden')\n return <Empty icon=\"lock\" text={t('demo.commentsForbidden')} />;\n if (hydration.status === 'error') {\n return (\n <Empty icon=\"alertTriangle\" text={t('demo.commentsError')}>\n <button\n type=\"button\"\n onClick={() => void comments.rehydrate()}\n className=\"bg-accent text-on-accent rounded-md px-3 py-1.5 text-sm font-medium\"\n >\n {t('demo.commentsRetry')}\n </button>\n </Empty>\n );\n }\n if (threads.length === 0) return <Empty icon=\"comment\" text={t('demo.commentsEmpty')} />;\n\n return (\n <div ref={scrollRef} className=\"min-h-0 flex-1 overflow-y-auto\">\n <div className=\"flex flex-col gap-5 p-3\">\n {byPage.map(([pageIndex, group]) => (\n <div key={pageIndex} className=\"flex flex-col gap-2\">\n <div className=\"bg-surface sticky top-0 z-10\">\n <div className=\"border-border-subtle border-b pb-1.5\">\n <h3 className=\"text-fg text-sm font-semibold\">\n {t('demo.commentsPage', { params: { page: group[0]!.pageLabel } })}\n </h3>\n <p className=\"text-fg-muted text-xs\">\n {t(group.length === 1 ? 'demo.commentCount' : 'demo.commentCountPlural', {\n params: { count: String(group.length) },\n })}\n </p>\n </div>\n </div>\n <ul className=\"flex flex-col gap-2\">\n {group.map((view) => {\n const key = refKey(view.root.ref);\n return (\n <ThreadCard\n key={key}\n view={view}\n selected={selectedThreadKey === key}\n onSelect={() => goTo(view)}\n cardRef={(el) => {\n cardRefs.current[key] = el;\n }}\n />\n );\n })}\n </ul>\n </div>\n ))}\n </div>\n </div>\n );\n}\n\nfunction Empty({\n icon,\n text,\n children,\n}: {\n icon: string;\n text: string;\n children?: React.ReactNode;\n}) {\n return (\n <div className=\"flex flex-col items-center gap-3 px-4 py-10 text-center\">\n <Icon name={icon} size={32} className=\"text-fg-muted\" />\n <p className=\"text-fg-muted text-sm\">{text}</p>\n {children}\n </div>\n );\n}\n\nfunction ThreadCard({\n view,\n selected,\n onSelect,\n cardRef,\n}: {\n view: CommentThreadView;\n selected: boolean;\n onSelect: () => void;\n cardRef: (el: HTMLLIElement | null) => void;\n}) {\n const t = useT();\n const comments = useComments();\n const [reply, setReply] = useState('');\n const perms = comments.permissionsFor(view.root.ref);\n const config = commentTypeConfig(view.root);\n const status = view.review.mine?.state ?? 'none';\n const latest = view.review.lastChange;\n\n const sendReply = () => {\n const text = reply.trim();\n if (!text) return;\n setReply('');\n void comments.reply(view.root.ref, text);\n };\n\n return (\n <li\n ref={cardRef}\n onClick={onSelect}\n className={`bg-surface cursor-pointer rounded-lg border shadow-sm transition-all hover:shadow-md ${\n selected ? 'border-accent ring-accent/40 ring-2' : 'border-border-subtle'\n }`}\n >\n <div className=\"flex flex-col gap-2 p-3\">\n {/* identity row: the annotation's own glyph + color is the anchor */}\n <div className=\"flex items-start gap-2.5\">\n <div\n className=\"bg-hover mt-0.5 grid h-8 w-8 shrink-0 place-items-center rounded-full\"\n title={t(config.labelKey, { fallback: config.label })}\n >\n <Icon name={config.icon} size={18} accent={commentIconAccent(view.root)} />\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"text-fg truncate text-sm font-medium\">\n {view.root.author ?? t('demo.commentsAnonymous')}\n </span>\n <span className=\"text-fg-muted ml-auto shrink-0 text-xs\">\n {dateLabel(view.root.modified ?? view.root.created)}\n </span>\n </div>\n {latest && (\n <span className=\"bg-accent-light text-accent mt-1 inline-block rounded px-1.5 py-0.5 text-[11px] font-medium\">\n {statusLabel(t, latest.state)}\n {latest.by ? ` — ${latest.by}` : ''}\n </span>\n )}\n </div>\n {perms.canDeleteThread && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n void comments.removeThread(view.root.ref);\n }}\n className=\"text-fg-muted hover:text-fg grid h-6 w-6 shrink-0 place-items-center rounded\"\n title={t('demo.commentsDeleteThread')}\n >\n <Icon name=\"trash\" size={14} />\n </button>\n )}\n </div>\n\n <CommentBody annotationRef={view.root.ref} text={view.root.contents ?? ''} deletable={false} />\n\n {view.replies.length > 0 && (\n <div className=\"border-border-subtle flex flex-col gap-2 border-t pt-2\">\n {view.replies.map((r) => (\n <Reply key={refKey(r.ref)} dto={r} />\n ))}\n </div>\n )}\n\n <div className=\"border-border-subtle flex flex-col gap-1.5 border-t pt-2\">\n {perms.canSetStatus && (\n <label\n className=\"text-fg-muted flex items-center gap-2 text-xs\"\n onClick={(e) => e.stopPropagation()}\n >\n {t('demo.commentsStatus')}\n <select\n value={status}\n onChange={(e) => void comments.setStatus(view.root.ref, e.target.value)}\n className=\"border-border bg-surface text-fg flex-1 rounded-md border px-1.5 py-1 text-xs outline-none\"\n >\n {REVIEW_STATES.map((s) => (\n <option key={s} value={s}>\n {statusLabel(t, s)}\n </option>\n ))}\n </select>\n </label>\n )}\n {perms.canReply && (\n <div className=\"flex items-center gap-1.5\" onClick={(e) => e.stopPropagation()}>\n <input\n type=\"text\"\n value={reply}\n placeholder={\n view.root.contents || view.replies.length\n ? t('demo.commentsReplyPlaceholder')\n : t('demo.commentsAddPlaceholder')\n }\n onChange={(e) => setReply(e.target.value)}\n onKeyDown={(e) => e.key === 'Enter' && sendReply()}\n className=\"border-border bg-surface text-fg focus:border-accent w-full min-w-0 flex-1 rounded-md border px-2 py-1 text-sm outline-none\"\n />\n <button\n type=\"button\"\n onClick={sendReply}\n disabled={!reply.trim()}\n className=\"text-accent disabled:text-fg-muted grid h-7 w-7 shrink-0 place-items-center rounded-md\"\n title={t('demo.commentsReply')}\n >\n <Icon name=\"arrowForwardUp\" size={16} />\n </button>\n </div>\n )}\n </div>\n </div>\n </li>\n );\n}\n\nfunction Reply({ dto }: { dto: AnnotationDTO }) {\n const t = useT();\n return (\n <div className=\"border-border-subtle ml-1 border-l-2 pl-2\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"text-fg-secondary text-xs font-medium\">\n {dto.author ?? t('demo.commentsAnonymous')}\n </span>\n <span className=\"text-fg-muted text-[11px]\">\n {dateLabel(dto.modified ?? dto.created)}\n </span>\n </div>\n <CommentBody annotationRef={dto.ref} text={dto.contents ?? ''} deletable />\n </div>\n );\n}\n\n/** One comment's text with inline edit (own, unlocked) and delete (replies). */\nfunction CommentBody({\n annotationRef,\n text,\n deletable,\n}: {\n annotationRef: AnnotationRef;\n text: string;\n deletable: boolean;\n}) {\n const t = useT();\n const comments = useComments();\n const perms = comments.permissionsFor(annotationRef);\n const [draft, setDraft] = useState<string | null>(null);\n\n if (draft !== null) {\n const save = () => {\n const next = draft.trim();\n setDraft(null);\n if (next && next !== text) void comments.edit(annotationRef, next);\n };\n return (\n <textarea\n value={draft}\n autoFocus\n rows={2}\n onClick={(e) => e.stopPropagation()}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={save}\n onKeyDown={(e) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n save();\n }\n if (e.key === 'Escape') setDraft(null);\n }}\n className=\"border-accent bg-surface text-fg w-full resize-none rounded-md border px-2 py-1 text-sm outline-none\"\n />\n );\n }\n if (!text && !perms.canEditText && !deletable) return null;\n return (\n <div className=\"group/body flex items-start gap-1\">\n <p className=\"text-fg min-w-0 flex-1 whitespace-pre-wrap text-sm\">{text}</p>\n {perms.canEditText && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n setDraft(text);\n }}\n className=\"text-fg-muted hover:text-fg grid h-5 w-5 shrink-0 place-items-center rounded opacity-0 group-hover/body:opacity-100\"\n title={t('demo.commentsEdit')}\n >\n <Icon name=\"pencilMarker\" size={12} />\n </button>\n )}\n {deletable && perms.canDelete && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n void comments.remove(annotationRef);\n }}\n className=\"text-fg-muted hover:text-fg grid h-5 w-5 shrink-0 place-items-center rounded opacity-0 group-hover/body:opacity-100\"\n title={t('demo.commentsDelete')}\n >\n <Icon name=\"trash\" size={12} />\n </button>\n )}\n </div>\n );\n}\n\nfunction statusLabel(t: ReturnType<typeof useT>, state: string): string {\n switch (state) {\n case 'none':\n return t('demo.commentsStatusNone');\n case 'accepted':\n return t('demo.commentsStatusAccepted');\n case 'rejected':\n return t('demo.commentsStatusRejected');\n case 'cancelled':\n return t('demo.commentsStatusCancelled');\n case 'completed':\n return t('demo.commentsStatusCompleted');\n default:\n return state; // custom vocabularies render verbatim\n }\n}\n","import { useEffect } from 'react';\nimport { useCapability } from '@embedpdf/react/runtime';\nimport { AnnotationToken } from '@embedpdf/react/annotation';\nimport { usePendingRedactions, useRedaction } from '@embedpdf/react/redaction';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\nimport { Icon } from './icons';\n\n/**\n * The pending-redactions review panel (right sidebar). The list is a LIVE view\n * over the annotation plane — deleting a mark here is deleting the annotation.\n * \"Apply all\" routes through the confirm modal: the apply is irreversible.\n */\nexport function RedactionPanel() {\n const t = useT();\n const redaction = useRedaction();\n const pending = usePendingRedactions();\n const anno = useCapability(AnnotationToken);\n const confirm = useSurface('redact-confirm');\n\n // The annotation plane loads lazily per page; pull every page in so the\n // panel shows marks on pages never scrolled to.\n useEffect(() => {\n void redaction.preparePending();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <div className=\"flex min-h-0 flex-1 flex-col\">\n <div className=\"min-h-0 flex-1 overflow-y-auto p-2\">\n {pending.length === 0 ? (\n <div className=\"flex flex-col items-center gap-3 px-4 py-10 text-center\">\n <Icon name=\"redactionSidebar\" size={32} className=\"text-fg-muted\" />\n <p className=\"text-fg-muted text-sm\">{t('demo.redactionEmpty')}</p>\n </div>\n ) : (\n <ul className=\"flex flex-col gap-1\">\n {pending.map((item) => (\n <li key={item.id}>\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => anno.select(item.ref)}\n onKeyDown={(e) => e.key === 'Enter' && anno.select(item.ref)}\n className=\"hover:bg-hover group flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left\"\n >\n <Icon\n name={item.kind === 'area' ? 'redactArea' : 'redact'}\n size={16}\n className=\"text-fg-muted shrink-0\"\n />\n <span className=\"text-fg min-w-0 flex-1 truncate text-sm\">\n {item.overlayText ??\n t(item.kind === 'area' ? 'demo.redactionArea' : 'demo.redactionText')}\n </span>\n <span className=\"text-fg-muted shrink-0 text-xs\">\n {t('demo.pageBadge', {\n params: { page: item.pageIndex >= 0 ? String(item.pageIndex + 1) : '?' },\n })}\n </span>\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n void anno.delete(item.ref);\n }}\n className=\"text-fg-muted hover:text-fg grid h-6 w-6 shrink-0 place-items-center rounded opacity-0 group-hover:opacity-100\"\n title={t('demo.redactionRemove')}\n >\n <Icon name=\"trash\" size={14} />\n </button>\n </div>\n </li>\n ))}\n </ul>\n )}\n </div>\n <div className=\"border-border-subtle flex shrink-0 gap-2 border-t p-3\">\n <button\n type=\"button\"\n disabled={pending.length === 0}\n onClick={() => {\n for (const item of pending) void anno.delete(item.ref);\n }}\n className=\"border-border text-fg hover:bg-hover flex-1 rounded-md border px-3 py-1.5 text-sm disabled:opacity-40\"\n >\n {t('commands.redact.clearAll')}\n </button>\n <button\n type=\"button\"\n disabled={pending.length === 0 || !redaction.canApply() || redaction.applying}\n onClick={() => confirm.open()}\n className=\"flex-1 rounded-md bg-red-600 px-3 py-1.5 text-sm text-white hover:bg-red-700 disabled:opacity-40\"\n >\n {t('commands.redact.applyAll')}\n </button>\n </div>\n </div>\n );\n}\n","/**\n * The search panel — the v2 snippet's search sidebar on the v3 plugin-search\n * capability. ONE shape end to end: the flat `SearchQuery` {text, regex,\n * matchCase, wholeWord} is what the engine matches, what the plugin stores\n * (document-scoped, survives the sidebar closing), and what this box renders.\n * The panel keeps only a DRAFT of it for keystroke/debounce echo.\n *\n * Data flow:\n * type / toggle → validateSearchQuery → (debounced) search(draftQuery)\n * useSearchState() → query / status / hitCount / activeIndex (reactive)\n * useSelector(SearchToken, c => c.hits()) → the streamed hit list\n * click a hit / prev / next → goTo/prev/next (capability reveals it on-page)\n *\n * The look is ported 1:1 from viewers/snippet's search-sidebar (magnifier\n * input with clear button, option checkboxes, results-found counter with\n * prev/next, per-page grouped snippet list with the match bolded and the\n * active hit accented), retinted to this app's semantic tokens. The regex\n * toggle is new in v3 (v2 had no pattern search); matchDiacritics exists in\n * the engine but is deliberately not exposed here — v2 parity.\n */\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport {\n useSearch,\n useSearchState,\n validateSearchQuery,\n SearchToken,\n} from '@embedpdf/react/search';\nimport type { SearchHit, SearchQuery, SearchSnippet } from '@embedpdf/react/search';\nimport { useSelector } from '@embedpdf/react/runtime';\nimport { useT } from '@embedpdf/react/i18n';\nimport { Icon } from './icons';\nimport { buttonClass } from './toolbar';\n\nconst DEBOUNCE_MS = 300;\n\n/** Field-wise equality on the flat query — the mount/echo no-op guard. */\nconst sameQuery = (a: SearchQuery | null, b: SearchQuery) =>\n a != null &&\n a.text === b.text &&\n !!a.regex === !!b.regex &&\n !!a.matchCase === !!b.matchCase &&\n !!a.wholeWord === !!b.wholeWord;\n\n// ── option checkbox (v2's peer-checked custom box) ───────────────────────────\nfunction Checkbox({\n label,\n checked,\n onChange,\n}: {\n label: string;\n checked: boolean;\n onChange: (v: boolean) => void;\n}) {\n return (\n <label className=\"text-fg-secondary flex cursor-pointer select-none items-center gap-2 text-xs font-medium\">\n <span className=\"relative flex h-4 w-4 items-center justify-center\">\n <input\n type=\"checkbox\"\n checked={checked}\n onChange={(e) => onChange(e.target.checked)}\n className=\"border-border bg-surface checked:border-accent checked:bg-accent peer h-4 w-4 shrink-0 appearance-none rounded-[3px] border transition-colors\"\n />\n <svg\n viewBox=\"0 0 24 24\"\n className=\"text-on-accent pointer-events-none absolute h-3 w-3 opacity-0 peer-checked:opacity-100\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={3}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </span>\n {label}\n </label>\n );\n}\n\n// ── one result row: a snippet with the match bolded, active = accented ───────\nfunction renderSnippet(s: SearchSnippet | undefined) {\n if (!s) return null;\n const end = s.matchStart + s.matchLength;\n return (\n <>\n {s.text.slice(0, s.matchStart)}\n <span className=\"text-accent font-semibold\">{s.text.slice(s.matchStart, end)}</span>\n {s.text.slice(end)}\n </>\n );\n}\n\nfunction HitLine({\n hit,\n active,\n onClick,\n}: {\n hit: SearchHit;\n active: boolean;\n onClick: () => void;\n}) {\n const ref = useRef<HTMLButtonElement>(null);\n // Keep the active hit visible as prev/next walks the list.\n useEffect(() => {\n if (active) ref.current?.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n }, [active]);\n return (\n <button\n ref={ref}\n type=\"button\"\n onClick={onClick}\n className={`w-full rounded border p-2 text-left text-sm transition-colors ${\n active\n ? 'border-accent bg-accent-light text-fg'\n : 'border-border-subtle bg-surface text-fg-secondary hover:bg-hover'\n }`}\n >\n <span>{renderSnippet(hit.snippet)}</span>\n </button>\n );\n}\n\n// ── the panel ────────────────────────────────────────────────────────────────\nexport function SearchPanel() {\n const t = useT();\n const search = useSearch();\n const { query, status, hitCount, activeIndex } = useSearchState();\n const hits = useSelector(SearchToken, (c) => c.hits());\n\n // `query` is the document-scoped stored search (survives the sidebar\n // closing). The box is a controlled draft that STARTS from it; the panel is\n // keyed on the document (see panels.tsx), so this one-time seed is always\n // the right document's query — switching tabs remounts and reseeds.\n const [draft, setDraft] = useState(() => query?.text ?? '');\n const [matchCase, setMatchCase] = useState(() => query?.matchCase ?? false);\n const [wholeWord, setWholeWord] = useState(() => query?.wholeWord ?? false);\n const [regex, setRegex] = useState(() => query?.regex ?? false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // The draft IS a SearchQuery — same shape the engine matches on.\n const draftQuery: SearchQuery = { text: draft, regex, matchCase, wholeWord };\n // Early feedback on keystroke: the same validator the engine enforces\n // (regex dialect). Invalid patterns never fire a query.\n const validation = draft && regex ? validateSearchQuery(draftQuery) : { ok: true as const };\n\n // Debounced query. The sameQuery guard makes the mount pass (and our own\n // echo coming back through state) a no-op — nothing re-runs until the user\n // actually changes the text or a toggle. Clearing the box clears results.\n useEffect(() => {\n // No-ops: invalid pattern, draft already the stored query (mount pass /\n // our own echo), or an empty box with nothing stored to clear.\n if (!validation.ok || sameQuery(query, draftQuery)) return;\n if (draft === '' && query === null) return;\n const id = setTimeout(() => search.search(draftQuery), DEBOUNCE_MS);\n return () => clearTimeout(id);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [draft, matchCase, wholeWord, regex, query, validation.ok, search]);\n\n // Group hits by page, preserving page order, for the sectioned list.\n const grouped = useMemo(() => {\n const map = new Map<number, { hit: SearchHit; index: number }[]>();\n hits.forEach((hit, index) => {\n const arr = map.get(hit.pageIndex);\n if (arr) arr.push({ hit, index });\n else map.set(hit.pageIndex, [{ hit, index }]);\n });\n return [...map.entries()].sort((a, b) => a[0] - b[0]);\n }, [hits]);\n\n const searching = status === 'searching';\n\n return (\n <div className=\"flex min-h-0 flex-1 flex-col\">\n <div className=\"p-3\">\n {/* input: magnifier + clear */}\n <div className=\"relative\">\n <div className=\"text-fg-muted pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2.5\">\n <Icon name=\"search\" size={16} />\n </div>\n <input\n ref={inputRef}\n type=\"text\"\n value={draft}\n placeholder={t('demo.searchPlaceholder')}\n onChange={(e) => setDraft(e.target.value)}\n className={`bg-surface text-fg w-full rounded-md border py-1.5 pl-8 pr-9 text-sm outline-none focus:ring-1 ${\n validation.ok\n ? 'border-border focus:border-accent focus:ring-accent'\n : 'border-red-400 focus:border-red-400 focus:ring-red-400'\n }`}\n />\n {draft && (\n <button\n type=\"button\"\n onClick={() => {\n setDraft('');\n inputRef.current?.focus();\n }}\n className=\"text-fg-muted hover:text-fg-secondary absolute inset-y-0 right-0 flex items-center pr-2.5\"\n >\n <Icon name=\"x\" size={16} />\n </button>\n )}\n </div>\n\n {/* the invalid-pattern message, straight from the shared validator */}\n {!validation.ok && <p className=\"mt-1.5 text-xs text-red-500\">{validation.message}</p>}\n\n {/* options — the three VS Code toggles, all composable */}\n <div className=\"mt-3 flex flex-col gap-2\">\n <Checkbox\n label={t('demo.searchCaseSensitive')}\n checked={matchCase}\n onChange={setMatchCase}\n />\n <Checkbox label={t('demo.searchWholeWord')} checked={wholeWord} onChange={setWholeWord} />\n <Checkbox label={t('demo.searchRegex')} checked={regex} onChange={setRegex} />\n </div>\n\n <hr className=\"border-border-subtle mb-2 mt-4\" />\n\n {/* results counter + prev/next */}\n {status !== 'idle' && (\n <div className=\"flex h-8 items-center justify-between\">\n <div className=\"text-fg-muted text-xs\">\n {hitCount === 0\n ? t(searching ? 'demo.searchSearching' : 'demo.searchNoResults')\n : t('demo.searchResults', { params: { count: hitCount } })}\n </div>\n {hitCount > 1 && (\n <div className=\"flex items-center\">\n <button\n type=\"button\"\n title=\"Previous\"\n className={buttonClass(false)}\n onClick={() => search.prev()}\n >\n <Icon name=\"chevronLeft\" size={20} />\n </button>\n <button\n type=\"button\"\n title=\"Next\"\n className={buttonClass(false)}\n onClick={() => search.next()}\n >\n <Icon name=\"chevronRight\" size={20} />\n </button>\n </div>\n )}\n </div>\n )}\n </div>\n\n {/* per-page grouped results */}\n <div className=\"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-3 pb-3\">\n {grouped.map(([pageIndex, items]) => (\n <div key={pageIndex} className=\"mt-2 first:mt-0\">\n <div className=\"bg-surface/80 text-fg-muted py-2 text-xs backdrop-blur\">\n {t('demo.searchPage', { params: { page: pageIndex + 1 } })}\n </div>\n <div className=\"flex flex-col gap-2\">\n {items.map(({ hit, index }) => (\n <HitLine\n key={index}\n hit={hit}\n active={index === activeIndex}\n onClick={() => search.goTo(index)}\n />\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n}\n","/**\n * The stamps sidebar (right panel) — v2's rubber-stamp sidebar on v3 parts.\n * The stamp plugin owns the libraries, the asset bytes and the cached\n * previews; this panel is the PICKER over them:\n *\n * a library <select> (\"All stamps\" + one per library, shown once there\n * are two) → a two-column grid of thumbnails → click a stamp → `armAsset`\n * arms the annotation plugin's stamp tool → hovering a page ghosts the\n * exact placement → each click on a page places one.\n *\n * Deliberately NOT a file dialog: picking arbitrary image bytes is the Image\n * tool's job (a click-then-pick tool, `insert:add-image`). The stamp button\n * opens a library; a library is a set of reusable, named assets — the two\n * gestures are different, so they are different controls.\n *\n * The panel stays open while you place, so a stamp can be dropped on several\n * pages and swapped without a round trip through the toolbar. A command can\n * open it ON a library (`annotation:stamp-from-selection` → \"My stamps\")\n * through the surface's open props.\n */\nimport { useEffect, useRef, useState } from 'react';\nimport { useTool } from '@embedpdf/react/interaction';\nimport {\n useArmStampAsset,\n useStamp,\n useStampAssetPreviewUrl,\n useStampAssets,\n useStampLibraries,\n type StampAsset,\n} from '@embedpdf/react/stamp';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { useLocale, useT } from '@embedpdf/react/i18n';\nimport { useStampsConfig } from '../config-context';\nimport {\n DEFAULT_LIBRARY_ID,\n ensureDefaultLibrary,\n resolveStampsLocale,\n} from '../config/default-stamps';\nimport { Icon } from './icons';\nimport { restoreStampLibrariesOnce } from './stamp-store';\n\nconst ALL = 'all';\n\nexport function StampsPanel() {\n const t = useT();\n const stamp = useStamp();\n const { defaultLibrary, sidebar } = useStampsConfig();\n // Which catalogs this sidebar shows (`stamps.sidebar`): the plain stamps by\n // default — never the people's marks, which have their own panel.\n const libraries = useStampLibraries({ kind: sidebar ?? ['stamps'] });\n const assets = useStampAssets();\n const { armAsset } = useArmStampAsset();\n const { activeToolId } = useTool();\n const { locale } = useLocale();\n const surface = useSurface('stamps');\n const fileRef = useRef<HTMLInputElement>(null);\n const [armedId, setArmedId] = useState<string | null>(null);\n const [busy, setBusy] = useState<'loading' | 'importing' | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [picked, setPicked] = useState<string>(ALL);\n\n // A command opened the panel ON a library (v2's `selectedLibraryId` prop).\n const openedOn = surface.props?.libraryId;\n useEffect(() => {\n if (typeof openedOn === 'string') setPicked(openedOn);\n }, [openedOn]);\n\n // First open: the user's stored libraries (the workspace store restores\n // them; this only awaits it), THEN the built-in library for this locale —\n // never at viewer boot, so a viewer whose user never opens this panel pays\n // nothing for it. A locale change while open swaps the built-in library;\n // the user's own are untouched.\n useEffect(() => {\n let live = true;\n setBusy('loading');\n restoreStampLibrariesOnce(stamp)\n .then(() => ensureDefaultLibrary(stamp, resolveStampsLocale(locale), defaultLibrary))\n .catch((err: unknown) => {\n console.error('[embedpdf] default stamps failed:', err);\n if (live) setError(t('demo.stampsError'));\n })\n .finally(() => live && setBusy(null));\n return () => {\n live = false;\n };\n // `t` and `defaultLibrary` are init-stable; only the locale re-runs this.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [stamp, locale]);\n\n // The interaction hub owns tool state: leaving the stamp tool (picking\n // another tool, pressing Escape) un-highlights the gallery.\n useEffect(() => {\n if (activeToolId !== 'stamp') setArmedId(null);\n }, [activeToolId]);\n\n const arm = (asset: StampAsset) => {\n setError(null);\n setArmedId(asset.id);\n void armAsset(asset.id).catch((err) => {\n console.error('[embedpdf] arm stamp failed:', err);\n setArmedId(null);\n setError(t('demo.stampsArmError'));\n });\n };\n\n const importPdf = (file: File) => {\n setError(null);\n setBusy('importing');\n // The file name is only a FALLBACK: an Acrobat-authored or previously\n // exported library names itself through its /Title.\n stamp\n .importLibraryPdf(file, { name: file.name.replace(/\\.pdf$/i, '') })\n .then((id) => setPicked(id))\n .catch((err) => {\n console.error('[embedpdf] stamp library import failed:', err);\n setError(t('demo.stampsImportError'));\n })\n .finally(() => setBusy(null));\n };\n\n /** The library as the PDF it is — title, registry, artwork — for Acrobat\n * or another viewer. */\n const exportPdf = (libraryId: string, name: string) => {\n const bytes = stamp.exportLibrary(libraryId);\n if (!bytes) return;\n const blob = new Blob([bytes as BlobPart], { type: 'application/pdf' });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = `${name || 'stamps'}.pdf`;\n a.click();\n URL.revokeObjectURL(url);\n };\n\n // A removed library falls back to \"All\"; the picker never names a ghost.\n // One library needs no picker: it is simply the selection (so its export\n // button is reachable).\n const selectedId =\n libraries.length === 1\n ? libraries[0].id\n : libraries.some((library) => library.id === picked)\n ? picked\n : ALL;\n const selected = selectedId === ALL ? null : (libraries.find((l) => l.id === selectedId) ?? null);\n const shown = selectedId === ALL ? assets : assets.filter((a) => a.libraryId === selectedId);\n const isDefault = (libraryId: string) => libraryId === DEFAULT_LIBRARY_ID;\n\n return (\n <div className=\"flex min-h-0 flex-1 flex-col\">\n {libraries.length > 0 && (\n <div className=\"border-border-subtle flex items-center gap-1 border-b p-2\">\n {libraries.length > 1 ? (\n <select\n value={selectedId}\n onChange={(event) => setPicked(event.target.value)}\n aria-label={t('demo.stampsTitle')}\n className=\"border-border bg-surface text-fg min-w-0 flex-1 rounded border px-2 py-1.5 text-sm\"\n >\n <option value={ALL}>{t('demo.stampsAll')}</option>\n {libraries.map((library) => (\n <option key={library.id} value={library.id}>\n {library.name}\n </option>\n ))}\n </select>\n ) : (\n <span className=\"text-fg-muted min-w-0 flex-1 truncate px-1 text-xs font-semibold uppercase tracking-wide\">\n {libraries[0].name}\n </span>\n )}\n {selected && (\n <>\n <button\n type=\"button\"\n onClick={() => exportPdf(selected.id, selected.name)}\n title={t('demo.stampsExportLibrary')}\n className=\"text-fg-muted hover:text-fg grid h-7 w-7 shrink-0 place-items-center rounded\"\n >\n <Icon name=\"download\" size={14} />\n </button>\n {!isDefault(selected.id) && (\n <button\n type=\"button\"\n onClick={() => void stamp.removeLibrary(selected.id)}\n title={t('demo.stampsRemoveLibrary')}\n className=\"text-fg-muted hover:text-fg grid h-7 w-7 shrink-0 place-items-center rounded\"\n >\n <Icon name=\"trash\" size={14} />\n </button>\n )}\n </>\n )}\n </div>\n )}\n\n <div className=\"min-h-0 flex-1 overflow-y-auto p-3\">\n {busy === 'loading' && shown.length === 0 ? (\n <div className=\"flex flex-col items-center gap-3 px-4 py-10 text-center\">\n <div className=\"border-border-subtle border-t-accent h-6 w-6 animate-spin rounded-full border-2\" />\n <p className=\"text-fg-muted text-sm\">{t('demo.stampsLoading')}</p>\n </div>\n ) : shown.length === 0 ? (\n <div className=\"flex flex-col items-center gap-3 px-4 py-10 text-center\">\n <Icon name=\"rubberStamp\" size={32} className=\"text-fg-muted\" />\n <p className=\"text-fg-muted text-sm\">{t('demo.stampsEmpty')}</p>\n </div>\n ) : (\n <ul className=\"grid grid-cols-2 gap-3\">\n {shown.map((asset) => (\n <li key={asset.id} className=\"group relative\">\n <StampAssetCell\n asset={asset}\n armed={armedId === asset.id}\n onArm={() => arm(asset)}\n />\n {!isDefault(asset.libraryId) && (\n <button\n type=\"button\"\n onClick={() => void stamp.removeAsset(asset.id)}\n title={t('demo.stampsRemoveStamp')}\n className=\"bg-surface border-border text-fg-muted hover:text-fg absolute right-1 top-1 grid h-5 w-5 place-items-center rounded-full border opacity-0 shadow-sm focus:opacity-100 group-hover:opacity-100\"\n >\n <Icon name=\"x\" size={12} />\n </button>\n )}\n </li>\n ))}\n </ul>\n )}\n </div>\n\n {(error || armedId) && (\n <div\n className={`border-border-subtle shrink-0 border-t px-3 py-2 text-xs ${\n error ? 'text-red-600' : 'text-fg-muted'\n }`}\n >\n {error ?? t('demo.stampsArmedHint')}\n </div>\n )}\n\n <div className=\"border-border-subtle shrink-0 border-t p-3\">\n <button\n type=\"button\"\n disabled={busy != null}\n onClick={() => fileRef.current?.click()}\n title={t('demo.stampsImportHint')}\n className=\"border-border text-fg hover:bg-hover flex w-full items-center justify-center gap-2 rounded-md border px-3 py-1.5 text-sm disabled:opacity-40\"\n >\n <Icon name=\"rubberStampPlus\" size={16} />\n {busy === 'importing' ? t('demo.stampsImporting') : t('demo.stampsImport')}\n </button>\n <input\n ref={fileRef}\n type=\"file\"\n accept=\"application/pdf\"\n className=\"hidden\"\n onChange={(e) => {\n const file = e.currentTarget.files?.[0];\n e.currentTarget.value = ''; // allow re-picking the same file\n if (file) importPdf(file);\n }}\n />\n </div>\n </div>\n );\n}\n\n/** One grid cell: the plugin's cached preview through the object-URL hook\n * (the DOM resource's lifetime belongs to the framework layer, not the\n * store). Image only, as v2 — the artwork IS the label; the label is the\n * tooltip for the curious. */\nfunction StampAssetCell({\n asset,\n armed,\n onArm,\n}: {\n asset: StampAsset;\n armed: boolean;\n onArm: () => void;\n}) {\n const url = useStampAssetPreviewUrl(asset.id);\n return (\n <button\n type=\"button\"\n onClick={onArm}\n title={asset.label}\n aria-pressed={armed}\n className={`flex aspect-square w-full items-center justify-center rounded-md border p-2 ${\n armed\n ? 'border-accent bg-accent-light ring-accent ring-2'\n : 'border-border-subtle hover:border-border hover:bg-hover'\n }`}\n >\n {url ? (\n <img src={url} alt={asset.label} className=\"max-h-full max-w-full object-contain\" />\n ) : (\n <span className=\"text-fg truncate text-sm\">{asset.label}</span>\n )}\n </button>\n );\n}\n","/**\n * The signatures sidebar (right panel) — Preview's signature sheet on v3\n * parts. One row per PERSON: a stamp library of kind `signatures` holding a\n * full signature and, optionally, initials. Nothing is stored beyond the\n * file; rename/export/delete are the library verbs.\n *\n * pick a mark → with a TARGET field (\"sign here\" was clicked, or a\n * signature widget selected) the mark goes into that field by the\n * plugin's mode; otherwise it ARMS — hover a page for the ghost, click a\n * signature field to sign it, click anywhere else to drop it as a stamp.\n *\n * Below the people: the signature fields of THIS document, signed or not,\n * with their verdicts — click an unsigned one to target it, a signed one to\n * inspect it.\n */\nimport { useEffect, useState } from 'react';\nimport { useTool } from '@embedpdf/react/interaction';\nimport { useT } from '@embedpdf/react/i18n';\nimport { useSurface } from '@embedpdf/react/shell';\nimport {\n useArmStampAsset,\n useStamp,\n useStampAssetPreviewUrl,\n type StampAsset,\n} from '@embedpdf/react/stamp';\nimport {\n useSignature,\n useSignatureSnapshot,\n useSignatureTarget,\n useSignatureVerdicts,\n useSignatureEvent,\n useSignerRows,\n type SignatureDTO,\n type SignatureVerdict,\n type SignerRow,\n} from '@embedpdf/react/signature';\nimport { useSignaturesConfig } from '../config-context';\nimport { Icon } from './icons';\nimport { restoreStampLibrariesOnce } from './stamp-store';\n\nconst fieldLabel = (\n field: { kind: 'fqn'; name: string } | { kind: 'objectNumber'; fieldObjectNumber: number },\n): string => (field.kind === 'fqn' ? field.name : `#${field.fieldObjectNumber}`);\n\nexport function SignaturesPanel() {\n const t = useT();\n const stamp = useStamp();\n const signature = useSignature();\n const config = useSignaturesConfig();\n const rows = useSignerRows();\n const { target, busy } = useSignatureTarget();\n const { armAsset } = useArmStampAsset();\n const { activeToolId } = useTool();\n const maker = useSurface('signature-maker');\n const [armedId, setArmedId] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n // Acrobat's warning: an unsaved edit just turned a signature that held into\n // one a save would invalidate. Shown until the next verdicts land.\n const [invalidating, setInvalidating] = useState<string | null>(null);\n useSignatureEvent((event) => {\n if (event.type === 'invalidating')\n setInvalidating(signature.signatureOf(event.field)?.fieldName ?? fieldLabel(event.field));\n else if (\n event.type === 'validated' &&\n !event.verdicts.some(\n (v) => v.summary === 'invalid' && v.modifications.basis === 'working-copy',\n )\n )\n setInvalidating(null);\n });\n\n // The people live in the same store as the stamps: bring them back on\n // first open (a no-op when the store component already did).\n useEffect(() => {\n void restoreStampLibrariesOnce(stamp);\n }, [stamp]);\n useEffect(() => {\n if (activeToolId !== 'stamp') setArmedId(null);\n }, [activeToolId]);\n\n const pick = (asset: StampAsset) => {\n setError(null);\n if (target) {\n void signature.placeMark({ assetId: asset.id }, { field: target }).catch((err) => {\n console.error('[embedpdf] placing the mark failed:', err);\n setError(t('demo.signError'));\n });\n return;\n }\n setArmedId(asset.id);\n void armAsset(asset.id).catch((err) => {\n console.error('[embedpdf] arm mark failed:', err);\n setArmedId(null);\n setError(t('demo.stampsArmError'));\n });\n };\n\n const canAddPerson = (config.libraries ?? 'many') === 'many' || rows.length === 0;\n const wantsInitials = (config.kinds ?? ['signature', 'initials']).includes('initials');\n\n return (\n <div className=\"flex min-h-0 flex-1 flex-col\">\n <div className=\"min-h-0 flex-1 overflow-y-auto p-3\">\n {rows.length === 0 ? (\n <div className=\"flex flex-col items-center gap-3 px-4 py-8 text-center\">\n <Icon name=\"signature\" size={32} className=\"text-fg-muted\" />\n <p className=\"text-fg-muted text-sm\">{t('demo.signaturesEmpty')}</p>\n </div>\n ) : (\n <ul className=\"flex flex-col gap-3\">\n {rows.map((row) => (\n <SignerRowView\n key={row.libraryId}\n row={row}\n armedId={armedId}\n wantsInitials={wantsInitials}\n onPick={pick}\n onAddInitials={() =>\n maker.open({ exclusive: 'modal', props: { libraryId: row.libraryId } })\n }\n />\n ))}\n </ul>\n )}\n <DocumentSignatures />\n </div>\n\n {invalidating && (\n <div className=\"border-border-subtle shrink-0 border-t px-3 py-2 text-xs text-amber-700\">\n {t('demo.signaturesInvalidating', { params: { field: invalidating } })}\n </div>\n )}\n {(error || target || armedId) && (\n <div\n className={`border-border-subtle shrink-0 border-t px-3 py-2 text-xs ${\n error ? 'text-red-600' : 'text-fg-muted'\n }`}\n >\n {error ??\n (target\n ? busy\n ? t('demo.signSigning')\n : t('demo.signaturesTargetHint')\n : t('demo.signaturesArmedHint'))}\n </div>\n )}\n\n {canAddPerson ? (\n <div className=\"border-border-subtle shrink-0 border-t p-3\">\n <button\n type=\"button\"\n onClick={() => maker.open({ exclusive: 'modal' })}\n className=\"border-border text-fg hover:bg-hover flex w-full items-center justify-center gap-2 rounded-md border px-3 py-1.5 text-sm\"\n >\n <Icon name=\"plus\" size={16} />\n {t('demo.signaturesNew')}\n </button>\n </div>\n ) : null}\n </div>\n );\n}\n\nfunction SignerRowView({\n row,\n armedId,\n wantsInitials,\n onPick,\n onAddInitials,\n}: {\n row: SignerRow;\n armedId: string | null;\n wantsInitials: boolean;\n onPick: (asset: StampAsset) => void;\n onAddInitials: () => void;\n}) {\n const t = useT();\n const stamp = useStamp();\n const [renaming, setRenaming] = useState<string | null>(null);\n\n const exportPdf = () => {\n const bytes = stamp.exportLibrary(row.libraryId);\n if (!bytes) return;\n const blob = new Blob([bytes as BlobPart], { type: 'application/pdf' });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = `${row.name || 'signature'}.pdf`;\n a.click();\n URL.revokeObjectURL(url);\n };\n const commitRename = () => {\n const name = renaming?.trim();\n setRenaming(null);\n if (name && name !== row.name) void stamp.updateLibrary(row.libraryId, { name });\n };\n const iconButton = 'text-fg-muted hover:text-fg grid h-6 w-6 shrink-0 place-items-center rounded';\n\n return (\n <li className=\"border-border-subtle rounded-md border p-2\">\n <div className=\"flex items-center gap-1\">\n {renaming !== null ? (\n <input\n autoFocus\n value={renaming}\n onChange={(e) => setRenaming(e.target.value)}\n onBlur={commitRename}\n onKeyDown={(e) => {\n if (e.key === 'Enter') commitRename();\n if (e.key === 'Escape') setRenaming(null);\n }}\n className=\"border-border bg-surface text-fg min-w-0 flex-1 rounded border px-1.5 py-0.5 text-sm\"\n />\n ) : (\n <span className=\"text-fg min-w-0 flex-1 truncate text-sm font-medium\">{row.name}</span>\n )}\n <button\n type=\"button\"\n onClick={() => setRenaming(row.name)}\n title={t('demo.signaturesRename')}\n className={iconButton}\n >\n <Icon name=\"pencilMarker\" size={13} />\n </button>\n <button\n type=\"button\"\n onClick={exportPdf}\n title={t('demo.signaturesExport')}\n className={iconButton}\n >\n <Icon name=\"download\" size={13} />\n </button>\n <button\n type=\"button\"\n onClick={() => void stamp.removeLibrary(row.libraryId)}\n title={t('demo.signaturesRemove')}\n className={iconButton}\n >\n <Icon name=\"trash\" size={13} />\n </button>\n </div>\n <div className=\"mt-2 grid grid-cols-[2fr_1fr] gap-2\">\n {row.signatures.map((asset) => (\n <MarkThumb\n key={asset.id}\n asset={asset}\n label={t('demo.signatureLabel')}\n armed={armedId === asset.id}\n onPick={() => onPick(asset)}\n />\n ))}\n {wantsInitials ? (\n row.initials ? (\n <MarkThumb\n asset={row.initials}\n label={t('demo.initialsLabel')}\n armed={armedId === row.initials.id}\n onPick={() => onPick(row.initials!)}\n />\n ) : (\n <button\n type=\"button\"\n onClick={onAddInitials}\n title={t('demo.signaturesAddInitials')}\n className=\"border-border-subtle text-fg-muted hover:bg-hover flex h-16 items-center justify-center rounded-md border border-dashed text-xs\"\n >\n <Icon name=\"plus\" size={14} />\n </button>\n )\n ) : null}\n </div>\n </li>\n );\n}\n\nfunction MarkThumb({\n asset,\n label,\n armed,\n onPick,\n}: {\n asset: StampAsset;\n label: string;\n armed: boolean;\n onPick: () => void;\n}) {\n const url = useStampAssetPreviewUrl(asset.id);\n return (\n <button\n type=\"button\"\n onClick={onPick}\n title={label}\n aria-pressed={armed}\n className={`flex h-16 items-center justify-center rounded-md border p-1 ${\n armed\n ? 'border-accent bg-accent-light ring-accent ring-2'\n : 'border-border-subtle hover:border-border hover:bg-hover'\n }`}\n >\n {url ? (\n <img src={url} alt={label} className=\"max-h-full max-w-full object-contain\" />\n ) : (\n <span className=\"text-fg-muted text-xs\">{label}</span>\n )}\n </button>\n );\n}\n\n/** The signature fields of this document, with their state. */\nfunction DocumentSignatures() {\n const t = useT();\n const signature = useSignature();\n const snapshot = useSignatureSnapshot();\n const verdicts = useSignatureVerdicts();\n const { target } = useSignatureTarget();\n const [validating, setValidating] = useState(false);\n const fields = snapshot?.signatures ?? [];\n const verdictOf = (dto: SignatureDTO) =>\n verdicts?.find((v) => v.signature.index === dto.index) ?? null;\n // Three honest states: valid; valid on disk but unsaved edits would\n // invalidate it (the verdict judged the working copy); invalid on disk.\n const verdictLabel = (v: SignatureVerdict | null): string =>\n !v\n ? t('demo.signaturesSigned')\n : v.summary === 'valid'\n ? t('demo.verdictValid')\n : v.summary === 'valid-untrusted'\n ? t('demo.verdictValidUntrusted')\n : v.summary === 'indeterminate'\n ? t('demo.verdictIndeterminate')\n : v.modifications.basis === 'working-copy'\n ? t('demo.verdictWillInvalidate')\n : t('demo.verdictInvalid');\n const verdictTone = (v: SignatureVerdict | null): string =>\n !v || v.summary === 'indeterminate'\n ? 'text-fg-muted'\n : v.summary === 'invalid'\n ? v.modifications.basis === 'working-copy'\n ? 'text-amber-600'\n : 'text-red-600'\n : v.summary === 'valid-untrusted'\n ? 'text-amber-600'\n : 'text-green-600';\n const isTarget = (dto: SignatureDTO) =>\n !!target &&\n (target.kind === 'fqn'\n ? target.name === dto.fieldName\n : target.fieldObjectNumber ===\n (dto.field.kind === 'objectNumber' ? dto.field.fieldObjectNumber : -1));\n const validate = () => {\n setValidating(true);\n void signature.validate().finally(() => setValidating(false));\n };\n\n return (\n <div className=\"mt-4\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-fg-muted text-xs font-semibold uppercase tracking-wide\">\n {t('demo.signaturesInDocument')}\n </span>\n {fields.some((f) => f.signed) ? (\n <button\n type=\"button\"\n disabled={validating}\n onClick={validate}\n className=\"text-accent text-xs hover:underline disabled:opacity-60\"\n >\n {validating ? t('demo.signaturesValidating') : t('demo.signaturesValidate')}\n </button>\n ) : null}\n </div>\n {fields.length === 0 ? (\n <p className=\"text-fg-muted mt-1 text-xs\">{t('demo.signaturesNone')}</p>\n ) : (\n <ul className=\"mt-1 flex flex-col gap-1\">\n {fields.map((dto) => {\n const verdict = verdictOf(dto);\n return (\n <li key={dto.index}>\n <button\n type=\"button\"\n onClick={() =>\n dto.signed ? signature.inspect(dto.field) : signature.setTarget(dto.field)\n }\n className={`hover:bg-hover flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm ${\n isTarget(dto) ? 'bg-accent-light' : ''\n }`}\n >\n <Icon\n name={dto.signed ? 'check' : 'signature'}\n size={14}\n className={dto.signed ? 'text-green-600' : 'text-fg-muted'}\n />\n <span className=\"text-fg min-w-0 flex-1 truncate\">{dto.fieldName}</span>\n <span\n className={`shrink-0 text-right text-xs ${dto.signed ? verdictTone(verdict) : 'text-fg-muted'}`}\n >\n {dto.signed ? verdictLabel(verdict) : t('demo.signaturesUnsigned')}\n </span>\n </button>\n </li>\n );\n })}\n </ul>\n )}\n </div>\n );\n}\n","/**\n * The static chrome around the toolbars: the left/right sidebars (shell\n * surfaces) and the bottom page-controls overlay. Deliberately minimal —\n * chrome-parity scope. Panels read their open state from plugin-shell; the\n * app owns their DOM.\n *\n * There is no built-in header: branding, a locale picker and a theme switch\n * are the EMBEDDER's chrome, not the viewer's. The frame keeps a `header`\n * socket for a slotted one (see Shell).\n */\nimport { useEffect } from 'react';\nimport { useSelector, useDocumentId } from '@embedpdf/react/runtime';\nimport { Stage, StageToken, usePages } from '@embedpdf/react/stage';\nimport { RenderLayer } from '@embedpdf/react/render';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\nimport { ThumbsStageToken } from '../config/stage';\nimport { Icon } from './icons';\nimport { AnnotationStylePanel } from './annotation-style';\nimport { CommentsPanel } from './comments-panel';\nimport { RedactionPanel } from './redaction-panel';\nimport { SearchPanel } from './search-panel';\nimport { StampsPanel } from './stamps-panel';\nimport { SignaturesPanel } from './signatures-panel';\n\n// ── left sidebar (thumbnails / outline tabs) ─────────────────────────────────\nexport function LeftSidebar() {\n const t = useT();\n const sidebar = useSurface('sidebar');\n if (!sidebar.isOpen) return null;\n return (\n <aside className=\"border-border-subtle bg-surface flex w-60 shrink-0 flex-col border-r\">\n <div className=\"border-border-subtle flex items-center gap-1 border-b p-2\">\n <span className=\"bg-accent-light text-accent rounded-md px-2 py-1 text-xs font-medium\">\n {t('demo.thumbnails')}\n </span>\n <span className=\"text-fg-muted rounded-md px-2 py-1 text-xs font-medium\">\n {t('demo.outline')}\n </span>\n <div className=\"flex-1\" />\n <button\n type=\"button\"\n onClick={sidebar.close}\n className=\"text-fg-muted hover:bg-hover grid h-7 w-7 place-items-center rounded-md\"\n >\n <Icon name=\"x\" size={16} />\n </button>\n </div>\n <ThumbnailList />\n </aside>\n );\n}\n\n// The thumbnail rail: the SAME document through the thumbnail Stage lens (a\n// single-column, fixed-zoom grid — see App's `stage-thumbs` plugin). Click a\n// thumb to navigate the MAIN lens; the rail follows the main view. Read-only —\n// no page edits (rotate/move/delete), just the page bitmap and its number.\nfunction ThumbnailList() {\n const { currentPage, goToPage } = usePages(); // the MAIN lens\n const { reveal } = usePages(ThumbsStageToken); // the SIDEBAR lens\n // Follow the main view: when its current page changes, make that thumb visible —\n // minimal movement, zero when it's already on screen.\n useEffect(() => reveal(currentPage), [currentPage, reveal]);\n return (\n <Stage\n token={ThumbsStageToken}\n zoomGestures={false} // fixed-magnification rail: cmd+wheel/pinch scrolls, never zooms\n className=\"flex-1\"\n style={{ position: 'relative' }}\n pageChrome={(page) => (\n <>\n {/* BOX-SPACE chrome: the click target + selection border hug the page\n box; the number sits in the reserved bottom band. Neither rotates. */}\n <button\n type=\"button\"\n onClick={() => goToPage(page.pageIndex)}\n title={`Page ${page.pageIndex + 1}`}\n style={{\n position: 'absolute',\n top: page.frame.top,\n left: page.frame.left,\n right: page.frame.right,\n bottom: page.frame.bottom,\n cursor: 'pointer',\n boxSizing: 'border-box',\n borderRadius: 4,\n border:\n page.pageIndex === currentPage\n ? '2px solid var(--ep-accent)'\n : '1px solid var(--ep-border-subtle)',\n boxShadow:\n page.pageIndex === currentPage ? '0 0 0 2px var(--ep-accent-light)' : 'none',\n }}\n />\n <div\n style={{\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n height: page.frame.bottom,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontSize: 11,\n color: 'var(--ep-fg-muted)',\n pointerEvents: 'none',\n }}\n >\n {page.pageIndex + 1}\n </div>\n </>\n )}\n >\n {/* page-space content: the bitmap, which rotates with the page */}\n {() => <RenderLayer />}\n </Stage>\n );\n}\n\n// ── right sidebar (search / comment / style / redaction / stamps) ────────────\nexport function RightSidebar() {\n const t = useT();\n // Keys the SearchPanel below: the panel seeds its query box from the active\n // document's search state on mount, so it must remount when the active\n // document changes (switching tabs with the sidebar open) to re-seed.\n const documentId = useDocumentId();\n const search = useSurface('search');\n const comment = useSurface('comment');\n const style = useSurface('annotation-style');\n const redaction = useSurface('redaction');\n const stamps = useSurface('stamps');\n const signatures = useSurface('signatures');\n const active = search.isOpen\n ? 'search'\n : comment.isOpen\n ? 'comment'\n : style.isOpen\n ? 'style'\n : redaction.isOpen\n ? 'redaction'\n : stamps.isOpen\n ? 'stamps'\n : signatures.isOpen\n ? 'signatures'\n : null;\n if (!active) return null;\n\n const titleKey =\n active === 'search'\n ? 'demo.searchTitle'\n : active === 'comment'\n ? 'demo.commentsTitle'\n : active === 'redaction'\n ? 'demo.redactionTitle'\n : active === 'stamps'\n ? 'demo.stampsTitle'\n : active === 'signatures'\n ? 'demo.signaturesTitle'\n : 'demo.styleTitle';\n const close =\n active === 'search'\n ? search.close\n : active === 'comment'\n ? comment.close\n : active === 'redaction'\n ? redaction.close\n : active === 'stamps'\n ? stamps.close\n : active === 'signatures'\n ? signatures.close\n : style.close;\n\n return (\n <aside className=\"border-border-subtle bg-surface flex w-72 shrink-0 flex-col border-l\">\n <div className=\"border-border-subtle flex items-center justify-between border-b p-3\">\n <span className=\"text-fg text-sm font-semibold\">{t(titleKey)}</span>\n <button\n type=\"button\"\n onClick={close}\n className=\"text-fg-muted hover:bg-hover grid h-7 w-7 place-items-center rounded-md\"\n >\n <Icon name=\"x\" size={16} />\n </button>\n </div>\n {active === 'style' ? (\n <AnnotationStylePanel />\n ) : active === 'search' ? (\n <SearchPanel key={documentId ?? 'none'} />\n ) : active === 'redaction' ? (\n <RedactionPanel />\n ) : active === 'stamps' ? (\n <StampsPanel />\n ) : active === 'signatures' ? (\n <SignaturesPanel />\n ) : (\n <CommentsPanel key={documentId ?? 'none'} />\n )}\n </aside>\n );\n}\n\n// ── bottom page-controls overlay ─────────────────────────────────────────────\nexport function PageControls() {\n const t = useT();\n // the Stage cursor is a 0-based display index; people count from 1\n const current = useSelector(StageToken, (c) => c.currentPage() + 1);\n const total = useSelector(StageToken, (c) => c.pageCount());\n if (!total) return null;\n return (\n <div className=\"pointer-events-none absolute inset-x-0 bottom-5 flex justify-center\">\n <div className=\"border-border-subtle bg-elevated/95 text-fg-secondary pointer-events-auto rounded-full border px-4 py-1.5 text-sm shadow-lg backdrop-blur\">\n {t('demo.page', { params: { current, total } })}\n </div>\n </div>\n );\n}\n","import { useState } from 'react';\nimport { useRedaction } from '@embedpdf/react/redaction';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\n\n/**\n * The apply-all confirm modal (`redact-confirm` shell surface, `exclusive:\n * 'modal'` via the command router). Shows the pending count and the\n * CLIENT-SIDE collateral estimate — other annotations the apply will destroy —\n * before anything irreversible happens. The authoritative collateral count\n * comes back on the result.\n */\nexport function RedactConfirmModal() {\n const t = useT();\n const surface = useSurface('redact-confirm');\n const redaction = useRedaction();\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n if (!surface.isOpen) return null;\n\n const count = redaction.pendingCount();\n const collateral = redaction.estimateCollateral();\n\n const apply = async () => {\n setBusy(true);\n setError(null);\n try {\n await redaction.applyAll();\n surface.close();\n } catch (err) {\n setError(err instanceof Error ? err.message : String(err));\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <div className=\"fixed inset-0 z-50 grid place-items-center bg-black/40\">\n <div className=\"border-border bg-surface w-96 rounded-lg border p-4 shadow-xl\">\n <h2 className=\"text-fg text-base font-semibold\">{t('demo.redactConfirmTitle')}</h2>\n <p className=\"text-fg-muted mt-2 text-sm\">\n {t('demo.redactConfirmBody', { params: { count } })}\n </p>\n {collateral > 0 ? (\n <p className=\"mt-2 text-sm font-medium text-red-600\">\n {t('demo.redactConfirmCollateral', { params: { count: collateral } })}\n </p>\n ) : null}\n {error ? <p className=\"mt-2 text-sm text-red-600\">{error}</p> : null}\n <div className=\"mt-4 flex justify-end gap-2\">\n <button\n type=\"button\"\n disabled={busy}\n onClick={surface.close}\n className=\"border-border text-fg hover:bg-hover rounded-md border px-3 py-1.5 text-sm\"\n >\n {t('demo.cancel')}\n </button>\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => void apply()}\n className=\"rounded-md bg-red-600 px-3 py-1.5 text-sm text-white hover:bg-red-700 disabled:opacity-60\"\n >\n {busy ? t('demo.redactApplying') : t('demo.redactApply')}\n </button>\n </div>\n </div>\n </div>\n );\n}\n","/**\n * The sign dialog (`signature-sign` modal surface): a mark met a field and\n * the mode is `ask` — or a \"sign here\" flow wants the facts first. Shows\n * the mark as it will sit in the field, takes reason and location, offers\n * a certification when the config allows it, and either SEALS the field\n * (`signField`) or only draws the mark into it (`fillField`).\n */\nimport { useState } from 'react';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\nimport { useStampAssetPreviewUrl } from '@embedpdf/react/stamp';\nimport { useSignature, type FormFieldRef, type Mark } from '@embedpdf/react/signature';\n\nexport function SignDialog() {\n const t = useT();\n const surface = useSurface('signature-sign');\n const signature = useSignature();\n const [reason, setReason] = useState('');\n const [location, setLocation] = useState('');\n // What the signature declares about later changes: a plain approval (form\n // filling and further signatures keep it valid; Acrobat's reading), or a\n // certification with its DocMDP permission. Only the FIRST signature can certify.\n const [signKind, setSignKind] = useState<'approval' | 'certify-3' | 'certify-2' | 'certify-1'>(\n 'approval',\n );\n const [busy, setBusy] = useState<'sign' | 'fill' | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n const field = surface.props?.field as FormFieldRef | undefined;\n const mark = surface.props?.mark as Mark | undefined;\n const assetId = mark && 'assetId' in mark ? mark.assetId : null;\n const preview = useStampAssetPreviewUrl(assetId);\n if (!surface.isOpen || !field || !mark) return null;\n\n const attribution = {\n ...(reason.trim() ? { reason: reason.trim() } : {}),\n ...(location.trim() ? { location: location.trim() } : {}),\n };\n const run = async (kind: 'sign' | 'fill') => {\n setBusy(kind);\n setError(null);\n try {\n if (kind === 'sign') {\n await signature.signField({\n field,\n mark,\n attribution,\n ...(signKind !== 'approval' && signature.canCertify()\n ? { certify: { permission: Number(signKind.slice(-1)) as 1 | 2 | 3 } }\n : {}),\n });\n } else {\n await signature.fillField(field, mark);\n }\n surface.close();\n } catch (err) {\n setError(err instanceof Error ? err.message : String(err));\n } finally {\n setBusy(null);\n }\n };\n\n const input = 'border-border bg-surface text-fg w-full rounded border px-2 py-1.5 text-sm';\n return (\n <div className=\"fixed inset-0 z-50 grid place-items-center bg-black/40\">\n <div className=\"border-border bg-surface w-96 rounded-lg border p-4 shadow-xl\">\n <h2 className=\"text-fg text-base font-semibold\">{t('demo.signTitle')}</h2>\n <div className=\"border-border-subtle mt-3 flex h-24 items-center justify-center rounded-md border p-2\">\n {preview ? (\n <img src={preview} alt=\"\" className=\"max-h-full max-w-full object-contain\" />\n ) : (\n <span className=\"text-fg-muted text-sm\">{t('demo.signatureLabel')}</span>\n )}\n </div>\n <label className=\"text-fg-muted mt-3 block text-xs\">\n {t('demo.signReason')}\n <input value={reason} onChange={(e) => setReason(e.target.value)} className={input} />\n </label>\n <label className=\"text-fg-muted mt-2 block text-xs\">\n {t('demo.signLocation')}\n <input value={location} onChange={(e) => setLocation(e.target.value)} className={input} />\n </label>\n {signature.canCertify() ? (\n <label className=\"text-fg-muted mt-3 block text-xs\">\n {t('demo.signKind')}\n <select\n value={signKind}\n onChange={(e) => setSignKind(e.target.value as typeof signKind)}\n className={input}\n >\n <option value=\"approval\">{t('demo.signKindApproval')}</option>\n <option value=\"certify-3\">{t('demo.signKindCertifyAnnotate')}</option>\n <option value=\"certify-2\">{t('demo.signKindCertifyFill')}</option>\n <option value=\"certify-1\">{t('demo.signKindCertifyLocked')}</option>\n </select>\n </label>\n ) : null}\n {error ? <p className=\"mt-2 text-sm text-red-600\">{error}</p> : null}\n <div className=\"mt-4 flex justify-end gap-2\">\n <button\n type=\"button\"\n disabled={busy != null}\n onClick={surface.close}\n className=\"border-border text-fg hover:bg-hover rounded-md border px-3 py-1.5 text-sm\"\n >\n {t('demo.cancel')}\n </button>\n {signature.canFill() ? (\n <button\n type=\"button\"\n disabled={busy != null}\n onClick={() => void run('fill')}\n className=\"border-border text-fg hover:bg-hover rounded-md border px-3 py-1.5 text-sm disabled:opacity-60\"\n >\n {t('demo.signFill')}\n </button>\n ) : null}\n {signature.canSign() ? (\n <button\n type=\"button\"\n disabled={busy != null}\n onClick={() => void run('sign')}\n className=\"bg-accent text-on-accent rounded-md px-3 py-1.5 text-sm disabled:opacity-60\"\n >\n {busy === 'sign' ? t('demo.signSigning') : t('demo.signButton')}\n </button>\n ) : null}\n </div>\n </div>\n </div>\n );\n}\n","/**\n * The signature plugin's UI intents → shell surfaces. The plugin owns the\n * act and says WHAT happened; the chrome decides WHAT OPENS:\n *\n * target (a \"sign here\" click) → the signatures panel, right side\n * ask (mode 'ask' met a field) → the sign dialog (modal)\n * inspect (a signed field clicked) → the validation popover\n *\n * Mounted once per document view; renders nothing.\n */\nimport { useSignatureEvent } from '@embedpdf/react/signature';\nimport { useShell } from '@embedpdf/react/shell';\n\nexport function SignatureBridge() {\n const shell = useShell();\n useSignatureEvent((event) => {\n switch (event.type) {\n case 'target':\n if (event.field) shell.open('signatures', { exclusive: 'right' });\n return;\n case 'ask':\n shell.open('signature-sign', {\n exclusive: 'modal',\n props: { field: event.field, mark: event.mark },\n });\n return;\n case 'inspect':\n shell.open('signature-inspector', { props: { field: event.field } });\n return;\n case 'invalidating':\n // The notice lives in the signatures panel; make sure it is seen.\n shell.open('signatures', { exclusive: 'right' });\n return;\n default:\n return;\n }\n });\n return null;\n}\n","/**\n * The validation popover (`signature-inspector` surface): what a signed\n * field's signature says and whether it holds — the four independent facts\n * (integrity, cryptography, trust, changes since) and the signer's claims,\n * anchored at the widget when its box is known, plus the signed revision as\n * a download (the exact bytes the signature covers). Mounted in the Stage\n * overlay so `<Anchored>` can project onto the page.\n */\nimport { useEffect, useState } from 'react';\nimport { Anchored } from '@embedpdf/react/anchored';\nimport { useSelector } from '@embedpdf/react/runtime';\nimport { FormToken } from '@embedpdf/react/form';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\nimport {\n useSignature,\n useSignatureSnapshot,\n useSignatureVerdicts,\n type FormFieldRef,\n type SignatureVerdict,\n} from '@embedpdf/react/signature';\nimport { Icon } from './icons';\n\nconst verdictKey = (v: SignatureVerdict | null): string =>\n !v\n ? 'demo.verdictIndeterminate'\n : v.summary === 'valid'\n ? 'demo.verdictValid'\n : v.summary === 'valid-untrusted'\n ? 'demo.verdictValidUntrusted'\n : v.summary === 'invalid'\n ? v.modifications.basis === 'working-copy'\n ? 'demo.verdictWillInvalidate'\n : 'demo.verdictInvalid'\n : 'demo.verdictIndeterminate';\n\n/** A PDF date string (`D:YYYYMMDDHHmmSSZ` or with a zone offset) as a locale date; the raw text when it is not one. */\nconst pdfDate = (raw: string): string => {\n const m = /^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(Z|[+-]\\d{2}'?\\d{2}'?)?/.exec(raw);\n if (!m) return raw;\n const [, y, mo = '01', d = '01', h = '00', mi = '00', s = '00', zone] = m;\n const offset =\n !zone || zone === 'Z'\n ? 'Z'\n : `${zone[0]}${zone.slice(1, 3)}:${zone.slice(3).replace(/'/g, '') || '00'}`;\n const date = new Date(`${y}-${mo}-${d}T${h}:${mi}:${s}${offset}`);\n return Number.isNaN(date.getTime()) ? raw : date.toLocaleString();\n};\n\nconst tone = (summary: SignatureVerdict['summary'] | null): string =>\n summary === 'valid'\n ? 'text-green-600'\n : summary === 'invalid'\n ? 'text-red-600'\n : summary === 'valid-untrusted'\n ? 'text-amber-600'\n : 'text-fg-muted';\n\nexport function SignatureInspector() {\n const t = useT();\n const surface = useSurface('signature-inspector');\n const signature = useSignature();\n const snapshot = useSignatureSnapshot();\n const verdicts = useSignatureVerdicts();\n const [validating, setValidating] = useState(false);\n const field = surface.props?.field as FormFieldRef | undefined;\n const dto = field ? signature.signatureOf(field) : null;\n const verdict = field ? signature.verdictOf(field) : null;\n const widget = dto?.widget ?? null;\n const box = useSelector(FormToken, (c) =>\n widget && widget.annotObjectNumber > 0\n ? (c.fillItem(widget.annotObjectNumber)?.box ?? null)\n : null,\n );\n\n // Open on a field never validated: judge it now.\n useEffect(() => {\n if (!surface.isOpen || !dto?.signed || verdicts) return;\n setValidating(true);\n void signature.validate().finally(() => setValidating(false));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [surface.isOpen, dto?.index]);\n\n if (!surface.isOpen || !field || !dto || !snapshot) return null;\n\n const revalidate = () => {\n setValidating(true);\n void signature.validate().finally(() => setValidating(false));\n };\n const summary = verdict?.summary ?? null;\n const modifications = verdict?.modifications.verdict ?? null;\n const row = (label: string, value: string, className = 'text-fg') => (\n <div className=\"flex items-baseline justify-between gap-3 text-xs\">\n <span className=\"text-fg-muted\">{label}</span>\n <span className={`text-right ${className}`}>{value}</span>\n </div>\n );\n\n const card = (\n <div className=\"border-border bg-elevated w-72 rounded-lg border p-3 text-sm shadow-xl\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-fg font-semibold\">{t('demo.inspectTitle')}</span>\n <button\n type=\"button\"\n onClick={surface.close}\n className=\"text-fg-muted hover:bg-hover grid h-6 w-6 place-items-center rounded\"\n aria-label={t('demo.cancel')}\n >\n <Icon name=\"x\" size={14} />\n </button>\n </div>\n <p className={`mt-1 text-sm font-medium ${tone(summary)}`}>\n {validating ? t('demo.signaturesValidating') : t(verdictKey(verdict))}\n </p>\n <div className=\"mt-2 flex flex-col gap-1\">\n {row(t('demo.inspectSigner'), dto.signer.name ?? '—')}\n {dto.signer.reason ? row(t('demo.inspectReason'), dto.signer.reason) : null}\n {dto.signer.location ? row(t('demo.inspectLocation'), dto.signer.location) : null}\n {dto.signer.claimedTime\n ? row(t('demo.inspectTime'), pdfDate(dto.signer.claimedTime))\n : null}\n </div>\n <div className=\"border-border-subtle mt-2 flex flex-col gap-1 border-t pt-2\">\n {row(\n t('demo.inspectIntegrity'),\n verdict?.integrity ?? '—',\n tone(\n verdict?.integrity === 'valid'\n ? 'valid'\n : verdict?.integrity === 'invalid'\n ? 'invalid'\n : null,\n ),\n )}\n {row(t('demo.inspectCryptography'), verdict?.cryptography ?? '—')}\n {row(t('demo.inspectTrust'), verdict?.trust ?? '—')}\n {row(\n t('demo.inspectChanges'),\n modifications === 'unchanged'\n ? verdict?.modifications.undone\n ? t('demo.verdictRestored')\n : t('demo.verdictUnchanged')\n : modifications === 'permitted'\n ? t('demo.verdictPermitted')\n : modifications === 'forbidden'\n ? t('demo.verdictForbidden')\n : '—',\n modifications === 'forbidden' ? 'text-red-600' : 'text-fg',\n )}\n {verdict?.modifications.laterRevisions\n ? row(t('demo.inspectLaterRevisions'), String(verdict.modifications.laterRevisions))\n : null}\n </div>\n <div className=\"mt-3 flex justify-end gap-2\">\n <button\n type=\"button\"\n disabled={validating}\n onClick={revalidate}\n className=\"border-border text-fg hover:bg-hover rounded-md border px-2 py-1 text-xs disabled:opacity-60\"\n >\n {t('demo.signaturesValidate')}\n </button>\n <DownloadRevision field={field} />\n </div>\n </div>\n );\n\n if (widget && widget.pageObjectNumber > 0 && box) {\n return (\n <Anchored anchor={{ pon: widget.pageObjectNumber, bounds: box }} placement=\"bottom\" gap={8}>\n {card}\n </Anchored>\n );\n }\n return <div className=\"absolute right-4 top-4 z-40\">{card}</div>;\n}\n\n/** The signed revision — the exact bytes the signature covers — as a file. */\nfunction DownloadRevision({ field }: { field: FormFieldRef }) {\n const t = useT();\n const signature = useSignature();\n const dto = signature.signatureOf(field);\n const [busy, setBusy] = useState(false);\n if (!dto || dto.revisionIndex === null) return null;\n const revisionIndex = dto.revisionIndex;\n const run = async () => {\n setBusy(true);\n try {\n const bytes = await signature.revisionBytes(revisionIndex);\n const blob = new Blob([bytes as BlobPart], { type: 'application/pdf' });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = `${dto.fieldName}-signed.pdf`;\n a.click();\n URL.revokeObjectURL(url);\n } catch (err) {\n console.error('[embedpdf] signed revision download failed:', err);\n } finally {\n setBusy(false);\n }\n };\n return (\n <button\n type=\"button\"\n disabled={busy}\n onClick={() => void run()}\n className=\"border-border text-fg hover:bg-hover rounded-md border px-2 py-1 text-xs disabled:opacity-60\"\n >\n {t('demo.inspectDownload')}\n </button>\n );\n}\n","/**\n * The mark maker (`signature-maker` modal surface): a person's signature and\n * initials, drawn, typed, or uploaded, saved as ONE library of kind\n * `signatures` — the file IS the person (Preview's model). Chrome code over\n * the stamp plugin's generic calls: `createLibrary` + `addAsset({ mark })`;\n * rename/export/delete are the library verbs. Opened on an existing library\n * (`props.libraryId`) it only adds the missing initials.\n */\nimport { useEffect, useRef, useState } from 'react';\nimport { useKernel } from '@embedpdf/react/runtime';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\nimport { useStamp, type MarkSource } from '@embedpdf/react/stamp';\nimport {\n INITIALS_MARK_NAME,\n SIGNATURE_MARK_NAME,\n SIGNATURES_LIBRARY_KIND,\n} from '@embedpdf/react/signature';\nimport { useSignaturesConfig } from '../config-context';\nimport { Icon } from './icons';\n\ntype Tab = 'draw' | 'type' | 'upload';\ntype Stroke = Array<{ x: number; y: number }>;\n\nconst PAD = { width: 360, height: 120 };\nconst BUILTIN_FONTS: ReadonlyArray<{ key: string; label: string }> = [\n { key: 'helvetica-oblique', label: 'Helvetica' },\n { key: 'times-italic', label: 'Times' },\n];\n\n/** One pad: draw / type / upload, producing a `MarkSource` or null. */\nfunction MarkPad({\n value,\n onChange,\n fonts,\n registerFont,\n}: {\n value: MarkSource | null;\n onChange: (mark: MarkSource | null) => void;\n fonts: ReadonlyArray<{ key: string; label: string }>;\n registerFont: (key: string) => Promise<void>;\n}) {\n const t = useT();\n const [tab, setTab] = useState<Tab>('draw');\n const [strokes, setStrokes] = useState<Stroke[]>([]);\n const [text, setText] = useState('');\n const [font, setFont] = useState(fonts[0]?.key ?? 'helvetica-oblique');\n const [fileName, setFileName] = useState<string | null>(null);\n const canvas = useRef<HTMLCanvasElement>(null);\n const drawing = useRef<Stroke | null>(null);\n\n // Paint the strokes (device-pixel sharp).\n useEffect(() => {\n const el = canvas.current;\n if (!el) return;\n const dpr = window.devicePixelRatio || 1;\n el.width = PAD.width * dpr;\n el.height = PAD.height * dpr;\n const ctx = el.getContext('2d');\n if (!ctx) return;\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n ctx.clearRect(0, 0, PAD.width, PAD.height);\n ctx.lineCap = 'round';\n ctx.lineJoin = 'round';\n ctx.lineWidth = 2.5;\n ctx.strokeStyle = getComputedStyle(el).color || '#000';\n for (const stroke of strokes) {\n ctx.beginPath();\n stroke.forEach((p, i) => (i === 0 ? ctx.moveTo(p.x, p.y) : ctx.lineTo(p.x, p.y)));\n ctx.stroke();\n }\n }, [strokes, tab]);\n\n const point = (e: React.PointerEvent<HTMLCanvasElement>) => {\n const r = e.currentTarget.getBoundingClientRect();\n return { x: e.clientX - r.left, y: e.clientY - r.top };\n };\n const commitStrokes = (next: Stroke[]) => {\n setStrokes(next);\n onChange(\n next.length ? { kind: 'ink', strokes: next, color: '#000000', strokeWidth: 2.5 } : null,\n );\n };\n const commitText = async (next: string, key: string) => {\n setText(next);\n setFont(key);\n if (!next.trim()) {\n onChange(null);\n return;\n }\n await registerFont(key);\n onChange({ kind: 'text', text: next.trim(), fontFamily: key, color: '#000000', fontSize: 36 });\n };\n const pickFile = (file: File) => {\n setFileName(file.name);\n onChange(\n file.type === 'application/pdf'\n ? { kind: 'pdf', source: file, pageIndex: 0 }\n : { kind: 'image', source: file },\n );\n };\n\n const tabClass = (id: Tab) =>\n `rounded px-2 py-1 text-xs font-medium ${tab === id ? 'bg-accent text-on-accent' : 'text-fg-muted hover:bg-hover'}`;\n return (\n <div className=\"flex flex-col gap-2\">\n <div className=\"flex items-center gap-1\">\n <button type=\"button\" className={tabClass('draw')} onClick={() => setTab('draw')}>\n {t('demo.makerDraw')}\n </button>\n <button type=\"button\" className={tabClass('type')} onClick={() => setTab('type')}>\n {t('demo.makerType')}\n </button>\n <button type=\"button\" className={tabClass('upload')} onClick={() => setTab('upload')}>\n {t('demo.makerUpload')}\n </button>\n <div className=\"flex-1\" />\n {value ? (\n <button\n type=\"button\"\n onClick={() => {\n commitStrokes([]);\n setText('');\n setFileName(null);\n onChange(null);\n }}\n className=\"text-fg-muted hover:text-fg text-xs\"\n >\n {t('demo.makerClear')}\n </button>\n ) : null}\n </div>\n {tab === 'draw' ? (\n <canvas\n ref={canvas}\n style={{ width: PAD.width, height: PAD.height, touchAction: 'none' }}\n className=\"border-border-subtle bg-surface text-fg rounded-md border\"\n onPointerDown={(e) => {\n e.currentTarget.setPointerCapture(e.pointerId);\n drawing.current = [point(e)];\n setStrokes((s) => [...s, drawing.current!]);\n }}\n onPointerMove={(e) => {\n if (!drawing.current) return;\n drawing.current.push(point(e));\n setStrokes((s) => [...s.slice(0, -1), [...drawing.current!]]);\n }}\n onPointerUp={() => {\n if (!drawing.current) return;\n const done = drawing.current;\n drawing.current = null;\n setStrokes((s) => {\n const next = [...s.slice(0, -1), done];\n commitStrokes(next);\n return next;\n });\n }}\n />\n ) : tab === 'type' ? (\n <div className=\"flex flex-col gap-2\">\n <input\n value={text}\n placeholder={t('demo.makerTypePlaceholder')}\n onChange={(e) => void commitText(e.target.value, font)}\n className=\"border-border bg-surface text-fg w-full rounded border px-2 py-1.5 text-sm\"\n />\n <label className=\"text-fg-muted flex items-center gap-2 text-xs\">\n {t('demo.makerFont')}\n <select\n value={font}\n onChange={(e) => void commitText(text, e.target.value)}\n className=\"border-border bg-surface text-fg rounded border px-2 py-1 text-xs\"\n >\n {fonts.map((f) => (\n <option key={f.key} value={f.key}>\n {f.label}\n </option>\n ))}\n </select>\n </label>\n </div>\n ) : (\n <label className=\"border-border-subtle text-fg-muted hover:bg-hover flex h-24 cursor-pointer items-center justify-center rounded-md border border-dashed text-sm\">\n {fileName ?? t('demo.makerUploadHint')}\n <input\n type=\"file\"\n accept=\"image/png,image/jpeg,application/pdf\"\n className=\"hidden\"\n onChange={(e) => {\n const file = e.currentTarget.files?.[0];\n e.currentTarget.value = '';\n if (file) pickFile(file);\n }}\n />\n </label>\n )}\n </div>\n );\n}\n\nexport function SignatureMakerModal() {\n const t = useT();\n const surface = useSurface('signature-maker');\n const stamp = useStamp();\n const kernel = useKernel();\n const config = useSignaturesConfig();\n const [name, setName] = useState('');\n const [signatureMark, setSignatureMark] = useState<MarkSource | null>(null);\n const [initialsMark, setInitialsMark] = useState<MarkSource | null>(null);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const existingId = surface.props?.libraryId as string | undefined;\n const existing = existingId ? stamp.library(existingId) : null;\n const wantsInitials = (config.kinds ?? ['signature', 'initials']).includes('initials');\n const fonts = [\n ...(config.fonts ?? []).map((f) => ({ key: f.key, label: f.label })),\n ...BUILTIN_FONTS,\n ];\n const registered = useRef(new Set<string>());\n // A configured script face is registered on the engine the stamp plugin\n // authors with (the viewer's own) the first time a typed mark uses it.\n const registerFont = async (key: string) => {\n const spec = config.fonts?.find((f) => f.key === key);\n if (!spec || registered.current.has(key) || !kernel.engine.fonts) return;\n const response = await fetch(spec.url);\n if (!response.ok) throw new Error(`${spec.url}: HTTP ${response.status}`);\n await kernel.engine.fonts.register({ key, data: new Uint8Array(await response.arrayBuffer()) });\n registered.current.add(key);\n };\n\n if (!surface.isOpen) return null;\n\n const canSave = existing ? initialsMark != null : name.trim().length > 0 && signatureMark != null;\n const save = async () => {\n setBusy(true);\n setError(null);\n try {\n if (existing) {\n await stamp.addAsset({\n libraryId: existing.id,\n name: INITIALS_MARK_NAME,\n label: t('demo.initialsLabel'),\n mark: initialsMark!,\n });\n } else {\n const libraryId = await stamp.createLibrary(name.trim(), { kind: SIGNATURES_LIBRARY_KIND });\n await stamp.addAsset({\n libraryId,\n name: SIGNATURE_MARK_NAME,\n label: t('demo.signatureLabel'),\n mark: signatureMark!,\n });\n if (initialsMark) {\n await stamp.addAsset({\n libraryId,\n name: INITIALS_MARK_NAME,\n label: t('demo.initialsLabel'),\n mark: initialsMark,\n });\n }\n }\n setName('');\n setSignatureMark(null);\n setInitialsMark(null);\n surface.close();\n } catch (err) {\n console.error('[embedpdf] saving the signature failed:', err);\n setError(t('demo.makerError'));\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <div className=\"fixed inset-0 z-50 grid place-items-center bg-black/40\">\n <div className=\"border-border bg-surface w-[26rem] rounded-lg border p-4 shadow-xl\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-fg text-base font-semibold\">\n {existing ? t('demo.signaturesAddInitials') : t('demo.makerTitle')}\n </h2>\n <button\n type=\"button\"\n onClick={surface.close}\n className=\"text-fg-muted hover:bg-hover grid h-7 w-7 place-items-center rounded-md\"\n aria-label={t('demo.cancel')}\n >\n <Icon name=\"x\" size={16} />\n </button>\n </div>\n {existing ? null : (\n <label className=\"text-fg-muted mt-3 block text-xs\">\n {t('demo.makerName')}\n <input\n value={name}\n placeholder={t('demo.makerNamePlaceholder')}\n onChange={(e) => setName(e.target.value)}\n className=\"border-border bg-surface text-fg mt-1 w-full rounded border px-2 py-1.5 text-sm\"\n />\n </label>\n )}\n {existing ? null : (\n <div className=\"mt-3\">\n <p className=\"text-fg mb-1 text-xs font-semibold uppercase tracking-wide\">\n {t('demo.signatureLabel')}\n </p>\n <MarkPad\n value={signatureMark}\n onChange={setSignatureMark}\n fonts={fonts}\n registerFont={registerFont}\n />\n </div>\n )}\n {wantsInitials ? (\n <div className=\"mt-3\">\n <p className=\"text-fg mb-1 text-xs font-semibold uppercase tracking-wide\">\n {t('demo.initialsLabel')}\n {existing ? null : (\n <span className=\"text-fg-muted ml-1 font-normal normal-case tracking-normal\">\n {t('demo.makerOptional')}\n </span>\n )}\n </p>\n <MarkPad\n value={initialsMark}\n onChange={setInitialsMark}\n fonts={fonts}\n registerFont={registerFont}\n />\n </div>\n ) : null}\n {error ? <p className=\"mt-2 text-sm text-red-600\">{error}</p> : null}\n <div className=\"mt-4 flex justify-end gap-2\">\n <button\n type=\"button\"\n disabled={busy}\n onClick={surface.close}\n className=\"border-border text-fg hover:bg-hover rounded-md border px-3 py-1.5 text-sm\"\n >\n {t('demo.cancel')}\n </button>\n <button\n type=\"button\"\n disabled={busy || !canSave}\n onClick={() => void save()}\n className=\"bg-accent text-on-accent rounded-md px-3 py-1.5 text-sm disabled:opacity-60\"\n >\n {busy ? t('demo.makerSaving') : t('demo.makerSave')}\n </button>\n </div>\n </div>\n </div>\n );\n}\n","/**\n * Boot-state panes for the document area — what renders INSTEAD of the Stage\n * while the selected tab's document isn't ready:\n *\n * `locked` → <PasswordPrompt/> (per-tab, v2's document-password-prompt port)\n * `error` → <DocumentError/>\n *\n * Both are per-TAB, not modal: several tabs can be locked/broken at once and\n * switching tabs stays free. The prompt drives ONE call —\n * `documents.unlock(id, { password })` — identical on the local (worker loads\n * the parked bytes) and cloud (/access grant) engines. The \"incorrect\" copy\n * keys on a real rejection: either this session's failed attempt, or\n * `passwordProvided` (a config-supplied password the engine already rejected).\n */\nimport { useState } from 'react';\nimport { useDocumentId, useDocuments } from '@embedpdf/react/runtime';\nimport { useT } from '@embedpdf/react/i18n';\nimport { Icon } from './icons';\n\nexport function PasswordPrompt() {\n const docId = useDocumentId();\n const { docs, unlock, close } = useDocuments();\n const t = useT();\n const [password, setPassword] = useState('');\n const [rejected, setRejected] = useState(false);\n const [busy, setBusy] = useState(false);\n\n const doc = docs.find((d) => d.id === docId);\n if (!docId || !doc) return null;\n const incorrect = rejected || doc.passwordProvided === true;\n\n const submit = async () => {\n if (busy || !password.trim()) return;\n setBusy(true);\n try {\n await unlock(docId, { password });\n // success → the tab promotes to ready and this pane unmounts\n } catch {\n setRejected(true);\n setPassword('');\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <div className=\"bg-app flex h-full w-full items-center justify-center p-8\">\n <div className=\"bg-surface border-border w-full max-w-sm rounded-xl border p-6 shadow-lg\">\n <div className=\"flex flex-col items-center text-center\">\n <div className=\"bg-accent-light mb-4 rounded-full p-4\">\n <Icon name=\"lock\" size={28} className=\"text-accent\" />\n </div>\n <h3 className=\"text-fg text-lg font-semibold\">{t('passwordPrompt.title')}</h3>\n {doc.name && <p className=\"text-fg-muted mt-1 text-sm\">{doc.name}</p>}\n </div>\n\n <p className=\"text-fg-secondary mt-4 text-center text-sm\">\n {incorrect ? t('passwordPrompt.incorrect') : t('passwordPrompt.required')}\n </p>\n\n <div className=\"mt-5\">\n <label className=\"text-fg mb-1.5 block text-sm font-medium\" htmlFor=\"doc-password\">\n {t('passwordPrompt.label')}\n </label>\n <input\n id=\"doc-password\"\n type=\"password\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n onKeyDown={(e) => e.key === 'Enter' && void submit()}\n disabled={busy}\n placeholder={t('passwordPrompt.placeholder')}\n className=\"bg-surface border-border focus:border-accent focus:ring-accent text-fg placeholder:text-fg-muted block w-full rounded-md border px-3 py-2.5 text-sm focus:outline-none focus:ring-1 disabled:opacity-50\"\n autoFocus\n />\n </div>\n\n {incorrect && (\n <div className=\"mt-3 flex items-center gap-2 rounded-md border border-red-500/40 bg-red-500/10 p-3\">\n <Icon name=\"alertTriangle\" size={16} className=\"flex-shrink-0 text-red-500\" />\n <p className=\"text-sm text-red-500\">{t('passwordPrompt.incorrectWarning')}</p>\n </div>\n )}\n\n <div className=\"mt-6 flex gap-3\">\n <button\n type=\"button\"\n onClick={() => void close(docId)}\n disabled={busy}\n className=\"border-border text-fg-secondary hover:bg-hover flex-1 cursor-pointer rounded-md border px-4 py-2.5 text-sm font-medium transition-colors disabled:opacity-50\"\n >\n {t('passwordPrompt.cancel')}\n </button>\n <button\n type=\"button\"\n onClick={() => void submit()}\n disabled={busy || !password.trim()}\n className=\"bg-accent text-on-accent flex-1 cursor-pointer rounded-md px-4 py-2.5 text-sm font-medium transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {busy ? t('passwordPrompt.opening') : t('passwordPrompt.open')}\n </button>\n </div>\n </div>\n </div>\n );\n}\n\nexport function DocumentError() {\n const docId = useDocumentId();\n const { docs, close } = useDocuments();\n const t = useT();\n const doc = docs.find((d) => d.id === docId);\n if (!docId || !doc) return null;\n\n return (\n <div className=\"bg-app flex h-full w-full items-center justify-center p-8\">\n <div className=\"bg-surface border-border flex max-w-sm flex-col items-center rounded-xl border p-6 text-center shadow-lg\">\n <div className=\"mb-4 rounded-full bg-red-500/10 p-4\">\n <Icon name=\"alertTriangle\" size={28} className=\"text-red-500\" />\n </div>\n <h3 className=\"text-fg text-lg font-semibold\">{t('documentError.title')}</h3>\n {doc.name && <p className=\"text-fg-muted mt-1 text-sm\">{doc.name}</p>}\n <p className=\"text-fg-secondary mt-2 text-sm\">{t('documentError.unknown')}</p>\n <button\n type=\"button\"\n onClick={() => void close(docId)}\n className=\"bg-accent text-on-accent mt-5 w-full cursor-pointer rounded-md px-4 py-2.5 text-sm font-medium transition-colors hover:opacity-90\"\n >\n {t('documentError.close')}\n </button>\n </div>\n </div>\n );\n}\n","/**\n * The viewer shell — the snippet's layout, driven entirely by the v3 commands\n * + measured-toolbar system.\n *\n * ── header socket (empty unless a child fills it) ─────────\n * ── main toolbar (measured; auto-overflows) ───────────────\n * ── mode band (DERIVED from the shell's open mode surface) ─\n * left sidebar │ Stage (pages) │ right sidebar\n * ──────────── page-controls overlay ──────────────────────\n *\n * The workspace/document split is structural: header + toolbars are\n * workspace-scoped and render at t≈0 (translated, measured) while the wasm\n * engine still boots; everything document-scoped sits inside <DocumentGate>,\n * whose fallback is the empty-workspace state (v2's loader, but UNDER a live\n * toolbar instead of replacing the whole app).\n *\n * Which mode band shows is not stored anywhere: it's a projection of\n * plugin-shell's exclusive 'mode' surface, read null-safely so the band simply\n * doesn't exist without a document.\n */\nimport { useMemo, type ReactNode } from 'react';\nimport {\n DocumentGate,\n useDocumentId,\n useDocumentStatus,\n useOptionalSelector,\n} from '@embedpdf/react/runtime';\nimport { Stage } from '@embedpdf/react/stage';\nimport { Scrollbar } from '@embedpdf/react/scrollbar';\nimport { RenderLayer } from '@embedpdf/react/render';\nimport { SelectionClipboard, SelectionHandles, SelectionLayer } from '@embedpdf/react/selection';\nimport { AnnotationLayer, useFilePickerProvider } from '@embedpdf/react/annotation';\nimport { LinkLayer } from '@embedpdf/react/link';\nimport type { AnnotationRenderer } from '@embedpdf/react/annotation';\nimport { useActionsUiAdapter } from '@embedpdf/react/actions';\nimport { formWidgetRenderer } from '@embedpdf/react/form';\nimport { SearchLayer } from '@embedpdf/react/search';\nimport { useCommandShortcuts } from '@embedpdf/react/commands';\nimport { ShellToken } from '@embedpdf/react/shell';\nimport { useT } from '@embedpdf/react/i18n';\nimport { getModeBar } from './config/chrome';\nimport { useChromeSchema } from './config-context';\nimport { AppToolbar } from './ui/toolbar';\nimport { AnnotationFontsProvider } from './ui/annotation-fonts';\nimport { AnnotationStrip } from './ui/annotation-strip';\nimport { SelectionStrip } from './ui/selection-strip';\nimport { TabBar } from './ui/tab-bar';\nimport { ArmedToolCursor } from './ui/tool-cursor';\nimport { LeftSidebar, RightSidebar, PageControls } from './ui/panels';\nimport { RedactConfirmModal } from './ui/redact-confirm';\nimport { SignDialog } from './ui/sign-dialog';\nimport { SignatureBridge } from './ui/signature-bridge';\nimport { SignatureInspector } from './ui/signature-inspector';\nimport { SignatureMakerModal } from './ui/signature-maker';\nimport { StampLibraryStore } from './ui/stamp-store';\nimport { DocumentError, PasswordPrompt } from './ui/document-boot';\n\n// Annotation renderers — module scope, per the AnnotationRenderer identity\n// rule. One entry today: form widgets render as fill controls while the form\n// plugin's Behavior is engaged.\nconst ANNOTATION_RENDERERS: AnnotationRenderer[] = [formWidgetRenderer];\n\nfunction ModeBand({ edge }: { edge: 'top' | 'bottom' }) {\n const schema = useChromeSchema();\n // The mode list is DERIVED from the chrome's modeBars keys — adding a custom\n // mode is one command + one bar schema in config, not a shell change.\n const modeSurfaces = useMemo(() => Object.keys(schema.modeBars ?? {}), [schema]);\n const activeMode = useOptionalSelector(\n ShellToken,\n (s) => modeSurfaces.find((m) => s.isOpen(m)) ?? null,\n null,\n );\n if (!activeMode) return null;\n const bar = getModeBar(schema, activeMode);\n if (!bar) return null;\n return (\n <div\n className={`border-border bg-surface-alt flex shrink-0 items-center px-4 py-2 ${\n edge === 'top' ? 'border-b' : 'border-t'\n }`}\n >\n <AppToolbar bar={bar} className=\"w-full\" />\n </div>\n );\n}\n\n/** The empty-workspace state: shown while the initial documents (and the\n * engine behind them) are still loading — or if the user closes every tab. */\nfunction OpeningDocuments() {\n const t = useT();\n return (\n <div className=\"grid h-full w-full place-items-center\">\n <div className=\"text-fg-muted flex flex-col items-center gap-3\">\n <div className=\"border-border-subtle border-t-accent h-8 w-8 animate-spin rounded-full border-2\" />\n <div className=\"text-sm\">{t('demo.opening')}</div>\n </div>\n </div>\n );\n}\n\n/**\n * The document area's lifecycle switch. A `locked` tab shows its password\n * prompt, an `error` tab its error pane — per TAB (keyed by document), so\n * several can coexist and tab switching stays free. Everything else is the\n * ready-gated Stage; the gate's fallback covers `loading`.\n */\nfunction DocumentArea({ children }: { children: ReactNode }) {\n const docId = useDocumentId();\n const status = useDocumentStatus();\n if (status === 'locked') return <PasswordPrompt key={docId} />;\n if (status === 'error') return <DocumentError key={docId} />;\n return <DocumentGate fallback={<OpeningDocuments />}>{children}</DocumentGate>;\n}\n\nexport function Shell() {\n useCommandShortcuts();\n // Click-then-pick tools (stamp, file attachment) → click a page → file dialog\n // opens → the file lands where you clicked. One line: the default provider is\n // the built-in file picker honouring each tool's `accept` filter (swap it for\n // a custom picker, or pass null to disable). The plugin stays DOM-free.\n useFilePickerProvider();\n // The ONE UI port for the action engine AND every script-produced effect:\n // sanitized URI opens, Named `Print`, script alerts (boot/lifecycle nags\n // suppressed by default), and script page navigation.\n useActionsUiAdapter();\n const schema = useChromeSchema();\n\n // The FRAME: region arrangement & visibility from the chrome value (see\n // FrameSchema). Regions render as named <slot> sockets with the built-ins\n // as fallback — light-DOM children of <embedpdf-viewer> replace them; in\n // plain light DOM a slot just displays its fallback (UA display:contents),\n // so this package's direct React consumers see no difference. A region\n // hidden by the frame hides its socket too: visibility outranks content.\n const frame = schema.frame ?? {};\n const toolbarEdge = frame.toolbar ?? 'top';\n\n // main toolbar — measured; degrades + overflows with zero config.\n // Deliberately OUTSIDE the gate: chrome renders before any document.\n // Bar id 'main' is the shell's one structural expectation — an owned\n // chrome without it simply has no main toolbar. Its mode band rides the\n // CONTENT side, whichever edge the frame picked.\n const toolbarBand = schema.bars.main && (\n <div\n part=\"toolbar\"\n className={`border-border bg-surface flex shrink-0 items-center px-4 py-2 ${\n toolbarEdge === 'top' ? 'border-b' : 'border-t'\n }`}\n >\n <AppToolbar bar={schema.bars.main} className=\"w-full\" />\n </div>\n );\n\n return (\n <AnnotationFontsProvider>\n <div className=\"bg-app text-fg flex h-full flex-col\">\n {/* the user's stamp + signature libraries: restored once, persisted for\n the workspace's lifetime (workspace-scoped, like the stamp plugin) */}\n <StampLibraryStore />\n {/* The header socket. The chrome ships NO header of its own — branding,\n locale pickers and theme switches are the embedder's chrome, not the\n viewer's — so this renders nothing until a child fills the slot. */}\n {(frame.header ?? true) && <slot name=\"header\" />}\n\n {/* the v2 document tab bar — the kernel's document registry IS the tab model */}\n {(frame.tabs ?? 'always') !== 'never' && (\n <slot name=\"tabs\">\n <TabBar visibility={frame.tabs ?? 'always'} />\n </slot>\n )}\n\n {toolbarEdge === 'top' && (\n <>\n {toolbarBand}\n <ModeBand edge=\"top\" />\n </>\n )}\n\n <div className=\"relative flex min-h-0 flex-1\">\n <DocumentArea>\n <LeftSidebar />\n <div className=\"relative min-w-0 flex-1\">\n {/* the armed tool's cursor: its toolbar icon as a real CSS cursor\n (zero-lag; the hub hides it over annotations/fields/gaps) */}\n <ArmedToolCursor />\n {/* ctrl/cmd+C and native Edit→Copy for the text selection —\n prefetches on commit so the copy event answers synchronously.\n Renders nothing; mount ONCE per document view. */}\n <SelectionClipboard />\n <Stage\n overlay={\n <>\n <AnnotationStrip />\n <SelectionStrip />\n {/* a signed field's facts, anchored at its widget */}\n <SignatureInspector />\n {/* touch: draggable start/end selection handles (long-press\n selects a word; the lollipops grow it from there) */}\n <SelectionHandles />\n {/* headless scrollbars: geometry/behavior from the stage's\n scroller contract; the look is index.css (data-attrs) */}\n <Scrollbar axis=\"y\" />\n <Scrollbar axis=\"x\" />\n </>\n }\n className=\"h-full w-full\"\n style={{ background: 'var(--ep-canvas)' }}\n >\n {() => (\n <>\n {/* Base + deep-zoom tiles in one layer. Tiles engage by\n demand arithmetic when the view wants more pixels than\n the base budget supplies — the thumbnail rail's demand\n never does, so it mounts the same layer for free. */}\n <RenderLayer annotations={false} />\n <SelectionLayer />\n <SearchLayer />\n {/* Clickable links (nav plane): anchors under the default\n pointer/pan tools; stands down whenever an authoring\n tool is active (the annotation plane owns links then).\n Below the AnnotationLayer so an editing free-text box\n wins pointer hits; the annotation layer's own surface\n is pointer-events: none, so clicks fall through to the\n anchors everywhere else. */}\n <LinkLayer />\n {/* Form widgets plug into the annotation stack: engaged\n (fill mode) they render as fill controls over the baked\n appearance; under the Form tab they're plain editable\n annotations. */}\n <AnnotationLayer renderers={ANNOTATION_RENDERERS} />\n </>\n )}\n </Stage>\n <PageControls />\n </div>\n <RightSidebar />\n <RedactConfirmModal />\n {/* signatures: plugin intents → surfaces; the dialogs they open */}\n <SignatureBridge />\n <SignDialog />\n <SignatureMakerModal />\n </DocumentArea>\n </div>\n\n {toolbarEdge === 'bottom' && (\n <>\n <ModeBand edge=\"bottom\" />\n {toolbarBand}\n </>\n )}\n </div>\n </AnnotationFontsProvider>\n );\n}\n","/**\n * The full viewer, as a component — and the customization CONTRACT. The\n * `ViewerCustomization` surface here is the exact shape that later powers\n * `EmbedPDF.init({...})` and every framework wrapper, because all of it is\n * plain data (see README.md).\n *\n * Two semantics, on purpose:\n * - REGISTRIES (commands / icons / strings) merge ADDITIVELY over the\n * defaults by id; a colliding id overrides.\n * - STRUCTURE (chrome) is an owned VALUE: the default, a transform of it,\n * or the host's own schema — never merged.\n *\n * The engine stays a prop — choosing local-wasm vs cloud is the host's\n * decision, and each delivery wires its own. The chrome —\n * toolbars, translations, theme — renders at t≈0; only the pages wait on\n * the engine. Customization is mount-time (exactly like v2's init config);\n * changing these props on a mounted viewer does not rebuild the workspace.\n */\n// One import line per feature: each subpath carries the\n// plugin AND its UI; delete a line and the feature leaves the bundle.\nimport { useEffect, useState, type ReactNode } from 'react';\nimport { Viewer, useKernel } from '@embedpdf/react/runtime';\nimport type { Engine, EngineFactory, InitialDocument } from '@embedpdf/react/runtime';\nimport { stagePlugin } from '@embedpdf/react/stage';\nimport { renderPlugin } from '@embedpdf/react/render';\nimport { pageEditPlugin } from '@embedpdf/react/page-edit';\nimport { feedbackPlugin, interactionPlugin, vibrationFeedback } from '@embedpdf/react/interaction';\nimport { selectionPlugin } from '@embedpdf/react/selection';\nimport { annotationPlugin } from '@embedpdf/react/annotation';\nimport { stampPlugin } from '@embedpdf/react/stamp';\nimport { redactionPlugin } from '@embedpdf/react/redaction';\nimport { actionsPlugin } from '@embedpdf/react/actions';\nimport { formPlugin } from '@embedpdf/react/form';\nimport { signaturePlugin } from '@embedpdf/react/signature';\nimport { linkPlugin } from '@embedpdf/react/link';\nimport { searchPlugin } from '@embedpdf/react/search';\nimport { i18nPlugin, negotiateLocale, useT } from '@embedpdf/react/i18n';\nimport type { Locale, TranslationDictionary } from '@embedpdf/react/i18n';\nimport { commandsPlugin } from '@embedpdf/react/commands';\nimport type { CommandDef } from '@embedpdf/react/commands';\nimport { shellPlugin } from '@embedpdf/react/shell';\nimport { chromeHelpers, validateChrome } from '@embedpdf/react/toolbar';\nimport type { ChromeHelpers, ChromeSchema } from '@embedpdf/react/toolbar';\nimport { ThumbsStageToken } from './config/stage';\nimport { defaultChrome } from './config/chrome';\nimport { defaultCommands } from './config/commands';\nimport { demoToolsPlugin } from './config/demo-tools.plugin';\nimport { en } from './locales/en';\nimport {\n ViewerConfigProvider,\n type ResolvedViewerConfig,\n type StampsCustomization,\n} from './config-context';\nimport type { AnnotationsCustomization, SignaturesCustomization } from './config-context';\nimport { createViewerHandle, type ViewerHandle } from './handle';\nimport { ICON_PATHS, type IconDef } from './ui/icons';\nimport { ThemeProvider, type ThemePreference } from './ui/theme';\nimport { Shell } from './Shell';\n\n/** Lazy built-in packs — a strings override for one of these wraps its loader. */\nconst BUILTIN_LOADERS: Record<string, () => Promise<Locale>> = {\n es: () => import('./locales/es').then((m) => m.es),\n};\n\nconst isDict = (v: unknown): v is TranslationDictionary => typeof v === 'object' && v !== null;\n\n/**\n * Deep-merge `over` into `base` (immutably), expanding dotted keys —\n * `{ 'acme.send': 'X' }` and `{ acme: { send: 'X' } }` are the same override.\n */\nfunction mergeTranslations(\n base: TranslationDictionary,\n over: TranslationDictionary,\n): TranslationDictionary {\n const out: Record<string, string | TranslationDictionary> = { ...base };\n for (const [key, value] of Object.entries(over)) {\n const path = key.split('.');\n let node = out;\n for (let i = 0; i < path.length - 1; i++) {\n const prev = node[path[i]];\n node = (node[path[i]] = isDict(prev) ? { ...prev } : {}) as Record<\n string,\n string | TranslationDictionary\n >;\n }\n const leaf = path[path.length - 1];\n const prev = node[leaf];\n node[leaf] =\n typeof value === 'string' ? value : mergeTranslations(isDict(prev) ? prev : {}, value);\n }\n return out;\n}\n\nconst mergeLocale = (pack: Locale, over?: TranslationDictionary): Locale =>\n over ? { ...pack, translations: mergeTranslations(pack.translations, over) } : pack;\n\n/**\n * The customization surface — identical in the vanilla snippet and every\n * framework wrapper. See README.md for the ladder this implements.\n */\nexport interface ViewerCustomization {\n /** ADDITIVE over the default vocabulary; a colliding id overrides. */\n commands?: readonly CommandDef[];\n /** ADDITIVE 24×24 stroke icons by name; a colliding name overrides. */\n icons?: Readonly<Record<string, IconDef>>;\n /** Per-locale translation overrides/additions; dotted keys expand. A code\n * with no built-in pack becomes a new locale (falls back to English). */\n strings?: Readonly<Record<string, TranslationDictionary>>;\n /** 'auto' (default) negotiates from the browser languages. */\n locale?: 'auto' | (string & {});\n /** Feature gating: a disabled category vanishes from every surface. */\n disabledCategories?: readonly string[];\n /** The structure — a value you OWN: the default (pass nothing), a transform\n * of it, or your own schema. Never merged. */\n chrome?: ChromeSchema | ((base: ChromeSchema, helpers: ChromeHelpers) => ChromeSchema);\n /** The stamps sidebar's built-in library. `false`: none (air-gapped, no\n * request). A string: a URL template with a `{locale}` slot for a\n * self-hosted copy of `@embedpdf/default-stamps`. Default: the copy that\n * ships with the viewer, as a lazy chunk of your own build — no CDN. */\n stamps?: StampsCustomization;\n /** Digital signatures: the signer, trust anchors, the mode (sign / visual /\n * ask), which marks a person keeps, and script faces for typed marks. With\n * no signer, a mark placed on a field is drawn in without sealing. */\n signatures?: SignaturesCustomization;\n /** Annotations: fonts the free-text style panel offers beyond the standard\n * 14 — fetched, registered on the engine and mounted for the live editor. */\n annotations?: AnnotationsCustomization;\n /** Light/dark preference (string shorthand), or the full theme config with\n * `--ep-*` token overrides. Tokens are applied by the DELIVERY (the custom\n * element adopts them into its shadow root); direct consumers of this\n * package set the `--ep-*` variables in their own CSS instead. */\n theme?: ThemePreference | ThemeConfig;\n}\n\n/** Token overrides — names WITHOUT the `--ep-` prefix ('accent', 'surface'…). */\nexport type ThemeTokens = Readonly<Record<string, string>>;\n\nexport interface ThemeConfig {\n /** 'system' (default) follows the OS. */\n preference?: ThemePreference;\n /** Applied in BOTH modes (a later sheet: wins over the defaults). */\n tokens?: ThemeTokens;\n /** Dark-mode-only overrides, applied over `tokens`. */\n dark?: ThemeTokens;\n}\n\n/** Normalize the shorthand — deliveries use this to read one shape. */\nexport const themeConfigOf = (theme: ThemePreference | ThemeConfig | undefined): ThemeConfig =>\n typeof theme === 'string' ? { preference: theme } : (theme ?? {});\n\nexport interface FullViewerProps extends ViewerCustomization {\n /** Instance (borrowed) or thunk (viewer-owned) — the Viewer's own contract. */\n engine: Engine | EngineFactory;\n /** Documents to open at mount; more arrive via the tab bar's open button. */\n initialDocuments?: InitialDocument[];\n /** Shown while the workspace boots. Default: a translated pulse line. */\n fallback?: ReactNode;\n /** Where the theme's `.dark` class goes — a DELIVERY concern, not user\n * config: the custom element passes its shadow wrapper so theming never\n * touches the host page. Default: document.documentElement. */\n themeTarget?: HTMLElement | null;\n /** Called once the workspace kernel is live, with the viewer handle — the\n * DRIVE surface (`el.viewer` on the custom element, `onReady` on the\n * wrappers). Capabilities resolve from the moment this fires; document-\n * scoped calls simply await their document. */\n onViewer?: (viewer: ViewerHandle) => void;\n}\n\n/** Inside <Viewer>: mints the handle from the live kernel, reports it up. */\nfunction HandleBridge({ onViewer }: { onViewer: (viewer: ViewerHandle) => void }) {\n const kernel = useKernel();\n useEffect(() => {\n onViewer(createViewerHandle(kernel));\n // Init-only like everything else: re-fires only if the KERNEL changes\n // (a remount), never because the callback prop identity churned.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [kernel]);\n return null;\n}\n\nfunction Booting() {\n const t = useT();\n return (\n <div className=\"bg-app text-fg-muted grid h-full place-items-center\">\n <div className=\"animate-pulse text-sm\">{t('demo.starting')}</div>\n </div>\n );\n}\n\nexport function FullViewer({\n engine,\n initialDocuments,\n fallback,\n commands,\n icons,\n strings,\n locale = 'auto',\n disabledCategories,\n chrome,\n stamps,\n signatures,\n annotations,\n theme,\n themeTarget,\n onViewer,\n}: FullViewerProps) {\n // Customization is INIT-ONLY, exactly like v2's `EmbedPDF.init` (and like\n // the Viewer's own engine/plugins contract): the whole config resolves ONCE\n // from the mount-time props, so inline literals — the idiomatic way to pass\n // it — never churn plugin identities. Later prop changes are ignored.\n const [resolved] = useState(() => {\n // ── registries: additive, user wins by id ───────────────────────────────\n const byId = new Map(defaultCommands.map((c) => [c.id, c]));\n for (const c of commands ?? []) byId.set(c.id, c);\n const resolvedCommands = [...byId.values()];\n\n // ── structure: an owned value (default | transform | replacement) ───────\n const resolvedChrome =\n typeof chrome === 'function'\n ? chrome(defaultChrome, chromeHelpers)\n : (chrome ?? defaultChrome);\n\n // ── locale packs: overrides merge into built-ins; unknown codes become\n // new locales that fall back to English ──────────────────────────────\n const overrides = strings ?? {};\n const locales: Locale[] = [mergeLocale(en, overrides.en)];\n const loaders: Record<string, () => Promise<Locale>> = {};\n for (const [code, load] of Object.entries(BUILTIN_LOADERS)) {\n const over = overrides[code];\n loaders[code] = over ? () => load().then((pack) => mergeLocale(pack, over)) : load;\n }\n for (const [code, over] of Object.entries(overrides)) {\n if (code === 'en' || code in BUILTIN_LOADERS) continue;\n locales.push({ code, name: code, translations: mergeTranslations({}, over) });\n }\n const codes = [...new Set(['en', ...Object.keys(BUILTIN_LOADERS), ...Object.keys(overrides)])];\n const initial =\n locale === 'auto'\n ? (negotiateLocale(codes, typeof navigator !== 'undefined' ? navigator.languages : []) ??\n 'en')\n : locale;\n\n return {\n commands: resolvedCommands,\n chrome: resolvedChrome,\n icons: icons ?? {},\n stamps: stamps ?? {},\n signatures: signatures ?? {},\n annotations: annotations ?? {},\n i18n: { locales, loaders, initial },\n };\n });\n\n // Dev guardrail: every id the chrome references must exist; every icon a\n // command names must resolve. Warnings name the exact id (README promise).\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') return;\n const ids = new Set(resolved.commands.map((c) => c.id));\n for (const problem of validateChrome(resolved.chrome, ids)) {\n console.warn(`[embedpdf] chrome: ${problem}`);\n }\n for (const c of resolved.commands) {\n if (c.icon && !(c.icon in ICON_PATHS) && !(c.icon in resolved.icons)) {\n console.warn(`[embedpdf] command \"${c.id}\": unknown icon \"${c.icon}\"`);\n }\n }\n }, [resolved]);\n\n const [plugins] = useState(() => [\n stagePlugin({ layout: 'vertical' }), // main lens (tools engage via interactionPlugin below)\n // Thumbnail lens over the SAME document: a single-column grid at a fixed small\n // zoom, its own camera. Click a thumb to navigate the main lens; the sidebar\n // follows the main view (see ui/panels ThumbnailList).\n stagePlugin({\n id: 'stage-thumbs',\n token: ThumbsStageToken,\n layout: 'grid',\n columns: 1, // single column, like the v2 snippet's thumbnail rail\n sizing: 'uniform', // equalize pages so the pixel target hits every thumb\n zoom: { pageWidth: 150 }, // thumbs are 150 SCREEN px wide — for ANY document\n padding: 12,\n gap: { px: 16 }, // UI-stable spacing between thumbs\n pageFrame: { top: 0, right: 0, bottom: 20, left: 0 }, // reserved label band (screen px)\n fitAlign: { x: 'center', y: 'start' }, // few pages? thumbs hug the TOP\n scrollBehavior: 'instant',\n }),\n renderPlugin(),\n pageEditPlugin(),\n interactionPlugin(),\n // Platform haptics, default-on: the Vibration API where it exists\n // (Android), a safe silent no-op elsewhere — iOS Safari included, until\n // Apple ships a haptics API. Native shells swap in their own provider\n // (`wkFeedback`) instead.\n feedbackPlugin({ provider: vibrationFeedback }),\n selectionPlugin(),\n // The arrow tool is a `line` preset — same subtype, an arrowhead default. This is\n // the whole integration for a new tool: one `tools` entry + a command/toolbar\n // slot (see config/commands.ts + config/chrome.ts).\n annotationPlugin({\n tools: [\n {\n id: 'arrow',\n extends: 'line',\n defaults: { lineEndings: { start: 'none', end: 'open-arrow' } },\n },\n // The Insert tab's Image button: a `stamp` preset whose payload comes\n // from the file-picker port, narrowed to rasters. Click the spot, the\n // dialog opens, the picture lands there. Its own tool id (not `stamp`)\n // keeps it out of the stamp panel's armed state and gives it its own\n // cursor icon.\n {\n id: 'image',\n extends: 'stamp',\n source: { kind: 'prompt', accept: 'image/png,image/jpeg' },\n },\n ],\n }),\n // Stamp LIBRARIES (workspace-scoped): named reusable assets — the built-in\n // set plus any PDF the user imports, each page one vector stamp. The\n // stamps sidebar is the picker; placement rides annotation's armed stamp.\n stampPlugin(),\n // The action engine: /A and /AA trees dispatch through one policy-gated\n // executor spine, and THE JavaScript switch lives here (the per-document\n // ScriptHost realm; form's K/V/C/F pipeline rides its transaction port,\n // stamp's dynamic templates evaluate in detached realms it mints).\n actionsPlugin({\n javascript: { enabled: true, identity: { name: 'John Doe', corporation: 'Acme Inc' } },\n }),\n // Forms: fillable under the default pointer/pan (widgets render as fill\n // controls), editable under the Form tab's 'form-edit' + palette tools.\n formPlugin(),\n // Signatures: the ACT — a mark (a signatures-library asset) dropped on a\n // signature field signs it through the configured signer, or is drawn in\n // without sealing when there is none. Marks themselves are the stamp\n // plugin's; the panel lists libraries of kind 'signatures'.\n signaturePlugin({\n mode: resolved.signatures.mode,\n signer: resolved.signatures.signer,\n trust: resolved.signatures.trust,\n allowCertify: resolved.signatures.allowCertify,\n }),\n // Links: navigable under the default pointer/pan ('link-nav'), editable\n // under the link tool — the annotation plane then owns them (select, move,\n // retarget via the style panel's Link control).\n linkPlugin(),\n // Redaction: marking is the annotation plane's composed `redact` tool; this\n // plugin adds the pending-queue view + the destructive apply.\n redactionPlugin(),\n searchPlugin(),\n demoToolsPlugin(),\n i18nPlugin({\n locale: resolved.i18n.initial,\n fallbackLocale: 'en',\n locales: resolved.i18n.locales,\n loaders: resolved.i18n.loaders,\n }),\n commandsPlugin({\n commands: resolved.commands,\n disabledCategories: disabledCategories ? [...disabledCategories] : undefined,\n }),\n shellPlugin(),\n ]);\n\n // Structural subset of `resolved`, identity-stable across renders.\n const config: ResolvedViewerConfig = resolved;\n\n return (\n <ThemeProvider preference={themeConfigOf(theme).preference} target={themeTarget}>\n <Viewer\n engine={engine}\n plugins={plugins}\n initialDocuments={initialDocuments}\n fallback={fallback ?? <Booting />}\n >\n <ViewerConfigProvider value={config}>\n {onViewer && <HandleBridge onViewer={onViewer} />}\n <Shell />\n </ViewerConfigProvider>\n </Viewer>\n </ThemeProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAa,oBAAA,GAAA,wBAAA,sB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CACA,SAAS;EACP;EACA;EACA;EACA;CACF;CACA,MAAM,CACJ,gKACA,+FACF;CACA,cAAc;EACZ;EACA;EACA;CACF;CACA,MAAM;EACJ;EACA;EACA;CACF;CACA,YAAY,CACV,yFACF;CACA,UAAU;EAAC;EAA8C;EAAkB;CAAY;CACvF,cAAc;EACZ;EACA;EACA;CACF;CACA,KAAK,CAAC,8CAA8C;CACpD,MAAM,CAAC,4DAA4D;CACnE,YAAY,CACV,2BACA,+EACF;CACA,WAAW;EACT;EACA;EACA;EACA;EACA;CACF;CACA,YAAY;EACV;EACA;EACA;EACA;EACA;CACF;CACA,cAAc,CACZ,kFACA,gBACF;CACA,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,WAAW,CACT;EAAE,GAAG;EAAsC,MAAM;CAAK,GACtD,sCACF;CACA,YAAY,CACV,kFACA,gBACF;CACA,eAAe;EACb;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR;GAAE,GAAG;GAAgB,QAAQ;EAAU;EACvC;GAAE,GAAG;GAAY,QAAQ;EAAU;EACnC;GAAE,GAAG;GAAa,QAAQ;EAAU;EACpC;GAAE,GAAG;GAAiB,QAAQ;EAAU;EACxC;GAAE,GAAG;GAAY,QAAQ;EAAU;EACnC;GAAE,GAAG;GAAY,QAAQ;EAAU;CACrC;CACA,YAAY;EACV;EACA;EACA;EACA;CACF;CACA,gBAAgB;EACd;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM;EACJ;EACA;EACA;EACA;CACF;CACA,WAAW;EAET;GACE,GAAG;GACH,MAAM;EACR;EACA;EACA;CACF;CACA,YAAY;EAAC;EAAiB;EAAkB;CAAY;CAC5D,gBAAgB;EACd;EACA;EACA;EACA;GAAE,GAAG;GAAwB,QAAQ;GAAW,MAAM;EAAU;CAClE;CACA,YAAY;EACV;GAAE,GAAG;GAAgB,QAAQ;EAAU;EACvC;GAAE,GAAG;GAAW,QAAQ;EAAU;EAClC;GAAE,GAAG;GAAW,QAAQ;EAAU;EAClC;GAAE,GAAG;GAAiB,QAAQ;EAAU;EACxC;GAAE,GAAG;GAAe,QAAQ;EAAU;CACxC;CACA,QAAQ;EAAC;EAAa;EAAa;CAAa;CAChD,MAAM,CAAC;EAAE,GAAG;EAAgB,QAAQ;CAAU,CAAC;CAI/C,WAAW,CACT;EAAE,GAAG;EAAgB,QAAQ;CAAU,GACvC;EAAE,GAAG;EAAa,QAAQ;CAAU,CACtC;CACA,MAAM;EACJ;EACA;EACA;CACF;CACA,SAAS;EACP;EACA;EACA;EACA;CACF;CACA,UAAU;EAAC;EAAW;EAAY;EAAY;EAAY;EAAa;CAAY;CACnF,MAAM,CACJ,gFACA,0BACF;CACA,eAAe;EACb;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM,CAAC,aAAa,YAAY;CAChC,SAAS;EACP;EACA;EACA;CACF;CACA,SAAS;EACP;EACA;EACA;EACA;CACF;CACA,WAAW,CACT,+FACF;CACA,cAAc,CACZ,gIACA;EACE,GAAG;EACH,QAAQ;CACV,CACF;CACA,OAAO;EACL;EACA;EACA;EACA;CACF;CAEA,MAAM,CAAC,cAAc,YAAY;CACjC,SAAS,CACP,oNACF;CACA,SAAS,CACP;EACE,GAAG;EACH,QAAQ;EACR,MAAM;CACR,CACF;CACA,OAAO;EACL;EACA;EACA;CACF;CACA,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CAIA,YAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,gBAAgB;EACd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,kBAAkB;EAChB;EACA;EACA;EACA;EACA;CACF;CACA,aAAa;EACX;GAAE,GAAG;GAAgB,QAAQ;EAAU;EACvC;GAAE,GAAG;G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