@surething/cockpit 1.0.261 → 1.0.263
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/.next-prod/BUILD_ID +1 -1
- package/.next-prod/app-path-routes-manifest.json +6 -3
- package/.next-prod/build-manifest.json +3 -3
- package/.next-prod/cockpit-build.json +2 -2
- package/.next-prod/prerender-manifest.json +4 -4
- package/.next-prod/react-loadable-manifest.json +1 -1
- package/.next-prod/routes-manifest.json +18 -0
- package/.next-prod/server/app/_global-error/page.js +2 -2
- package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +1 -1
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page.js +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_not-found.html +2 -2
- package/.next-prod/server/app/_not-found.rsc +4 -4
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +12 -11
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next-prod/server/app/api/agent/test/route.js +1 -1
- package/.next-prod/server/app/api/bash/route.js +1 -1
- package/.next-prod/server/app/api/chat/codex/route.js +1 -1
- package/.next-prod/server/app/api/chat/deepseek/route.js +1 -1
- package/.next-prod/server/app/api/chat/glm/route.js +1 -1
- package/.next-prod/server/app/api/chat/kimi/route.js +1 -1
- package/.next-prod/server/app/api/chat/ollama/route.js +1 -1
- package/.next-prod/server/app/api/chat/route.js +1 -1
- package/.next-prod/server/app/api/chat/stop/route.js +1 -1
- package/.next-prod/server/app/api/claude-stats/route.js +1 -1
- package/.next-prod/server/app/api/commands/route.js +1 -1
- package/.next-prod/server/app/api/comments/route.js +1 -1
- package/.next-prod/server/app/api/db/columns/route.js +1 -1
- package/.next-prod/server/app/api/db/connect/route.js +1 -1
- package/.next-prod/server/app/api/db/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/db/export/route.js +1 -1
- package/.next-prod/server/app/api/db/query/route.js +1 -1
- package/.next-prod/server/app/api/db/schemas/route.js +2 -2
- package/.next-prod/server/app/api/deepseek/balance/route.js +1 -1
- package/.next-prod/server/app/api/deepseek/credentials/route.js +1 -1
- package/.next-prod/server/app/api/deepseek/models/route.js +1 -1
- package/.next-prod/server/app/api/dev/spans/route.js +1 -1
- package/.next-prod/server/app/api/extension/version/route.js +1 -1
- package/.next-prod/server/app/api/file/route.js +1 -1
- package/.next-prod/server/app/api/files/blame/route.js +1 -1
- package/.next-prod/server/app/api/files/clipboard/route.js +1 -1
- package/.next-prod/server/app/api/files/copy/route.js +1 -1
- package/.next-prod/server/app/api/files/delete/route.js +1 -1
- package/.next-prod/server/app/api/files/expanded/route.js +1 -1
- package/.next-prod/server/app/api/files/index/route.js +1 -1
- package/.next-prod/server/app/api/files/init/route.js +1 -1
- package/.next-prod/server/app/api/files/paste/route.js +1 -1
- package/.next-prod/server/app/api/files/read/route.js +1 -1
- package/.next-prod/server/app/api/files/readdir/route.js +1 -1
- package/.next-prod/server/app/api/files/recent/route.js +1 -1
- package/.next-prod/server/app/api/files/save/route.js +1 -1
- package/.next-prod/server/app/api/files/search/route.js +1 -1
- package/.next-prod/server/app/api/files/stat/route.js +1 -1
- package/.next-prod/server/app/api/files/text/route.js +1 -1
- package/.next-prod/server/app/api/git/branch-diff/route.js +1 -1
- package/.next-prod/server/app/api/git/branches/route.js +1 -1
- package/.next-prod/server/app/api/git/commit-diff/route.js +1 -1
- package/.next-prod/server/app/api/git/commits/route.js +1 -1
- package/.next-prod/server/app/api/git/current-branch/route.js +1 -1
- package/.next-prod/server/app/api/git/diff/route.js +1 -1
- package/.next-prod/server/app/api/git/discard/route.js +1 -1
- package/.next-prod/server/app/api/git/stage/route.js +1 -1
- package/.next-prod/server/app/api/git/status/route.js +1 -1
- package/.next-prod/server/app/api/git/unstage/route.js +1 -1
- package/.next-prod/server/app/api/git/worktree/route.js +1 -1
- package/.next-prod/server/app/api/glm/credentials/route.js +1 -1
- package/.next-prod/server/app/api/glm/models/route.js +1 -1
- package/.next-prod/server/app/api/glm/usage/route.js +1 -1
- package/.next-prod/server/app/api/global-state/route.js +1 -1
- package/.next-prod/server/app/api/health/route.js +1 -1
- package/.next-prod/server/app/api/html-apps/[id]/route.js +1 -1
- package/.next-prod/server/app/api/html-apps/route.js +1 -1
- package/.next-prod/server/app/api/jupyter/load/route.js +1 -1
- package/.next-prod/server/app/api/jupyter/save/route.js +1 -1
- package/.next-prod/server/app/api/jupyter/shutdown/route.js +1 -1
- package/.next-prod/server/app/api/kimi/credentials/route.js +1 -1
- package/.next-prod/server/app/api/kimi/models/route.js +1 -1
- package/.next-prod/server/app/api/kimi/usage/route.js +1 -1
- package/.next-prod/server/app/api/lsp/definition/route.js +1 -1
- package/.next-prod/server/app/api/lsp/hover/route.js +1 -1
- package/.next-prod/server/app/api/lsp/references/route.js +1 -1
- package/.next-prod/server/app/api/lsp/status/route.js +1 -1
- package/.next-prod/server/app/api/lsp/warmup/route.js +1 -1
- package/.next-prod/server/app/api/mysql/columns/route.js +2 -2
- package/.next-prod/server/app/api/mysql/connect/route.js +1 -1
- package/.next-prod/server/app/api/mysql/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/mysql/export/route.js +1 -1
- package/.next-prod/server/app/api/mysql/query/route.js +1 -1
- package/.next-prod/server/app/api/mysql/schemas/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/connect/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/query/route.js +1 -1
- package/.next-prod/server/app/api/neo4j/schema/route.js +1 -1
- package/.next-prod/server/app/api/note/route.js +1 -1
- package/.next-prod/server/app/api/ollama/config/route.js +1 -1
- package/.next-prod/server/app/api/ollama/models/route.js +1 -1
- package/.next-prod/server/app/api/ollama/start/route.js +1 -1
- package/.next-prod/server/app/api/open-cursor/route.js +1 -1
- package/.next-prod/server/app/api/open-vscode/route.js +1 -1
- package/.next-prod/server/app/api/pick-folder/route.js +1 -1
- package/.next-prod/server/app/api/pinned-sessions/route.js +1 -1
- package/.next-prod/server/app/api/project-settings/route.js +1 -1
- package/.next-prod/server/app/api/project-state/route.js +2 -2
- package/.next-prod/server/app/api/projectGraph/affected/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/callees/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/callers/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/coedit/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/context/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/file/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/file-functions/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/impact/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/related/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/risk/route.js +1 -1
- package/.next-prod/server/app/api/projectGraph/search/route.js +1 -1
- package/.next-prod/server/app/api/projects/route.js +1 -1
- package/.next-prod/server/app/api/prompts/config/route.js +1 -1
- package/.next-prod/server/app/api/push/public-key/route.js +1 -1
- package/.next-prod/server/app/api/push/subscribe/route.js +1 -1
- package/.next-prod/server/app/api/push/unsubscribe/route.js +1 -1
- package/.next-prod/server/app/api/redis/command/route.js +1 -1
- package/.next-prod/server/app/api/redis/connect/route.js +1 -1
- package/.next-prod/server/app/api/redis/delete/route.js +1 -1
- package/.next-prod/server/app/api/redis/disconnect/route.js +1 -1
- package/.next-prod/server/app/api/redis/get/route.js +1 -1
- package/.next-prod/server/app/api/redis/keys/route.js +1 -1
- package/.next-prod/server/app/api/redis/set/route.js +1 -1
- package/.next-prod/server/app/api/restart/route.js +1 -0
- package/.next-prod/server/app/api/restart/route.js.nft.json +1 -0
- package/.next-prod/server/app/api/restart/route_client-reference-manifest.js +1 -0
- package/.next-prod/server/app/api/review/[id]/comments/route.js +1 -1
- package/.next-prod/server/app/api/review/[id]/replies/route.js +1 -1
- package/.next-prod/server/app/api/review/[id]/route.js +1 -1
- package/.next-prod/server/app/api/review/identify/route.js +1 -1
- package/.next-prod/server/app/api/review/order/route.js +1 -1
- package/.next-prod/server/app/api/review/route.js +1 -1
- package/.next-prod/server/app/api/review/share-info/route.js +1 -1
- package/.next-prod/server/app/api/review/users/route.js +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js +2 -2
- package/.next-prod/server/app/api/services/config/route.js +1 -1
- package/.next-prod/server/app/api/services/scripts/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/fork/route.js +1 -1
- package/.next-prod/server/app/api/session/[sessionId]/history/route.js +1 -1
- package/.next-prod/server/app/api/session-by-path/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js +1 -1
- package/.next-prod/server/app/api/sessions/projects/route.js +1 -1
- package/.next-prod/server/app/api/sessions/route.js +1 -1
- package/.next-prod/server/app/api/settings/route.js +1 -1
- package/.next-prod/server/app/api/shutdown/route.js +1 -0
- package/.next-prod/server/app/api/shutdown/route.js.nft.json +1 -0
- package/.next-prod/server/app/api/shutdown/route_client-reference-manifest.js +1 -0
- package/.next-prod/server/app/api/skills/[id]/route.js +1 -1
- package/.next-prod/server/app/api/skills/content/route.js +1 -1
- package/.next-prod/server/app/api/skills/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/diff/route.js +1 -1
- package/.next-prod/server/app/api/snapshots/route.js +1 -1
- package/.next-prod/server/app/api/terminal/aliases/route.js +1 -1
- package/.next-prod/server/app/api/terminal/autocomplete/route.js +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
- package/.next-prod/server/app/api/terminal/env/route.js +1 -1
- package/.next-prod/server/app/api/terminal/history/route.js +1 -1
- package/.next-prod/server/app/api/update/route.js +1 -0
- package/.next-prod/server/app/api/update/route.js.nft.json +1 -0
- package/.next-prod/server/app/api/update/route_client-reference-manifest.js +1 -0
- package/.next-prod/server/app/api/version/route.js +1 -1
- package/.next-prod/server/app/apps/[...path]/route.js +1 -1
- package/.next-prod/server/app/favicon.ico/route.js +1 -1
- package/.next-prod/server/app/m/page.js +1 -1
- package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/manifest.webmanifest/route.js +2 -2
- package/.next-prod/server/app/page.js +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page.js +1 -1
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/review/[id]/page.js +1 -1
- package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +6 -3
- package/.next-prod/server/chunks/1564.js +1 -1
- package/.next-prod/server/chunks/5750.js +42 -40
- package/.next-prod/server/chunks/6495.js +1 -1
- package/.next-prod/server/chunks/6548.js +1 -1
- package/.next-prod/server/chunks/7184.js +1 -1
- package/.next-prod/server/chunks/841.js +1 -1
- package/.next-prod/server/chunks/8764.js +2 -2
- package/.next-prod/server/functions-config-manifest.json +3 -0
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/middleware-react-loadable-manifest.js +1 -1
- package/.next-prod/server/pages/404.html +2 -2
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/Jy5sAJFfhng774VeXYdQS/_buildManifest.js +1 -0
- package/.next-prod/static/chunks/1372-c2e2e52980e95aec.js +15 -0
- package/.next-prod/static/chunks/{1959.a8039e13d14ada11.js → 1959.1d5dbd36400b94d2.js} +4 -4
- package/.next-prod/static/chunks/2032-8326efdf5830d58c.js +1 -0
- package/.next-prod/static/chunks/6722-1252a1399ff10e47.js +35 -0
- package/.next-prod/static/chunks/6784-20cc834d161af395.js +381 -0
- package/.next-prod/static/chunks/app/_global-error/page-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/agent/test/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/bash/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/codex/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/deepseek/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/glm/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/kimi/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/ollama/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/chat/stop/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/claude-stats/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/commands/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/comments/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/db/columns/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/db/connect/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/db/disconnect/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/db/export/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/db/query/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/db/schemas/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/deepseek/balance/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/deepseek/credentials/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/deepseek/models/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/dev/spans/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/extension/version/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/file/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/blame/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/clipboard/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/copy/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/delete/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/expanded/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/index/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/init/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/paste/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/read/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/readdir/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/recent/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/save/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/search/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/stat/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/files/text/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/git/branches/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/git/commits/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/git/current-branch/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/git/diff/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/git/discard/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/git/stage/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/git/status/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/git/unstage/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/git/worktree/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/glm/credentials/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/glm/models/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/glm/usage/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/global-state/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/health/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/html-apps/[id]/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/html-apps/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/load/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/save/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/kimi/credentials/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/kimi/models/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/kimi/usage/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/definition/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/hover/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/references/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/status/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/columns/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/connect/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/export/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/query/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/query/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/note/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/config/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/models/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/ollama/start/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/open-cursor/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/open-vscode/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/pick-folder/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/project-settings/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/project-state/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/affected/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/callees/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/callers/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/context/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/file/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/impact/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/related/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/risk/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/projectGraph/search/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/projects/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/prompts/config/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/push/public-key/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/push/subscribe/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/push/unsubscribe/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/command/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/connect/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/delete/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/get/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/keys/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/redis/set/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/restart/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/comments/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/replies/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/review/[id]/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/review/identify/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/review/order/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/review/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/review/share-info/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/review/users/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/services/config/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/services/scripts/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/session-by-path/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/projects/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/sessions/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/settings/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/shutdown/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/[id]/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/content/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/skills/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/diff/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/snapshots/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/env/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/terminal/history/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/update/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/api/version/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/apps/[...path]/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/{layout-ab52fc1a83af968b.js → layout-b11ccf3395201b18.js} +1 -1
- package/.next-prod/static/chunks/app/m/page-d7c162f2db6b377c.js +1 -0
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/app/{page-5de8b6584e328a6f.js → page-e03b50ea13cd6198.js} +1 -1
- package/.next-prod/static/chunks/app/project/{page-5de8b6584e328a6f.js → page-e03b50ea13cd6198.js} +1 -1
- package/.next-prod/static/chunks/app/review/[id]/page-556db82704d074ab.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-7c7e4c414aa6453c.js +1 -0
- package/.next-prod/static/chunks/{webpack-ce60587570394496.js → webpack-e959a5364a05b2ac.js} +1 -1
- package/.next-prod/static/css/237348b31ba05918.css +1 -0
- package/.next-prod/trace +14 -14
- package/.next-prod/trace-build +1 -1
- package/.next-prod/types/app/api/restart/route.ts +353 -0
- package/.next-prod/types/app/api/shutdown/route.ts +353 -0
- package/.next-prod/types/app/api/update/route.ts +353 -0
- package/.next-prod/types/routes.d.ts +4 -1
- package/.next-prod/types/validator.ts +27 -0
- package/README.md +75 -0
- package/README.zh.md +64 -0
- package/bin/cock-service.mjs +498 -0
- package/bin/cock.mjs +35 -27
- package/bin/cockpitHome.mjs +33 -0
- package/bin/rotateLog.mjs +52 -0
- package/bin/updater.mjs +231 -0
- package/dist/{chunk-B5LXMESP.mjs → chunk-FBAFMLUC.mjs} +1 -1
- package/dist/{chunk-CLPJYIFC.mjs → chunk-H6AI4XJC.mjs} +4 -3
- package/dist/{chunk-TU3GL2HK.mjs → chunk-ZE2JXL6E.mjs} +18 -7
- package/dist/httpApi.mjs +2 -2
- package/dist/scheduledTasks.mjs +24 -4
- package/dist/{server-2UJDVZ32.mjs → server-HRP33LCV.mjs} +2 -2
- package/dist/wsServer.mjs +144 -112
- package/package.json +1 -1
- package/public/html-lib/json-viewer.js +9 -9
- package/public/html-lib/markdown.css +0 -7
- package/public/html-lib/markdown.js +1 -1
- package/public/html-lib/pdf-viewer.css +0 -11
- package/public/html-lib/pdf-viewer.js +1 -1
- package/public/html-lib/theme.css +95 -11
- package/server.mjs +127 -11
- package/.next-prod/static/chunks/1157-164bcf046a0a9b15.js +0 -32
- package/.next-prod/static/chunks/1372-d16d68b1b03a345a.js +0 -15
- package/.next-prod/static/chunks/2032-f224a93f7a22bc21.js +0 -1
- package/.next-prod/static/chunks/6784-09dffdb0e8ca7fb3.js +0 -381
- package/.next-prod/static/chunks/app/_global-error/page-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/agent/test/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/bash/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/codex/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/deepseek/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/glm/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/kimi/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/ollama/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/chat/stop/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/claude-stats/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/commands/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/comments/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/db/columns/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/db/connect/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/db/disconnect/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/db/export/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/db/query/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/db/schemas/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/deepseek/balance/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/deepseek/credentials/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/deepseek/models/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/dev/spans/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/extension/version/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/file/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/blame/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/clipboard/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/copy/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/delete/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/expanded/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/index/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/init/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/paste/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/read/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/readdir/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/recent/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/save/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/search/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/stat/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/files/text/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branch-diff/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/git/branches/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commit-diff/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/git/commits/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/git/current-branch/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/git/diff/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/git/discard/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/git/stage/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/git/status/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/git/unstage/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/git/worktree/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/glm/credentials/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/glm/models/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/glm/usage/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/global-state/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/health/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/html-apps/[id]/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/html-apps/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/load/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/save/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/kimi/credentials/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/kimi/models/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/kimi/usage/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/definition/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/hover/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/references/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/status/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/lsp/warmup/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/columns/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/connect/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/disconnect/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/export/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/query/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/mysql/schemas/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/connect/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/query/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/neo4j/schema/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/note/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/config/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/models/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/ollama/start/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/open-cursor/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/open-vscode/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/pick-folder/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/pinned-sessions/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/project-settings/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/project-state/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/affected/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/callees/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/callers/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/context/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/file/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/impact/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/related/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/risk/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/projectGraph/search/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/projects/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/prompts/config/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/push/public-key/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/push/subscribe/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/push/unsubscribe/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/command/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/connect/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/delete/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/disconnect/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/get/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/keys/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/redis/set/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/comments/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/replies/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/review/[id]/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/review/identify/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/review/order/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/review/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/review/share-info/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/review/users/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/scheduled-tasks/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/services/config/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/services/scripts/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/session-by-path/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/projects/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/sessions/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/settings/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/[id]/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/content/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/skills/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/diff/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/snapshots/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/aliases/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/env/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/terminal/history/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/api/version/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/apps/[...path]/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/m/page-7dcf56a65528216f.js +0 -1
- package/.next-prod/static/chunks/app/manifest.webmanifest/route-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/app/review/[id]/page-c0136423507b7547.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-3c1c06e2de280418.js +0 -1
- package/.next-prod/static/css/83c134c954630942.css +0 -1
- package/.next-prod/static/pgteRwI6FQcp683smeSNO/_buildManifest.js +0 -1
- /package/.next-prod/static/{pgteRwI6FQcp683smeSNO → Jy5sAJFfhng774VeXYdQS}/_ssgManifest.js +0 -0
|
@@ -320,13 +320,6 @@
|
|
|
320
320
|
margin-bottom: calc(var(--spacing) * 0);
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
.hover\:bg-accent {
|
|
324
|
-
&:hover {
|
|
325
|
-
@media (hover: hover) {
|
|
326
|
-
background-color: var(--accent);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
323
|
.hover\:text-foreground {
|
|
331
324
|
&:hover {
|
|
332
325
|
@media (hover: hover) {
|
|
@@ -344,7 +344,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
344
344
|
`).filter(r=>/^\s*\||\|\s*$/.test(r));if(n.length>=3){let r=n.map(i=>(i.match(/\|/g)||[]).length);return!(r.every(i=>i===r[0])&&r[0]>=3)}return!1}function Q3(e){let t=[],n=i=>(t.push(i),` MASK${t.length-1} `);return e.replace(/```[\s\S]*?```/g,i=>n(i)).replace(/~~~[\s\S]*?~~~/g,i=>n(i)).replace(/^(\|.+\|)$/gm,i=>/^\|[\s:|-]+\|$/.test(i)?i:i.replace(/`([^`]*)`/g,(o,s)=>s.includes("|")?"`"+s.replace(/\|/g,"\\|")+"`":o)).replace(/ MASK(\d+) /g,(i,o)=>t[+o])}function YD(e){return e.replace(/\$(\d)/g,"\\$$1")}var IX=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clippath","defs","ellipse","g","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan","use"]);function Vb(e){let t=[],n=i=>(t.push(i),`\0MASK${t.length-1}\0`);return e.replace(/```[\s\S]*?```/g,i=>n(i)).replace(/~~~[\s\S]*?~~~/g,i=>n(i)).replace(/`[^`\n]+`/g,i=>n(i)).replace(/<\/?([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(i,o)=>{let s=o.toLowerCase();return IX.has(s)||s.includes("-")?i:i.replace(/</g,"<").replace(/>/g,">")}).replace(/\u0000MASK(\d+)\u0000/g,(i,o)=>t[+o])}function OX(e){return!RX(e)||/^```[\s\S]*```$/m.test(e.trim())?e:"```text\n"+e.trim()+"\n```"}function LX(e,t,n,r){return{code({className:a,children:i,node:o,...s}){let l=/language-(\w+)/.exec(a||"");if(!(typeof i=="string"||typeof i=="number"||Array.isArray(i)&&i.every(y=>typeof y=="string"||typeof y=="number")))return(0,tt.jsx)("code",{className:"px-1.5 py-0.5 mx-0.5 rounded bg-accent text-sm font-mono",...s,children:i});let c=String(i);if(!l&&!a&&!c.includes(`
|
|
345
345
|
`))return(0,tt.jsx)("code",{className:"px-1.5 py-0.5 mx-0.5 rounded bg-accent text-sm font-mono",...s,children:i});let p=c.replace(/\n$/,""),m=l?.[1]||"text",E=Number(s["data-source-start"])||0,S=E?E+1:0,x=0;return(0,tt.jsx)(h3,{style:e?g3:b3,language:m,PreTag:"div",customStyle:{margin:"0.75rem 0",borderRadius:"0.375rem",fontSize:"0.875rem"},wrapLines:!0,lineProps:()=>{let y=S+x;return x++,{"data-source-start":y,"data-source-end":y,style:{display:"block"}}},children:p})},p:({children:a,node:i,...o})=>(0,tt.jsx)("p",{className:"mb-3 last:mb-0",...o,children:a}),h1:({children:a,node:i,...o})=>(0,tt.jsx)("h1",{className:"text-xl font-bold mb-3 mt-4 first:mt-0",...o,children:a}),h2:({children:a,node:i,...o})=>(0,tt.jsx)("h2",{className:"text-lg font-bold mb-2 mt-3 first:mt-0",...o,children:a}),h3:({children:a,node:i,...o})=>(0,tt.jsx)("h3",{className:"text-base font-bold mb-2 mt-3 first:mt-0",...o,children:a}),ul:({children:a,node:i,...o})=>(0,tt.jsx)("ul",{className:"list-disc list-inside mb-3 space-y-1",...o,children:a}),ol:({children:a,node:i,...o})=>(0,tt.jsx)("ol",{className:"list-decimal list-inside mb-3 space-y-1",...o,children:a}),li:({children:a,node:i,...o})=>(0,tt.jsx)("li",{className:"leading-relaxed",...o,children:a}),blockquote:({children:a,node:i,...o})=>(0,tt.jsx)("blockquote",{className:"border-l-4 border-border pl-4 my-3 italic text-muted-foreground",...o,children:a}),a:({href:a,children:i,node:o,...s})=>(0,tt.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"text-brand hover:underline",...s,onClick:l=>{if(a){if(a.startsWith("#")){QL(n.current,a.slice(1))&&l.preventDefault();return}t?.(a)&&l.preventDefault()}},children:i}),table:({children:a,node:i,...o})=>(0,tt.jsx)("div",{className:"overflow-x-auto my-3",...o,children:(0,tt.jsx)("table",{className:"min-w-full border border-border",children:a})}),thead:({children:a,node:i,...o})=>(0,tt.jsx)("thead",{className:"bg-accent",...o,children:a}),th:({children:a,node:i,...o})=>(0,tt.jsx)("th",{className:"px-4 py-2 text-left font-semibold border-b border-border",...o,children:a}),td:({children:a,node:i,...o})=>(0,tt.jsx)("td",{className:"px-4 py-2 border-b border-border",...o,children:a}),hr:({node:a,...i})=>(0,tt.jsx)("hr",{className:"my-4 border-border",...i}),img:({src:a,alt:i,node:o,height:s,width:l,style:u,...c})=>{let d=r&&typeof a=="string"?XL(a,r):a;if(!(s||l||u))return(0,tt.jsx)("img",{src:d,alt:i||"",className:"max-w-full h-auto rounded-lg my-3",...c});let m=S=>S?/^\d+$/.test(String(S))?`${S}px`:String(S):void 0,E={...u,height:m(s)??u?.height,width:m(l)??u?.width};return(0,tt.jsx)("img",{src:d,alt:i||"",style:E,className:"inline-block align-middle",...c})},strong:({children:a,node:i,...o})=>(0,tt.jsx)("strong",{className:"font-bold",...o,children:a}),em:({children:a,node:i,...o})=>(0,tt.jsx)("em",{className:"italic",...o,children:a}),del:({children:a,node:i,...o})=>(0,tt.jsx)("del",{className:"line-through",...o,children:a})}}var VD=(0,go.memo)(function({content:t,isUser:n=!1,isStreaming:r=!1,enableMath:a=!0,isDark:i,rehypePlugins:o,onLinkClick:s,basePath:l}){let u=WL(),c=i??u?.resolvedTheme==="dark",d=(0,go.useRef)(null),p=(0,go.useMemo)(()=>LX(c,s,d,l),[c,s,l]),m=a?kX:wX,E=a?_X:NX,S=(0,go.useMemo)(()=>{if(n||r)return Vb(t);let y=Vb(Q3(OX(t)));return a?YD(y):y},[t,n,r,a]),x=(0,go.useMemo)(()=>o?.length?[...E,...o]:E,[o,E]);if(n)return(0,tt.jsx)("div",{className:"whitespace-pre-wrap break-words",children:t});if(r){let y=t.lastIndexOf(`
|
|
346
346
|
`);if(y===-1)return(0,tt.jsx)("div",{className:"whitespace-pre-wrap break-words",children:t});let T=t.slice(0,y+1),v=t.slice(y+1);return(0,tt.jsxs)("div",{className:"markdown-body",ref:d,children:[(0,tt.jsx)(T1,{remarkPlugins:m,rehypePlugins:E,components:p,children:a?YD(Vb(Q3(T))):Vb(Q3(T))}),v&&(0,tt.jsx)("span",{className:"whitespace-pre-wrap",children:v})]})}return(0,tt.jsx)("div",{className:"markdown-body",ref:d,children:(0,tt.jsx)(T1,{remarkPlugins:m,rehypePlugins:x,components:p,children:S})})});var hi=Ve(It());var Ul=Ve(It()),J3=Ve(Lr());function KD({content:e,children:t,className:n}){if(n)return(0,J3.jsx)("div",{"data-tooltip":e,className:n,children:t});let r=Ul.Children.toArray(t);if(r.length===1&&(0,Ul.isValidElement)(r[0])){let a=r[0];return(0,Ul.cloneElement)(a,{"data-tooltip":e})}return(0,J3.jsx)("div",{"data-tooltip":e,style:{display:"contents"},children:t})}var Br=Ve(Lr());function DX(e){let t=[],n=e.split(`
|
|
347
|
-
`),r=!1;for(let a=0;a<n.length;a++){let i=n[a];if(i.trimStart().startsWith("```")){r=!r;continue}if(r)continue;let o=/^(#{1,6})\s+(.+)$/.exec(i);o&&t.push({level:o[1].length,text:o[2].replace(/\s*#+\s*$/,"").replace(/\\([!-\/:-@[-`{-~])/g,"$1"),sourceLine:a+1})}return t}var XD=e=>`h1[data-source-start="${e}"], h2[data-source-start="${e}"], h3[data-source-start="${e}"], h4[data-source-start="${e}"], h5[data-source-start="${e}"], h6[data-source-start="${e}"]`;function WD({content:e,containerRef:t,width:n="w-80"}){let{t:r}=Xu(),a=(0,hi.useMemo)(()=>DX(e),[e]),[i,o]=(0,hi.useState)(!1),[s,l]=(0,hi.useState)(null),u=(0,hi.useCallback)(c=>{let d=t.current;if(!d)return;let p=d.querySelector(XD(c));p&&p.scrollIntoView({behavior:"smooth",block:"start"})},[t]);return(0,hi.useEffect)(()=>{let c=t.current;if(!c||a.length===0)return;let d=()=>{let m=[];for(let x of a){let y=c.querySelector(XD(x.sourceLine));if(y){let T=y.getBoundingClientRect().top-c.getBoundingClientRect().top;m.push({line:x.sourceLine,top:T})}}let E=60,S=null;for(let x of m)x.top<=E&&(S=x.line);S===null&&m.length>0&&(S=m[0].line),l(S)},p=setTimeout(d,150);return c.addEventListener("scroll",d,{passive:!0}),()=>{clearTimeout(p),c.removeEventListener("scroll",d)}},[a,e,t]),a.length===0?null:(0,Br.jsxs)("div",{className:`border-r border-border flex-shrink-0 flex flex-col transition-[width] duration-200 ${i?"w-8":n}`,children:[(0,Br.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-border flex-shrink-0",children:[!i&&(0,Br.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:r("editor.toc")}),(0,Br.jsx)("button",{onClick:()=>o(c=>!c),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-
|
|
347
|
+
`),r=!1;for(let a=0;a<n.length;a++){let i=n[a];if(i.trimStart().startsWith("```")){r=!r;continue}if(r)continue;let o=/^(#{1,6})\s+(.+)$/.exec(i);o&&t.push({level:o[1].length,text:o[2].replace(/\s*#+\s*$/,"").replace(/\\([!-\/:-@[-`{-~])/g,"$1"),sourceLine:a+1})}return t}var XD=e=>`h1[data-source-start="${e}"], h2[data-source-start="${e}"], h3[data-source-start="${e}"], h4[data-source-start="${e}"], h5[data-source-start="${e}"], h6[data-source-start="${e}"]`;function WD({content:e,containerRef:t,width:n="w-80"}){let{t:r}=Xu(),a=(0,hi.useMemo)(()=>DX(e),[e]),[i,o]=(0,hi.useState)(!1),[s,l]=(0,hi.useState)(null),u=(0,hi.useCallback)(c=>{let d=t.current;if(!d)return;let p=d.querySelector(XD(c));p&&p.scrollIntoView({behavior:"smooth",block:"start"})},[t]);return(0,hi.useEffect)(()=>{let c=t.current;if(!c||a.length===0)return;let d=()=>{let m=[];for(let x of a){let y=c.querySelector(XD(x.sourceLine));if(y){let T=y.getBoundingClientRect().top-c.getBoundingClientRect().top;m.push({line:x.sourceLine,top:T})}}let E=60,S=null;for(let x of m)x.top<=E&&(S=x.line);S===null&&m.length>0&&(S=m[0].line),l(S)},p=setTimeout(d,150);return c.addEventListener("scroll",d,{passive:!0}),()=>{clearTimeout(p),c.removeEventListener("scroll",d)}},[a,e,t]),a.length===0?null:(0,Br.jsxs)("div",{className:`border-r border-border flex-shrink-0 flex flex-col transition-[width] duration-200 ${i?"w-8":n}`,children:[(0,Br.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-border flex-shrink-0",children:[!i&&(0,Br.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:r("editor.toc")}),(0,Br.jsx)("button",{onClick:()=>o(c=>!c),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-hover rounded transition-colors",title:r(i?"editor.expandToc":"editor.collapseToc"),children:(0,Br.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:i?(0,Br.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"}):(0,Br.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})})]}),!i&&(0,Br.jsx)("nav",{className:"flex-1 overflow-y-auto py-1",children:a.map((c,d)=>(0,Br.jsx)(KD,{content:c.text,delay:400,children:(0,Br.jsx)("button",{onClick:()=>u(c.sourceLine),className:`block w-full text-left text-sm py-1 px-2 truncate transition-colors hover:bg-hover ${s===c.sourceLine?"text-brand font-medium bg-brand/5":"text-muted-foreground"}`,style:{paddingLeft:`${(c.level-1)*12+8}px`},children:c.text})},d))})]})}var MX=new Set(["p","h1","h2","h3","h4","h5","h6","li","blockquote","pre","table","tr","hr","div","ul","ol"]);function ZD(){return e=>{fr(e,"element",t=>{if(!(!MX.has(t.tagName)||!t.position)&&(t.properties||(t.properties={}),t.properties["data-source-start"]=t.position.start.line,t.properties["data-source-end"]=t.position.end.line,t.tagName==="pre")){let n=t.children?.find(r=>r.type==="element"&&r.tagName==="code");n&&(n.properties||(n.properties={}),n.properties["data-source-start"]=t.position.start.line,n.properties["data-source-end"]=t.position.end.line)}})}}var gi=Ve(Lr()),QD={en:{toc:"TOC",expandToc:"Expand TOC",collapseToc:"Collapse TOC"},zh:{toc:"\u76EE\u5F55",expandToc:"\u5C55\u5F00\u76EE\u5F55",collapseToc:"\u6536\u8D77\u76EE\u5F55"}};Ft.isInitialized||Ft.init({resources:{en:{translation:{editor:QD.en}},zh:{translation:{editor:QD.zh}}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});var zX=document.documentElement.getAttribute("data-cockpit-lang");Ft.changeLanguage(zX||(navigator.language.startsWith("zh")?"zh":"en"));window.addEventListener("message",e=>{e.data?.type==="cockpit:language-change"&&e.data.lang&&Ft.language!==e.data.lang&&Ft.changeLanguage(e.data.lang)});function BX(e){if(e)for(let t of["en","zh"])e[t]&&Ft.addResourceBundle(t,"translation",{editor:e[t]},!0,!0)}var FX=[ZD];function UX({content:e,opts:t,dark:n}){let r=(0,JD.useRef)(null);return(0,gi.jsxs)("div",{className:"cockpit-md-widget flex h-full",children:[(t.toc??!0)&&(0,gi.jsx)(WD,{content:e,containerRef:r}),(0,gi.jsx)("div",{ref:r,className:"flex-1 overflow-y-auto",children:(0,gi.jsx)("div",{className:"cockpit-md",children:(0,gi.jsx)(VD,{content:e,isDark:n,enableMath:t.enableMath,rehypePlugins:FX,onLinkClick:t.onLinkClick})})})]})}var Wm=new Map,PX=()=>document.documentElement.classList.contains("dark");function tM(e){e.root.render((0,gi.jsx)(Ky,{i18n:Ft,children:(0,gi.jsx)(UX,{content:e.content,opts:e.opts,dark:e.opts.isDark??PX()})}))}var ev=null;function HX(){ev||(ev=new MutationObserver(()=>{for(let e of Wm.values())e.opts.isDark===void 0&&tM(e)}),ev.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}))}function GX(e,t,n={}){BX(n.labels);let r=Wm.get(e);r?(r.content=t,r.opts=n):(r={root:(0,eM.createRoot)(e),content:t,opts:n},Wm.set(e,r)),HX(),tM(r)}function qX(e){let t=Wm.get(e);t&&(t.root.unmount(),Wm.delete(e))}window.CockpitMarkdown={render:GX,unmount:qX};})();
|
|
348
348
|
/*! Bundled license information:
|
|
349
349
|
|
|
350
350
|
react/cjs/react.production.js:
|
|
@@ -221,10 +221,6 @@
|
|
|
221
221
|
--tw-numeric-spacing: tabular-nums;
|
|
222
222
|
font-variant-numeric: var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);
|
|
223
223
|
}
|
|
224
|
-
.shadow-md {
|
|
225
|
-
--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
226
|
-
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
227
|
-
}
|
|
228
224
|
.ring-1 {
|
|
229
225
|
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
230
226
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -253,13 +249,6 @@
|
|
|
253
249
|
-webkit-user-select: none;
|
|
254
250
|
user-select: none;
|
|
255
251
|
}
|
|
256
|
-
.hover\:bg-accent {
|
|
257
|
-
&:hover {
|
|
258
|
-
@media (hover: hover) {
|
|
259
|
-
background-color: var(--accent);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
252
|
.hover\:ring-muted-foreground {
|
|
264
253
|
&:hover {
|
|
265
254
|
@media (hover: hover) {
|
|
@@ -63,7 +63,7 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
|
|
|
63
63
|
`)){let a=document.createElement("div");a.append(s?document.createTextNode(s):document.createElement("br")),e.append(a)}return t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:this.#t}}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}},O=class{static PRECISION=1e-4;toSVGPath(){Q("Abstract method `toSVGPath` must be implemented.")}get box(){Q("Abstract getter `box` must be implemented.")}serialize(t,e){Q("Abstract method `serialize` must be implemented.")}static _rescale(t,e,n,s,a,r){r||=new Float32Array(t.length);for(let o=0,l=t.length;o<l;o+=2)r[o]=e+t[o]*s,r[o+1]=n+t[o+1]*a;return r}static _rescaleAndSwap(t,e,n,s,a,r){r||=new Float32Array(t.length);for(let o=0,l=t.length;o<l;o+=2)r[o]=e+t[o+1]*s,r[o+1]=n+t[o]*a;return r}static _translate(t,e,n,s){s||=new Float32Array(t.length);for(let a=0,r=t.length;a<r;a+=2)s[a]=e+t[a],s[a+1]=n+t[a+1];return s}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,e,n,s,a){switch(a){case 90:return[1-e/n,t/s];case 180:return[1-t/n,1-e/s];case 270:return[e/n,1-t/s];default:return[t/n,e/s]}}static createBezierPoints(t,e,n,s,a,r){return[(t+5*n)/6,(e+5*s)/6,(5*n+a)/6,(5*s+r)/6,(n+a)/2,(s+r)/2]}},Il=class i{#t;#e=[];#i;#n;#s=[];#r=new Float32Array(18);#a;#o;#c;#l;#d;#h;#p=[];static#m=8;static#g=2;static#u=i.#m+i.#g;constructor({x:t,y:e},n,s,a,r,o=0){this.#t=n,this.#h=a*s,this.#n=r,this.#r.set([NaN,NaN,NaN,NaN,t,e],6),this.#i=o,this.#l=i.#m*s,this.#c=i.#u*s,this.#d=s,this.#p.push(t,e)}isEmpty(){return isNaN(this.#r[8])}#f(){let t=this.#r.subarray(4,6),e=this.#r.subarray(16,18),[n,s,a,r]=this.#t;return[(this.#a+(t[0]-e[0])/2-n)/a,(this.#o+(t[1]-e[1])/2-s)/r,(this.#a+(e[0]-t[0])/2-n)/a,(this.#o+(e[1]-t[1])/2-s)/r]}add({x:t,y:e}){this.#a=t,this.#o=e;let[n,s,a,r]=this.#t,[o,l,c,u]=this.#r.subarray(8,12),h=t-c,d=e-u,f=Math.hypot(h,d);if(f<this.#c)return!1;let m=f-this.#l,y=m/f,v=y*h,p=y*d,g=o,b=l;o=c,l=u,c+=v,u+=p,this.#p?.push(t,e);let A=-p/m,S=v/m,E=A*this.#h,T=S*this.#h;return this.#r.set(this.#r.subarray(2,8),0),this.#r.set([c+E,u+T],4),this.#r.set(this.#r.subarray(14,18),12),this.#r.set([c-E,u-T],16),isNaN(this.#r[6])?(this.#s.length===0&&(this.#r.set([o+E,l+T],2),this.#s.push(NaN,NaN,NaN,NaN,(o+E-n)/a,(l+T-s)/r),this.#r.set([o-E,l-T],14),this.#e.push(NaN,NaN,NaN,NaN,(o-E-n)/a,(l-T-s)/r)),this.#r.set([g,b,o,l,c,u],6),!this.isEmpty()):(this.#r.set([g,b,o,l,c,u],6),Math.abs(Math.atan2(b-l,g-o)-Math.atan2(p,v))<Math.PI/2?([o,l,c,u]=this.#r.subarray(2,6),this.#s.push(NaN,NaN,NaN,NaN,((o+c)/2-n)/a,((l+u)/2-s)/r),[o,l,g,b]=this.#r.subarray(14,18),this.#e.push(NaN,NaN,NaN,NaN,((g+o)/2-n)/a,((b+l)/2-s)/r),!0):([g,b,o,l,c,u]=this.#r.subarray(0,6),this.#s.push(((g+5*o)/6-n)/a,((b+5*l)/6-s)/r,((5*o+c)/6-n)/a,((5*l+u)/6-s)/r,((o+c)/2-n)/a,((l+u)/2-s)/r),[c,u,o,l,g,b]=this.#r.subarray(12,18),this.#e.push(((g+5*o)/6-n)/a,((b+5*l)/6-s)/r,((5*o+c)/6-n)/a,((5*l+u)/6-s)/r,((o+c)/2-n)/a,((l+u)/2-s)/r),!0))}toSVGPath(){if(this.isEmpty())return"";let t=this.#s,e=this.#e;if(isNaN(this.#r[6])&&!this.isEmpty())return this.#b();let n=[];n.push(`M${t[4]} ${t[5]}`);for(let s=6;s<t.length;s+=6)isNaN(t[s])?n.push(`L${t[s+4]} ${t[s+5]}`):n.push(`C${t[s]} ${t[s+1]} ${t[s+2]} ${t[s+3]} ${t[s+4]} ${t[s+5]}`);this.#y(n);for(let s=e.length-6;s>=6;s-=6)isNaN(e[s])?n.push(`L${e[s+4]} ${e[s+5]}`):n.push(`C${e[s]} ${e[s+1]} ${e[s+2]} ${e[s+3]} ${e[s+4]} ${e[s+5]}`);return this.#v(n),n.join(" ")}#b(){let[t,e,n,s]=this.#t,[a,r,o,l]=this.#f();return`M${(this.#r[2]-t)/n} ${(this.#r[3]-e)/s} L${(this.#r[4]-t)/n} ${(this.#r[5]-e)/s} L${a} ${r} L${o} ${l} L${(this.#r[16]-t)/n} ${(this.#r[17]-e)/s} L${(this.#r[14]-t)/n} ${(this.#r[15]-e)/s} Z`}#v(t){let e=this.#e;t.push(`L${e[4]} ${e[5]} Z`)}#y(t){let[e,n,s,a]=this.#t,r=this.#r.subarray(4,6),o=this.#r.subarray(16,18),[l,c,u,h]=this.#f();t.push(`L${(r[0]-e)/s} ${(r[1]-n)/a} L${l} ${c} L${u} ${h} L${(o[0]-e)/s} ${(o[1]-n)/a}`)}newFreeDrawOutline(t,e,n,s,a,r){return new Fl(t,e,n,s,a,r)}getOutlines(){let t=this.#s,e=this.#e,n=this.#r,[s,a,r,o]=this.#t,l=new Float32Array((this.#p?.length??0)+2);for(let h=0,d=l.length-2;h<d;h+=2)l[h]=(this.#p[h]-s)/r,l[h+1]=(this.#p[h+1]-a)/o;if(l[l.length-2]=(this.#a-s)/r,l[l.length-1]=(this.#o-a)/o,isNaN(n[6])&&!this.isEmpty())return this.#E(l);let c=new Float32Array(this.#s.length+24+this.#e.length),u=t.length;for(let h=0;h<u;h+=2){if(isNaN(t[h])){c[h]=c[h+1]=NaN;continue}c[h]=t[h],c[h+1]=t[h+1]}u=this.#A(c,u);for(let h=e.length-6;h>=6;h-=6)for(let d=0;d<6;d+=2){if(isNaN(e[h+d])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=e[h+d],c[u+1]=e[h+d+1],u+=2}return this.#w(c,u),this.newFreeDrawOutline(c,l,this.#t,this.#d,this.#i,this.#n)}#E(t){let e=this.#r,[n,s,a,r]=this.#t,[o,l,c,u]=this.#f(),h=new Float32Array(36);return h.set([NaN,NaN,NaN,NaN,(e[2]-n)/a,(e[3]-s)/r,NaN,NaN,NaN,NaN,(e[4]-n)/a,(e[5]-s)/r,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,(e[16]-n)/a,(e[17]-s)/r,NaN,NaN,NaN,NaN,(e[14]-n)/a,(e[15]-s)/r],0),this.newFreeDrawOutline(h,t,this.#t,this.#d,this.#i,this.#n)}#w(t,e){let n=this.#e;return t.set([NaN,NaN,NaN,NaN,n[4],n[5]],e),e+=6}#A(t,e){let n=this.#r.subarray(4,6),s=this.#r.subarray(16,18),[a,r,o,l]=this.#t,[c,u,h,d]=this.#f();return t.set([NaN,NaN,NaN,NaN,(n[0]-a)/o,(n[1]-r)/l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,h,d,NaN,NaN,NaN,NaN,(s[0]-a)/o,(s[1]-r)/l],e),e+=24}},Fl=class extends O{#t;#e=new Float32Array(4);#i;#n;#s;#r;#a;constructor(t,e,n,s,a,r){super(),this.#a=t,this.#s=e,this.#t=n,this.#r=s,this.#i=a,this.#n=r,this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],this.#o(r);let[o,l,c,u]=this.#e;for(let h=0,d=t.length;h<d;h+=2)t[h]=(t[h]-o)/c,t[h+1]=(t[h+1]-l)/u;for(let h=0,d=e.length;h<d;h+=2)e[h]=(e[h]-o)/c,e[h+1]=(e[h+1]-l)/u}toSVGPath(){let t=[`M${this.#a[4]} ${this.#a[5]}`];for(let e=6,n=this.#a.length;e<n;e+=6){if(isNaN(this.#a[e])){t.push(`L${this.#a[e+4]} ${this.#a[e+5]}`);continue}t.push(`C${this.#a[e]} ${this.#a[e+1]} ${this.#a[e+2]} ${this.#a[e+3]} ${this.#a[e+4]} ${this.#a[e+5]}`)}return t.push("Z"),t.join(" ")}serialize([t,e,n,s],a){let r=n-t,o=s-e,l,c;switch(a){case 0:l=O._rescale(this.#a,t,s,r,-o),c=O._rescale(this.#s,t,s,r,-o);break;case 90:l=O._rescaleAndSwap(this.#a,t,e,r,o),c=O._rescaleAndSwap(this.#s,t,e,r,o);break;case 180:l=O._rescale(this.#a,n,e,-r,o),c=O._rescale(this.#s,n,e,-r,o);break;case 270:l=O._rescaleAndSwap(this.#a,n,s,-r,-o),c=O._rescaleAndSwap(this.#s,n,s,-r,-o);break}return{outline:Array.from(l),points:[Array.from(c)]}}#o(t){let e=this.#a,n=e[4],s=e[5],a=[n,s,n,s],r=n,o=s,l=n,c=s,u=t?Math.max:Math.min,h=new Float32Array(4);for(let f=6,m=e.length;f<m;f+=6){let y=e[f+4],v=e[f+5];isNaN(e[f])?(M.pointBoundingBox(y,v,a),o>v?(r=y,o=v):o===v&&(r=u(r,y)),c<v?(l=y,c=v):c===v&&(l=u(l,y))):(h.set(Ti,0),M.bezierBoundingBox(n,s,...e.slice(f,f+6),h),M.rectBoundingBox(...h,a),o>h[1]?(r=h[0],o=h[1]):o===h[1]&&(r=u(r,h[0])),c<h[3]?(l=h[2],c=h[3]):c===h[3]&&(l=u(l,h[2]))),n=y,s=v}let d=this.#e;d[0]=a[0]-this.#i,d[1]=a[1]-this.#i,d[2]=a[2]-a[0]+2*this.#i,d[3]=a[3]-a[1]+2*this.#i,this.firstPoint=[r,o],this.lastPoint=[l,c]}get box(){return this.#e}newOutliner(t,e,n,s,a,r=0){return new Il(t,e,n,s,a,r)}getNewOutline(t,e){let[n,s,a,r]=this.#e,[o,l,c,u]=this.#t,h=a*c,d=r*u,f=n*c+o,m=s*u+l,y=this.newOutliner({x:this.#s[0]*h+f,y:this.#s[1]*d+m},this.#t,this.#r,t,this.#n,e??this.#i);for(let v=2;v<this.#s.length;v+=2)y.add({x:this.#s[v]*h+f,y:this.#s[v+1]*d+m});return y.getOutlines()}},wr=class{#t;#e;#i;#n=[];#s=[];constructor(t,e=0,n=0,s=!0){let a=Ti.slice(),o=10**-4;for(let{x:v,y:p,width:g,height:b}of t){let A=Math.floor((v-e)/o)*o,S=Math.ceil((v+g+e)/o)*o,E=Math.floor((p-e)/o)*o,T=Math.ceil((p+b+e)/o)*o,w=[A,E,T,!0],_=[S,E,T,!1];this.#n.push(w,_),M.rectBoundingBox(A,E,S,T,a)}let l=a[2]-a[0]+2*n,c=a[3]-a[1]+2*n,u=a[0]-n,h=a[1]-n,d=s?-1/0:1/0,f=1/0,m=this.#n.at(s?-1:-2),y=[m[0],m[2]];for(let v of this.#n){let[p,g,b,A]=v;!A&&s?g<f?(f=g,d=p):g===f&&(d=Math.max(d,p)):A&&!s&&(g<f?(f=g,d=p):g===f&&(d=Math.min(d,p))),v[0]=(p-u)/l,v[1]=(g-h)/c,v[2]=(b-h)/c}this.#t=new Float32Array([u,h,l,c]),this.#e=[d,f],this.#i=y}getOutlines(){this.#n.sort((e,n)=>e[0]-n[0]||e[1]-n[1]||e[2]-n[2]);let t=[];for(let e of this.#n)e[3]?(t.push(...this.#l(e)),this.#o(e)):(this.#c(e),t.push(...this.#l(e)));return this.#r(t)}#r(t){let e=[],n=new Set;for(let r of t){let[o,l,c]=r;e.push([o,l,r],[o,c,r])}e.sort((r,o)=>r[1]-o[1]||r[0]-o[0]);for(let r=0,o=e.length;r<o;r+=2){let l=e[r][2],c=e[r+1][2];l.push(c),c.push(l),n.add(l),n.add(c)}let s=[],a;for(;n.size>0;){let r=n.values().next().value,[o,l,c,u,h]=r;n.delete(r);let d=o,f=l;for(a=[o,c],s.push(a);;){let m;if(n.has(u))m=u;else if(n.has(h))m=h;else break;n.delete(m),[o,l,c,u,h]=m,d!==o&&(a.push(d,f,o,f===l?l:c),d=o),f=f===l?c:l}a.push(d,f)}return new xf(s,this.#t,this.#e,this.#i)}#a(t){let e=this.#s,n=0,s=e.length-1;for(;n<=s;){let a=n+s>>1,r=e[a][0];if(r===t)return a;r<t?n=a+1:s=a-1}return s+1}#o([,t,e]){let n=this.#a(t);this.#s.splice(n,0,[t,e])}#c([,t,e]){let n=this.#a(t);for(let s=n;s<this.#s.length;s++){let[a,r]=this.#s[s];if(a!==t)break;if(a===t&&r===e){this.#s.splice(s,1);return}}for(let s=n-1;s>=0;s--){let[a,r]=this.#s[s];if(a!==t)break;if(a===t&&r===e){this.#s.splice(s,1);return}}}#l(t){let[e,n,s]=t,a=[[e,n,s]],r=this.#a(s);for(let o=0;o<r;o++){let[l,c]=this.#s[o];for(let u=0,h=a.length;u<h;u++){let[,d,f]=a[u];if(!(c<=d||f<=l)){if(d>=l){if(f>c)a[u][1]=c;else{if(h===1)return[];a.splice(u,1),u--,h--}continue}a[u][2]=l,f>c&&a.push([e,c,f])}}}return a}},xf=class extends O{#t;#e;constructor(t,e,n,s){super(),this.#e=t,this.#t=e,this.firstPoint=n,this.lastPoint=s}toSVGPath(){let t=[];for(let e of this.#e){let[n,s]=e;t.push(`M${n} ${s}`);for(let a=2;a<e.length;a+=2){let r=e[a],o=e[a+1];r===n?(t.push(`V${o}`),s=o):o===s&&(t.push(`H${r}`),n=r)}t.push("Z")}return t.join(" ")}serialize([t,e,n,s],a){let r=[],o=n-t,l=s-e;for(let c of this.#e){let u=new Array(c.length);for(let h=0;h<c.length;h+=2)u[h]=t+c[h]*o,u[h+1]=s-c[h+1]*l;r.push(u)}return r}get box(){return this.#t}},_r=class extends Il{newFreeDrawOutline(t,e,n,s,a,r){return new Cf(t,e,n,s,a,r)}},Cf=class extends Fl{newOutliner(t,e,n,s,a,r=0){return new _r(t,e,n,s,a,r)}},Hl=class i extends tt{#t=null;#e=0;#i;#n=null;#s=null;#r=null;#a=null;#o=0;#c=null;#l=null;#d=null;#h=!1;#p=null;#m=null;#g=null;#u="";#f;#b="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=P.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){let t=i.prototype;return L(this,"_keyboardManager",new kn([[["ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:"highlightEditor"}),this.color=t.color||i._defaultColor,this.#f=t.thickness||i._defaultThickness,this.opacity=t.opacity||i._defaultOpacity,this.#i=t.boxes||null,this.#b=t.methodOfCreation||"",this.#u=t.text||"",this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(this.#h=!0,this.#y(t),this.#T()):this.#i&&(this.#t=t.anchorNode,this.#e=t.anchorOffset,this.#a=t.focusNode,this.#o=t.focusOffset,this.#v(),this.#T(),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert(tt._l10nAlert.highlight)}get telemetryInitialData(){return{action:"added",type:this.#h?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:this.#f,methodOfCreation:this.#b}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}#v(){let t=new wr(this.#i,.001);this.#l=t.getOutlines(),[this.x,this.y,this.width,this.height]=this.#l.box;let e=new wr(this.#i,.0025,.001,this._uiManager.direction==="ltr");this.#r=e.getOutlines();let{firstPoint:n}=this.#l;this.#p=[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height];let{lastPoint:s}=this.#r;this.#m=[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height]}#y({highlightOutlines:t,highlightId:e,clipPathId:n}){this.#l=t;let s=1.5;if(this.#r=t.getNewOutline(this.#f/2+s,.0025),e>=0)this.#d=e,this.#n=n,this.parent.drawLayer.finalizeDraw(e,{bbox:t.box,path:{d:t.toSVGPath()}}),this.#g=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#r.box,path:{d:this.#r.toSVGPath()}},!0);else if(this.parent){let h=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#d,{bbox:i.#C(this.#l.box,(h-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#g,{bbox:i.#C(this.#r.box,h),path:{d:this.#r.toSVGPath()}})}let[a,r,o,l]=t.box;switch(this.rotation){case 0:this.x=a,this.y=r,this.width=o,this.height=l;break;case 90:{let[h,d]=this.parentDimensions;this.x=r,this.y=1-a,this.width=o*d/h,this.height=l*h/d;break}case 180:this.x=1-a,this.y=1-r,this.width=o,this.height=l;break;case 270:{let[h,d]=this.parentDimensions;this.x=1-r,this.y=a,this.width=o*d/h,this.height=l*h/d;break}}let{firstPoint:c}=t;this.#p=[(c[0]-a)/o,(c[1]-r)/l];let{lastPoint:u}=this.#r;this.#m=[(u[0]-a)/o,(u[1]-r)/l]}static initialize(t,e){tt.initialize(t,e),i._defaultColor||=e.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(t,e){switch(t){case H.HIGHLIGHT_COLOR:i._defaultColor=e;break;case H.HIGHLIGHT_THICKNESS:i._defaultThickness=e;break}}translateInPage(t,e){}get toolbarPosition(){return this.#m}get commentButtonPosition(){return this.#p}updateParams(t,e){switch(t){case H.HIGHLIGHT_COLOR:this.#E(e);break;case H.HIGHLIGHT_THICKNESS:this.#w(e);break}}static get defaultPropertiesToUpdate(){return[[H.HIGHLIGHT_COLOR,i._defaultColor],[H.HIGHLIGHT_THICKNESS,i._defaultThickness]]}get propertiesToUpdate(){return[[H.HIGHLIGHT_COLOR,this.color||i._defaultColor],[H.HIGHLIGHT_THICKNESS,this.#f||i._defaultThickness],[H.HIGHLIGHT_FREE,this.#h]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(this.#d,{root:{fill:this.color,"fill-opacity":this.opacity}}),this.#s?.updateColor(this.color),super.onUpdatedColor()}#E(t){let e=(a,r)=>{this.color=a,this.opacity=r,this.onUpdatedColor()},n=this.color,s=this.opacity;this.addCommands({cmd:e.bind(this,t,i._defaultOpacity),undo:e.bind(this,n,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:H.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)}#w(t){let e=this.#f,n=s=>{this.#f=s,this.#A(s)};this.addCommands({cmd:n.bind(this,t),undo:n.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:H.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",this.#s=new Ar({editor:this})]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#M())}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,this.#M())}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){this.#_(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#T(),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?this.#_():t&&(this.#T(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),e&&this.select()}#A(t){this.#h&&(this.#y({highlightOutlines:this.#l.getNewOutline(t/2)}),this.fixAndSetPosition(),this.setDims())}#_(){this.#d===null||!this.parent||(this.parent.drawLayer.remove(this.#d),this.#d=null,this.parent.drawLayer.remove(this.#g),this.#g=null)}#T(t=this.parent){this.#d===null&&({id:this.#d,clipPathId:this.#n}=t.drawLayer.draw({bbox:this.#l.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:this.#h},path:{d:this.#l.toSVGPath()}},!1,!0),this.#g=t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#h},bbox:this.#r.box,path:{d:this.#r.toSVGPath()}},this.#h),this.#c&&(this.#c.style.clipPath=this.#n))}static#C([t,e,n,s],a){switch(a){case 90:return[1-e-s,t,s,n];case 180:return[1-t-n,1-e-s,n,s];case 270:return[e,1-t-n,s,n]}return[t,e,n,s]}rotate(t){let{drawLayer:e}=this.parent,n;this.#h?(t=(t-this.rotation+360)%360,n=i.#C(this.#l.box,t)):n=i.#C([this.x,this.y,this.width,this.height],t),e.updateProperties(this.#d,{bbox:n,root:{"data-main-rotation":t}}),e.updateProperties(this.#g,{bbox:i.#C(this.#r.box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;let t=super.render();this.#u&&(t.setAttribute("aria-label",this.#u),t.setAttribute("role","mark")),this.#h?t.classList.add("free"):this.div.addEventListener("keydown",this.#D.bind(this),{signal:this._uiManager._signal});let e=this.#c=document.createElement("div");return t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=this.#n,this.setDims(),Eb(this,this.#c,["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#g,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#g,{rootClass:{hovered:!1}})}#D(t){i._keyboardManager.exec(this,t)}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:this.#O(!0);break;case 1:case 3:this.#O(!1);break}}#O(t){if(!this.#t)return;let e=window.getSelection();t?e.setPosition(this.#t,this.#e):e.setPosition(this.#a,this.#o)}select(){super.select(),this.#g&&this.parent?.drawLayer.updateProperties(this.#g,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#g&&(this.parent?.drawLayer.updateProperties(this.#g,{rootClass:{selected:!1}}),this.#h||this.#O(!1))}get _mustFixPosition(){return!this.#h}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(this.#d,{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(this.#g,{rootClass:{hidden:!t}}))}#M(){return this.#h?this.rotation:0}#k(){if(this.#h)return null;let[t,e]=this.pageDimensions,[n,s]=this.pageTranslation,a=this.#i,r=new Float32Array(a.length*8),o=0;for(let{x:l,y:c,width:u,height:h}of a){let d=l*t+n,f=(1-c)*e+s;r[o]=r[o+4]=d,r[o+1]=r[o+3]=f,r[o+2]=r[o+6]=d+u*t,r[o+5]=r[o+7]=f-h*e,o+=8}return r}#L(t){return this.#l.serialize(t,this.#M())}static startHighlighting(t,e,{target:n,x:s,y:a}){let{x:r,y:o,width:l,height:c}=n.getBoundingClientRect(),u=new AbortController,h=t.combinedSignal(u),d=f=>{u.abort(),this.#B(t,f)};window.addEventListener("blur",d,{signal:h}),window.addEventListener("pointerup",d,{signal:h}),window.addEventListener("pointerdown",vt,{capture:!0,passive:!1,signal:h}),window.addEventListener("contextmenu",Te,{signal:h}),n.addEventListener("pointermove",this.#N.bind(this,t),{signal:h}),this._freeHighlight=new _r({x:s,y:a},[r,o,l,c],t.scale,this._defaultThickness/2,e,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static#N(t,e){this._freeHighlight.add(e)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#B(t,e){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(t,e,n){let s=null;if(t instanceof Ll){let{data:{quadPoints:y,rect:v,rotation:p,id:g,color:b,opacity:A,popupRef:S,richText:E,contentsObj:T,creationDate:w,modificationDate:_},parent:{page:{pageNumber:C}}}=t;s=t={annotationType:P.HIGHLIGHT,color:Array.from(b),opacity:A,quadPoints:y,boxes:null,pageIndex:C-1,rect:v.slice(0),rotation:p,annotationElementId:g,id:g,deleted:!1,popupRef:S,richText:E,comment:T?.str||null,creationDate:w,modificationDate:_}}else if(t instanceof Tr){let{data:{inkLists:y,rect:v,rotation:p,id:g,color:b,borderStyle:{rawWidth:A},popupRef:S,richText:E,contentsObj:T,creationDate:w,modificationDate:_},parent:{page:{pageNumber:C}}}=t;s=t={annotationType:P.HIGHLIGHT,color:Array.from(b),thickness:A,inkLists:y,boxes:null,pageIndex:C-1,rect:v.slice(0),rotation:p,annotationElementId:g,id:g,deleted:!1,popupRef:S,richText:E,comment:T?.str||null,creationDate:w,modificationDate:_}}let{color:a,quadPoints:r,inkLists:o,outlines:l,opacity:c}=t,u=await super.deserialize(t,e,n);u.color=M.makeHexColor(...a),u.opacity=c||1,o&&(u.#f=t.thickness),u._initialData=s,t.comment&&u.setCommentData(t);let[h,d]=u.pageDimensions,[f,m]=u.pageTranslation;if(r){let y=u.#i=[];for(let v=0;v<r.length;v+=8)y.push({x:(r[v]-f)/h,y:1-(r[v+1]-m)/d,width:(r[v+2]-r[v])/h,height:(r[v+1]-r[v+5])/d});u.#v(),u.#T(),u.rotate(u.rotation)}else if(o||l){u.#h=!0;let y=(o||l.points)[0],v={x:y[0]-f,y:d-(y[1]-m)},p=new _r(v,[0,0,h,d],1,u.#f/2,!0,.001);for(let A=0,S=y.length;A<S;A+=2)v.x=y[A]-f,v.y=d-(y[A+1]-m),p.add(v);let{id:g,clipPathId:b}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:u.color,"fill-opacity":u._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:p.toSVGPath()}},!0,!0);u.#y({highlightOutlines:p.getOutlines(),highlightId:g,clipPathId:b}),u.#T(),u.rotate(u.parentRotation)}return u}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();let e=tt._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),n=super.serialize(t);return Object.assign(n,{color:e,opacity:this.opacity,thickness:this.#f,quadPoints:this.#k(),outlines:this.#L(n.rect)}),this.addComment(n),this.annotationElementId&&!this.#P(n)?null:(n.id=this.annotationElementId,n)}#P(t){let{color:e}=this._initialData;return this.hasEditedComment||t.color.some((n,s)=>n!==e[s])}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}},Ul=class{#t=Object.create(null);updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(let[e,n]of Object.entries(t))e.startsWith("_")||this.updateProperty(e,n)}updateSVGProperty(t,e){this.#t[t]=e}toSVGProperties(){let t=this.#t;return this.#t=Object.create(null),{root:t}}reset(){this.#t=Object.create(null)}updateAll(t=this){this.updateProperties(t)}clone(){Q("Not implemented")}},Gl=class i extends tt{#t=null;#e;_colorPicker=null;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#i=null;static#n=null;static#s=null;static _INNER_MARGIN=3;constructor(t){super(t),this.#e=t.mustBeCommitted||!1,this._addOutlines(t)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}onUpdatedOpacity(){this._colorPicker?.updateOpacity?.(this.opacity)}_addOutlines(t){t.drawOutlines&&(this.#r(t),this.#c())}#r({drawOutlines:t,drawId:e,drawingOptions:n}){this.#t=t,this._drawingOptions||=n,this.annotationElementId||this._uiManager.a11yAlert(tt._l10nAlert[this.editorType]),e>=0?(this._drawId=e,this.parent.drawLayer.finalizeDraw(e,t.defaultProperties)):this._drawId=this.#a(t,this.parent),this.#h(t.box)}#a(t,e){let{id:n}=e.drawLayer.draw(i._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return n}static _mergeSVGProperties(t,e){let n=new Set(Object.keys(t));for(let[s,a]of Object.entries(e))n.has(s)?Object.assign(t[s],a):t[s]=a;return t}static getDefaultDrawingOptions(t){Q("Not implemented")}static get typesMap(){Q("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,e){let n=this.typesMap.get(t);n&&this._defaultDrawingOptions.updateProperty(n,e),this._currentParent&&(i.#i.updateProperty(n,e),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,e){let n=this.constructor.typesMap.get(t);n&&this._updateProperty(t,n,e)}static get defaultPropertiesToUpdate(){let t=[],e=this._defaultDrawingOptions;for(let[n,s]of this.typesMap)t.push([n,e[s]]);return t}get propertiesToUpdate(){let t=[],{_drawingOptions:e}=this;for(let[n,s]of this.constructor.typesMap)t.push([n,e[s]]);return t}_updateProperty(t,e,n){let s=this._drawingOptions,a=s[e],r=o=>{s.updateProperty(e,o);let l=this.#t.updateProperty(e,o);l&&this.#h(l),this.parent?.drawLayer.updateProperties(this._drawId,s.toSVGProperties()),t===this.colorType?this.onUpdatedColor():t===this.opacityType&&this.onUpdatedOpacity()};this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_updateColorAndOpacity(t,e){let n=this.constructor.typesMap.get(this.colorType),s=this.constructor.typesMap.get(this.opacityType),a=this._drawingOptions,r=a[n],o=a[s],l=(c,u)=>{a.updateProperty(n,c),a.updateProperty(s,u),this.#t.updateProperty(n,c),this.#t.updateProperty(s,u),this.parent?.drawLayer.updateProperties(this._drawId,a.toSVGProperties()),this.onUpdatedColor(),this.onUpdatedOpacity()};this.addCommands({cmd:l.bind(this,t,e),undo:l.bind(this,r,o),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:H.INK_COLOR_AND_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,i._mergeSVGProperties(this.#t.getPathResizingSVGProperties(this.#d()),{bbox:this.#p()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,i._mergeSVGProperties(this.#t.getPathResizedSVGProperties(this.#d()),{bbox:this.#p()}))}_onTranslating(t,e){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#p()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,i._mergeSVGProperties(this.#t.getPathTranslatedSVGProperties(this.#d(),this.parentDimensions),{bbox:this.#p()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#e&&(this.#e=!1,this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){this.#o(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#c(),this.#h(this.#t.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),this.#o()):t&&(this._uiManager.addShouldRescale(this),this.#c(t),e=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),e&&this.select()}#o(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#c(t=this.parent){if(!(this._drawId!==null&&this.parent===t)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,t.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=this.#a(this.#t,t)}}#l([t,e,n,s]){let{parentDimensions:[a,r],rotation:o}=this;switch(o){case 90:return[e,1-t,n*(r/a),s*(a/r)];case 180:return[1-t,1-e,n,s];case 270:return[1-e,t,n*(r/a),s*(a/r)];default:return[t,e,n,s]}}#d(){let{x:t,y:e,width:n,height:s,parentDimensions:[a,r],rotation:o}=this;switch(o){case 90:return[1-e,t,n*(a/r),s*(r/a)];case 180:return[1-t,1-e,n,s];case 270:return[e,1-t,n*(a/r),s*(r/a)];default:return[t,e,n,s]}}#h(t){[this.x,this.y,this.width,this.height]=this.#l(t),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}#p(){let{x:t,y:e,width:n,height:s,rotation:a,parentRotation:r,parentDimensions:[o,l]}=this;switch((a*4+r)/90){case 1:return[1-e-s,t,s,n];case 2:return[1-t-n,1-e-s,n,s];case 3:return[e,1-t-n,s,n];case 4:return[t,e-n*(o/l),s*(l/o),n*(o/l)];case 5:return[1-e,t,n*(o/l),s*(l/o)];case 6:return[1-t-s*(l/o),1-e,s*(l/o),n*(o/l)];case 7:return[e-n*(o/l),1-t-s*(l/o),n*(o/l),s*(l/o)];case 8:return[t-n,e-s,n,s];case 9:return[1-e,t-n,s,n];case 10:return[1-t,1-e,n,s];case 11:return[e-s,1-t,s,n];case 12:return[t-s*(l/o),e,s*(l/o),n*(o/l)];case 13:return[1-e-n*(o/l),t-s*(l/o),n*(o/l),s*(l/o)];case 14:return[1-t,1-e-n*(o/l),s*(l/o),n*(o/l)];case 15:return[e,1-t,n*(o/l),s*(l/o)];default:return[t,e,n,s]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,i._mergeSVGProperties({bbox:this.#p()},this.#t.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#h(this.#t.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,e;this._isCopy&&(t=this.x,e=this.y);let n=super.render();n.classList.add("draw");let s=document.createElement("div");return n.append(s),s.setAttribute("aria-hidden","true"),s.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,e),n}static createDrawerInstance(t,e,n,s,a){Q("Not implemented")}static startDrawing(t,e,n,s){let{target:a,offsetX:r,offsetY:o,pointerId:l,pointerType:c}=s;if(Kt.isInitializedAndDifferentPointerType(c))return;let{viewport:{rotation:u}}=t,{width:h,height:d}=a.getBoundingClientRect(),f=i.#n=new AbortController,m=t.combinedSignal(f);if(Kt.setPointer(c,l),window.addEventListener("pointerup",y=>{Kt.isSamePointerIdOrRemove(y.pointerId)&&this._endDraw(y)},{signal:m}),window.addEventListener("pointercancel",y=>{Kt.isSamePointerIdOrRemove(y.pointerId)&&this._currentParent.endDrawingSession()},{signal:m}),window.addEventListener("pointerdown",y=>{Kt.isSamePointerType(y.pointerType)&&(Kt.initializeAndAddPointerId(y.pointerId),i.#i.isCancellable()&&(i.#i.removeLastElement(),i.#i.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:m}),window.addEventListener("contextmenu",Te,{signal:m}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:m}),a.addEventListener("touchmove",y=>{Kt.isSameTimeStamp(y.timeStamp)&&vt(y)},{signal:m}),t.toggleDrawing(),e._editorUndoBar?.hide(),i.#i){t.drawLayer.updateProperties(this._currentDrawId,i.#i.startNew(r,o,h,d,u));return}e.updateUIForDefaultProperties(this),i.#i=this.createDrawerInstance(r,o,h,d,u),i.#s=this.getDefaultDrawingOptions(),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(i.#s.toSVGProperties(),i.#i.defaultSVGProperties),!0,!1)}static _drawMove(t){if(Kt.isSameTimeStamp(t.timeStamp),!i.#i)return;let{offsetX:e,offsetY:n,pointerId:s}=t;if(Kt.isSamePointerId(s)){if(Kt.isUsingMultiplePointers()){this._endDraw(t);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,i.#i.add(e,n)),Kt.setTimeStamp(t.timeStamp),vt(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,i.#i=null,i.#s=null,Kt.clearTimeStamp()),i.#n&&(i.#n.abort(),i.#n=null,Kt.clearPointerIds())}static _endDraw(t){let e=this._currentParent;if(e){if(e.toggleDrawing(!0),this._cleanup(!1),t?.target===e.div&&e.drawLayer.updateProperties(this._currentDrawId,i.#i.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){let n=i.#i,s=this._currentDrawId,a=n.getLastElement();e.addCommands({cmd:()=>{e.drawLayer.updateProperties(s,n.setLastElement(a))},undo:()=>{e.drawLayer.updateProperties(s,n.removeLastElement())},mustExec:!1,type:H.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){let e=this._currentParent;if(!e)return null;if(e.toggleDrawing(!0),e.cleanUndoStack(H.DRAW_STEP),!i.#i.isEmpty()){let{pageDimensions:[n,s],scale:a}=e,r=e.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:i.#i.getOutlines(n*a,s*a,a,this._INNER_MARGIN),drawingOptions:i.#s,mustBeCommitted:!t});return this._cleanup(!0),r}return e.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,e,n,s,a,r){Q("Not implemented")}static async deserialize(t,e,n){let{rawDims:{pageWidth:s,pageHeight:a,pageX:r,pageY:o}}=e.viewport,l=this.deserializeDraw(r,o,s,a,this._INNER_MARGIN,t),c=await super.deserialize(t,e,n);return c.createDrawingOptions(t),c.#r({drawOutlines:l}),c.#c(),c.onScaleChanging(),c.rotate(),c}serializeDraw(t){let[e,n]=this.pageTranslation,[s,a]=this.pageDimensions;return this.#t.serialize([e,n,s,a],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}},Mf=class{#t=new Float64Array(6);#e;#i;#n;#s;#r;#a="";#o=0;#c=new zn;#l;#d;constructor(t,e,n,s,a,r){this.#l=n,this.#d=s,this.#n=a,this.#s=r,[t,e]=this.#h(t,e);let o=this.#e=[NaN,NaN,NaN,NaN,t,e];this.#r=[t,e],this.#i=[{line:o,points:this.#r}],this.#t.set(o,0)}updateProperty(t,e){t==="stroke-width"&&(this.#s=e)}#h(t,e){return O._normalizePoint(t,e,this.#l,this.#d,this.#n)}isEmpty(){return!this.#i?.length}isCancellable(){return this.#r.length<=10}add(t,e){[t,e]=this.#h(t,e);let[n,s,a,r]=this.#t.subarray(2,6),o=t-a,l=e-r;return Math.hypot(this.#l*o,this.#d*l)<=2?null:(this.#r.push(t,e),isNaN(n)?(this.#t.set([a,r,t,e],2),this.#e.push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(this.#t[0])&&this.#e.splice(6,6),this.#t.set([n,s,a,r,t,e],0),this.#e.push(...O.createBezierPoints(n,s,a,r,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){let n=this.add(t,e);return n||(this.#r.length===2?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,n,s,a){this.#l=n,this.#d=s,this.#n=a,[t,e]=this.#h(t,e);let r=this.#e=[NaN,NaN,NaN,NaN,t,e];this.#r=[t,e];let o=this.#i.at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),this.#i.push({line:r,points:this.#r}),this.#t.set(r,0),this.#o=0,this.toSVGPath(),null}getLastElement(){return this.#i.at(-1)}setLastElement(t){return this.#i?(this.#i.push(t),this.#e=t.line,this.#r=t.points,this.#o=0,{path:{d:this.toSVGPath()}}):this.#c.setLastElement(t)}removeLastElement(){if(!this.#i)return this.#c.removeLastElement();this.#i.pop(),this.#a="";for(let t=0,e=this.#i.length;t<e;t++){let{line:n,points:s}=this.#i[t];this.#e=n,this.#r=s,this.#o=0,this.toSVGPath()}return{path:{d:this.#a}}}toSVGPath(){let t=O.svgRound(this.#e[4]),e=O.svgRound(this.#e[5]);if(this.#r.length===2)return this.#a=`${this.#a} M ${t} ${e} Z`,this.#a;if(this.#r.length<=6){let s=this.#a.lastIndexOf("M");this.#a=`${this.#a.slice(0,s)} M ${t} ${e}`,this.#o=6}if(this.#r.length===4){let s=O.svgRound(this.#e[10]),a=O.svgRound(this.#e[11]);return this.#a=`${this.#a} L ${s} ${a}`,this.#o=12,this.#a}let n=[];this.#o===0&&(n.push(`M ${t} ${e}`),this.#o=6);for(let s=this.#o,a=this.#e.length;s<a;s+=6){let[r,o,l,c,u,h]=this.#e.slice(s,s+6).map(O.svgRound);n.push(`C${r} ${o} ${l} ${c} ${u} ${h}`)}return this.#a+=n.join(" "),this.#o=this.#e.length,this.#a}getOutlines(t,e,n,s){let a=this.#i.at(-1);return a.line=new Float32Array(a.line),a.points=new Float32Array(a.points),this.#c.build(this.#i,t,e,n,this.#n,this.#s,s),this.#t=null,this.#e=null,this.#i=null,this.#a=null,this.#c}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}},zn=class extends O{#t;#e=0;#i;#n;#s;#r;#a;#o;#c;build(t,e,n,s,a,r,o){this.#s=e,this.#r=n,this.#a=s,this.#o=a,this.#c=r,this.#i=o??0,this.#n=t,this.#h()}get thickness(){return this.#c}setLastElement(t){return this.#n.push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#n.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){let t=[];for(let{line:e}of this.#n){if(t.push(`M${O.svgRound(e[4])} ${O.svgRound(e[5])}`),e.length===6){t.push("Z");continue}if(e.length===12&&isNaN(e[6])){t.push(`L${O.svgRound(e[10])} ${O.svgRound(e[11])}`);continue}for(let n=6,s=e.length;n<s;n+=6){let[a,r,o,l,c,u]=e.subarray(n,n+6).map(O.svgRound);t.push(`C${a} ${r} ${o} ${l} ${c} ${u}`)}}return t.join("")}serialize([t,e,n,s],a){let r=[],o=[],[l,c,u,h]=this.#d(),d,f,m,y,v,p,g,b,A;switch(this.#o){case 0:A=O._rescale,d=t,f=e+s,m=n,y=-s,v=t+l*n,p=e+(1-c-h)*s,g=t+(l+u)*n,b=e+(1-c)*s;break;case 90:A=O._rescaleAndSwap,d=t,f=e,m=n,y=s,v=t+c*n,p=e+l*s,g=t+(c+h)*n,b=e+(l+u)*s;break;case 180:A=O._rescale,d=t+n,f=e,m=-n,y=s,v=t+(1-l-u)*n,p=e+c*s,g=t+(1-l)*n,b=e+(c+h)*s;break;case 270:A=O._rescaleAndSwap,d=t+n,f=e+s,m=-n,y=-s,v=t+(1-c-h)*n,p=e+(1-l-u)*s,g=t+(1-c)*n,b=e+(1-l)*s;break}for(let{line:S,points:E}of this.#n)r.push(A(S,d,f,m,y,a?new Array(S.length):null)),o.push(A(E,d,f,m,y,a?new Array(E.length):null));return{lines:r,points:o,rect:[v,p,g,b]}}static deserialize(t,e,n,s,a,{paths:{lines:r,points:o},rotation:l,thickness:c}){let u=[],h,d,f,m,y;switch(l){case 0:y=O._rescale,h=-t/n,d=e/s+1,f=1/n,m=-1/s;break;case 90:y=O._rescaleAndSwap,h=-e/s,d=-t/n,f=1/s,m=1/n;break;case 180:y=O._rescale,h=t/n+1,d=-e/s,f=-1/n,m=1/s;break;case 270:y=O._rescaleAndSwap,h=e/s+1,d=t/n+1,f=-1/s,m=-1/n;break}if(!r){r=[];for(let p of o){let g=p.length;if(g===2){r.push(new Float32Array([NaN,NaN,NaN,NaN,p[0],p[1]]));continue}if(g===4){r.push(new Float32Array([NaN,NaN,NaN,NaN,p[0],p[1],NaN,NaN,NaN,NaN,p[2],p[3]]));continue}let b=new Float32Array(3*(g-2));r.push(b);let[A,S,E,T]=p.subarray(0,4);b.set([NaN,NaN,NaN,NaN,A,S],0);for(let w=4;w<g;w+=2){let _=p[w],C=p[w+1];b.set(O.createBezierPoints(A,S,E,T,_,C),(w-2)*3),[A,S,E,T]=[E,T,_,C]}}}for(let p=0,g=r.length;p<g;p++)u.push({line:y(r[p].map(b=>b??NaN),h,d,f,m),points:y(o[p].map(b=>b??NaN),h,d,f,m)});let v=new this.prototype.constructor;return v.build(u,n,s,1,l,c,a),v}#l(t=this.#c){let e=this.#i+t/2*this.#a;return this.#o%180===0?[e/this.#s,e/this.#r]:[e/this.#r,e/this.#s]}#d(){let[t,e,n,s]=this.#t,[a,r]=this.#l(0);return[t+a,e+r,n-2*a,s-2*r]}#h(){let t=this.#t=On.slice();for(let{line:s}of this.#n){if(s.length<=12){for(let o=4,l=s.length;o<l;o+=6)M.pointBoundingBox(s[o],s[o+1],t);continue}let a=s[4],r=s[5];for(let o=6,l=s.length;o<l;o+=6){let[c,u,h,d,f,m]=s.subarray(o,o+6);M.bezierBoundingBox(a,r,c,u,h,d,f,m,t),a=f,r=m}}let[e,n]=this.#l();t[0]=ht(t[0]-e,0,1),t[1]=ht(t[1]-n,0,1),t[2]=ht(t[2]+e,0,1),t[3]=ht(t[3]+n,0,1),t[2]-=t[0],t[3]-=t[1]}get box(){return this.#t}updateProperty(t,e){return t==="stroke-width"?this.#p(e):null}#p(t){let[e,n]=this.#l();this.#c=t;let[s,a]=this.#l(),[r,o]=[s-e,a-n],l=this.#t;return l[0]-=r,l[1]-=o,l[2]+=2*r,l[3]+=2*o,l}updateParentDimensions([t,e],n){let[s,a]=this.#l();this.#s=t,this.#r=e,this.#a=n;let[r,o]=this.#l(),l=r-s,c=o-a,u=this.#t;return u[0]-=l,u[1]-=c,u[2]+=2*l,u[3]+=2*c,u}updateRotation(t){return this.#e=t,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#t.map(O.svgRound).join(" ")}get defaultProperties(){let[t,e]=this.#t;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${O.svgRound(t)} ${O.svgRound(e)}`}}}get rotationTransform(){let[,,t,e]=this.#t,n=0,s=0,a=0,r=0,o=0,l=0;switch(this.#e){case 90:s=e/t,a=-t/e,o=t;break;case 180:n=-1,r=-1,o=t,l=e;break;case 270:s=-e/t,a=t/e,l=e;break;default:return""}return`matrix(${n} ${s} ${a} ${r} ${O.svgRound(o)} ${O.svgRound(l)})`}getPathResizingSVGProperties([t,e,n,s]){let[a,r]=this.#l(),[o,l,c,u]=this.#t;if(Math.abs(c-a)<=O.PRECISION||Math.abs(u-r)<=O.PRECISION){let y=t+n/2-(o+c/2),v=e+s/2-(l+u/2);return{path:{"transform-origin":`${O.svgRound(t)} ${O.svgRound(e)}`,transform:`${this.rotationTransform} translate(${y} ${v})`}}}let h=(n-2*a)/(c-2*a),d=(s-2*r)/(u-2*r),f=c/n,m=u/s;return{path:{"transform-origin":`${O.svgRound(o)} ${O.svgRound(l)}`,transform:`${this.rotationTransform} scale(${f} ${m}) translate(${O.svgRound(a)} ${O.svgRound(r)}) scale(${h} ${d}) translate(${O.svgRound(-a)} ${O.svgRound(-r)})`}}}getPathResizedSVGProperties([t,e,n,s]){let[a,r]=this.#l(),o=this.#t,[l,c,u,h]=o;if(o[0]=t,o[1]=e,o[2]=n,o[3]=s,Math.abs(u-a)<=O.PRECISION||Math.abs(h-r)<=O.PRECISION){let v=t+n/2-(l+u/2),p=e+s/2-(c+h/2);for(let{line:g,points:b}of this.#n)O._translate(g,v,p,g),O._translate(b,v,p,b);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${O.svgRound(t)} ${O.svgRound(e)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}let d=(n-2*a)/(u-2*a),f=(s-2*r)/(h-2*r),m=-d*(l+a)+t+a,y=-f*(c+r)+e+r;if(d!==1||f!==1||m!==0||y!==0)for(let{line:v,points:p}of this.#n)O._rescale(v,m,y,d,f,v),O._rescale(p,m,y,d,f,p);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${O.svgRound(t)} ${O.svgRound(e)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,e],n){let[s,a]=n,r=this.#t,o=t-r[0],l=e-r[1];if(this.#s===s&&this.#r===a)for(let{line:c,points:u}of this.#n)O._translate(c,o,l,c),O._translate(u,o,l,u);else{let c=this.#s/s,u=this.#r/a;this.#s=s,this.#r=a;for(let{line:h,points:d}of this.#n)O._rescale(h,o,l,c,u,h),O._rescale(d,o,l,c,u,d);r[2]*=c,r[3]*=u}return r[0]=t,r[1]=e,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${O.svgRound(t)} ${O.svgRound(e)}`}}}get defaultSVGProperties(){let t=this.#t;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${O.svgRound(t[0])} ${O.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}},jl=class i extends Ul{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:tt._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,e){t==="stroke-width"&&(e??=this["stroke-width"],e*=this._viewParameters.realScale),super.updateSVGProperty(t,e)}clone(){let t=new i(this._viewParameters);return t.updateAll(this),t}},Df=class i extends Gl{static _type="ink";static _editorType=P.INK;static _defaultDrawingOptions=null;constructor(t){super({...t,name:"inkEditor"}),this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,e){tt.initialize(t,e),this._defaultDrawingOptions=new jl(e.viewParameters)}static getDefaultDrawingOptions(t){let e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!0}static get typesMap(){return L(this,"typesMap",new Map([[H.INK_THICKNESS,"stroke-width"],[H.INK_COLOR,"stroke"],[H.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,e,n,s,a){return new Mf(t,e,n,s,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,e,n,s,a,r){return zn.deserialize(t,e,n,s,a,r)}static async deserialize(t,e,n){let s=null;if(t instanceof Tr){let{data:{inkLists:r,rect:o,rotation:l,id:c,color:u,opacity:h,borderStyle:{rawWidth:d},popupRef:f,richText:m,contentsObj:y,creationDate:v,modificationDate:p},parent:{page:{pageNumber:g}}}=t;s=t={annotationType:P.INK,color:Array.from(u),thickness:d,opacity:h,paths:{points:r},boxes:null,pageIndex:g-1,rect:o.slice(0),rotation:l,annotationElementId:c,id:c,deleted:!1,popupRef:f,richText:m,comment:y?.str||null,creationDate:v,modificationDate:p}}let a=await super.deserialize(t,e,n);return a._initialData=s,t.comment&&a.setCommentData(t),a}get toolbarButtons(){return this._colorPicker||=new Ol(this),[["colorPicker",this._colorPicker]]}get colorType(){return H.INK_COLOR}get colorAndOpacityType(){return H.INK_COLOR_AND_OPACITY}get opacityType(){return H.INK_OPACITY}updateParams(t,e){if(t===H.INK_COLOR_AND_OPACITY){this._updateColorAndOpacity(e.color,e.opacity);return}super.updateParams(t,e)}static updateDefaultParams(t,e){if(t===H.INK_COLOR_AND_OPACITY){super.updateDefaultParams(H.INK_COLOR,e.color),super.updateDefaultParams(H.INK_OPACITY,e.opacity);return}super.updateDefaultParams(t,e)}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();let{_drawId:t,_drawingOptions:e,parent:n}=this;e.updateSVGProperty("stroke-width"),n.drawLayer.updateProperties(t,e.toSVGProperties())}static onScaleChangingWhenDrawing(){let t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:e,opacity:n}){this._drawingOptions=i.getDefaultDrawingOptions({stroke:M.makeHexColor(...t),"stroke-width":e,"stroke-opacity":n})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let{lines:e,points:n}=this.serializeDraw(t),{_drawingOptions:{stroke:s,"stroke-opacity":a,"stroke-width":r}}=this,o=Object.assign(super.serialize(t),{color:tt._colorManager.convert(s),opacity:a,thickness:r,paths:{lines:e,points:n}});return this.addComment(o),t?(o.isCopy=!0,o):this.annotationElementId&&!this.#t(o)?null:(o.id=this.annotationElementId,o)}#t(t){let{color:e,thickness:n,opacity:s,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||t.color.some((r,o)=>r!==e[o])||t.thickness!==n||t.opacity!==s||t.pageIndex!==a}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let{points:e,rect:n}=this.serializeDraw(!1);return t.updateEdited({rect:n,thickness:this._drawingOptions["stroke-width"],points:e,popup:this.comment}),null}},xr=class extends zn{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}},pl=8,nr=3,Ei=class{static#t={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#e(t,e,n,s){return n-=t,s-=e,n===0?s>0?0:4:n===1?s+6:2-s}static#i=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#n(t,e,n,s,a,r,o){let l=this.#e(n,s,a,r);for(let c=0;c<8;c++){let u=(-c+l-o+16)%8,h=this.#i[2*u],d=this.#i[2*u+1];if(t[(n+h)*e+(s+d)]!==0)return u}return-1}static#s(t,e,n,s,a,r,o){let l=this.#e(n,s,a,r);for(let c=0;c<8;c++){let u=(c+l+o+16)%8,h=this.#i[2*u],d=this.#i[2*u+1];if(t[(n+h)*e+(s+d)]!==0)return u}return-1}static#r(t,e,n,s){let a=t.length,r=new Int32Array(a);for(let u=0;u<a;u++)r[u]=t[u]<=s?1:0;for(let u=1;u<n-1;u++)r[u*e]=r[u*e+e-1]=0;for(let u=0;u<e;u++)r[u]=r[e*n-1-u]=0;let o=1,l,c=[];for(let u=1;u<n-1;u++){l=1;for(let h=1;h<e-1;h++){let d=u*e+h,f=r[d];if(f===0)continue;let m=u,y=h;if(f===1&&r[d-1]===0)o+=1,y-=1;else if(f>=1&&r[d+1]===0)o+=1,y+=1,f>1&&(l=f);else{f!==1&&(l=Math.abs(f));continue}let v=[h,u],p=y===h+1,g={isHole:p,points:v,id:o,parent:0};c.push(g);let b;for(let D of c)if(D.id===l){b=D;break}b?b.isHole?g.parent=p?b.parent:l:g.parent=p?l:b.parent:g.parent=p?l:0;let A=this.#n(r,e,u,h,m,y,0);if(A===-1){r[d]=-o,r[d]!==1&&(l=Math.abs(r[d]));continue}let S=this.#i[2*A],E=this.#i[2*A+1],T=u+S,w=h+E;m=T,y=w;let _=u,C=h;for(;;){let D=this.#s(r,e,_,C,m,y,1);S=this.#i[2*D],E=this.#i[2*D+1];let N=_+S,z=C+E;v.push(z,N);let X=_*e+C;if(r[X+1]===0?r[X]=-o:r[X]===1&&(r[X]=o),N===u&&z===h&&_===T&&C===w){r[d]!==1&&(l=Math.abs(r[d]));break}else m=_,y=C,_=N,C=z}}}return c}static#a(t,e,n,s){if(n-e<=4){for(let T=e;T<n-2;T+=2)s.push(t[T],t[T+1]);return}let a=t[e],r=t[e+1],o=t[n-4]-a,l=t[n-3]-r,c=Math.hypot(o,l),u=o/c,h=l/c,d=u*r-h*a,f=l/o,m=1/c,y=Math.atan(f),v=Math.cos(y),p=Math.sin(y),g=m*(Math.abs(v)+Math.abs(p)),b=m*(1-g+g**2),A=Math.max(Math.atan(Math.abs(p+v)*b),Math.atan(Math.abs(p-v)*b)),S=0,E=e;for(let T=e+2;T<n-2;T+=2){let w=Math.abs(d-u*t[T+1]+h*t[T]);w>S&&(E=T,S=w)}S>(c*A)**2?(this.#a(t,e,E+2,s),this.#a(t,E,n,s)):s.push(a,r)}static#o(t){let e=[],n=t.length;return this.#a(t,0,n,e),e.push(t[n-2],t[n-1]),e.length<=4?null:e}static#c(t,e,n,s,a,r){let o=new Float32Array(r**2),l=-2*s**2,c=r>>1;for(let y=0;y<r;y++){let v=(y-c)**2;for(let p=0;p<r;p++)o[y*r+p]=Math.exp((v+(p-c)**2)/l)}let u=new Float32Array(256),h=-2*a**2;for(let y=0;y<256;y++)u[y]=Math.exp(y**2/h);let d=t.length,f=new Uint8Array(d),m=new Uint32Array(256);for(let y=0;y<n;y++)for(let v=0;v<e;v++){let p=y*e+v,g=t[p],b=0,A=0;for(let E=0;E<r;E++){let T=y+E-c;if(!(T<0||T>=n))for(let w=0;w<r;w++){let _=v+w-c;if(_<0||_>=e)continue;let C=t[T*e+_],D=o[E*r+w]*u[Math.abs(C-g)];b+=C*D,A+=D}}let S=f[p]=Math.round(b/A);m[S]++}return[f,m]}static#l(t){let e=new Uint32Array(256);for(let n of t)e[n]++;return e}static#d(t){let e=t.length,n=new Uint8ClampedArray(e>>2),s=-1/0,a=1/0;for(let o=0,l=n.length;o<l;o++){let c=n[o]=t[o<<2];s=Math.max(s,c),a=Math.min(a,c)}let r=255/(s-a);for(let o=0,l=n.length;o<l;o++)n[o]=(n[o]-a)*r;return n}static#h(t){let e,n=-1/0,s=-1/0,a=t.findIndex(l=>l!==0),r=a,o=a;for(e=a;e<256;e++){let l=t[e];l>n&&(e-r>s&&(s=e-r,o=e-1),n=l,r=e)}for(e=o-1;e>=0&&!(t[e]>t[e+1]);e--);return e}static#p(t){let e=t,{width:n,height:s}=t,{maxDim:a}=this.#t,r=n,o=s;if(n>a||s>a){let d=n,f=s,m=Math.log2(Math.max(n,s)/a),y=Math.floor(m);m=m===y?y-1:y;for(let p=0;p<m;p++){r=Math.ceil(d/2),o=Math.ceil(f/2);let g=new OffscreenCanvas(r,o);g.getContext("2d").drawImage(t,0,0,d,f,0,0,r,o),d=r,f=o,t!==e&&t.close(),t=g.transferToImageBitmap()}let v=Math.min(a/r,a/o);r=Math.round(r*v),o=Math.round(o*v)}let c=new OffscreenCanvas(r,o).getContext("2d",{willReadFrequently:!0});c.fillStyle="white",c.fillRect(0,0,r,o),c.filter="grayscale(1)",c.drawImage(t,0,0,t.width,t.height,0,0,r,o);let u=c.getImageData(0,0,r,o).data;return[this.#d(u),r,o]}static extractContoursFromText(t,{fontFamily:e,fontStyle:n,fontWeight:s},a,r,o,l){let c=new OffscreenCanvas(1,1),u=c.getContext("2d",{alpha:!1}),h=200,d=u.font=`${n} ${s} ${h}px ${e}`,{actualBoundingBoxLeft:f,actualBoundingBoxRight:m,actualBoundingBoxAscent:y,actualBoundingBoxDescent:v,fontBoundingBoxAscent:p,fontBoundingBoxDescent:g,width:b}=u.measureText(t),A=1.5,S=Math.ceil(Math.max(Math.abs(f)+Math.abs(m)||0,b)*A),E=Math.ceil(Math.max(Math.abs(y)+Math.abs(v)||h,Math.abs(p)+Math.abs(g)||h)*A);c=new OffscreenCanvas(S,E),u=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),u.font=d,u.filter="grayscale(1)",u.fillStyle="white",u.fillRect(0,0,S,E),u.fillStyle="black",u.fillText(t,S*(A-1)/2,E*(3-A)/2);let T=this.#d(u.getImageData(0,0,S,E).data),w=this.#l(T),_=this.#h(w),C=this.#r(T,S,E,_);return this.processDrawnLines({lines:{curves:C,width:S,height:E},pageWidth:a,pageHeight:r,rotation:o,innerMargin:l,mustSmooth:!0,areContours:!0})}static process(t,e,n,s,a){let[r,o,l]=this.#p(t),[c,u]=this.#c(r,o,l,Math.hypot(o,l)*this.#t.sigmaSFactor,this.#t.sigmaR,this.#t.kernelSize),h=this.#h(u),d=this.#r(c,o,l,h);return this.processDrawnLines({lines:{curves:d,width:o,height:l},pageWidth:e,pageHeight:n,rotation:s,innerMargin:a,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:e,pageHeight:n,rotation:s,innerMargin:a,mustSmooth:r,areContours:o}){s%180!==0&&([e,n]=[n,e]);let{curves:l,width:c,height:u}=t,h=t.thickness??0,d=[],f=Math.min(e/c,n/u),m=f/e,y=f/n,v=[];for(let{points:g}of l){let b=r?this.#o(g):g;if(!b)continue;v.push(b);let A=b.length,S=new Float32Array(A),E=new Float32Array(3*(A===2?2:A-2));if(d.push({line:E,points:S}),A===2){S[0]=b[0]*m,S[1]=b[1]*y,E.set([NaN,NaN,NaN,NaN,S[0],S[1]],0);continue}let[T,w,_,C]=b;T*=m,w*=y,_*=m,C*=y,S.set([T,w,_,C],0),E.set([NaN,NaN,NaN,NaN,T,w],0);for(let D=4;D<A;D+=2){let N=S[D]=b[D]*m,z=S[D+1]=b[D+1]*y;E.set(O.createBezierPoints(T,w,_,C,N,z),(D-2)*3),[T,w,_,C]=[_,C,N,z]}}if(d.length===0)return null;let p=o?new xr:new zn;return p.build(d,e,n,1,s,o?0:h,a),{outline:p,newCurves:v,areContours:o,thickness:h,width:c,height:u}}static async compressSignature({outlines:t,areContours:e,thickness:n,width:s,height:a}){let r=1/0,o=-1/0,l=0;for(let g of t){l+=g.length;for(let b=2,A=g.length;b<A;b++){let S=g[b]-g[b-2];r=Math.min(r,S),o=Math.max(o,S)}}let c;r>=-128&&o<=127?c=Int8Array:r>=-32768&&o<=32767?c=Int16Array:c=Int32Array;let u=t.length,h=pl+nr*u,d=new Uint32Array(h),f=0;d[f++]=h*Uint32Array.BYTES_PER_ELEMENT+(l-2*u)*c.BYTES_PER_ELEMENT,d[f++]=0,d[f++]=s,d[f++]=a,d[f++]=e?0:1,d[f++]=Math.max(0,Math.floor(n??0)),d[f++]=u,d[f++]=c.BYTES_PER_ELEMENT;for(let g of t)d[f++]=g.length-2,d[f++]=g[0],d[f++]=g[1];let m=new CompressionStream("deflate-raw"),y=m.writable.getWriter();await y.ready,y.write(d);let v=c.prototype.constructor;for(let g of t){let b=new v(g.length-2);for(let A=2,S=g.length;A<S;A++)b[A-2]=g[A]-g[A-2];y.write(b)}return y.close(),(await new Response(m.readable).bytes()).toBase64()}static async decompressSignature(t){try{let e=Uint8Array.fromBase64(t),{readable:n,writable:s}=new DecompressionStream("deflate-raw"),a=s.getWriter();await a.ready,a.write(e).then(async()=>{await a.ready,await a.close()}).catch(()=>{});let r=null,o=0;for await(let b of n)r||=new Uint8Array(new Uint32Array(b.buffer,0,4)[0]),r.set(b,o),o+=b.length;let l=new Uint32Array(r.buffer,0,r.length>>2),c=l[1];if(c!==0)throw new Error(`Invalid version: ${c}`);let u=l[2],h=l[3],d=l[4]===0,f=l[5],m=l[6],y=l[7],v=[],p=(pl+nr*m)*Uint32Array.BYTES_PER_ELEMENT,g;switch(y){case Int8Array.BYTES_PER_ELEMENT:g=new Int8Array(r.buffer,p);break;case Int16Array.BYTES_PER_ELEMENT:g=new Int16Array(r.buffer,p);break;case Int32Array.BYTES_PER_ELEMENT:g=new Int32Array(r.buffer,p);break}o=0;for(let b=0;b<m;b++){let A=l[nr*b+pl],S=new Float32Array(A+2);v.push(S);for(let E=0;E<nr-1;E++)S[E]=l[nr*b+pl+E+1];for(let E=0;E<A;E++)S[E+2]=S[E]+g[o++]}return{areContours:d,thickness:f,outlines:v,width:u,height:h}}catch(e){return I(`decompressSignature: ${e}`),null}}},Of=class i extends Ul{constructor(){super(),super.updateProperties({fill:tt._defaultLineColor,"stroke-width":0})}clone(){let t=new i;return t.updateAll(this),t}},Rf=class i extends jl{constructor(t){super(t),super.updateProperties({stroke:tt._defaultLineColor,"stroke-width":1})}clone(){let t=new i(this._viewParameters);return t.updateAll(this),t}},Nf=class i extends Gl{#t=!1;#e=null;#i=null;#n=null;static _type="signature";static _editorType=P.SIGNATURE;static _defaultDrawingOptions=null;constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"}),this._willKeepAspectRatio=!0,this.#i=t.signatureData||null,this.#e=null,this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,e){tt.initialize(t,e),this._defaultDrawingOptions=new Of,this._defaultDrawnSignatureOptions=new Rf(e.viewParameters)}static getDefaultDrawingOptions(t){let e=this._defaultDrawingOptions.clone();return e.updateProperties(t),e}static get supportMultipleDrawings(){return!1}static get typesMap(){return L(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!this.#e}}static computeTelemetryFinalData(t){let e=t.get("hasDescription");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,e,{_isCopy:n}=this;if(n&&(this._isCopy=!1,t=this.x,e=this.y),super.render(),this._drawId===null)if(this.#i){let{lines:s,mustSmooth:a,areContours:r,description:o,uuid:l,heightInPage:c}=this.#i,{rawDims:{pageWidth:u,pageHeight:h},rotation:d}=this.parent.viewport,f=Ei.processDrawnLines({lines:s,pageWidth:u,pageHeight:h,rotation:d,innerMargin:i._INNER_MARGIN,mustSmooth:a,areContours:r});this.addSignature(f,c,o,l)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:this.#e||""}));return n&&(this._isCopy=!0,this._moveAfterPaste(t,e)),this.div}setUuid(t){this.#n=t,this.addEditToolbar()}getUuid(){return this.#n}get description(){return this.#e}set description(t){this.#e=t,this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(e=>{e?.updateEditSignatureButton(t)}))}getSignaturePreview(){let{newCurves:t,areContours:e,thickness:n,width:s,height:a}=this.#i,r=Math.max(s,a),o=Ei.processDrawnLines({lines:{curves:t.map(l=>({points:l})),thickness:n,width:s,height:a},pageWidth:r,pageHeight:r,rotation:0,innerMargin:0,mustSmooth:!1,areContours:e});return{areContours:e,outline:o.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,e,n,s){let{x:a,y:r}=this,{outline:o}=this.#i=t;this.#t=o instanceof xr,this.description=n;let l;this.#t?l=i.getDefaultDrawingOptions():(l=i._defaultDrawnSignatureOptions.clone(),l.updateProperties({"stroke-width":o.thickness})),this._addOutlines({drawOutlines:o,drawingOptions:l});let[,c]=this.pageDimensions,u=e/c;u=u>=1?.5:u,this.width*=u/this.height,this.width>=1&&(u*=.9/this.width,this.width=.9),this.height=u,this.setDims(),this.x=a,this.y=r,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(s),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!s,hasDescription:!!n}}),this.div.hidden=!1}getFromImage(t){let{rawDims:{pageWidth:e,pageHeight:n},rotation:s}=this.parent.viewport;return Ei.process(t,e,n,s,i._INNER_MARGIN)}getFromText(t,e){let{rawDims:{pageWidth:n,pageHeight:s},rotation:a}=this.parent.viewport;return Ei.extractContoursFromText(t,e,n,s,a,i._INNER_MARGIN)}getDrawnSignature(t){let{rawDims:{pageWidth:e,pageHeight:n},rotation:s}=this.parent.viewport;return Ei.processDrawnLines({lines:t,pageWidth:e,pageHeight:n,rotation:s,innerMargin:i._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:e}){t?this._drawingOptions=i.getDefaultDrawingOptions():(this._drawingOptions=i._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":e}))}serialize(t=!1){if(this.isEmpty())return null;let{lines:e,points:n}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":s}}=this,a=Object.assign(super.serialize(t),{isSignature:!0,areContours:this.#t,color:[0,0,0],thickness:this.#t?0:s});return this.addComment(a),t?(a.paths={lines:e,points:n},a.uuid=this.#n,a.isCopy=!0):a.lines=e,this.#e&&(a.accessibilityData={type:"Figure",alt:this.#e}),a}static deserializeDraw(t,e,n,s,a,r){return r.areContours?xr.deserialize(t,e,n,s,a,r):zn.deserialize(t,e,n,s,a,r)}static async deserialize(t,e,n){let s=await super.deserialize(t,e,n);return s.#t=t.areContours,s.description=t.accessibilityData?.alt||"",s.#n=t.uuid,s}},kf=class extends tt{#t=null;#e=null;#i=null;#n=null;#s=null;#r="";#a=null;#o=!1;#c=null;#l=!1;#d=!1;static _type="stamp";static _editorType=P.STAMP;constructor(t){super({...t,name:"stampEditor"}),this.#n=t.bitmapUrl,this.#s=t.bitmapFile,this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,e){tt.initialize(t,e)}static isHandlingMimeForPasting(t){return Al.includes(t)}static paste(t,e){e.pasteEditor({mode:P.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){let e=t.get("hasAltText");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}#h(t,e=!1){if(!t){this.remove();return}this.#t=t.bitmap,e||(this.#e=t.id,this.#l=t.isSvg),t.file&&(this.#r=t.file.name),this.#g()}#p(){if(this.#i=null,this._uiManager.enableWaiting(!1),!!this.#a){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#t){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#t){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(t=null,e=!0){if(this.hasAltTextData())return null;let{mlManager:n}=this._uiManager;if(!n)throw new Error("No ML.");if(!await n.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");let{data:s,width:a,height:r}=t||this.copyCanvas(null,null,!0).imageData,o=await n.guess({name:"altText",request:{data:s,width:a,height:r,channels:s.length/(a*r)}});if(!o)throw new Error("No response from the AI service.");if(o.error)throw new Error("Error from the AI service.");if(o.cancel)return null;if(!o.output)throw new Error("No valid response from the AI service.");let l=o.output;return await this.setGuessedAltText(l),e&&!this.hasAltTextData()&&(this.altTextData={alt:l,decorative:!1}),l}#m(){if(this.#e){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#e).then(n=>this.#h(n,!0)).finally(()=>this.#p());return}if(this.#n){let n=this.#n;this.#n=null,this._uiManager.enableWaiting(!0),this.#i=this._uiManager.imageManager.getFromUrl(n).then(s=>this.#h(s)).finally(()=>this.#p());return}if(this.#s){let n=this.#s;this.#s=null,this._uiManager.enableWaiting(!0),this.#i=this._uiManager.imageManager.getFromFile(n).then(s=>this.#h(s)).finally(()=>this.#p());return}let t=document.createElement("input");t.type="file",t.accept=Al.join(",");let e=this._uiManager._signal;this.#i=new Promise(n=>{t.addEventListener("change",async()=>{if(!t.files||t.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);let s=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#h(s)}n()},{signal:e}),t.addEventListener("cancel",()=>{this.remove(),n()},{signal:e})}).finally(()=>this.#p()),t.click()}remove(){this.#e&&(this.#t=null,this._uiManager.imageManager.deleteId(this.#e),this.#a?.remove(),this.#a=null,this.#c&&(clearTimeout(this.#c),this.#c=null)),super.remove()}rebuild(){if(!this.parent){this.#e&&this.#m();return}super.rebuild(),this.div!==null&&(this.#e&&this.#a===null&&this.#m(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(this.#i||this.#t||this.#n||this.#s||this.#e||this.#o)}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;return this._isCopy&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#o||(this.#t?this.#g():this.#m()),this._isCopy&&this._moveAfterPaste(t,e),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,e){let{id:n,bitmap:s}=this._uiManager.imageManager.getFromCanvas(t,e);e.remove(),n&&this._uiManager.imageManager.isValidId(n)&&(this.#e=n,s&&(this.#t=s),this.#o=!1,this.#g())}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;this.#c!==null&&clearTimeout(this.#c);let t=200;this.#c=setTimeout(()=>{this.#c=null,this.#f()},t)}#g(){let{div:t}=this,{width:e,height:n}=this.#t,[s,a]=this.pageDimensions,r=.75;if(this.width)e=this.width*s,n=this.height*a;else if(e>r*s||n>r*a){let l=Math.min(r*s/e,r*a/n);e*=l,n*=l}this._uiManager.enableWaiting(!1);let o=this.#a=document.createElement("canvas");o.setAttribute("role","img"),this.addContainer(o),this.width=e/s,this.height=n/a,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(t.hidden=!1),this.#f(),this.#d||(this.parent.addUndoableEditor(this),this.#d=!0),this._reportTelemetry({action:"inserted_image"}),this.#r&&this.div.setAttribute("aria-description",this.#r),this.annotationElementId||this._uiManager.a11yAlert(tt._l10nAlert.stamp)}copyCanvas(t,e,n=!1){t||=224;let{width:s,height:a}=this.#t,r=new Je,o=this.#t,l=s,c=a,u=null;if(e){if(s>e||a>e){let E=Math.min(e/s,e/a);l=Math.floor(s*E),c=Math.floor(a*E)}u=document.createElement("canvas");let d=u.width=Math.ceil(l*r.sx),f=u.height=Math.ceil(c*r.sy);this.#l||(o=this.#u(d,f));let m=u.getContext("2d");m.filter=this._uiManager.hcmFilter;let y="white",v="#cfcfd8";this._uiManager.hcmFilter!=="none"?v="black":nd.isDarkMode&&(y="#8f8f9d",v="#42414d");let p=15,g=p*r.sx,b=p*r.sy,A=new OffscreenCanvas(g*2,b*2),S=A.getContext("2d");S.fillStyle=y,S.fillRect(0,0,g*2,b*2),S.fillStyle=v,S.fillRect(0,0,g,b),S.fillRect(g,b,g,b),m.fillStyle=m.createPattern(A,"repeat"),m.fillRect(0,0,d,f),m.drawImage(o,0,0,o.width,o.height,0,0,d,f)}let h=null;if(n){let d,f;if(r.symmetric&&o.width<t&&o.height<t)d=o.width,f=o.height;else if(o=this.#t,s>t||a>t){let v=Math.min(t/s,t/a);d=Math.floor(s*v),f=Math.floor(a*v),this.#l||(o=this.#u(d,f))}let y=new OffscreenCanvas(d,f).getContext("2d",{willReadFrequently:!0});y.drawImage(o,0,0,o.width,o.height,0,0,d,f),h={width:d,height:f,data:y.getImageData(0,0,d,f).data}}return{canvas:u,width:l,height:c,imageData:h}}#u(t,e){let{width:n,height:s}=this.#t,a=n,r=s,o=this.#t;for(;a>2*t||r>2*e;){let l=a,c=r;a>2*t&&(a=Math.ceil(a/2)),r>2*e&&(r=Math.ceil(r/2));let u=new OffscreenCanvas(a,r);u.getContext("2d").drawImage(o,0,0,l,c,0,0,a,r),o=u.transferToImageBitmap()}return o}#f(){let[t,e]=this.parentDimensions,{width:n,height:s}=this,a=new Je,r=Math.ceil(n*t*a.sx),o=Math.ceil(s*e*a.sy),l=this.#a;if(!l||l.width===r&&l.height===o)return;l.width=r,l.height=o;let c=this.#l?this.#t:this.#u(r,o),u=l.getContext("2d");u.filter=this._uiManager.hcmFilter,u.drawImage(c,0,0,c.width,c.height,0,0,r,o)}#b(t){if(t){if(this.#l){let s=this._uiManager.imageManager.getSvgUrl(this.#e);if(s)return s}let e=document.createElement("canvas");return{width:e.width,height:e.height}=this.#t,e.getContext("2d").drawImage(this.#t,0,0),e.toDataURL()}if(this.#l){let[e,n]=this.pageDimensions,s=Math.round(this.width*e*wi.PDF_TO_CSS_UNITS),a=Math.round(this.height*n*wi.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(s,a);return r.getContext("2d").drawImage(this.#t,0,0,this.#t.width,this.#t.height,0,0,s,a),r.transferToImageBitmap()}return structuredClone(this.#t)}static async deserialize(t,e,n){let s=null,a=!1;if(t instanceof Bl){let{data:{rect:y,rotation:v,id:p,structParent:g,popupRef:b,richText:A,contentsObj:S,creationDate:E,modificationDate:T},container:w,parent:{page:{pageNumber:_}},canvas:C}=t,D,N;C?(delete t.canvas,{id:D,bitmap:N}=n.imageManager.getFromCanvas(w.id,C),C.remove()):(a=!0,t._hasNoCanvas=!0);let z=(await e._structTree.getAriaAttributes(`${Ls}${p}`))?.get("aria-label")||"";s=t={annotationType:P.STAMP,bitmapId:D,bitmap:N,pageIndex:_-1,rect:y.slice(0),rotation:v,annotationElementId:p,id:p,deleted:!1,accessibilityData:{decorative:!1,altText:z},isSvg:!1,structParent:g,popupRef:b,richText:A,comment:S?.str||null,creationDate:E,modificationDate:T}}let r=await super.deserialize(t,e,n),{rect:o,bitmap:l,bitmapUrl:c,bitmapId:u,isSvg:h,accessibilityData:d}=t;a?(n.addMissingCanvas(t.id,r),r.#o=!0):u&&n.imageManager.isValidId(u)?(r.#e=u,l&&(r.#t=l)):r.#n=c,r.#l=h;let[f,m]=r.pageDimensions;return r.width=(o[2]-o[0])/f,r.height=(o[3]-o[1])/m,d&&(r.altTextData=d),r._initialData=s,t.comment&&r.setCommentData(t),r.#d=!!s,r}serialize(t=!1,e=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let n=Object.assign(super.serialize(t),{bitmapId:this.#e,isSvg:this.#l});if(this.addComment(n),t)return n.bitmapUrl=this.#b(!0),n.accessibilityData=this.serializeAltText(!0),n.isCopy=!0,n;let{decorative:s,altText:a}=this.serializeAltText(!1);if(!s&&a&&(n.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){let o=this.#v(n);return o.isSame?null:(o.isSameAltText?delete n.accessibilityData:n.accessibilityData.structParent=this._initialData.structParent??-1,n.id=this.annotationElementId,delete n.bitmapId,n)}if(e===null)return n;e.stamps||=new Map;let r=this.#l?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(!e.stamps.has(this.#e))e.stamps.set(this.#e,{area:r,serialized:n}),n.bitmap=this.#b(!1);else if(this.#l){let o=e.stamps.get(this.#e);r>o.area&&(o.area=r,o.serialized.bitmap.close(),o.serialized.bitmap=this.#b(!1))}return n}#v(t){let{pageIndex:e,accessibilityData:{altText:n}}=this._initialData,s=t.pageIndex===e,a=(t.accessibilityData?.alt||"")===n;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&s&&a,isSameAltText:a}}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}},Vl=class i{#t;#e=!1;#i=null;#n=null;#s=null;#r=new Map;#a=!1;#o=!1;#c=!1;#l=null;#d=null;#h=null;#p=null;#m=null;#g=-1;#u;static _initialized=!1;static#f=new Map([_f,Df,kf,Hl,Nf].map(t=>[t._editorType,t]));constructor({uiManager:t,pageIndex:e,div:n,structTreeLayer:s,accessibilityManager:a,annotationLayer:r,drawLayer:o,textLayer:l,viewport:c,l10n:u}){let h=[...i.#f.values()];if(!i._initialized){i._initialized=!0;for(let d of h)d.initialize(u,t)}t.registerEditorTypes(h),this.#u=t,this.pageIndex=e,this.div=n,this.#t=a,this.#i=r,this.viewport=c,this.#h=l,this.drawLayer=o,this._structTree=s,this.#u.addLayer(this)}get isEmpty(){return this.#r.size===0}get isInvisible(){return this.isEmpty&&this.#u.getMode()===P.NONE}updateToolbar(t){this.#u.updateToolbar(t)}updateMode(t=this.#u.getMode()){switch(this.#A(),t){case P.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case P.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case P.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:e}=this.div;if(e.toggle("nonEditing",!1),t===P.POPUP)e.toggle("commentEditing",!0);else{e.toggle("commentEditing",!1);for(let n of i.#f.values())e.toggle(`${n._type}Editing`,t===n._editorType)}this.div.hidden=!1}hasTextLayer(t){return t===this.#h?.div}setEditingState(t){this.#u.setEditingState(t)}addCommands(t){this.#u.addCommands(t)}cleanUndoStack(t){this.#u.cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#i?.togglePointerEvents(t)}get#b(){return this.#r.size!==0?this.#r.values():this.#u.getEditors(this.pageIndex)}async enable(){this.#c=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),this.#m?.abort(),this.#m=null;let t=new Set;for(let n of this.#b)n.enableEditing(),n.show(!0),n.annotationElementId&&(this.#u.removeChangedExistingAnnotation(n),t.add(n.annotationElementId));let e=this.#i;if(e)for(let n of e.getEditableAnnotations()){if(n.hide(),this.#u.isDeletedAnnotationElement(n.data.id)||t.has(n.data.id))continue;let s=await this.deserialize(n);s&&(this.addOrRebuild(s),s.enableEditing())}this.#c=!1,this.#u._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(this.#o=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),this.#h&&!this.#m){this.#m=new AbortController;let s=this.#u.combinedSignal(this.#m);this.#h.div.addEventListener("pointerdown",a=>{let{clientX:o,clientY:l,timeStamp:c}=a,u=this.#g;if(c-u>500){this.#g=c;return}this.#g=-1;let{classList:h}=this.div;h.toggle("getElements",!0);let d=document.elementsFromPoint(o,l);if(h.toggle("getElements",!1),!this.div.contains(d[0]))return;let f,m=new RegExp(`^${cr}[0-9]+$`);for(let v of d)if(m.test(v.id)){f=v.id;break}if(!f)return;let y=this.#r.get(f);y?.annotationElementId===null&&(vt(a),y.dblclick(a))},{signal:s,capture:!0})}let t=this.#i,e=[];if(t){let s=new Map,a=new Map;for(let r of this.#b){if(r.disableEditing(),!r.annotationElementId){e.push(r);continue}if(r.serialize()!==null){s.set(r.annotationElementId,r);continue}else a.set(r.annotationElementId,r);this.getEditableAnnotation(r.annotationElementId)?.show(),r.remove()}for(let r of t.getEditableAnnotations()){let{id:o}=r.data;if(this.#u.isDeletedAnnotationElement(o)){r.updateEdited({deleted:!0});continue}let l=a.get(o);if(l){l.resetAnnotationElement(r),l.show(!1),r.show();continue}l=s.get(o),l&&(this.#u.addChangedExistingAnnotation(l),l.renderAnnotationElement(r)&&l.show(!1)),r.show()}}this.#A(),this.isEmpty&&(this.div.hidden=!0);let{classList:n}=this.div;for(let s of i.#f.values())n.remove(`${s._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),t?.updateFakeAnnotations(e),this.#o=!1}getEditableAnnotation(t){return this.#i?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#u.getActive()!==t&&this.#u.setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,this.#h?.div&&!this.#p){this.#p=new AbortController;let t=this.#u.combinedSignal(this.#p);this.#h.div.addEventListener("pointerdown",this.#v.bind(this),{signal:t}),this.#h.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#h?.div&&this.#p&&(this.#p.abort(),this.#p=null,this.#h.div.classList.remove("highlighting"))}#v(t){this.#u.unselectAll();let{target:e}=t;if(e===this.#h.div||(e.getAttribute("role")==="img"||e.classList.contains("endOfContent")||e.classList.contains("textLayerImages")||e.classList.contains("textLayerImagePlaceholder"))&&this.#h.div.contains(e)){let{isMac:n}=J.platform;if(t.button!==0||t.ctrlKey&&n)return;this.#u.showAllEditors("highlight",!0,!0),this.#h.div.classList.add("free"),this.toggleDrawing(),Hl.startHighlighting(this,this.#u.direction==="ltr",{target:this.#h.div,x:t.x,y:t.y}),this.#h.div.addEventListener("pointerup",()=>{this.#h.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#u._signal}),t.preventDefault()}}enableClick(){if(this.#n)return;this.#n=new AbortController;let t=this.#u.combinedSignal(this.#n);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});let e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){this.#n?.abort(),this.#n=null}attach(t){this.#r.set(t.id,t);let{annotationElementId:e}=t;e&&this.#u.isDeletedAnnotationElement(e)&&this.#u.removeDeletedAnnotationElement(t)}detach(t){this.#r.delete(t.id),this.#t?.removePointerInTextLayer(t.contentDiv),!this.#o&&t.annotationElementId&&this.#u.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#u.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#u.addDeletedAnnotationElement(t),tt.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),this.#u.addEditor(t),this.attach(t),!t.isAttachedToDOM){let e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!this.#c),this.#u.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;let{activeElement:e}=document;t.div.contains(e)&&!this.#s&&(t._focusEventsAllowed=!1,this.#s=setTimeout(()=>{this.#s=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this.#u._signal}),e.focus())},0)),t._structTreeParentId=this.#t?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){let e=()=>t._uiManager.rebuild(t),n=()=>{t.remove()};this.addCommands({cmd:e,undo:n,mustExec:!1})}getEditorByUID(t){for(let e of this.#r.values())if(e.uid===t)return e;return null}get#y(){return i.#f.get(this.#u.getMode())}combinedSignal(t){return this.#u.combinedSignal(t)}#E(t){let e=this.#y;return e?new e.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#y?.canCreateNewEmptyEditor()}async pasteEditor(t,e){this.updateToolbar(t),await this.#u.updateMode(t.mode);let{offsetX:n,offsetY:s}=this.#w(),a=this.#u.getId(),r=this.#E({parent:this,id:a,x:n,y:s,uiManager:this.#u,isCentered:!0,...e});r&&this.add(r)}async deserialize(t){return await i.#f.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#u)||null}createAndAddNewEditor(t,e,n={}){let s=this.#u.getId(),a=this.#E({parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:this.#u,isCentered:e,...n});return a&&this.add(a),a}get boundingClientRect(){return this.div.getBoundingClientRect()}#w(){let{x:t,y:e,width:n,height:s}=this.boundingClientRect,a=Math.max(0,t),r=Math.max(0,e),o=Math.min(window.innerWidth,t+n),l=Math.min(window.innerHeight,e+s),c=(a+o)/2-t,u=(r+l)/2-e,[h,d]=this.viewport.rotation%180===0?[c,u]:[u,c];return{offsetX:h,offsetY:d}}addNewEditor(t={}){this.createAndAddNewEditor(this.#w(),!0,t)}setSelected(t){this.#u.setSelected(t)}toggleSelected(t){this.#u.toggleSelected(t)}unselect(t){this.#u.unselect(t)}pointerup(t){let{isMac:e}=J.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div||!this.#a||(this.#a=!1,this.#y?.isDrawer&&this.#y.supportMultipleDrawings))return;if(!this.#e){this.#e=!0;return}let n=this.#u.getMode();if(n===P.STAMP||n===P.POPUP||n===P.SIGNATURE){this.#u.unselectAll();return}this.createAndAddNewEditor(t,!1)}pointerdown(t){if(this.#u.getMode()===P.HIGHLIGHT&&this.enableTextSelection(),this.#a){this.#a=!1;return}let{isMac:e}=J.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div)return;if(this.#a=!0,this.#y?.isDrawer){this.startDrawingSession(t);return}let n=this.#u.getActive();this.#e=!n||n.isEmpty()}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),this.#l){this.#y.startDrawing(this,this.#u,!1,t);return}this.#u.setCurrentDrawingSession(this),this.#l=new AbortController;let e=this.#u.combinedSignal(this.#l);this.div.addEventListener("blur",({relatedTarget:n})=>{n&&!this.div.contains(n)&&(this.#d=null,this.commitOrRemove())},{signal:e}),this.#y.startDrawing(this,this.#u,!1,t)}pause(t){if(t){let{activeElement:e}=document;this.div.contains(e)&&(this.#d=e);return}this.#d&&setTimeout(()=>{this.#d?.focus(),this.#d=null},0)}endDrawingSession(t=!1){return this.#l?(this.#u.setCurrentDrawingSession(null),this.#l.abort(),this.#l=null,this.#d=null,this.#y.endDrawing(t)):null}findNewParent(t,e,n){let s=this.#u.findParent(e,n);return s===null||s===this?!1:(s.changeParent(t),!0)}commitOrRemove(){return this.#l?(this.endDrawingSession(),!0):!1}onScaleChanging(){this.#l&&this.#y.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#u.getActive()?.parent===this&&(this.#u.commitOrRemove(),this.#u.setActiveEditor(null)),this.#s&&(clearTimeout(this.#s),this.#s=null);for(let t of this.#r.values())this.#t?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#r.clear(),this.#u.removeLayer(this)}#A(){for(let t of this.#r.values())t.isEmpty()&&t.remove()}async render({viewport:t}){this.viewport=t,an(this.div,t);for(let e of this.#u.getEditors(this.pageIndex))this.add(e),e.rebuild();await this.#u.findClonesForPage(this),this.div.hidden=this.isEmpty,this.updateMode()}update({viewport:t}){this.#u.commitOrRemove(),this.#A();let e=this.viewport.rotation,n=t.rotation;if(this.viewport=t,an(this.div,{rotation:n}),e!==n)for(let s of this.#r.values())s.rotate(n)}get pageDimensions(){let{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return this.#u.viewParameters.realScale}};Xl=class i{#t=null;#e=new Map;#i=null;#n=null;#s=null;#r=null;#a=new Map;static#o=0;static#c=0;static#l=null;static#d=new Set;static#h=!1;static#p=new Set;static#m=new WeakMap;constructor({filterFactory:t=null,pageColors:e=null,pageIndex:n,textLayer:s=null}){if(this.pageIndex=n,this.#n=t,this.#s=e,s){let a=i.#m.get(s);if(a?.selectionDiv&&(a.selectionDiv.remove(),i.#d.delete(a.selectionDiv)),i.#m.set(s,{drawLayer:this}),i.#p.add(s),this.#i=s,this.#r=new MutationObserver(r=>{if(!(!this.#t||!this.#i?.isConnected||!i.#u())){for(let{addedNodes:o}of r)for(let l of o)if(l.nodeType===Node.ELEMENT_NODE&&l.classList.contains("endOfContent")){i.#b();return}}}),this.#r.observe(s,{childList:!0}),i.#l===null){i.#l=new AbortController;let{signal:r}=i.#l;document.addEventListener("selectionchange",i.#b.bind(i),{signal:r}),document.addEventListener("pointerdown",()=>{i.#h=!0},{signal:r}),document.addEventListener("pointerup",()=>{i.#h=!1},{signal:r}),window.addEventListener("blur",()=>{i.#h=!1},{signal:r})}}}setParent(t){if(!this.#t){this.#t=t,this.#i?.isConnected&&i.#u()&&i.#b();return}if(this.#t!==t){if(this.#e.size>0)for(let e of this.#e.values())e.remove(),t.append(e);this.#t=t}}static#g(t){let e=this.#m.get(t);e?.selectionDiv&&(e.selectionDiv.remove(),this.#d.delete(e.selectionDiv),e.selectionDiv=null,e.path=null)}static#u(){let t=document.getSelection();return!!t&&!t.isCollapsed}static#f(){return this.#p.keys().filter(t=>t.isConnected).toArray().sort(kS)}static#b(){let t=document.getSelection();if(!t||t.isCollapsed){for(let r of this.#d)r.remove();this.#d.clear();return}let e=new WeakMap,n=this.#f(),s=[];for(let r=0,o=t.rangeCount;r<o;r++){let l=t.getRangeAt(r);if(l.collapsed)continue;let{startContainer:c,startOffset:u,endContainer:h,endOffset:d}=l,f=gl(c),m=gl(h),y=f===null,v=m===null;if(this.#h&&y!==v)return;if(t.rangeCount===1){let{anchorNode:b,anchorOffset:A,focusNode:S,focusOffset:E}=t,T=gl(b),w=gl(S),_=LS(b,A,S,E);T&&w&&_!==null&&(_?(c=b,u=A,f=T,h=S,d=E,m=w):(c=S,u=E,f=w,h=b,d=A,m=T))}let p=n.filter(b=>l.intersectsNode(b));if(p.length===0)continue;let g=!1;if(f||(f=p[0],c=f,u=0,g=!0),m||(m=p.at(-1),h=m,d=m.childNodes.length,g=!0),h.nodeType===Node.ELEMENT_NODE){if(h.classList.contains("endOfContent")){let b=h.previousSibling;if(!b)continue;h=b,d=b.nodeType===Node.TEXT_NODE?b.textContent.length:b.childNodes.length}else if(h.classList.contains("textLayer")&&h.childNodes.length===d){let b=db(h,d,m);if(!b)continue;h=b.container,d=b.offset}}if(c.nodeType===Node.ELEMENT_NODE){let b=db(c,u,f);if(!b)continue;c=b.container,u=b.offset}if(f===m&&!g&&p.includes(f)){s.push([l,f]);continue}for(let b of p){let A=b.firstChild;if(!A)continue;let S=document.createRange();if(b===f?S.setStart(c,u):S.setStartBefore(A),b===m)S.setEnd(h,d);else{let E=b.lastChild;if(!E)continue;if(E.nodeType===Node.ELEMENT_NODE&&E.classList.contains("endOfContent")){let T=E.previousSibling;if(!T)continue;S.setEndAfter(T)}else S.setEndAfter(E)}S.collapsed||s.push([S,b])}}let a=new Set(s.map(r=>r[1]));for(let r of this.#p)a.has(r)||this.#g(r);for(let[r,o]of s){let l=i.#m.get(o);if(!l)continue;let c=e.get(o);if(!c){let m=o.getBoundingClientRect();c=(y,v,p,g)=>({x:(y-m.x)/m.width,y:(v-m.y)/m.height,width:p/m.width,height:g/m.height}),e.set(o,c)}let u=[];for(let{x:m,y,width:v,height:p}of r.getClientRects())v===0||p===0||({x:m,y,width:v,height:p}=c(m,y,v,p),!(v===1&&p===1)&&u.push(`M${m} ${y} h${v} v${p} h-${v} Z`));if(u.length===0)continue;let h=l.drawLayer,d=l.selectionDiv,f=l.path;if(!d){let m=`clip_selection_${i.#c++}`;d=document.createElement("div"),d.className="selection",d.style.clipPath=`url(#${m})`;let y=h.#n?.createSelectionStyle(h.#s);if(y)for(let[g,b]of Object.entries(y))d.style.setProperty(g,b);let v=i._svgFactory.create(1,1,!0);v.setAttribute("aria-hidden","true"),v.setAttribute("width","100%"),v.setAttribute("height","100%");let p=i._svgFactory.createElement("clipPath");p.setAttribute("id",m),p.setAttribute("clipPathUnits","objectBoundingBox"),f=i._svgFactory.createElement("path"),p.append(f),v.append(p),d.append(v),l.path=f,l.selectionDiv=d}!d.parentNode&&h.#t&&(h.#t.append(d),this.#d.add(d)),f.setAttribute("d",u.join(" "))}}static get _svgFactory(){return L(this,"_svgFactory",new Ln)}static#v(t,[e,n,s,a]){let{style:r}=t;r.top=`${100*n}%`,r.left=`${100*e}%`,r.width=`${100*s}%`,r.height=`${100*a}%`}#y(){let t=i._svgFactory.create(1,1,!0);return this.#t.append(t),t.setAttribute("aria-hidden","true"),t}#E(t,e){let n=i._svgFactory.createElement("clipPath");t.append(n);let s=`clip_${e}`;n.setAttribute("id",s),n.setAttribute("clipPathUnits","objectBoundingBox");let a=i._svgFactory.createElement("use");return n.append(a),a.setAttribute("href",`#${e}`),a.classList.add("clip"),s}#w(t,e){for(let[n,s]of Object.entries(e))s===null?t.removeAttribute(n):t.setAttribute(n,s)}draw(t,e=!1,n=!1){let s=i.#o++,a=this.#y(),r=i._svgFactory.createElement("defs");a.append(r);let o=i._svgFactory.createElement("path");r.append(o);let l=`path_${s}`;o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),e&&this.#a.set(s,o);let c=n?this.#E(r,l):null,u=i._svgFactory.createElement("use");return a.append(u),u.setAttribute("href",`#${l}`),this.updateProperties(a,t),this.#e.set(s,a),{id:s,clipPathId:`url(#${c})`}}drawOutline(t,e){let n=i.#o++,s=this.#y(),a=i._svgFactory.createElement("defs");s.append(a);let r=i._svgFactory.createElement("path");a.append(r);let o=`path_${n}`;r.setAttribute("id",o),r.setAttribute("vector-effect","non-scaling-stroke");let l;if(e){let h=i._svgFactory.createElement("mask");a.append(h),l=`mask_${n}`,h.setAttribute("id",l),h.setAttribute("maskUnits","objectBoundingBox");let d=i._svgFactory.createElement("rect");h.append(d),d.setAttribute("width","1"),d.setAttribute("height","1"),d.setAttribute("fill","white");let f=i._svgFactory.createElement("use");h.append(f),f.setAttribute("href",`#${o}`),f.setAttribute("stroke","none"),f.setAttribute("fill","black"),f.setAttribute("fill-rule","nonzero"),f.classList.add("mask")}let c=i._svgFactory.createElement("use");s.append(c),c.setAttribute("href",`#${o}`),l&&c.setAttribute("mask",`url(#${l})`);let u=c.cloneNode();return s.append(u),c.classList.add("mainOutline"),u.classList.add("secondaryOutline"),this.updateProperties(s,t),this.#e.set(n,s),n}finalizeDraw(t,e){this.#a.delete(t),this.updateProperties(t,e)}updateProperties(t,e){if(!e)return;let{root:n,bbox:s,rootClass:a,path:r}=e,o=typeof t=="number"?this.#e.get(t):t;if(o){if(n&&this.#w(o,n),s&&i.#v(o,s),a){let{classList:l}=o;for(let[c,u]of Object.entries(a))l.toggle(c,u)}if(r){let c=o.firstElementChild.firstElementChild;this.#w(c,r)}}}updateParent(t,e){if(e===this)return;let n=this.#e.get(t);n&&(e.#t.append(n),this.#e.delete(t),e.#e.set(t,n))}remove(t){this.#a.delete(t),this.#t!==null&&(this.#e.get(t).remove(),this.#e.delete(t))}destroy(){this.#t=null;for(let t of this.#e.values())t.remove();this.#e.clear(),this.#a.clear(),this.#r?.disconnect(),this.#r=null,this.#i&&(i.#m.get(this.#i)?.drawLayer===this&&(i.#g(this.#i),i.#m.delete(this.#i),i.#p.delete(this.#i),i.#p.size===0&&(i.#l?.abort(),i.#l=null,i.#h=!1)),this.#i=null)}};Yl=class i{#t=[];#e=new Map;#i=null;#n=0;#s=0;#r=0;static#a=null;constructor(t,e,n,s){this.#n=t,this.#t=e,this.#s=n.rawDims.pageWidth,this.#r=n.rawDims.pageHeight,this.#i=s}render(){let t=document.createElement("div");t.className="textLayerImages";for(let e=0;e<this.#t.length;e+=6){let n=this.#o(this.#t.subarray(e,e+6));n&&t.append(n)}return t.addEventListener("contextmenu",e=>{if(!(e.target instanceof HTMLCanvasElement))return;let n=e.target,s=this.#e.get(n);if(!s)return;let a=i.#a?.deref();if(a===n)return;a&&(a.width=0,a.height=0),i.#a=new WeakRef(n);let{inverseTransform:r,x1:o,y1:l,width:c,height:u}=s,h=this.#i(),d=Math.ceil(o*h.width),f=Math.ceil(l*h.height),m=Math.floor((o+c/this.#s)*h.width),y=Math.floor((l+u/this.#r)*h.height);n.width=m-d,n.height=y-f;let v=n.getContext("2d");v.setTransform(...r),v.translate(-d,-f),v.drawImage(h,0,0)}),t}#o([t,e,n,s,a,r]){let o=Math.hypot((a-t)*this.#s,(r-e)*this.#r),l=Math.hypot((n-t)*this.#s,(s-e)*this.#r);if(o<this.#n||l<this.#n)return null;let c=[(a-t)*this.#s/o,(r-e)*this.#r/o,(n-t)*this.#s/l,(s-e)*this.#r/l,0,0],u=M.inverseTransform(c),h=document.createElement("canvas");return h.className="textLayerImagePlaceholder",h.width=0,h.height=0,Object.assign(h.style,{opacity:0,position:"absolute",left:ml(t),top:ml(e),width:ml(o/this.#s),height:ml(l/this.#r),transformOrigin:"0% 0%",transform:`matrix(${c.join(",")})`}),this.#e.set(h,{inverseTransform:u,width:o,height:l,x1:t,y1:e}),h}};globalThis._pdfjsTestingUtils={HighlightOutliner:wr};globalThis.pdfjsLib={AbortException:Ge,AnnotationEditorLayer:Vl,AnnotationEditorParamsType:H,AnnotationEditorType:P,AnnotationEditorUIManager:rn,AnnotationLayer:Pl,AnnotationMode:Si,AnnotationType:bt,applyOpacity:vb,build:Lb,ColorPicker:Ar,createValidAbsoluteUrl:Lf,CSSConstants:Sl,DOMSVGFactory:Ln,DrawLayer:Xl,FeatureTest:J,fetchData:$l,findContrastColor:Ab,getDocument:Nb,getFilenameFromUrl:yb,getPdfFilenameFromUrl:bb,getRGB:Ks,getRGBA:qs,getUuid:zf,GlobalWorkerOptions:sn,ImageKind:sr,InvalidPDFException:Is,isDataScheme:Mr,isPdfFile:Zl,isValidExplicitDest:Tb,makeArr:Ys,makeMap:Ql,makeObj:bl,makeSet:mb,MathClamp:ht,noContextMenu:Te,normalizeUnicode:gb,OPS:Ue,OutputScale:Je,PasswordException:Ps,PasswordResponses:pb,PDFDataRangeTransport:vr,PDFDateString:Hs,PDFWorker:Xs,PermissionFlag:fb,PixelsPerInch:wi,RenderingCancelledException:Fs,renderRichText:Pf,ResponseException:Nn,setLayerDimensions:an,shadow:L,SignatureExtractor:Ei,stopEvent:vt,SupportedImageMimeTypes:Al,TextLayer:Vs,TextLayerImages:Yl,TouchManager:fr,updateUrlHash:Bf,Util:M,VerbosityLevel:Cr,version:kb,XfaLayer:dr}});var jb=Ci(My());var q=Ci(ea());var nn=Ci(ea(),1),Fy=Ci(Ec(),1);function Cn(i,t,e){let n=e.initialDeps??[],s,a=!0;function r(){var o,l,c;let u;e.key&&((o=e.debug)!=null&&o.call(e))&&(u=Date.now());let h=i();if(!(h.length!==n.length||h.some((m,y)=>n[y]!==m)))return s;n=h;let f;if(e.key&&((l=e.debug)!=null&&l.call(e))&&(f=Date.now()),s=t(...h),e.key&&((c=e.debug)!=null&&c.call(e))){let m=Math.round((Date.now()-u)*100)/100,y=Math.round((Date.now()-f)*100)/100,v=y/16,p=(g,b)=>{for(g=String(g);g.length<b;)g=" "+g;return g};console.info(`%c\u23F1 ${p(y,5)} /${p(m,5)} ms`,`
|
|
64
64
|
font-size: .6rem;
|
|
65
65
|
font-weight: bold;
|
|
66
|
-
color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,e?.key)}return e?.onChange&&!(a&&e.skipInitialOnChange)&&e.onChange(s),a=!1,s}return r.updateDeps=o=>{n=o},r}function qh(i,t){if(i===void 0)throw new Error(`Unexpected undefined${t?`: ${t}`:""}`);return i}var Dy=(i,t)=>Math.abs(i-t)<1.01,Oy=(i,t,e)=>{let n;return function(...s){i.clearTimeout(n),n=i.setTimeout(()=>t.apply(this,s),e)}};var Ry=i=>{let{offsetWidth:t,offsetHeight:e}=i;return{width:t,height:e}},V1=i=>i,X1=i=>{let t=Math.max(i.startIndex-i.overscan,0),e=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let s=t;s<=e;s++)n.push(s);return n},Ly=(i,t)=>{let e=i.scrollElement;if(!e)return;let n=i.targetWindow;if(!n)return;let s=r=>{let{width:o,height:l}=r;t({width:Math.round(o),height:Math.round(l)})};if(s(Ry(e)),!n.ResizeObserver)return()=>{};let a=new n.ResizeObserver(r=>{let o=()=>{let l=r[0];if(l?.borderBoxSize){let c=l.borderBoxSize[0];if(c){s({width:c.inlineSize,height:c.blockSize});return}}s(Ry(e))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return a.observe(e,{box:"border-box"}),()=>{a.unobserve(e)}},Ny={passive:!0};var ky=typeof window>"u"?!0:"onscrollend"in window,By=(i,t)=>{let e=i.scrollElement;if(!e)return;let n=i.targetWindow;if(!n)return;let s=0,a=i.options.useScrollendEvent&&ky?()=>{}:Oy(n,()=>{t(s,!1)},i.options.isScrollingResetDelay),r=u=>()=>{let{horizontal:h,isRtl:d}=i.options;s=h?e.scrollLeft*(d&&-1||1):e.scrollTop,a(),t(s,u)},o=r(!0),l=r(!1);e.addEventListener("scroll",o,Ny);let c=i.options.useScrollendEvent&&ky;return c&&e.addEventListener("scrollend",l,Ny),()=>{e.removeEventListener("scroll",o),c&&e.removeEventListener("scrollend",l)}};var Y1=(i,t,e)=>{if(t?.borderBoxSize){let n=t.borderBoxSize[0];if(n)return Math.round(n[e.options.horizontal?"inlineSize":"blockSize"])}return i[e.options.horizontal?"offsetWidth":"offsetHeight"]};var zy=(i,{adjustments:t=0,behavior:e},n)=>{var s,a;let r=i+t;(a=(s=n.scrollElement)==null?void 0:s.scrollTo)==null||a.call(s,{[n.options.horizontal?"left":"top"]:r,behavior:e})},ol=class{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e,n,s;return((s=(n=(e=this.targetWindow)==null?void 0:e.performance)==null?void 0:n.now)==null?void 0:s.call(n))??Date.now()},this.observer=(()=>{let e=null,n=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(s=>{s.forEach(a=>{let r=()=>{let o=a.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,a,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var s;(s=n())==null||s.disconnect(),e=null},observe:s=>{var a;return(a=n())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:s=>{var a;return(a=n())==null?void 0:a.unobserve(s)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([n,s])=>{typeof s>"u"&&delete e[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:V1,rangeExtractor:X1,onChange:()=>{},measureElement:Y1,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...e}},this.notify=e=>{var n,s;(s=(n=this.options).onChange)==null||s.call(n,this,e)},this.maybeNotify=Cn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;let n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,a)=>{this.scrollAdjustments=0,this.scrollDirection=a?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=a,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,n)=>{let s=new Map,a=new Map;for(let r=n-1;r>=0;r--){let o=e[r];if(s.has(o.lane))continue;let l=a.get(o.lane);if(l==null||o.end>l.end?a.set(o.lane,o):o.end<l.end&&s.set(o.lane,!0),s.size===this.options.lanes)break}return a.size===this.options.lanes?Array.from(a.values()).sort((r,o)=>r.end===o.end?r.index-o.index:r.end-o.end)[0]:void 0},this.getMeasurementOptions=Cn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,n,s,a,r,o,l)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:n,scrollMargin:s,getItemKey:a,enabled:r,lanes:o,laneAssignmentMode:l}),{key:!1}),this.getMeasurements=Cn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:n,scrollMargin:s,getItemKey:a,enabled:r,lanes:o,laneAssignmentMode:l},c)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let f of this.laneAssignments.keys())f>=e&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));let u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let h=this.measurementsCache.slice(0,u),d=new Array(o).fill(void 0);for(let f=0;f<u;f++){let m=h[f];m&&(d[m.lane]=f)}for(let f=u;f<e;f++){let m=a(f),y=this.laneAssignments.get(f),v,p,g=l==="estimate"||c.has(m);if(y!==void 0&&this.options.lanes>1){v=y;let E=d[v],T=E!==void 0?h[E]:void 0;p=T?T.end+this.options.gap:n+s}else{let E=this.options.lanes===1?h[f-1]:this.getFurthestMeasurement(h,f);p=E?E.end+this.options.gap:n+s,v=E?E.lane:f%this.options.lanes,this.options.lanes>1&&g&&this.laneAssignments.set(f,v)}let b=c.get(m),A=typeof b=="number"?b:this.options.estimateSize(f),S=p+A;h[f]={index:f,start:p,size:A,end:S,key:m,lane:v},d[v]=f}return this.measurementsCache=h,h},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Cn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,n,s,a)=>this.range=e.length>0&&n>0?q1({measurements:e,outerSize:n,scrollOffset:s,lanes:a}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Cn(()=>{let e=null,n=null,s=this.calculateRange();return s&&(e=s.startIndex,n=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,n]},(e,n,s,a,r)=>a===null||r===null?[]:e({startIndex:a,endIndex:r,overscan:n,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let n=this.options.indexAttribute,s=e.getAttribute(n);return s?parseInt(s,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;let s=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(s!==void 0&&this.range){let a=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,s-a),o=Math.min(this.options.count-1,s+a);return e>=r&&e<=o}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}let n=this.indexFromElement(e),s=this.options.getItemKey(n),a=this.elementsCache.get(s);a!==e&&(a&&this.observer.unobserve(a),this.observer.observe(e),this.elementsCache.set(s,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,n)=>{var s;let a=this.measurementsCache[e];if(!a)return;let r=this.itemSizeCache.get(a.key)??a.size,o=n-r;o!==0&&(((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,o,this):a.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,n)),this.notify(!1))},this.getVirtualItems=Cn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,n)=>{let s=[];for(let a=0,r=e.length;a<r;a++){let o=e[a],l=n[o];s.push(l)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let n=this.getMeasurements();if(n.length!==0)return qh(n[Py(0,n.length-1,s=>qh(n[s]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,n,s=0)=>{if(!this.scrollElement)return 0;let a=this.getSize(),r=this.getScrollOffset();n==="auto"&&(n=e>=r+a?"end":"start"),n==="center"?e+=(s-a)/2:n==="end"&&(e-=a);let o=this.getMaxScrollOffset();return Math.max(Math.min(o,e),0)},this.getOffsetForIndex=(e,n="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let s=this.getSize(),a=this.getScrollOffset(),r=this.measurementsCache[e];if(!r)return;if(n==="auto")if(r.end>=a+s-this.options.scrollPaddingEnd)n="end";else if(r.start<=a+this.options.scrollPaddingStart)n="start";else return[a,n];if(n==="end"&&e===this.options.count-1)return[this.getMaxScrollOffset(),n];let o=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,n,r.size),n]},this.scrollToOffset=(e,{align:n="start",behavior:s="auto"}={})=>{let a=this.getOffsetForAlignment(e,n),r=this.now();this.scrollState={index:null,align:n,behavior:s,startedAt:r,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:n="auto",behavior:s="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let a=this.getOffsetForIndex(e,n);if(!a)return;let[r,o]=a,l=this.now();this.scrollState={index:e,align:o,behavior:s,startedAt:l,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:n="auto"}={})=>{let s=this.getScrollOffset()+e,a=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:a,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var e;let n=this.getMeasurements(),s;if(n.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((e=n[n.length-1])==null?void 0:e.end)??0;else{let a=Array(this.options.lanes).fill(null),r=n.length-1;for(;r>=0&&a.some(o=>o===null);){let o=n[r];a[o.lane]===null&&(a[o.lane]=o.end),r--}s=Math.max(...a.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:n,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=n?n[0]:this.scrollState.lastTargetOffset,a=1,r=s!==this.scrollState.lastTargetOffset;if(!r&&Dy(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=a){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=s,this.scrollState.behavior="auto",this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}},Py=(i,t,e,n)=>{for(;i<=t;){let s=(i+t)/2|0,a=e(s);if(a<n)i=s+1;else if(a>n)t=s-1;else return s}return i>0?i-1:0};function q1({measurements:i,outerSize:t,scrollOffset:e,lanes:n}){let s=i.length-1,a=l=>i[l].start;if(i.length<=n)return{startIndex:0,endIndex:s};let r=Py(0,s,a,e),o=r;if(n===1)for(;o<s&&i[o].end<e+t;)o++;else if(n>1){let l=Array(n).fill(0);for(;o<s&&l.some(u=>u<e+t);){let u=i[o];l[u.lane]=u.end,o++}let c=Array(n).fill(e+t);for(;r>=0&&c.some(u=>u>=e);){let u=i[r];c[u.lane]=u.start,r--}r=Math.max(0,r-r%n),o=Math.min(s,o+(n-1-o%n))}return{startIndex:r,endIndex:o}}var Iy=typeof document<"u"?nn.useLayoutEffect:nn.useEffect;function K1({useFlushSync:i=!0,...t}){let e=nn.useReducer(()=>({}),{})[1],n={...t,onChange:(a,r)=>{var o;i&&r?(0,Fy.flushSync)(e):e(),(o=t.onChange)==null||o.call(t,a,r)}},[s]=nn.useState(()=>new ol(n));return s.setOptions(n),Iy(()=>s._didMount(),[]),Iy(()=>s._willUpdate()),s}function Kh(i){return K1({observeElementRect:Ly,observeElementOffset:By,scrollToFn:zy,...i})}var W=Ci(tr()),Pb=16,zS=32,Dr=96/72,PS=.25,IS=4,Ib=1.2,FS=100,Fb=18,Hb=12,HS=132;function Ub({cwd:i,path:t,refreshKey:e}){let n=(0,q.useRef)(null),[s,a]=(0,q.useState)({kind:"loading"}),[r,o]=(0,q.useState)(null),[l,c]=(0,q.useState)(0),[u,h]=(0,q.useState)(null),[d,f]=(0,q.useState)(0),[m,y]=(0,q.useState)({kind:"auto"}),[v,p]=(0,q.useState)(1),[g,b]=(0,q.useState)(!0);(0,q.useEffect)(()=>{let G=!1;a({kind:"loading"}),o(null),c(0),h(null),p(1);let Wt=null;return(async()=>{try{let Ct=await Promise.resolve().then(()=>(zb(),Bb));Ct.GlobalWorkerOptions.workerSrc="/pdfjs/pdf.worker.min.mjs";let St=`/api/files/read?cwd=${encodeURIComponent(i)}&path=${encodeURIComponent(t)}&v=${encodeURIComponent(String(e??""))}`;Wt=Ct.getDocument({url:St});let In=await Wt.promise;if(G)return;let ac=await Promise.all(Array.from({length:In.numPages},(Ff,Ws)=>In.getPage(Ws+1).then(Qs=>{let $s=Qs.getViewport({scale:1});return{w:$s.width,h:$s.height}})));if(G)return;o(In),c(In.numPages),h(ac),a({kind:"ready"})}catch(Ct){G||a({kind:"error",message:Ct instanceof Error?Ct.message:"Failed to load PDF"})}})(),()=>{G=!0;try{Wt?.destroy()}catch{}}},[i,t,e]),(0,q.useEffect)(()=>{let G=n.current;if(!G)return;let Wt=()=>f(Math.max(0,G.clientWidth-zS));Wt();let Ct=new ResizeObserver(Wt);return Ct.observe(G),()=>Ct.disconnect()},[]);let A=(0,q.useMemo)(()=>u?.length?Math.max(...u.map(G=>G.w)):0,[u]),S=A>0&&d>0?d/A:Dr,E=Math.min(S,Dr),T=m.kind==="auto"?E:m.factor*Dr,w=Math.round(T/Dr*100),_=(0,q.useMemo)(()=>u?u.map(G=>G.h*T+Pb):[],[u,T]),C=A*T,D=(0,q.useRef)(1);D.current=E/Dr;let N=(0,q.useRef)(_);N.current=_;let z=Kh({count:l,getScrollElement:()=>n.current,estimateSize:G=>N.current[G]??0,overscan:2});(0,q.useEffect)(()=>{_.length>0&&z.measure()},[_,z]);let X=(0,q.useCallback)(()=>{let G=n.current;if(!G||l===0)return;let Wt=G.scrollTop,Ct=z.getVirtualItems().find(St=>St.end>Wt);p((Ct?Ct.index:l-1)+1)},[z,l]),lt=(0,q.useCallback)(G=>{y(Wt=>{let Ct=Wt.kind==="auto"?D.current:Wt.factor;return{kind:"fixed",factor:Math.min(IS,Math.max(PS,Ct*G))}})},[]),k=(0,q.useCallback)(()=>lt(Ib),[lt]),R=(0,q.useCallback)(()=>lt(1/Ib),[lt]),kt=(0,q.useCallback)(()=>y({kind:"auto"}),[]),Lt=(0,q.useCallback)(()=>b(G=>!G),[]),Pe=(0,q.useCallback)(G=>{z.scrollToIndex(G,{align:"start"}),p(G+1)},[z]),xi=z.getVirtualItems(),at=z.getTotalSize(),rt=(0,q.useMemo)(()=>(0,W.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-border bg-secondary text-muted-foreground text-xs select-none",children:[(0,W.jsx)("button",{onClick:Lt,className:`px-1.5 py-0.5 rounded hover:bg-accent transition-colors ${g?"text-foreground":""}`,title:g?"Hide thumbnails":"Show thumbnails","aria-label":"Toggle thumbnails",children:(0,W.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[(0,W.jsx)("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),(0,W.jsx)("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),(0,W.jsx)("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]})}),(0,W.jsx)("span",{className:"tabular-nums",children:l>0?`${v} / ${l}`:"\u2014"}),(0,W.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,W.jsx)("button",{onClick:R,className:"px-1.5 py-0.5 rounded hover:bg-accent transition-colors",title:"Zoom out","aria-label":"Zoom out",children:"\u2212"}),(0,W.jsxs)("button",{onClick:kt,className:`px-1.5 py-0.5 rounded hover:bg-accent transition-colors tabular-nums min-w-[3.5rem] ${m.kind==="auto"?"":"text-foreground"}`,title:"Reset to automatic zoom",children:[w,"%"]}),(0,W.jsx)("button",{onClick:k,className:"px-1.5 py-0.5 rounded hover:bg-accent transition-colors",title:"Zoom in","aria-label":"Zoom in",children:"+"})]})]}),[l,v,w,m.kind,k,R,kt,g,Lt]);return s.kind==="error"?(0,W.jsxs)("div",{className:"h-full flex flex-col bg-secondary",children:[rt,(0,W.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,W.jsx)("div",{className:"text-sm text-red-11",children:s.message})})]}):(0,W.jsxs)("div",{className:"h-full flex flex-col bg-secondary",children:[rt,(0,W.jsxs)("div",{className:"flex-1 flex min-h-0",children:[g&&r&&u&&(0,W.jsx)(US,{doc:r,numPages:l,sizes:u,maxPageW:A,currentPage:v,onSelect:Pe}),(0,W.jsx)("div",{ref:n,onScroll:X,className:"flex-1 overflow-auto px-4 py-4",children:s.kind==="loading"||!r||!u||C<=0?(0,W.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,W.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):(0,W.jsx)("div",{style:{height:at,width:Math.max(C,d),position:"relative"},children:xi.map(G=>(0,W.jsx)("div",{"data-index":G.index,className:"absolute left-0 top-0 w-full flex justify-center",style:{transform:`translateY(${G.start}px)`,paddingBottom:Pb},children:(0,W.jsx)(Gb,{doc:r,pageNumber:G.index+1,scale:T,width:u[G.index].w*T,height:u[G.index].h*T})},G.key))})})]})]})}function US({doc:i,numPages:t,sizes:e,maxPageW:n,currentPage:s,onSelect:a}){let r=(0,q.useRef)(null),o=n>0?FS/n:0,l=(0,q.useMemo)(()=>e.map(d=>d.h*o+Fb+Hb),[e,o]),c=(0,q.useRef)(l);c.current=l;let u=Kh({count:t,getScrollElement:()=>r.current,estimateSize:d=>c.current[d]??0,overscan:3});(0,q.useEffect)(()=>{l.length>0&&u.measure()},[l,u]),(0,q.useEffect)(()=>{t>0&&u.scrollToIndex(s-1,{align:"auto"})},[s]);let h=u.getVirtualItems();return(0,W.jsx)("div",{ref:r,className:"shrink-0 overflow-auto border-r border-border bg-secondary py-2",style:{width:HS},children:(0,W.jsx)("div",{style:{height:u.getTotalSize(),width:"100%",position:"relative"},children:h.map(d=>{let f=s===d.index+1;return(0,W.jsxs)("div",{className:"absolute left-0 top-0 w-full flex flex-col items-center",style:{transform:`translateY(${d.start}px)`,paddingBottom:Hb},children:[(0,W.jsx)("button",{onClick:()=>a(d.index),className:`rounded-sm overflow-hidden transition-shadow ${f?"ring-2 ring-brand":"ring-1 ring-border hover:ring-muted-foreground"}`,title:`Page ${d.index+1}`,"aria-label":`Go to page ${d.index+1}`,children:(0,W.jsx)(Gb,{doc:i,pageNumber:d.index+1,scale:o,width:e[d.index].w*o,height:e[d.index].h*o})}),(0,W.jsx)("span",{className:`mt-0.5 text-[11px] tabular-nums leading-none ${f?"text-foreground font-medium":"text-muted-foreground"}`,style:{height:Fb},children:d.index+1})]},d.key)})})})}function Gb({doc:i,pageNumber:t,scale:e,width:n,height:s}){let a=(0,q.useRef)(null);return(0,q.useEffect)(()=>{let r=!1,o=null;return(async()=>{let l=await i.getPage(t);if(r)return;let c=a.current;if(!c)return;let u=Math.min(typeof window<"u"&&window.devicePixelRatio||1,2),h=l.getViewport({scale:e*u});c.width=Math.floor(h.width),c.height=Math.floor(h.height),c.style.width=`${c.width/u}px`,c.style.height=`${c.height/u}px`,o=l.render({canvas:c,viewport:h});try{await o.promise}catch{}})(),()=>{r=!0;try{o?.cancel()}catch{}}},[i,t,e]),(0,W.jsx)("div",{className:"bg-white shadow-md",style:{width:n,height:s},children:(0,W.jsx)("canvas",{ref:a,className:"block"})})}var If=Ci(tr()),sc=new Map;function GS(i,t){let e=sc.get(i);e||(e=(0,jb.createRoot)(i),sc.set(i,e)),e.render((0,If.jsx)("div",{className:"cockpit-pdf",style:{height:"100%"},children:(0,If.jsx)(Ub,{cwd:t.cwd,path:t.path})}))}function jS(i){let t=sc.get(i);t&&(t.unmount(),sc.delete(i))}window.CockpitPdf={render:GS,unmount:jS};})();
|
|
66
|
+
color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,e?.key)}return e?.onChange&&!(a&&e.skipInitialOnChange)&&e.onChange(s),a=!1,s}return r.updateDeps=o=>{n=o},r}function qh(i,t){if(i===void 0)throw new Error(`Unexpected undefined${t?`: ${t}`:""}`);return i}var Dy=(i,t)=>Math.abs(i-t)<1.01,Oy=(i,t,e)=>{let n;return function(...s){i.clearTimeout(n),n=i.setTimeout(()=>t.apply(this,s),e)}};var Ry=i=>{let{offsetWidth:t,offsetHeight:e}=i;return{width:t,height:e}},V1=i=>i,X1=i=>{let t=Math.max(i.startIndex-i.overscan,0),e=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let s=t;s<=e;s++)n.push(s);return n},Ly=(i,t)=>{let e=i.scrollElement;if(!e)return;let n=i.targetWindow;if(!n)return;let s=r=>{let{width:o,height:l}=r;t({width:Math.round(o),height:Math.round(l)})};if(s(Ry(e)),!n.ResizeObserver)return()=>{};let a=new n.ResizeObserver(r=>{let o=()=>{let l=r[0];if(l?.borderBoxSize){let c=l.borderBoxSize[0];if(c){s({width:c.inlineSize,height:c.blockSize});return}}s(Ry(e))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return a.observe(e,{box:"border-box"}),()=>{a.unobserve(e)}},Ny={passive:!0};var ky=typeof window>"u"?!0:"onscrollend"in window,By=(i,t)=>{let e=i.scrollElement;if(!e)return;let n=i.targetWindow;if(!n)return;let s=0,a=i.options.useScrollendEvent&&ky?()=>{}:Oy(n,()=>{t(s,!1)},i.options.isScrollingResetDelay),r=u=>()=>{let{horizontal:h,isRtl:d}=i.options;s=h?e.scrollLeft*(d&&-1||1):e.scrollTop,a(),t(s,u)},o=r(!0),l=r(!1);e.addEventListener("scroll",o,Ny);let c=i.options.useScrollendEvent&&ky;return c&&e.addEventListener("scrollend",l,Ny),()=>{e.removeEventListener("scroll",o),c&&e.removeEventListener("scrollend",l)}};var Y1=(i,t,e)=>{if(t?.borderBoxSize){let n=t.borderBoxSize[0];if(n)return Math.round(n[e.options.horizontal?"inlineSize":"blockSize"])}return i[e.options.horizontal?"offsetWidth":"offsetHeight"]};var zy=(i,{adjustments:t=0,behavior:e},n)=>{var s,a;let r=i+t;(a=(s=n.scrollElement)==null?void 0:s.scrollTo)==null||a.call(s,{[n.options.horizontal?"left":"top"]:r,behavior:e})},ol=class{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e,n,s;return((s=(n=(e=this.targetWindow)==null?void 0:e.performance)==null?void 0:n.now)==null?void 0:s.call(n))??Date.now()},this.observer=(()=>{let e=null,n=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(s=>{s.forEach(a=>{let r=()=>{let o=a.target,l=this.indexFromElement(o);if(!o.isConnected){this.observer.unobserve(o);return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(o,a,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var s;(s=n())==null||s.disconnect(),e=null},observe:s=>{var a;return(a=n())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:s=>{var a;return(a=n())==null?void 0:a.unobserve(s)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([n,s])=>{typeof s>"u"&&delete e[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:V1,rangeExtractor:X1,onChange:()=>{},measureElement:Y1,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...e}},this.notify=e=>{var n,s;(s=(n=this.options).onChange)==null||s.call(n,this,e)},this.maybeNotify=Cn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;let n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,a)=>{this.scrollAdjustments=0,this.scrollDirection=a?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=a,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,n)=>{let s=new Map,a=new Map;for(let r=n-1;r>=0;r--){let o=e[r];if(s.has(o.lane))continue;let l=a.get(o.lane);if(l==null||o.end>l.end?a.set(o.lane,o):o.end<l.end&&s.set(o.lane,!0),s.size===this.options.lanes)break}return a.size===this.options.lanes?Array.from(a.values()).sort((r,o)=>r.end===o.end?r.index-o.index:r.end-o.end)[0]:void 0},this.getMeasurementOptions=Cn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,n,s,a,r,o,l)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:n,scrollMargin:s,getItemKey:a,enabled:r,lanes:o,laneAssignmentMode:l}),{key:!1}),this.getMeasurements=Cn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:n,scrollMargin:s,getItemKey:a,enabled:r,lanes:o,laneAssignmentMode:l},c)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let f of this.laneAssignments.keys())f>=e&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));let u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let h=this.measurementsCache.slice(0,u),d=new Array(o).fill(void 0);for(let f=0;f<u;f++){let m=h[f];m&&(d[m.lane]=f)}for(let f=u;f<e;f++){let m=a(f),y=this.laneAssignments.get(f),v,p,g=l==="estimate"||c.has(m);if(y!==void 0&&this.options.lanes>1){v=y;let E=d[v],T=E!==void 0?h[E]:void 0;p=T?T.end+this.options.gap:n+s}else{let E=this.options.lanes===1?h[f-1]:this.getFurthestMeasurement(h,f);p=E?E.end+this.options.gap:n+s,v=E?E.lane:f%this.options.lanes,this.options.lanes>1&&g&&this.laneAssignments.set(f,v)}let b=c.get(m),A=typeof b=="number"?b:this.options.estimateSize(f),S=p+A;h[f]={index:f,start:p,size:A,end:S,key:m,lane:v},d[v]=f}return this.measurementsCache=h,h},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Cn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,n,s,a)=>this.range=e.length>0&&n>0?q1({measurements:e,outerSize:n,scrollOffset:s,lanes:a}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Cn(()=>{let e=null,n=null,s=this.calculateRange();return s&&(e=s.startIndex,n=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,n]},(e,n,s,a,r)=>a===null||r===null?[]:e({startIndex:a,endIndex:r,overscan:n,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let n=this.options.indexAttribute,s=e.getAttribute(n);return s?parseInt(s,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;let s=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(s!==void 0&&this.range){let a=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,s-a),o=Math.min(this.options.count-1,s+a);return e>=r&&e<=o}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}let n=this.indexFromElement(e),s=this.options.getItemKey(n),a=this.elementsCache.get(s);a!==e&&(a&&this.observer.unobserve(a),this.observer.observe(e),this.elementsCache.set(s,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,n)=>{var s;let a=this.measurementsCache[e];if(!a)return;let r=this.itemSizeCache.get(a.key)??a.size,o=n-r;o!==0&&(((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,o,this):a.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,n)),this.notify(!1))},this.getVirtualItems=Cn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,n)=>{let s=[];for(let a=0,r=e.length;a<r;a++){let o=e[a],l=n[o];s.push(l)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let n=this.getMeasurements();if(n.length!==0)return qh(n[Py(0,n.length-1,s=>qh(n[s]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,n,s=0)=>{if(!this.scrollElement)return 0;let a=this.getSize(),r=this.getScrollOffset();n==="auto"&&(n=e>=r+a?"end":"start"),n==="center"?e+=(s-a)/2:n==="end"&&(e-=a);let o=this.getMaxScrollOffset();return Math.max(Math.min(o,e),0)},this.getOffsetForIndex=(e,n="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let s=this.getSize(),a=this.getScrollOffset(),r=this.measurementsCache[e];if(!r)return;if(n==="auto")if(r.end>=a+s-this.options.scrollPaddingEnd)n="end";else if(r.start<=a+this.options.scrollPaddingStart)n="start";else return[a,n];if(n==="end"&&e===this.options.count-1)return[this.getMaxScrollOffset(),n];let o=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,n,r.size),n]},this.scrollToOffset=(e,{align:n="start",behavior:s="auto"}={})=>{let a=this.getOffsetForAlignment(e,n),r=this.now();this.scrollState={index:null,align:n,behavior:s,startedAt:r,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:n="auto",behavior:s="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let a=this.getOffsetForIndex(e,n);if(!a)return;let[r,o]=a,l=this.now();this.scrollState={index:e,align:o,behavior:s,startedAt:l,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:n="auto"}={})=>{let s=this.getScrollOffset()+e,a=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:a,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var e;let n=this.getMeasurements(),s;if(n.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((e=n[n.length-1])==null?void 0:e.end)??0;else{let a=Array(this.options.lanes).fill(null),r=n.length-1;for(;r>=0&&a.some(o=>o===null);){let o=n[r];a[o.lane]===null&&(a[o.lane]=o.end),r--}s=Math.max(...a.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:n,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=n?n[0]:this.scrollState.lastTargetOffset,a=1,r=s!==this.scrollState.lastTargetOffset;if(!r&&Dy(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=a){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=s,this.scrollState.behavior="auto",this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}},Py=(i,t,e,n)=>{for(;i<=t;){let s=(i+t)/2|0,a=e(s);if(a<n)i=s+1;else if(a>n)t=s-1;else return s}return i>0?i-1:0};function q1({measurements:i,outerSize:t,scrollOffset:e,lanes:n}){let s=i.length-1,a=l=>i[l].start;if(i.length<=n)return{startIndex:0,endIndex:s};let r=Py(0,s,a,e),o=r;if(n===1)for(;o<s&&i[o].end<e+t;)o++;else if(n>1){let l=Array(n).fill(0);for(;o<s&&l.some(u=>u<e+t);){let u=i[o];l[u.lane]=u.end,o++}let c=Array(n).fill(e+t);for(;r>=0&&c.some(u=>u>=e);){let u=i[r];c[u.lane]=u.start,r--}r=Math.max(0,r-r%n),o=Math.min(s,o+(n-1-o%n))}return{startIndex:r,endIndex:o}}var Iy=typeof document<"u"?nn.useLayoutEffect:nn.useEffect;function K1({useFlushSync:i=!0,...t}){let e=nn.useReducer(()=>({}),{})[1],n={...t,onChange:(a,r)=>{var o;i&&r?(0,Fy.flushSync)(e):e(),(o=t.onChange)==null||o.call(t,a,r)}},[s]=nn.useState(()=>new ol(n));return s.setOptions(n),Iy(()=>s._didMount(),[]),Iy(()=>s._willUpdate()),s}function Kh(i){return K1({observeElementRect:Ly,observeElementOffset:By,scrollToFn:zy,...i})}var W=Ci(tr()),Pb=16,zS=32,Dr=96/72,PS=.25,IS=4,Ib=1.2,FS=100,Fb=18,Hb=12,HS=132;function Ub({cwd:i,path:t,refreshKey:e}){let n=(0,q.useRef)(null),[s,a]=(0,q.useState)({kind:"loading"}),[r,o]=(0,q.useState)(null),[l,c]=(0,q.useState)(0),[u,h]=(0,q.useState)(null),[d,f]=(0,q.useState)(0),[m,y]=(0,q.useState)({kind:"auto"}),[v,p]=(0,q.useState)(1),[g,b]=(0,q.useState)(!0);(0,q.useEffect)(()=>{let G=!1;a({kind:"loading"}),o(null),c(0),h(null),p(1);let Wt=null;return(async()=>{try{let Ct=await Promise.resolve().then(()=>(zb(),Bb));Ct.GlobalWorkerOptions.workerSrc="/pdfjs/pdf.worker.min.mjs";let St=`/api/files/read?cwd=${encodeURIComponent(i)}&path=${encodeURIComponent(t)}&v=${encodeURIComponent(String(e??""))}`;Wt=Ct.getDocument({url:St});let In=await Wt.promise;if(G)return;let ac=await Promise.all(Array.from({length:In.numPages},(Ff,Ws)=>In.getPage(Ws+1).then(Qs=>{let $s=Qs.getViewport({scale:1});return{w:$s.width,h:$s.height}})));if(G)return;o(In),c(In.numPages),h(ac),a({kind:"ready"})}catch(Ct){G||a({kind:"error",message:Ct instanceof Error?Ct.message:"Failed to load PDF"})}})(),()=>{G=!0;try{Wt?.destroy()}catch{}}},[i,t,e]),(0,q.useEffect)(()=>{let G=n.current;if(!G)return;let Wt=()=>f(Math.max(0,G.clientWidth-zS));Wt();let Ct=new ResizeObserver(Wt);return Ct.observe(G),()=>Ct.disconnect()},[]);let A=(0,q.useMemo)(()=>u?.length?Math.max(...u.map(G=>G.w)):0,[u]),S=A>0&&d>0?d/A:Dr,E=Math.min(S,Dr),T=m.kind==="auto"?E:m.factor*Dr,w=Math.round(T/Dr*100),_=(0,q.useMemo)(()=>u?u.map(G=>G.h*T+Pb):[],[u,T]),C=A*T,D=(0,q.useRef)(1);D.current=E/Dr;let N=(0,q.useRef)(_);N.current=_;let z=Kh({count:l,getScrollElement:()=>n.current,estimateSize:G=>N.current[G]??0,overscan:2});(0,q.useEffect)(()=>{_.length>0&&z.measure()},[_,z]);let X=(0,q.useCallback)(()=>{let G=n.current;if(!G||l===0)return;let Wt=G.scrollTop,Ct=z.getVirtualItems().find(St=>St.end>Wt);p((Ct?Ct.index:l-1)+1)},[z,l]),lt=(0,q.useCallback)(G=>{y(Wt=>{let Ct=Wt.kind==="auto"?D.current:Wt.factor;return{kind:"fixed",factor:Math.min(IS,Math.max(PS,Ct*G))}})},[]),k=(0,q.useCallback)(()=>lt(Ib),[lt]),R=(0,q.useCallback)(()=>lt(1/Ib),[lt]),kt=(0,q.useCallback)(()=>y({kind:"auto"}),[]),Lt=(0,q.useCallback)(()=>b(G=>!G),[]),Pe=(0,q.useCallback)(G=>{z.scrollToIndex(G,{align:"start"}),p(G+1)},[z]),xi=z.getVirtualItems(),at=z.getTotalSize(),rt=(0,q.useMemo)(()=>(0,W.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-border text-muted-foreground text-xs select-none",children:[(0,W.jsx)("button",{onClick:Lt,className:`px-1.5 py-0.5 rounded hover:bg-hover transition-colors ${g?"text-foreground":""}`,title:g?"Hide thumbnails":"Show thumbnails","aria-label":"Toggle thumbnails",children:(0,W.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[(0,W.jsx)("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),(0,W.jsx)("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),(0,W.jsx)("line",{x1:"4",y1:"18",x2:"20",y2:"18"})]})}),(0,W.jsx)("span",{className:"tabular-nums",children:l>0?`${v} / ${l}`:"\u2014"}),(0,W.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,W.jsx)("button",{onClick:R,className:"px-1.5 py-0.5 rounded hover:bg-hover transition-colors",title:"Zoom out","aria-label":"Zoom out",children:"\u2212"}),(0,W.jsxs)("button",{onClick:kt,className:`px-1.5 py-0.5 rounded hover:bg-hover transition-colors tabular-nums min-w-[3.5rem] ${m.kind==="auto"?"":"text-foreground"}`,title:"Reset to automatic zoom",children:[w,"%"]}),(0,W.jsx)("button",{onClick:k,className:"px-1.5 py-0.5 rounded hover:bg-hover transition-colors",title:"Zoom in","aria-label":"Zoom in",children:"+"})]})]}),[l,v,w,m.kind,k,R,kt,g,Lt]);return s.kind==="error"?(0,W.jsxs)("div",{className:"h-full flex flex-col bg-secondary",children:[rt,(0,W.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,W.jsx)("div",{className:"text-sm text-red-11",children:s.message})})]}):(0,W.jsxs)("div",{className:"h-full flex flex-col bg-secondary",children:[rt,(0,W.jsxs)("div",{className:"flex-1 flex min-h-0",children:[g&&r&&u&&(0,W.jsx)(US,{doc:r,numPages:l,sizes:u,maxPageW:A,currentPage:v,onSelect:Pe}),(0,W.jsx)("div",{ref:n,onScroll:X,className:"flex-1 overflow-auto px-4 py-4",children:s.kind==="loading"||!r||!u||C<=0?(0,W.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,W.jsx)("span",{className:"inline-block w-6 h-6 border-2 border-brand border-t-transparent rounded-full animate-spin"})}):(0,W.jsx)("div",{style:{height:at,width:Math.max(C,d),position:"relative"},children:xi.map(G=>(0,W.jsx)("div",{"data-index":G.index,className:"absolute left-0 top-0 w-full flex justify-center",style:{transform:`translateY(${G.start}px)`,paddingBottom:Pb},children:(0,W.jsx)(Gb,{doc:r,pageNumber:G.index+1,scale:T,width:u[G.index].w*T,height:u[G.index].h*T})},G.key))})})]})]})}function US({doc:i,numPages:t,sizes:e,maxPageW:n,currentPage:s,onSelect:a}){let r=(0,q.useRef)(null),o=n>0?FS/n:0,l=(0,q.useMemo)(()=>e.map(d=>d.h*o+Fb+Hb),[e,o]),c=(0,q.useRef)(l);c.current=l;let u=Kh({count:t,getScrollElement:()=>r.current,estimateSize:d=>c.current[d]??0,overscan:3});(0,q.useEffect)(()=>{l.length>0&&u.measure()},[l,u]),(0,q.useEffect)(()=>{t>0&&u.scrollToIndex(s-1,{align:"auto"})},[s]);let h=u.getVirtualItems();return(0,W.jsx)("div",{ref:r,className:"shrink-0 overflow-auto border-r border-border py-2",style:{width:HS},children:(0,W.jsx)("div",{style:{height:u.getTotalSize(),width:"100%",position:"relative"},children:h.map(d=>{let f=s===d.index+1;return(0,W.jsxs)("div",{className:"absolute left-0 top-0 w-full flex flex-col items-center",style:{transform:`translateY(${d.start}px)`,paddingBottom:Hb},children:[(0,W.jsx)("button",{onClick:()=>a(d.index),className:`rounded-sm overflow-hidden transition-shadow ${f?"ring-2 ring-brand":"ring-1 ring-border hover:ring-muted-foreground"}`,title:`Page ${d.index+1}`,"aria-label":`Go to page ${d.index+1}`,children:(0,W.jsx)(Gb,{doc:i,pageNumber:d.index+1,scale:o,width:e[d.index].w*o,height:e[d.index].h*o})}),(0,W.jsx)("span",{className:`mt-0.5 text-[11px] tabular-nums leading-none ${f?"text-foreground font-medium":"text-muted-foreground"}`,style:{height:Fb},children:d.index+1})]},d.key)})})})}function Gb({doc:i,pageNumber:t,scale:e,width:n,height:s}){let a=(0,q.useRef)(null);return(0,q.useEffect)(()=>{let r=!1,o=null;return(async()=>{let l=await i.getPage(t);if(r)return;let c=a.current;if(!c)return;let u=Math.min(typeof window<"u"&&window.devicePixelRatio||1,2),h=l.getViewport({scale:e*u});c.width=Math.floor(h.width),c.height=Math.floor(h.height),c.style.width=`${c.width/u}px`,c.style.height=`${c.height/u}px`,o=l.render({canvas:c,viewport:h});try{await o.promise}catch{}})(),()=>{r=!0;try{o?.cancel()}catch{}}},[i,t,e]),(0,W.jsx)("div",{className:"bg-white shadow-lv2",style:{width:n,height:s},children:(0,W.jsx)("canvas",{ref:a,className:"block"})})}var If=Ci(tr()),sc=new Map;function GS(i,t){let e=sc.get(i);e||(e=(0,jb.createRoot)(i),sc.set(i,e)),e.render((0,If.jsx)("div",{className:"cockpit-pdf",style:{height:"100%"},children:(0,If.jsx)(Ub,{cwd:t.cwd,path:t.path})}))}function jS(i){let t=sc.get(i);t&&(t.unmount(),sc.delete(i))}window.CockpitPdf={render:GS,unmount:jS};})();
|
|
67
67
|
/*! Bundled license information:
|
|
68
68
|
|
|
69
69
|
scheduler/cjs/scheduler.production.js:
|
|
@@ -32,27 +32,79 @@
|
|
|
32
32
|
--blue-9: 206 100% 50%; --blue-10: 207 96% 43%; --blue-11: 208 88% 43%;
|
|
33
33
|
--violet-9: 252 56% 57%; --violet-10: 251 48% 53%; --violet-11: 250 43% 48%;
|
|
34
34
|
|
|
35
|
-
/* ---- Semantic tokens (ready-to-use colors) ----
|
|
36
|
-
|
|
35
|
+
/* ---- Semantic tokens (ready-to-use colors) ----
|
|
36
|
+
* SURFACES are solid and form an elevation ladder (background / card /
|
|
37
|
+
* popover): things you put content on. FILLS are alpha and carry no
|
|
38
|
+
* elevation (muted / accent / secondary): tinted regions that land on top of
|
|
39
|
+
* whichever surface they happen to sit on. Keeping them apart is what lets
|
|
40
|
+
* one fill value be correct on every surface — and, in dark, frees the three
|
|
41
|
+
* solid steps to actually differ from each other.
|
|
42
|
+
*
|
|
43
|
+
* Light and dark still express depth in opposite directions: dark stacks
|
|
44
|
+
* lighter surfaces above a near-black base, while light has nowhere lighter
|
|
45
|
+
* to go than white and leans on border + shadow, which is why --background,
|
|
46
|
+
* --card and --popover are all white here. */
|
|
47
|
+
--background: hsl(0 0% 100%);
|
|
37
48
|
--foreground: hsl(var(--slate-12));
|
|
38
49
|
--card: hsl(0 0% 100%);
|
|
39
50
|
--card-foreground: hsl(var(--slate-12));
|
|
40
51
|
--primary: hsl(var(--slate-12));
|
|
41
52
|
--primary-foreground: hsl(0 0% 100%);
|
|
42
|
-
--
|
|
53
|
+
--popover: hsl(0 0% 100%);
|
|
54
|
+
--popover-foreground: hsl(var(--slate-12));
|
|
55
|
+
/* Fills — alpha, so they compose on any surface. Deep-navy tint, not a
|
|
56
|
+
near-black one: at these washes a near-black carries no blue and the cool
|
|
57
|
+
slate character flattens to neutral gray. */
|
|
58
|
+
--secondary: rgba(0, 0, 60, 0.090);
|
|
43
59
|
--secondary-foreground: hsl(var(--slate-12));
|
|
44
|
-
--muted:
|
|
60
|
+
--muted: rgba(0, 0, 60, 0.035);
|
|
45
61
|
--muted-foreground: hsl(var(--slate-11));
|
|
46
|
-
--accent:
|
|
62
|
+
--accent: rgba(0, 0, 60, 0.063);
|
|
47
63
|
--accent-foreground: hsl(var(--slate-12));
|
|
48
|
-
--border: hsl(var(--slate-5));
|
|
49
|
-
--input: hsl(var(--slate-5));
|
|
50
64
|
--ring: hsl(var(--teal-9));
|
|
51
65
|
--brand: hsl(var(--teal-9));
|
|
52
66
|
--brand-foreground: hsl(var(--teal-11));
|
|
53
67
|
--destructive: hsl(var(--red-9));
|
|
54
68
|
--destructive-foreground: hsl(0 0% 100%);
|
|
55
69
|
|
|
70
|
+
/* ---- Text ramp ---- */
|
|
71
|
+
--foreground-subtle: hsl(var(--slate-10)); /* tertiary / metadata */
|
|
72
|
+
--foreground-faint: hsl(var(--slate-9)); /* NON-TEXT only — fails AA */
|
|
73
|
+
|
|
74
|
+
/* ---- Lines (alpha, 4 steps) ----
|
|
75
|
+
* Alpha rather than a solid gray so one token darkens whatever it sits on by
|
|
76
|
+
* the same amount, on white and on tinted surfaces alike. --border and
|
|
77
|
+
* --input alias into this ladder; --input sits one step stronger so a field
|
|
78
|
+
* reads as a field on a white card. */
|
|
79
|
+
--line-1: rgba(0, 0, 0, 0.05);
|
|
80
|
+
--line-2: rgba(0, 0, 0, 0.12);
|
|
81
|
+
--line-3: rgba(0, 0, 0, 0.16);
|
|
82
|
+
--line-4: rgba(0, 0, 0, 0.22);
|
|
83
|
+
--border: var(--line-2);
|
|
84
|
+
--input: var(--line-3);
|
|
85
|
+
|
|
86
|
+
/* ---- Interactive tints ----
|
|
87
|
+
* Same tint as the fills: a near-black tint washes out to neutral at these
|
|
88
|
+
* alphas, so hover drifted gray against a cool palette. */
|
|
89
|
+
--tint-hover: rgba(0, 0, 60, 0.06);
|
|
90
|
+
--tint-hover-strong: rgba(0, 0, 60, 0.10);
|
|
91
|
+
--tint-active: rgba(0, 0, 60, 0.14);
|
|
92
|
+
|
|
93
|
+
/* ---- Elevation — light mode's primary depth cue ---- */
|
|
94
|
+
--shadow-lv1: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
95
|
+
--shadow-lv2: 0 4px 12px 0 rgba(0, 0, 0, 0.03), 0 2px 6px 0 rgba(0, 0, 0, 0.05);
|
|
96
|
+
--shadow-lv3: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 8px 24px 0 rgba(0, 0, 0, 0.08),
|
|
97
|
+
0 2px 6px 0 rgba(0, 0, 0, 0.04);
|
|
98
|
+
|
|
99
|
+
/* ---- Overlay surfaces ----
|
|
100
|
+
* Tooltips/toasts stay DARK in light mode: an overlay reads as "above" the
|
|
101
|
+
* page by contrasting with it, not by being another white box. The scrim is
|
|
102
|
+
* theme-specific — a backdrop needs far less black over white than over a
|
|
103
|
+
* dark ground. */
|
|
104
|
+
--scrim: rgba(0, 0, 0, 0.24);
|
|
105
|
+
--tooltip: hsl(var(--slate-12));
|
|
106
|
+
--tooltip-foreground: hsl(0 0% 100%);
|
|
107
|
+
|
|
56
108
|
/* Friendly status aliases (auto-adapt in dark via the scale overrides) */
|
|
57
109
|
--success: hsl(var(--green-9));
|
|
58
110
|
--warning: hsl(var(--amber-9));
|
|
@@ -84,11 +136,43 @@
|
|
|
84
136
|
|
|
85
137
|
/* Semantic overrides that differ from light (the rest auto-adapt via the scales) */
|
|
86
138
|
--background: hsl(var(--slate-1));
|
|
87
|
-
|
|
139
|
+
/* Elevation ladder: 7% ground / 11% panel / 13% floating. --popover used to
|
|
140
|
+
equal --card, so a menu dissolved into the panel it opened on. The step is
|
|
141
|
+
small on purpose — a menu reads as floating because of its border and
|
|
142
|
+
shadow, not its lightness (the whole usable range is 1.03-1.11 against
|
|
143
|
+
--card), and forcing it brighter only washed dropdowns out. */
|
|
144
|
+
--card: hsl(240 5% 11%);
|
|
145
|
+
--popover: hsl(240 5% 13%);
|
|
88
146
|
--primary-foreground: hsl(var(--slate-1));
|
|
89
|
-
|
|
90
|
-
--
|
|
91
|
-
--
|
|
147
|
+
/* Fills — blue-white tint, same ordering as light (see the light note). */
|
|
148
|
+
--secondary: rgba(220, 220, 255, 0.108);
|
|
149
|
+
--muted: rgba(220, 220, 255, 0.035);
|
|
150
|
+
--accent: rgba(220, 220, 255, 0.069);
|
|
151
|
+
|
|
152
|
+
/* Lines — alpha WHITE. --line-2 is 0.16 rather than light's 0.12 because it
|
|
153
|
+
is solved against THIS theme's base: 0.16 over slate-1 lands where the
|
|
154
|
+
old solid slate-6 border painted, so dark keeps its border weight. */
|
|
155
|
+
--line-1: rgba(255, 255, 255, 0.06);
|
|
156
|
+
--line-2: rgba(255, 255, 255, 0.16);
|
|
157
|
+
--line-3: rgba(255, 255, 255, 0.20);
|
|
158
|
+
--line-4: rgba(255, 255, 255, 0.26);
|
|
159
|
+
|
|
160
|
+
/* White alpha: a bluish-black tint would vanish into a near-black ground. */
|
|
161
|
+
--tint-hover: rgba(220, 220, 255, 0.08);
|
|
162
|
+
--tint-hover-strong: rgba(220, 220, 255, 0.12);
|
|
163
|
+
--tint-active: rgba(220, 220, 255, 0.18);
|
|
164
|
+
|
|
165
|
+
/* A drop shadow barely registers on a near-black base, so lv3 adds a light
|
|
166
|
+
hairline ring to define the edge and the blurs go deeper. */
|
|
167
|
+
--shadow-lv1: 0 1px 2px 0 rgba(0, 0, 0, 0.40);
|
|
168
|
+
--shadow-lv2: 0 4px 12px 0 rgba(0, 0, 0, 0.45);
|
|
169
|
+
--shadow-lv3: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 32px 0 rgba(0, 0, 0, 0.60),
|
|
170
|
+
0 2px 8px 0 rgba(0, 0, 0, 0.40);
|
|
171
|
+
|
|
172
|
+
/* Tooltip inverts upward to a surface LIGHTER than the base. */
|
|
173
|
+
--scrim: rgba(0, 0, 0, 0.55);
|
|
174
|
+
--tooltip: hsl(var(--slate-6));
|
|
175
|
+
--tooltip-foreground: hsl(var(--slate-12));
|
|
92
176
|
}
|
|
93
177
|
|
|
94
178
|
/* Minimal base so linking the theme makes a page look native immediately. */
|