agentroam-runtime-darwin-arm64 0.2.0-preview.63 → 0.2.0-preview.64
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/manifest.json +2 -2
- package/package.json +1 -1
- package/runtime/.next/BUILD_ID +1 -1
- package/runtime/.next/app-build-manifest.json +8 -8
- package/runtime/.next/app-path-routes-manifest.json +1 -1
- package/runtime/.next/build-manifest.json +3 -3
- package/runtime/.next/prerender-manifest.json +1 -1
- package/runtime/.next/required-server-files.json +1 -1
- package/runtime/.next/server/app/_not-found/page.js +1 -1
- package/runtime/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/runtime/.next/server/app/_not-found.html +1 -1
- package/runtime/.next/server/app/_not-found.rsc +1 -1
- package/runtime/.next/server/app/api/agent/abort/route.js +1 -1
- package/runtime/.next/server/app/api/agent/answer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/codex-sharing/route.js +1 -1
- package/runtime/.next/server/app/api/agent/harness/status/route.js +1 -1
- package/runtime/.next/server/app/api/agent/model/route.js +1 -1
- package/runtime/.next/server/app/api/agent/models/route.js +1 -1
- package/runtime/.next/server/app/api/agent/run/route.js +2 -2
- package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
- package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/stream/route.js +3 -3
- package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
- package/runtime/.next/server/app/api/auth/verify/route.js +1 -1
- package/runtime/.next/server/app/api/business/route.js +1 -1
- package/runtime/.next/server/app/api/client-logs/route.js +1 -1
- package/runtime/.next/server/app/api/collaboration/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +3 -3
- package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
- package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/connect/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/disconnect/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/servers/route.js +1 -1
- package/runtime/.next/server/app/api/memory/[key]/route.js +1 -1
- package/runtime/.next/server/app/api/memory/route.js +1 -1
- package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
- package/runtime/.next/server/app/api/projects/[id]/route.js +1 -1
- package/runtime/.next/server/app/api/projects/check/route.js +1 -1
- package/runtime/.next/server/app/api/projects/directories/route.js +1 -1
- package/runtime/.next/server/app/api/projects/roots/route.js +1 -1
- package/runtime/.next/server/app/api/projects/route.js +1 -1
- package/runtime/.next/server/app/api/push/subscribe/route.js +2 -2
- package/runtime/.next/server/app/api/push/unsubscribe/route.js +2 -2
- package/runtime/.next/server/app/api/push/vapid/route.js +2 -2
- package/runtime/.next/server/app/api/push/vapid.body +1 -1
- package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +2 -2
- package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/settings/route.js +1 -1
- package/runtime/.next/server/app/api/skills/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
- package/runtime/.next/server/app/api/tools/route.js +1 -1
- package/runtime/.next/server/app/api/update/check/route.js +1 -1
- package/runtime/.next/server/app/api/update/install/route.js +1 -1
- package/runtime/.next/server/app/api/update/status/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/login/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/logout/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/revoke-all/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/setup/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/status/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/bootstrap/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/computer-settings/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/computers/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/device-state/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/history/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/preferences/route.js +1 -1
- package/runtime/.next/server/app/web/page.js +4 -4
- package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
- package/runtime/.next/server/app-paths-manifest.json +33 -33
- package/runtime/.next/server/chunks/5303.js +1 -1
- package/runtime/.next/server/middleware-build-manifest.js +1 -1
- package/runtime/.next/server/pages/404.html +1 -1
- package/runtime/.next/server/pages/500.html +1 -1
- package/runtime/.next/server/server-reference-manifest.json +1 -1
- package/runtime/.next/static/chunks/app/web/{error-7ac82267d3330344.js → error-4d3646f97c1344d3.js} +1 -1
- package/runtime/.next/static/chunks/app/web/layout-c8709c08fb7ad857.js +1 -0
- package/runtime/.next/static/chunks/app/web/page-b876912c109021db.js +1 -0
- package/runtime/.next/static/chunks/{main-app-51ee029f2d3c9d9e.js → main-app-00dfdb2d5c09719c.js} +1 -1
- package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/MacOS/agentroam-remote-desktop +0 -0
- package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/Resources/agentroam-component.json +1 -1
- package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/_CodeSignature/CodeResources +2 -2
- package/runtime/node_modules/.package-lock.json +19 -14
- package/runtime/node_modules/@agent/native-runtime/dist/index.js +572 -93
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +71 -71
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +37 -37
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-36zyfan5.mjs +52 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-p79weg14.mjs → core-5682eevd.mjs} +4 -4
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-nne0e2ds.mjs +40 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-mh5qmqqf.mjs → core-xpxe8nzb.mjs} +1 -1
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +10 -10
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +19 -20
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +23 -24
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +14 -14
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +74 -74
- package/runtime/node_modules/caniuse-lite/data/agents.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/browserVersions.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/aac.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/abortcontroller.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/ac3-ec3.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/accelerometer.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/addeventlistener.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/alternate-stylesheet.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/ambient-light.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/apng.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/array-find-index.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/array-find.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/array-flat.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/array-includes.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/arrow-functions.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/asmjs.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/async-clipboard.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/async-functions.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/atob-btoa.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/audio-api.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/audio.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/audiotracks.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/autofocus.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/auxclick.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/av1.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/avif.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/background-attachment.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/background-clip-text.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/background-img-opts.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/background-position-x-y.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/background-repeat-round-space.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/background-sync.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/battery-status.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/beacon.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/beforeafterprint.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/bigint.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/blobbuilder.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/bloburls.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/border-image.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/border-radius.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/broadcastchannel.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/brotli.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/calc.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/canvas-blending.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/canvas-text.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/canvas.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/ch-unit.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/chacha20-poly1305.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/channel-messaging.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/childnode-remove.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/classlist.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/client-hints-dpr-width-viewport.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/clipboard.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/colr-v1.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/colr.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/comparedocumentposition.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/console-basic.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/console-time.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/const.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/constraint-validation.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/contenteditable.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/contentsecuritypolicy.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/contentsecuritypolicy2.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/cookie-store-api.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/cors.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/createimagebitmap.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/credential-management.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/cross-document-view-transitions.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/cryptography.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-all.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-anchor-positioning.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-animation.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-any-link.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-appearance.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-at-counter-style.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-autofill.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-backdrop-filter.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-background-offsets.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-backgroundblendmode.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-boxshadow.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-canvas.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-caret-color.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-cascade-layers.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-cascade-scope.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-case-insensitive.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-clip-path.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-color-adjust.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-color-function.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-conic-gradients.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-container-queries-style.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-container-queries.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-container-query-units.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-containment.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-content-visibility.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-counters.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-crisp-edges.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-cross-fade.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-default-pseudo.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-descendant-gtgt.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-deviceadaptation.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-dir-pseudo.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-display-contents.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-element-function.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-env-function.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-exclusions.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-featurequeries.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-file-selector-button.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-filter-function.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-filters.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-first-letter.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-first-line.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-fixed.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-focus-visible.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-focus-within.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-font-palette.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-font-rendering-controls.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-font-stretch.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-gencontent.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-gradients.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-grid-animation.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-grid-lanes.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-grid.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-hanging-punctuation.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-has.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-hyphens.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-if.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-image-orientation.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-image-set.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-in-out-of-range.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-indeterminate-pseudo.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-initial-letter.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-initial-value.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-lch-lab.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-letter-spacing.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-line-clamp.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-logical-props.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-marker-pseudo.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-masks.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-matches-pseudo.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-math-functions.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-media-interaction.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-media-range-syntax.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-media-resolution.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-media-scripting.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-mediaqueries.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-mixblendmode.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-module-scripts.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-motion-paths.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-namespaces.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-nesting.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-not-sel-list.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-nth-child-of.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-opacity.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-optional-pseudo.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-overflow-anchor.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-overflow-overlay.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-overflow.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-overscroll-behavior.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-page-break.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-paged-media.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-paint-api.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-placeholder-shown.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-placeholder.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-print-color-adjust.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-read-only-write.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-rebeccapurple.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-reflections.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-regions.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-relative-colors.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-repeating-gradients.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-resize.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-revert-value.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-rrggbbaa.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-scroll-behavior.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-scrollbar.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-sel2.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-sel3.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-selection.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-shapes.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-snappoints.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-sticky.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-subgrid.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-supports-api.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-table.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-text-align-last.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-text-box-trim.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-text-indent.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-text-justify.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-text-orientation.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-text-spacing.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-text-wrap-balance.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-textshadow.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-touch-action.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-transitions.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-unicode-bidi.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-unset-value.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-variables.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-when-else.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-widows-orphans.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-width-stretch.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-writing-mode.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css-zoom.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css3-attr.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css3-boxsizing.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css3-colors.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css3-cursors-grab.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css3-cursors-newer.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css3-cursors.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/css3-tabsize.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/currentcolor.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/custom-elements.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/custom-elementsv1.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/customevent.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/customizable-select.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/datalist.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/dataset.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/datauri.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/date-tolocaledatestring.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/declarative-shadow-dom.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/decorators.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/details.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/deviceorientation.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/devicepixelratio.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/dialog.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/dispatchevent.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/dnssec.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/do-not-track.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/document-currentscript.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/document-evaluate-xpath.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/document-execcommand.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/document-policy.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/document-scrollingelement.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/documenthead.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/dom-manip-convenience.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/dom-range.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/domcontentloaded.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/dommatrix.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/download.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/dragndrop.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/element-closest.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/element-from-point.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/element-scroll-methods.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/eme.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/eot.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/es5.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/es6-class.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/es6-generators.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/es6-module-dynamic-import.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/es6-module.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/es6-number.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/es6-string-includes.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/es6.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/eventsource.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/extended-system-fonts.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/feature-policy.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/fetch.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/fieldset-disabled.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/fileapi.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/filereader.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/filereadersync.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/filesystem.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/flac.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/flexbox-gap.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/flexbox.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/flow-root.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/focusin-focusout-events.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/font-family-system-ui.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/font-feature.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/font-kerning.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/font-loading.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/font-size-adjust.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/font-smooth.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/font-unicode-range.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/font-variant-alternates.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/font-variant-numeric.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/fontface.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/form-attribute.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/form-submit-attributes.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/form-validation.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/forms.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/fullscreen.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/gamepad.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/geolocation.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/getboundingclientrect.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/getcomputedstyle.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/getelementsbyclassname.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/getrandomvalues.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/gyroscope.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/hardwareconcurrency.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/hashchange.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/heif.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/hevc.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/hidden.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/high-resolution-time.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/history.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/html-media-capture.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/html5semantic.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/http-live-streaming.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/http2.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/http3.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/iframe-sandbox.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/iframe-seamless.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/iframe-srcdoc.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/imagecapture.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/ime.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/img-naturalwidth-naturalheight.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/import-maps.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/imports.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/indeterminate-checkbox.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/indexeddb.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/indexeddb2.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/inline-block.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/innertext.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-autocomplete-onoff.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-color.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-datetime.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-email-tel-url.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-event.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-file-accept.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-file-directory.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-file-multiple.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-inputmode.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-minlength.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-number.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-pattern.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-placeholder.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-range.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-search.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/input-selection.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/insert-adjacent.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/insertadjacenthtml.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/internationalization.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/intersectionobserver-v2.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/intersectionobserver.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/intl-pluralrules.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/intrinsic-width.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/jpeg2000.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/jpegxl.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/jpegxr.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/js-regexp-lookbehind.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/json.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/justify-content-space-evenly.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/kerning-pairs-ligatures.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/keyboardevent-charcode.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/keyboardevent-code.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/keyboardevent-getmodifierstate.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/keyboardevent-key.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/keyboardevent-location.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/keyboardevent-which.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/lazyload.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/let.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/link-icon-png.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/link-icon-svg.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/link-rel-dns-prefetch.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/link-rel-modulepreload.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/link-rel-preconnect.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/link-rel-prefetch.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/link-rel-preload.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/link-rel-prerender.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/loading-lazy-attr.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/loading-lazy-media.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/localecompare.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/magnetometer.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/matchesselector.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/matchmedia.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mathml.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/maxlength.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mdn-css-backdrop-pseudo-element.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mdn-text-decoration-color.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mdn-text-decoration-line.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mdn-text-decoration-shorthand.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mdn-text-decoration-style.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/media-fragments.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mediacapture-fromelement.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mediarecorder.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mediasource.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/menu.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/meta-theme-color.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/meter.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/midi.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/minmaxwh.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mp3.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mpeg-dash.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mpeg4.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/multibackgrounds.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/multicolumn.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mutation-events.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/mutationobserver.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/namevalue-storage.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/native-filesystem-api.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/nav-timing.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/netinfo.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/notifications.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/object-entries.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/object-fit.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/object-observe.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/object-values.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/objectrtc.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/offline-apps.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/offscreencanvas.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/ogg-vorbis.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/ogv.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/ol-reversed.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/once-event-listener.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/online-status.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/opus.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/orientation-sensor.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/outline.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/pad-start-end.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/page-transition-events.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/pagevisibility.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/passive-event-listener.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/passkeys.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/passwordrules.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/path2d.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/payment-request.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/pdf-viewer.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/permissions-api.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/permissions-policy.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/picture-in-picture.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/picture.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/ping.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/png-alpha.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/pointer-events.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/pointer.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/pointerlock.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/portals.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/prefers-color-scheme.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/prefers-reduced-motion.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/progress.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/promise-finally.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/promises.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/proximity.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/proxy.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/publickeypinning.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/push-api.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/queryselector.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/readonly-attr.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/referrer-policy.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/registerprotocolhandler.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/rel-noopener.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/rel-noreferrer.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/rellist.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/rem.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/requestanimationframe.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/requestidlecallback.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/resizeobserver.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/resource-timing.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/rest-parameters.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/rtcpeerconnection.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/ruby.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/run-in.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/same-site-cookie-attribute.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/screen-orientation.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/script-async.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/script-defer.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/scrollintoview.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/scrollintoviewifneeded.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/sdch.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/selection-api.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/server-timing.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/serviceworkers.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/setimmediate.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/shadowdom.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/shadowdomv1.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/sharedarraybuffer.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/sharedworkers.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/sni.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/spdy.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/speech-recognition.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/speech-synthesis.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/spellcheck-attribute.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/sql-storage.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/srcset.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/stream.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/streams.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/stricttransportsecurity.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/style-scoped.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/subresource-bundling.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/subresource-integrity.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/svg-css.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/svg-filters.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/svg-fonts.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/svg-fragment.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/svg-html.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/svg-html5.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/svg-img.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/svg-smil.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/svg.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/sxg.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/tabindex-attr.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/template-literals.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/template.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/temporal.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/testfeat.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/text-decoration.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/text-emphasis.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/text-overflow.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/text-size-adjust.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/text-stroke.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/textcontent.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/textencoder.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/tls1-1.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/tls1-2.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/tls1-3.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/touch.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/transforms2d.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/transforms3d.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/trusted-types.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/ttf.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/typedarrays.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/u2f.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/unhandledrejection.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/upgradeinsecurerequests.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/url-scroll-to-text-fragment.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/url.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/urlsearchparams.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/use-strict.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/user-select-none.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/user-timing.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/variable-fonts.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/vector-effect.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/vibration.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/video.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/videotracks.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/view-transitions.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/viewport-unit-variants.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/viewport-units.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wai-aria.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wake-lock.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-bigint.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-bulk-memory.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-extended-const.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-gc.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-multi-memory.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-multi-value.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-mutable-globals.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-nontrapping-fptoint.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-reference-types.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-relaxed-simd.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-signext.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-simd.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-tail-calls.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm-threads.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wasm.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wav.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wbr-element.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/web-animation.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/web-app-manifest.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/web-bluetooth.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/web-serial.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/web-share.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webauthn.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webcodecs.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webgl.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webgl2.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webgpu.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webhid.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webkit-user-drag.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webm.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webnfc.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webp.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/websockets.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webtransport.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webusb.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webvr.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webvtt.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webworkers.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/webxr.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/will-change.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/woff.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/woff2.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/word-break.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/wordwrap.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/x-doc-messaging.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/x-frame-options.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/xhr2.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/xhtml.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/xhtmlsmil.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/xml-serializer.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/features/zstd.js +1 -1
- package/runtime/node_modules/caniuse-lite/data/versionGroups.js +1 -1
- package/runtime/node_modules/caniuse-lite/package.json +1 -1
- package/runtime/package-lock.json +43 -38
- package/runtime/server.js +1 -1
- package/runtime/webapp/dist/assets/{AiHubPane-D3O__UGN.js → AiHubPane-D1SGdI6y.js} +1 -1
- package/runtime/webapp/dist/assets/{App-DJXr24vO.js → App-Y_UUrP8i.js} +57 -57
- package/runtime/webapp/dist/assets/{BrowserLivePanel-DEl_6FZj.js → BrowserLivePanel-CapyOwFL.js} +2 -2
- package/runtime/webapp/dist/assets/{CollaborationDashboard-DhLKl7mR.js → CollaborationDashboard-CEF41i5J.js} +1 -1
- package/runtime/webapp/dist/assets/CollaborationPage-C8PN5oNe.js +16 -0
- package/runtime/webapp/dist/assets/{FilePreview-BQBYZYpb.js → FilePreview-BdB8syBQ.js} +3 -3
- package/runtime/webapp/dist/assets/{FileTree-CXiXQO4N.js → FileTree-Cf8wDAVy.js} +1 -1
- package/runtime/webapp/dist/assets/{FlowStudioPane-DUjBX_7t.js → FlowStudioPane-DuUmV_ki.js} +1 -1
- package/runtime/webapp/dist/assets/{RemoteDesktopPage-BDK0Mq5I.js → RemoteDesktopPage-DBoSlmlh.js} +1 -1
- package/runtime/webapp/dist/assets/{TerminalPane-L6DN1Y0T.js → TerminalPane-B2s2ff23.js} +1 -1
- package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-Dloq4lbc.js → abnfDiagram-VCTEODGH-CQ78RP8v.js} +1 -1
- package/runtime/webapp/dist/assets/{arc-DdmNhDp9.js → arc-B4CNFgtV.js} +1 -1
- package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-BTqm_9oY.js → architectureDiagram-5GKGNRK7-B-pYUJdJ.js} +1 -1
- package/runtime/webapp/dist/assets/{artifact-links-BI9xeGhs.js → artifact-links-DrWFmMXT.js} +1 -1
- package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-jT-ztA_A.js → blockDiagram-I7D4REHJ-CEEpSPhh.js} +1 -1
- package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-DxX89YpZ.js → c4Diagram-7LVT6UL2-Bq7l-OxC.js} +1 -1
- package/runtime/webapp/dist/assets/channel-B0Az_kl0.js +1 -0
- package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-BgXNuFPn.js → chunk-2Q5K7J3B-B2yw0jQL.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-Bv7-4JNt.js → chunk-5VM5RSS4-D7AIGjlP.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-F27PBJKO-BNSskrgg.js → chunk-F27PBJKO-_wNxBMaG.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-C166MQKM.js → chunk-IMKFNOWR-bMSiSCLu.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-Bl1a_rZ8.js → chunk-JWPE2WC7-Zu8gSQip.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-Ck6xvnVw.js → chunk-POPQ4Y6H-8G7L6RqL.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-SVP7TREG-h6j1DDv5.js → chunk-SVP7TREG-a6VVTk08.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-TICWLB2K-BFafTq0K.js → chunk-TICWLB2K-ddeHMudM.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-BQPWRmrg.js → chunk-XXDRQBXY-DSuvta0Q.js} +1 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-HNxe_TWF.js +1 -0
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-HNxe_TWF.js +1 -0
- package/runtime/webapp/dist/assets/{clipboard-B2fwlVD5.js → clipboard-DS4Pu9OB.js} +1 -1
- package/runtime/webapp/dist/assets/{codeSyntax-VUYFxRDg.js → codeSyntax-BWSPpoSH.js} +1 -1
- package/runtime/webapp/dist/assets/{collaboration-CalhGKdD.js → collaboration-D7MlFa87.js} +1 -1
- package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-IgwThNmP.js → cose-bilkent-JH36ORCC-D1TkGbTC.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-kfamOzdb.js → cynefin-OW5HDTMX-CYPV2qwK.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-TVskTO_2.js → cynefinDiagram-5FMLGOSQ-DH8spH6U.js} +1 -1
- package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-DA85rDs9.js → dagre-GXQ25YYZ-Dkv69aQ5.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-CK0LkDfU.js → diagram-S7CK7UJ4-Gl094s_z.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-Bkskt6g2.js → diagram-UQ7AKVKN-DKzCe2K6.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-DN2UO2Hh.js → diagram-VSXAHHWV-Dq1LtLSa.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VX7I27RA-BLSOCEKl.js → diagram-VX7I27RA-CN9QKehv.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-DNr6MVnd.js → diagram-Z3DM3KII-1J67VxEA.js} +1 -1
- package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-CRASUUeC.js → ebnfDiagram-PWID7BFC-CRyJYtkK.js} +1 -1
- package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-1VwQNW79.js → erDiagram-RLTQ6QDP-C0jVGZ7x.js} +1 -1
- package/runtime/webapp/dist/assets/{file-types-MDD5RUla.js → file-types-Bi7YTERW.js} +1 -1
- package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-DzhiH-fC.js → flowDiagram-HODETNUW-wm5Kefw0.js} +1 -1
- package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-DH8HcfJq.js → ganttDiagram-EL5Y4UJY-DN5F7ix3.js} +1 -1
- package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-DYOG2d-R.js → gitGraphDiagram-WWUBYQGX-DcpXNY21.js} +1 -1
- package/runtime/webapp/dist/assets/{index-Bqpz5--c.js → index-Ddj6oQ7t.js} +3 -3
- package/runtime/webapp/dist/assets/index-hju2LxNM.css +1 -0
- package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-DOjkALCi.js → infoDiagram-27XIBGKW-B1iXrK9c.js} +1 -1
- package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-DBXZxz82.js → ishikawaDiagram-5VMMS53U-C1jZv655.js} +1 -1
- package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-DEpi9Fbd.js → journeyDiagram-3NMN7TZE-BRSFQ0r1.js} +1 -1
- package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-Chbcb2nn.js → kanban-definition-UXKFOSKX-Cl9je8cc.js} +1 -1
- package/runtime/webapp/dist/assets/{layout-0ld5oekM.js → layout-CKkSxSc4.js} +1 -1
- package/runtime/webapp/dist/assets/{linear-BCRtBckJ.js → linear-CC85eD8_.js} +1 -1
- package/runtime/webapp/dist/assets/{loader-circle-DGJsEr0r.js → loader-circle-C63zcjMg.js} +1 -1
- package/runtime/webapp/dist/assets/{mermaid.core-ByBSaE2T.js → mermaid.core-DIjc2ZR6.js} +5 -5
- package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-BW9I4Kuv.js → mindmap-definition-YA3MSWOX-mJUtqDVt.js} +1 -1
- package/runtime/webapp/dist/assets/{page-DVdz2jp6.js → page-bnT1btVj.js} +6 -6
- package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-D9oxCTQA.js → pegDiagram-XKGWAZYB-Dt3xAyl2.js} +1 -1
- package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-Ca4vPJj3.js → pieDiagram-E7YTZNPT-DleFmb0m.js} +1 -1
- package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-DM9Go2ES.js → quadrantDiagram-AXDQQJYC-BpeD8UfU.js} +1 -1
- package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-BinalW7_.js → railroadDiagram-O6MQD6OU-BBQ5ixic.js} +1 -1
- package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-C4KXL_m1.js → requirementDiagram-BXWQKSXE-xO5TSQS3.js} +1 -1
- package/runtime/webapp/dist/assets/{rotate-ccw-DrBaBbCR.js → rotate-ccw-AmWkL3kV.js} +1 -1
- package/runtime/webapp/dist/assets/{rotate-cw-Ccsl7hB3.js → rotate-cw-DrY9cGmB.js} +1 -1
- package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-Ba3vi6ln.js → sankeyDiagram-P5KCCOFB-Fyt0-RhU.js} +1 -1
- package/runtime/webapp/dist/assets/{send-OgOSXSRs.js → send-ATfKaKHb.js} +1 -1
- package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-DJzCQdxN.js → sequenceDiagram-WJ2MYXX4-xkFumv3g.js} +1 -1
- package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-DYsPME1d.js → sizeCapture-INFHLROL-Ch5NIy5j.js} +1 -1
- package/runtime/webapp/dist/assets/{smartphone-BaeWE4n-.js → smartphone-BL3ONtnq.js} +1 -1
- package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-D2prIqK-.js → stateDiagram-D77RDMKH-BYyhiW6f.js} +1 -1
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-BbZH2Sb9.js +1 -0
- package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-NODzX6Rz.js → swimlanes-42K2YHIH-Da71LrsA.js} +1 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-CxBioyEE.js +8 -0
- package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-CTh1zdtP.js → timeline-definition-24CTP7MA-BaXSS2__.js} +1 -1
- package/runtime/webapp/dist/assets/{trash-2-DoqYR_LW.js → trash-2-DBC-hIuM.js} +1 -1
- package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-DyjbbvAr.js → vennDiagram-4TSXK5OY-D_V4cbSG.js} +1 -1
- package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-BFWVhSKh.js → wardleyDiagram-VM6X3IG4-C-31z3KF.js} +1 -1
- package/runtime/webapp/dist/assets/{web-W_qr76-r.js → web-C3itPQLn.js} +1 -1
- package/runtime/webapp/dist/assets/{web-BeDKAt7R.js → web-Co-fisS2.js} +1 -1
- package/runtime/webapp/dist/assets/{x-Dp1u7spG.js → x-qYJy8CK-.js} +1 -1
- package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-CkRP6Drf.js → xychartDiagram-S5SC5T6Z-DKF--ymA.js} +1 -1
- package/runtime/webapp/dist/index.html +2 -2
- package/runtime/.next/static/chunks/app/web/layout-4e2120c7c4a57f7c.js +0 -1
- package/runtime/.next/static/chunks/app/web/page-aa406cbaa5109651.js +0 -1
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-50f20fv8.mjs +0 -40
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-x5tcx9zy.mjs +0 -52
- package/runtime/webapp/dist/assets/CollaborationPage-BCzxWWHA.js +0 -16
- package/runtime/webapp/dist/assets/channel-9wfiqrt1.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-CTD9Lt2V.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-CTD9Lt2V.js +0 -1
- package/runtime/webapp/dist/assets/index-WGJ3Mevp.css +0 -1
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-tpTQhbGu.js +0 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-CUH3ZqiP.js +0 -8
- /package/runtime/.next/static/{wybbbDbeFWOi1186WVCZe → 4yVGaJwabJff1LDiyzYia}/_buildManifest.js +0 -0
- /package/runtime/.next/static/{wybbbDbeFWOi1186WVCZe → 4yVGaJwabJff1LDiyzYia}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as oe}from"./chunk-XXDRQBXY-
|
|
1
|
+
import{g as oe}from"./chunk-XXDRQBXY-DSuvta0Q.js";import{s as ce}from"./chunk-POPQ4Y6H-8G7L6RqL.js";import{_ as h,l as R,u as le,v as he,y as de,B as W,c as U,i as H,b4 as ge,ac as ue,ad as pe,ae as fe}from"./mermaid.core-DIjc2ZR6.js";import"./index-Ddj6oQ7t.js";const _=[];for(let t=0;t<256;++t)_.push((t+256).toString(16).slice(1));function me(t,e=0){return(_[t[e+0]]+_[t[e+1]]+_[t[e+2]]+_[t[e+3]]+"-"+_[t[e+4]]+_[t[e+5]]+"-"+_[t[e+6]]+_[t[e+7]]+"-"+_[t[e+8]]+_[t[e+9]]+"-"+_[t[e+10]]+_[t[e+11]]+_[t[e+12]]+_[t[e+13]]+_[t[e+14]]+_[t[e+15]]).toLowerCase()}const ye=new Uint8Array(16);function Ee(){return crypto.getRandomValues(ye)}function _e(t,e,o){return crypto.randomUUID?crypto.randomUUID():be(t)}function be(t,e,o){var n;t=t||{};const l=t.random??((n=t.rng)==null?void 0:n.call(t))??Ee();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,me(l)}var K=function(){var t=h(function(O,s,i,a){for(i=i||{},a=O.length;a--;i[O[a]]=s);return i},"o"),e=[1,4],o=[1,13],l=[1,12],n=[1,15],d=[1,16],p=[1,20],y=[1,19],E=[6,7,8],k=[1,26],L=[1,24],D=[1,25],b=[6,7,11],$=[1,6,13,15,16,19,22],f=[1,33],B=[1,34],P=[1,6,7,11,13,15,16,19,22],z={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(s,i,a,c,u,r,M){var g=r.length-1;switch(u){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[g].id),c.addNode(r[g-1].length,r[g].id,r[g].descr,r[g].type);break;case 16:c.getLogger().trace("Icon: ",r[g]),c.decorateNode({icon:r[g]});break;case 17:case 21:c.decorateNode({class:r[g]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[g].id),c.addNode(0,r[g].id,r[g].descr,r[g].type);break;case 20:c.decorateNode({icon:r[g]});break;case 25:c.getLogger().trace("node found ..",r[g-2]),this.$={id:r[g-1],descr:r[g-1],type:c.getType(r[g-2],r[g])};break;case 26:this.$={id:r[g],descr:r[g],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[g-3]),this.$={id:r[g-3],descr:r[g-1],type:c.getType(r[g-2],r[g])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:o,7:[1,10],9:9,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t(E,[2,3]),{1:[2,2]},t(E,[2,4]),t(E,[2,5]),{1:[2,6],6:o,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:o,9:22,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:k,7:L,10:23,11:D},t(b,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:y}),t(b,[2,18]),t(b,[2,19]),t(b,[2,20]),t(b,[2,21]),t(b,[2,23]),t(b,[2,24]),t(b,[2,26],{19:[1,30]}),{20:[1,31]},{6:k,7:L,10:32,11:D},{1:[2,7],6:o,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t($,[2,14],{7:f,11:B}),t(P,[2,8]),t(P,[2,9]),t(P,[2,10]),t(b,[2,15]),t(b,[2,16]),t(b,[2,17]),{20:[1,35]},{21:[1,36]},t($,[2,13],{7:f,11:B}),t(P,[2,11]),t(P,[2,12]),{21:[1,37]},t(b,[2,25]),t(b,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,i){if(i.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=i,a}},"parseError"),parse:h(function(s){var i=this,a=[0],c=[],u=[null],r=[],M=this.table,g="",F=0,Q=0,ie=2,Z=1,se=r.slice.call(arguments,1),m=Object.create(this.lexer),C={yy:{}};for(var X in this.yy)Object.prototype.hasOwnProperty.call(this.yy,X)&&(C.yy[X]=this.yy[X]);m.setInput(s,C.yy),C.yy.lexer=m,C.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Y=m.yylloc;r.push(Y);var re=m.options&&m.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ae(x){a.length=a.length-2*x,u.length=u.length-x,r.length=r.length-x}h(ae,"popStack");function ee(){var x;return x=c.pop()||m.lex()||Z,typeof x!="number"&&(x instanceof Array&&(c=x,x=c.pop()),x=i.symbols_[x]||x),x}h(ee,"lex");for(var S,I,N,q,w={},G,v,te,j;;){if(I=a[a.length-1],this.defaultActions[I]?N=this.defaultActions[I]:((S===null||typeof S>"u")&&(S=ee()),N=M[I]&&M[I][S]),typeof N>"u"||!N.length||!N[0]){var J="";j=[];for(G in M[I])this.terminals_[G]&&G>ie&&j.push("'"+this.terminals_[G]+"'");m.showPosition?J="Parse error on line "+(F+1)+`:
|
|
2
2
|
`+m.showPosition()+`
|
|
3
3
|
Expecting `+j.join(", ")+", got '"+(this.terminals_[S]||S)+"'":J="Parse error on line "+(F+1)+": Unexpected "+(S==Z?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(J,{text:m.match,token:this.terminals_[S]||S,line:m.yylineno,loc:Y,expected:j})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+S);switch(N[0]){case 1:a.push(S),u.push(m.yytext),r.push(m.yylloc),a.push(N[1]),S=null,Q=m.yyleng,g=m.yytext,F=m.yylineno,Y=m.yylloc;break;case 2:if(v=this.productions_[N[1]][1],w.$=u[u.length-v],w._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},re&&(w._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),q=this.performAction.apply(w,[g,Q,F,C.yy,N[1],u,r].concat(se)),typeof q<"u")return q;v&&(a=a.slice(0,-1*v*2),u=u.slice(0,-1*v),r=r.slice(0,-1*v)),a.push(this.productions_[N[1]][0]),u.push(w.$),r.push(w._$),te=M[a[a.length-2]][a[a.length-1]],a.push(te);break;case 3:return!0}}return!0},"parse")},ne=function(){var O={EOF:1,parseError:h(function(i,a){if(this.yy.parser)this.yy.parser.parseError(i,a);else throw new Error(i)},"parseError"),setInput:h(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:h(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:h(function(s){var i=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===c.length?this.yylloc.first_column:0)+c[c.length-a.length].length-a[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:h(function(s){this.unput(this.match.slice(s))},"less"),pastInput:h(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TerminalPane-
|
|
2
|
-
import{c as dt,r as t,j as e,P as $e,f as Te,R as be,m as Ar,n as zr,o as Re,s as cr,p as Dr,b as Ne,q as Fe,t as Or,v as Wr,w as qt,x as _r,d as Fr,y as $r,U as ut,l as et,g as lr,z as dr,L as ur,D as pt,E as Ur,F as Br,G as Ht,I as qr,J as Hr,K as Vr,N as Kr,O as tt,Q as Gr,S as rt,T as Qe,V as Yr,X as Jr,Y as Xr,Z as Qr,_ as Zr,$ as Vt,a0 as Pe}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TerminalPane-B2s2ff23.js","./index-Ddj6oQ7t.js","./index-hju2LxNM.css","./clipboard-DS4Pu9OB.js","./smartphone-BL3ONtnq.js","./x-qYJy8CK-.js","./artifact-links-DrWFmMXT.js","./trash-2-DBC-hIuM.js","./CollaborationTabBridge-Dqnn1SXm.js","./RemoteDesktopTabBridge-Cp9mLtcY.js","./TerminalPane-6GBZ9nXN.css","./FileTree-Cf8wDAVy.js","./file-types-Bi7YTERW.js","./loader-circle-C63zcjMg.js","./FilePreview-BdB8syBQ.js","./rotate-ccw-AmWkL3kV.js","./FilePreview-Zls_kcY7.css","./AiHubPane-D1SGdI6y.js","./send-ATfKaKHb.js","./FlowStudioPane-DuUmV_ki.js","./rotate-cw-DrY9cGmB.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as dt,r as t,j as e,P as $e,f as Te,R as be,m as Ar,n as zr,o as Re,s as cr,p as Dr,b as Ne,q as Fe,t as Or,v as Wr,w as qt,x as _r,d as Fr,y as $r,U as ut,l as et,g as lr,z as dr,L as ur,D as pt,E as Ur,F as Br,G as Ht,I as qr,J as Hr,K as Vr,N as Kr,O as tt,Q as Gr,S as rt,T as Qe,V as Yr,X as Jr,Y as Xr,Z as Qr,_ as Zr,$ as Vt,a0 as Pe}from"./index-Ddj6oQ7t.js";import{S as pr,M as Kt,a as en,G as tn,C as rn,P as nn}from"./smartphone-BL3ONtnq.js";import{X as ke}from"./x-qYJy8CK-.js";import{C as nt,a as on,r as an,i as Gt}from"./artifact-links-DrWFmMXT.js";import{T as mt,P as ot,C as sn,A as cn}from"./trash-2-DBC-hIuM.js";import{E as ft,c as ln}from"./clipboard-DS4Pu9OB.js";import{r as dn,d as un,e as pn}from"./CollaborationTabBridge-Dqnn1SXm.js";import{c as mn,d as fn,R as hn,b as gn}from"./RemoteDesktopTabBridge-Cp9mLtcY.js";/**
|
|
3
3
|
* @license lucide-react v0.468.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
@@ -14,7 +14,7 @@ import{c as dt,r as t,j as e,P as $e,f as Te,R as be,m as Ar,n as zr,o as Re,s a
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the ISC license.
|
|
16
16
|
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/const wn=dt("TextCursorInput",[["path",{d:"M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1",key:"18xjzo"}],["path",{d:"M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5",key:"fj48gi"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M9 7v10",key:"1vc8ob"}]]);function Le(r,o){const a=t.lazy(r);return function(
|
|
17
|
+
*/const wn=dt("TextCursorInput",[["path",{d:"M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1",key:"18xjzo"}],["path",{d:"M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5",key:"fj48gi"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M9 7v10",key:"1vc8ob"}]]);function Le(r,o){const a=t.lazy(r);return function(l){var d;return e.jsx(t.Suspense,{fallback:((d=o==null?void 0:o.loading)==null?void 0:d.call(o))??null,children:e.jsx(a,{...l})})}}const xn={background:"color-mix(in srgb, var(--ui-tab-accent) 88%, var(--ui-text))",borderColor:"color-mix(in srgb, var(--ui-tab-accent) 88%, var(--ui-text))",color:"var(--ui-primary-text)"};function yn(){const[r,o]=t.useState(!1),[a,s]=t.useState(!1),[l,d]=t.useState(null),u=t.useRef(null);return t.useEffect(()=>{d(document.querySelector(".web-root")??document.body);const p=v=>{var C;return o(!!((C=v.detail)!=null&&C.installed))},j=()=>s(!0);return window.addEventListener("agentroam:pwa-state",p),window.addEventListener("agentroam:pwa-guide",j),window.dispatchEvent(new Event("agentroam:pwa-query")),()=>{window.removeEventListener("agentroam:pwa-state",p),window.removeEventListener("agentroam:pwa-guide",j)}},[]),t.useEffect(()=>{var p,j;a&&!((p=u.current)!=null&&p.open)&&((j=u.current)==null||j.showModal())},[a]),e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"file-drawer-toggle pwa-install-button",title:r?"已添加到主屏幕":"添加到主屏幕","aria-label":r?"已添加到主屏幕":"添加到主屏幕",onClick:()=>r?s(!0):window.dispatchEvent(new Event("agentroam:pwa-install")),children:e.jsxs("span",{style:{position:"relative",display:"flex"},children:[e.jsx(pr,{size:17,"aria-hidden":"true"}),e.jsx($e,{size:9,strokeWidth:3,"aria-hidden":"true",style:{position:"absolute",right:-4,bottom:-2}})]})}),a&&l&&Te.createPortal(e.jsxs("dialog",{ref:u,"data-toolbar-overlay":!0,onClose:()=>s(!1),"aria-labelledby":"pwa-install-title",style:{maxWidth:340,width:"calc(100% - 40px)",margin:"auto",padding:24,borderRadius:16,border:"1px solid var(--ui-tabbar-border)",background:"var(--ui-root-bg)",color:"var(--ui-text)",whiteSpace:"normal",font:"14px/1.8 system-ui"},children:[e.jsx("h2",{id:"pwa-install-title",style:{margin:"0 0 12px",fontSize:18},children:r?"已添加到主屏幕":"添加到主屏幕"}),r&&e.jsx("p",{children:"当前已在主屏幕应用中打开。"}),e.jsx("p",{children:"iPhone / iPad:在 Safari 点击分享按钮,选择“添加到主屏幕”,再点“添加”。"}),e.jsx("p",{children:"Android:打开浏览器菜单,选择“安装应用”或“添加到主屏幕”。"}),e.jsx("p",{style:{color:"var(--ui-muted-text)"},children:"浏览器需要你确认,网页无法自动添加。从主屏幕打开后,如提示未配对,请重新扫码。"}),e.jsx("button",{type:"button",style:{...xn,width:"100%",padding:"10px 14px",borderStyle:"solid",borderWidth:1,borderRadius:8,cursor:"pointer"},onClick:()=>{var p;return(p=u.current)==null?void 0:p.close()},children:"知道了"})]}),l)]})}const Yt={shared:"已共享",independent:"独立后台",failed:"连接失败",stopped:"桌面未启动","not-installed":"桌面未安装",unsupported:"暂不支持"};function vn({csrfToken:r}){const[o,a]=t.useState(null),[s,l]=t.useState(!1),d=t.useRef(!1),u=t.useRef(0),p=t.useCallback(async(c=!1,k=!1,T=!1)=>{var m;if(d.current)return;d.current=!0;const L=u.current;l(!0);try{const y=await fetch("/api/agent/codex-sharing",{method:c||k?"POST":"GET",credentials:"same-origin",cache:"no-store",headers:c||k?{"x-csrf-token":r,...k?{"content-type":"application/json"}:{}}:void 0,body:k?JSON.stringify({action:"share",restartConfirmed:T}):void 0,signal:AbortSignal.timeout(18e4)}),w=await y.json();if(!y.ok||!Object.hasOwn(Yt,w==null?void 0:w.state))throw new Error(((m=w==null?void 0:w.error)==null?void 0:m.message)||"共享状态读取失败,请重试。");if(L!==u.current)return;a(w)}catch(y){if(L!==u.current)return;a({state:"failed",configured:!1,autoStart:!1,daemonReachable:!1,runtimeMode:null,message:y instanceof Error?y.message:"无法连接当前电脑。"})}finally{d.current=!1,L===u.current&&l(!1)}},[r]);t.useEffect(()=>{p();const c=()=>{document.hidden||p()},k=window.setInterval(c,15e3);return window.addEventListener("online",c),()=>{u.current++,window.clearInterval(k),window.removeEventListener("online",c)}},[p]);const j=o?Yt[o.state]:"检查中",v=()=>{const c=(o==null?void 0:o.state)!=="stopped";c&&!window.confirm("切换将强制重启 Codex 桌面,中断桌面任务并可能丢失未发送内容,不再显示 Codex 退出确认框。共享后端和手机会话不会被结束。是否继续?")||p(!1,!0,c)},C=o&&o.state!=="unsupported"&&(o.state!=="shared"||!o.configured||!o.autoStart||!o.daemonReachable);return e.jsxs("div",{className:"codex-sharing",children:[e.jsx("style",{children:kn}),e.jsxs("div",{className:"codex-sharing-title",role:"status",children:[e.jsx("span",{className:"codex-sharing-indicator","aria-hidden":"true",children:e.jsx("span",{className:"codex-sharing-dot","data-state":o==null?void 0:o.state})}),e.jsxs("span",{children:["Codex · ",j]})]}),C&&e.jsxs(e.Fragment,{children:[e.jsx("p",{children:o.state==="shared"?"共享连接可用,启动配置需要修复。":o.message}),e.jsxs("div",{className:"codex-sharing-actions",children:[e.jsxs("button",{type:"button",disabled:s,onClick:()=>{p()},"aria-label":"刷新 Codex 共享状态",children:[e.jsx(be,{size:12}),"刷新"]}),e.jsx("button",{type:"button",disabled:s,onClick:()=>{p(!0)},children:s?"正在修复…":"检查并修复"}),!["shared","not-installed"].includes(o.state)&&e.jsx("button",{type:"button",disabled:s,onClick:v,children:s?"正在处理…":o.state==="stopped"?"以共享模式启动 Codex":"切换到共享后端"})]})]})]})}const kn=`
|
|
18
18
|
.codex-sharing{padding:10px 14px;margin-bottom:6px;border-bottom:1px solid var(--ui-tabbar-border,#303442);color:var(--ui-text,#e8e8ee);font-size:13px;line-height:20px}
|
|
19
19
|
.codex-sharing-title{display:flex;align-items:center;gap:10px}
|
|
20
20
|
.codex-sharing-indicator{display:grid;place-items:center;flex:0 0 17px;height:17px}
|
|
@@ -28,7 +28,7 @@ import{c as dt,r as t,j as e,P as $e,f as Te,R as be,m as Ar,n as zr,o as Re,s a
|
|
|
28
28
|
.codex-sharing-actions button:focus-visible{outline:2px solid var(--ui-tab-accent,#7aa2f7);outline-offset:3px}
|
|
29
29
|
.codex-sharing-actions button:disabled{opacity:.5;cursor:wait}
|
|
30
30
|
@media(pointer:coarse){.codex-sharing-actions button{min-height:44px}}
|
|
31
|
-
`;function jn({computerName:r,page:o,onClose:a,onSave:s}){const[c,d]=t.useState((o==null?void 0:o.name)??""),[u,p]=t.useState((o==null?void 0:o.url)??""),[j,y]=t.useState((o==null?void 0:o.openMode)??"current"),[v,l]=t.useState(!!o),[C,E]=t.useState(""),[P,m]=t.useState(!1),k=t.useRef(!1),x=t.useRef(null);return t.useEffect(()=>{var R,N;(N=(R=x.current)==null?void 0:R.querySelector("input"))==null||N.focus();const w=D=>{var H;if(D.key==="Escape"&&!k.current&&a(),D.key!=="Tab")return;const M=(H=x.current)==null?void 0:H.querySelectorAll("button:not(:disabled), input:not(:disabled), select:not(:disabled)");if(!(M!=null&&M.length))return;const X=M[0],B=M[M.length-1];D.shiftKey&&document.activeElement===X?(D.preventDefault(),B.focus()):!D.shiftKey&&document.activeElement===B&&(D.preventDefault(),X.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[a]),e.jsx("div",{className:"computer-dialog-backdrop","data-toolbar-overlay":!0,onClick:w=>{w.target===w.currentTarget&&!k.current&&a()},children:e.jsxs("section",{ref:x,className:"computer-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"computer-page-title",children:[e.jsxs("div",{className:"computer-dialog-heading",children:[e.jsx("h2",{id:"computer-page-title",children:o?"编辑页面":"添加页面"}),e.jsx("button",{type:"button",className:"computer-close","aria-label":"关闭",disabled:P,onClick:a,children:e.jsx(ke,{size:20})})]}),e.jsxs("p",{className:"computer-hint",children:["所属电脑:",r]}),e.jsxs("form",{onSubmit:async w=>{if(w.preventDefault(),!k.current){k.current=!0,m(!0),E("");try{const R=zr(u),N=(o==null?void 0:o.id)??Array.from(crypto.getRandomValues(new Uint8Array(16)),D=>D.toString(16).padStart(2,"0")).join("");await s({id:N,name:c.trim(),url:R,openMode:j})}catch(R){E(R.message)}finally{k.current=!1,m(!1)}}},children:[e.jsx("label",{htmlFor:"computer-page-name",children:"页面名称"}),e.jsx("input",{id:"computer-page-name",maxLength:60,required:!0,disabled:P,value:c,onChange:w=>d(w.target.value),placeholder:"例如:Zcode / Qoder",autoComplete:"off"}),e.jsx("label",{htmlFor:"computer-page-url",children:"页面地址"}),e.jsx("input",{id:"computer-page-url",required:!0,disabled:P,value:u,onChange:w=>{p(w.target.value),v||y(Ar(w.target.value))},placeholder:"https://…",autoComplete:"off",spellCheck:!1}),e.jsx("label",{htmlFor:"computer-page-mode",children:"打开方式"}),e.jsxs("select",{id:"computer-page-mode",disabled:P,value:j,onChange:w=>{y(w.target.value),l(!0)},children:[e.jsx("option",{value:"current",children:"当前页面打开,保留顶部图标栏"}),e.jsx("option",{value:"new-tab",children:"新页面打开,保留原会话页"})]}),e.jsx("p",{className:"computer-hint",children:"当前页面会显示网站自己的界面。若网站禁止内嵌(如 Qoder),可改为新页面打开。"}),C&&e.jsx("p",{className:"computer-error",role:"alert",children:C}),e.jsx("button",{type:"submit",className:"computer-action computer-primary",disabled:P||!c.trim()||!u.trim(),children:P?"正在保存…":"保存页面"})]})]})})}async function En(r,o){const a=new AbortController,s=()=>a.abort();if(o!=null&&o.aborted)return"offline";o==null||o.addEventListener("abort",s,{once:!0});const c=setTimeout(s,4e3);try{const d=new URL("/pwa/icon-192.png",r);d.searchParams.set("online",String(Date.now()));const u=await fetch(d,{mode:"no-cors",credentials:"omit",cache:"no-store",referrerPolicy:"no-referrer",signal:a.signal});return u.type==="opaque"||u.ok?"online":"offline"}catch{return"offline"}finally{clearTimeout(c),o==null||o.removeEventListener("abort",s)}}const Sn=20;function at(r){if(!Array.isArray(r)||r.length>Sn)throw new Error("最多可添加 20 台电脑。");const o=new Set;return r.map(a=>{if(!a||typeof a!="object"||Array.isArray(a)||Object.keys(a).some(c=>!["origin","name"].includes(c))||typeof a.origin!="string"||a.origin.length>2048)throw new Error("电脑地址无效。");let s;try{s=new URL(a.origin)}catch{throw new Error("电脑地址无效。")}if(!["http:","https:"].includes(s.protocol)||s.username||s.password||s.pathname!=="/"||s.search||s.hash||o.has(s.origin))throw new Error("电脑地址无效或重复。");if(typeof a.name!="string"||!a.name.trim()||a.name.trim().length>60)throw new Error("电脑名称需为 1–60 个字符。");return o.add(s.origin),{origin:s.origin,name:a.name.trim()}})}async function Jt(r,o="GET",a){var d;const s=await fetch("/api/web-console/computers",{method:o,credentials:"same-origin",cache:"no-store",headers:a?{"content-type":"application/json","x-csrf-token":r}:void 0,body:a?JSON.stringify(a):void 0,signal:AbortSignal.timeout(15e3)}).catch(()=>{throw new Error("无法连接当前电脑,请检查连接后重试。")}),c=await s.json().catch(()=>null);if(!s.ok)throw new Error(((d=c==null?void 0:c.error)==null?void 0:d.message)??"电脑列表保存失败,请重试。");return at(c==null?void 0:c.computers)}function Cn(r){const[o,a]=t.useState([]),[s,c]=t.useState(!1),[d,u]=t.useState(!1),[p,j]=t.useState(""),y=t.useRef(!0),v=t.useRef(!1),l=t.useRef(0),C=t.useRef(!1),E=t.useCallback(R=>{if(y.current){a(N=>N.length===R.length&&N.every((D,M)=>D.origin===R[M].origin&&D.name===R[M].name)?N:R),c(!0);try{const N=Re();cr(R.map(D=>({...N.find(M=>M.origin===D.origin),...D})))}catch{}}},[]),P=t.useCallback(async()=>{if(v.current)return;const R=++l.current;try{const N=C.current?void 0:Dr(Ne(),void 0).map(({origin:M,name:X})=>({origin:M,name:X})),D=await Jt(r,N?"POST":"GET",N?{computers:N}:void 0);if(!y.current||R!==l.current)return;C.current=!0,E(D),j("")}catch(N){y.current&&R===l.current&&j(N instanceof Error?N.message:"无法读取电脑列表。")}},[E,r]);t.useEffect(()=>{y.current=!0,P();const R=()=>{document.hidden||P()};window.addEventListener("focus",R),window.addEventListener("pageshow",R);const N=window.setInterval(R,15e3);return()=>{y.current=!1,l.current++,window.removeEventListener("focus",R),window.removeEventListener("pageshow",R),window.clearInterval(N)}},[P]);const m=t.useCallback(async(R,N)=>{if(!s||v.current)throw new Error("电脑列表尚未就绪,请稍后重试。");v.current=!0,l.current++,u(!0),j("");try{E(await Jt(r,R,N))}catch(D){const M=D instanceof Error?D.message:"电脑列表保存失败,请重试。";throw y.current&&j(M),new Error(M)}finally{v.current=!1,y.current&&u(!1)}},[E,r,s]),k=t.useCallback((R,N)=>m("PATCH",at([{origin:R,name:N}])[0]),[m]),x=t.useCallback(async R=>{if(new URL(R).origin===Ne())throw new Error("不能删除当前连接的电脑。");await m("DELETE",{origin:R})},[m]),w=t.useCallback((R,N)=>m("POST",{computers:at([{origin:R,name:N}]),restore:!0}),[m]);return{computers:o,loaded:s,saving:d,error:p,reload:P,rename:k,remove:x,add:w}}let Xt;function mr(){return window.jsQR?Promise.resolve():Xt||(Xt=new Promise((r,o)=>{const a=document.createElement("script");a.src="/pwa/qr-decoder.js";const s=()=>{clearTimeout(c),Xt=null,a.remove(),o(new Error("二维码识别器加载失败,请重试。"))},c=setTimeout(s,1e4);a.onload=()=>{clearTimeout(c),r()},a.onerror=s,document.head.append(a)}))}function st(){var r;return!!(window.isSecureContext&&((r=navigator.mediaDevices)!=null&&r.getUserMedia))}async function Tn(r){if(!r||r.type&&!r.type.startsWith("image/"))throw new Error("请选择二维码照片。");if(r.size>20*1024*1024)throw new Error("照片过大,请重新拍摄二维码。");await mr();const o=new Image,a=URL.createObjectURL(r);try{await new Promise((d,u)=>{const p=setTimeout(()=>u(new Error("照片加载超时,请重新拍摄。")),1e4);o.onload=()=>{clearTimeout(p),d()},o.onerror=()=>{clearTimeout(p),u(new Error("无法读取照片,请重新拍摄二维码。"))},o.src=a});const s=document.createElement("canvas"),c=s.getContext("2d",{willReadFrequently:!0});for(const d of[1600,1024,640]){const u=Math.min(1,d/Math.max(o.naturalWidth,o.naturalHeight));s.width=Math.max(1,Math.round(o.naturalWidth*u)),s.height=Math.max(1,Math.round(o.naturalHeight*u)),c.drawImage(o,0,0,s.width,s.height);const p=c.getImageData(0,0,s.width,s.height),j=window.jsQR(p.data,p.width,p.height);if(j)return j.data}throw new Error("照片中没有识别到二维码,请靠近电脑屏幕重新拍摄。")}finally{o.onload=null,o.onerror=null,URL.revokeObjectURL(a)}}function Rn(r,o,a){let s,c=0,d;const u=()=>{c++,clearTimeout(d),s==null||s.getTracks().forEach(v=>v.stop()),s=null,r.srcObject=null},p=(v,l)=>{v===c&&(u(),a((l==null?void 0:l.name)==="NotAllowedError"?"相机权限未开启,请允许相机或粘贴二维码链接。":(l==null?void 0:l.message)||"无法启动扫码,请重试。"))},j=async()=>{u();const v=c;if(!st()){a("实时扫码需要 HTTPS,请使用拍照扫码。");return}try{if(await mr(),v!==c)return;const l=await navigator.mediaDevices.getUserMedia({video:{facingMode:{ideal:"environment"}},audio:!1});if(v!==c){l.getTracks().forEach(k=>k.stop());return}s=l,r.srcObject=l;let C;try{await Promise.race([r.play(),new Promise((k,x)=>{C=setTimeout(()=>x(new Error("相机没有返回画面,请重试。")),1e4)})])}finally{clearTimeout(C)}if(v!==c)return;const E=document.createElement("canvas"),P=E.getContext("2d",{willReadFrequently:!0}),m=()=>{if(v===c)try{if(r.videoWidth&&r.videoHeight){E.width=Math.min(r.videoWidth,640),E.height=Math.round(r.videoHeight*E.width/r.videoWidth),P.drawImage(r,0,0,E.width,E.height);const k=P.getImageData(0,0,E.width,E.height),x=window.jsQR(k.data,k.width,k.height);if(x){u(),o(x.data);return}}d=setTimeout(m,250)}catch(k){u(),a((k==null?void 0:k.message)||"二维码识别失败,请重试。")}};m()}catch(l){p(v,l)}},y=()=>{document.hidden&&u()};return window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",y),{start:j,stop:u,dispose(){u(),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",y)}}}const Nn=[{id:"refresh",name:"刷新",Icon:be},{id:"collaboration",name:"群聊看板",Icon:ut},{id:"remote",name:"远程桌面",Icon:et},{id:"theme",name:"皮肤",Icon:lr},{id:"files",name:"文件树",Icon:dr},{id:"ai-hub",name:"AI Hub",Icon:ur},{id:"flow",name:"数字人",Icon:pt},{id:"install",name:"添加到主屏幕",Icon:pr}];function Pn({username:r,connected:o,accent:a,accentText:s,selectedPageId:c,onSelectPage:d,onUpdatePage:u,configuration:p,csrfToken:j}){const y=t.useRef(null),v=t.useRef(null),l=Cn(j),C=l.computers,[E,P]=t.useState(""),[m,k]=t.useState(null),[x,w]=t.useState(!1),[R,N]=t.useState("home"),[D,M]=t.useState(!1),[X,B]=t.useState({top:48,right:12}),[H,ne]=t.useState(null),[$,L]=t.useState(null),[A,S]=t.useState(""),[I,z]=t.useState({}),g=C.find(b=>b.origin===E),_=p.settings.savedPages??[];t.useEffect(()=>{var b;p.loaded&&c&&u(((b=p.settings.savedPages)==null?void 0:b.find(O=>O.id===c))??null)},[p.loaded,p.settings.savedPages,c,u]),t.useEffect(()=>{var Y;P(Ne()),k(((Y=y.current)==null?void 0:Y.closest(".web-root"))??document.body);const b=window.matchMedia("(max-width: 600px)"),O=()=>M(b.matches);return O(),b.addEventListener("change",O),()=>{b.removeEventListener("change",O)}},[]),t.useEffect(()=>{if(!x)return;const b=U=>{var V,G;!((V=v.current)!=null&&V.contains(U.target))&&!((G=y.current)!=null&&G.contains(U.target))&&w(!1)},O=U=>{var Ie,Me;if(U.key==="Escape"&&(w(!1),(Ie=y.current)==null||Ie.focus()),!D||U.key!=="Tab")return;const V=(Me=v.current)==null?void 0:Me.querySelectorAll("button:not(:disabled), input:not(:disabled)");if(!(V!=null&&V.length))return;const G=V[0],se=V[V.length-1];U.shiftKey&&document.activeElement===G?(U.preventDefault(),se.focus()):!U.shiftKey&&document.activeElement===se&&(U.preventDefault(),G.focus())},Y=()=>{var G;const U=(G=y.current)==null?void 0:G.getBoundingClientRect();if(!U)return;const V=Math.min(292,innerWidth-24);B({top:U.bottom+8,right:Math.max(12,Math.min(innerWidth-V-12,innerWidth-U.right))})};return document.addEventListener("pointerdown",b),document.addEventListener("keydown",O),window.addEventListener("resize",Y),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",O),window.removeEventListener("resize",Y)}},[x,D]),t.useEffect(()=>{var b,O;x&&((O=(b=v.current)==null?void 0:b.querySelector("button"))==null||O.focus())},[x,R]),t.useEffect(()=>{if(!x)return;const b=new AbortController,O=()=>{for(const U of C)U.origin!==E&&En(U.origin,b.signal).then(V=>{b.signal.aborted||z(G=>({...G,[U.origin]:V}))})};O();const Y=window.setInterval(O,15e3);return window.addEventListener("online",O),()=>{b.abort(),window.clearInterval(Y),window.removeEventListener("online",O)}},[x,C,E]);const K=t.useCallback(()=>{var b;ne(null),(b=y.current)==null||b.focus()},[]),ie=t.useCallback(()=>{var b;L(null),(b=y.current)==null||b.focus()},[]),F=t.useCallback(async(b,O)=>{var G;if(Fe()){await Fe().pair(b);return}const Y=Or(b),U={origin:Y.origin,name:O.trim()||((G=C.find(se=>se.origin===Y.origin))==null?void 0:G.name)||Y.hostname},V=Wr(b,qt(Re(),C,[U]),O);await l.add(U.origin,U.name),location.assign(V)},[C,l.add]),ee=t.useCallback(async b=>{await l.rename(Ne(),b),K()},[K,l.rename]);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:In}),e.jsxs("div",{className:"theme-avatar-with-status",children:[e.jsx("button",{ref:y,type:"button",className:"theme-avatar","aria-label":`电脑与连接状态(${r})`,title:r,style:{border:`1px solid ${a}`,background:a,color:s},"aria-expanded":x,"aria-haspopup":"true",onClick:()=>{const b=y.current.getBoundingClientRect(),O=Math.min(292,innerWidth-24);B({top:b.bottom+8,right:Math.max(12,Math.min(innerWidth-O-12,innerWidth-b.right))}),x||(N("home"),S(""),p.reload(),l.reload()),w(Y=>!Y)},children:(r.trim()[0]??"?").toUpperCase()}),e.jsx("span",{className:"theme-avatar-status","data-connected":o,"aria-label":o?"已连接":"未连接"})]}),x&&m&&Te.createPortal(e.jsx("div",{className:"computer-menu-backdrop","data-toolbar-overlay":!0,children:e.jsxs("div",{ref:v,className:"computer-menu",style:D?void 0:X,role:"dialog","aria-modal":D,"aria-label":R==="tools"?"配置顶部工具":R==="computers"?"选择电脑":"电脑与保存页面",children:[e.jsx("div",{className:"computer-menu-grip","aria-hidden":"true"}),e.jsxs("div",{className:"computer-menu-heading",children:[R!=="home"&&e.jsx("button",{type:"button",className:"computer-close","aria-label":"返回电脑菜单",onClick:()=>N("home"),children:e.jsx(_r,{size:20})}),R==="home"?e.jsxs("button",{type:"button",className:"computer-menu-item computer-current","aria-label":"选择电脑",onClick:()=>N("computers"),children:[e.jsx(Kt,{size:17}),e.jsxs("span",{children:[e.jsx("strong",{children:(g==null?void 0:g.name)||"当前电脑"}),e.jsx("small",{children:o?"当前 · 在线":"当前 · 未连接"})]}),e.jsx(Fr,{size:16})]}):e.jsx("strong",{children:R==="tools"?`${(g==null?void 0:g.name)||"当前电脑"} · 顶部工具`:"选择电脑"}),e.jsx("button",{type:"button",className:"computer-close","aria-label":"关闭电脑菜单",onClick:()=>{var b;w(!1),(b=y.current)==null||b.focus()},children:e.jsx(ke,{size:20})})]}),R==="computers"&&e.jsxs(e.Fragment,{children:[!l.loaded&&e.jsx("p",{className:"computer-save-status",role:"status",children:l.error?"电脑列表尚未加载":"正在读取电脑列表…"}),C.map(b=>{const O=b.origin===E?o?"online":"offline":I[b.origin]??"checking",Y=O==="online"?"在线":O==="offline"?"无法连接":"检测中";return e.jsxs("div",{className:"computer-menu-row",children:[e.jsxs("button",{type:"button",className:"computer-menu-item","data-computer-origin":b.origin,"aria-label":`${b.name},${Y}${b.origin===E?",当前电脑":""}`,"aria-current":b.origin===E?"true":void 0,onClick:()=>{if(b.origin===E)N("home");else try{const U=Fe();U?U.switchComputer(b.origin).catch(V=>S(V.message)):location.assign($r(b.origin,qt(Re(),C)))}catch(U){S(U.message)}},children:[e.jsx(Kt,{size:17,"aria-hidden":"true"}),e.jsxs("span",{children:[e.jsx("strong",{children:b.name}),e.jsx("small",{children:b.origin})]}),e.jsx("span",{className:"computer-status-dot","data-status":O,role:"img","aria-label":Y,title:Y}),b.origin===E&&e.jsx(nt,{size:16,"aria-label":"当前电脑"})]}),b.origin!==E&&e.jsx("button",{type:"button",className:"computer-page-control computer-delete-control","aria-label":`删除电脑:${b.name}`,title:`删除电脑:${b.name}`,disabled:l.saving,onClick:()=>{l.remove(b.origin).catch(()=>{})},children:e.jsx(mt,{size:15})})]},b.origin)}),e.jsx("div",{className:"computer-menu-divider"}),e.jsxs("button",{type:"button",className:"computer-menu-item",disabled:!l.loaded||l.saving,onClick:()=>{const b=Fe();b?b.scan().catch(O=>S(O.message)):(w(!1),ne("add"))},children:[e.jsx($e,{size:17,"aria-hidden":"true"}),e.jsx("span",{children:"扫码添加电脑"})]}),e.jsxs("button",{type:"button",className:"computer-menu-item",disabled:!l.loaded||l.saving||!g,onClick:()=>{w(!1),ne("rename")},children:[e.jsx(ot,{size:16,"aria-hidden":"true"}),e.jsx("span",{children:"修改当前电脑名称"})]}),l.error&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"computer-error",role:"alert",children:l.error}),e.jsxs("button",{type:"button",className:"computer-menu-item",onClick:()=>{l.reload()},children:[e.jsx(be,{size:16}),e.jsx("span",{children:"重新加载电脑列表"})]})]})]}),R==="home"&&e.jsxs(e.Fragment,{children:[e.jsx(vn,{csrfToken:j}),e.jsxs("div",{className:"computer-menu-label computer-pages-heading",children:[e.jsx("span",{children:"保存的页面"}),e.jsx("button",{type:"button",className:"computer-page-control","aria-label":"添加页面",disabled:!p.loaded||p.saving,onClick:()=>{w(!1),L({computer:g??{origin:E,name:"当前电脑"}})},children:e.jsx($e,{size:17})})]}),e.jsxs("button",{type:"button",className:"computer-menu-item","aria-current":c?void 0:"true",onClick:()=>{w(!1),d(null)},children:[e.jsx(bn,{size:17}),e.jsx("span",{children:"电脑会话"}),!c&&e.jsx(nt,{size:16})]}),_.map(b=>e.jsxs("div",{className:"computer-menu-row",children:[e.jsxs("button",{type:"button",className:"computer-menu-item","aria-label":`打开 ${b.name}`,"aria-current":c===b.id?"true":void 0,onClick:()=>{w(!1),d(b)},children:[e.jsx(it,{size:15,"aria-hidden":"true"}),e.jsxs("span",{children:[e.jsx("strong",{children:b.name}),e.jsxs("small",{children:[b.openMode==="current"?"当前页面":"新页面"," · ",new URL(b.url).hostname]})]}),b.openMode==="new-tab"&&e.jsx(ft,{size:13,"aria-hidden":"true"})]}),e.jsx("button",{type:"button",className:"computer-page-control","aria-label":`编辑 ${b.name}`,disabled:p.saving,onClick:()=>{w(!1),L({computer:g??{origin:E,name:"当前电脑"},page:b})},children:e.jsx(ot,{size:14})}),e.jsx("button",{type:"button",className:"computer-page-control","aria-label":`删除 ${b.name}`,disabled:p.saving,onClick:()=>{p.setSavedPages(_.filter(O=>O.id!==b.id)).catch(()=>{})},children:e.jsx(ke,{size:15})})]},b.id)),e.jsx("div",{className:"computer-menu-divider"}),e.jsxs("button",{type:"button",className:"computer-menu-item",onClick:()=>N("tools"),children:[e.jsx(en,{size:17}),e.jsx("span",{children:"配置顶部工具"}),e.jsx(sn,{size:16})]})]}),R==="tools"&&e.jsx("div",{className:"computer-tools-list",children:Nn.map(({id:b,name:O,Icon:Y})=>e.jsxs("label",{className:"computer-tool-option",children:[e.jsx(Y,{size:17,"aria-hidden":"true"}),e.jsx("span",{children:O}),e.jsx("input",{type:"checkbox","aria-label":`显示${O}`,checked:p.settings.visibleTools.includes(b),disabled:!p.loaded||p.saving,onChange:U=>{const V=p.settings.visibleTools;p.setVisibleTools(U.target.checked?[...V,b]:V.filter(G=>G!==b)).catch(()=>{})}})]},b))}),R!=="computers"&&e.jsx("p",{className:"computer-save-status",role:"status",children:p.loaded?p.saving?"正在保存…":p.notice:p.error?"配置尚未加载":"正在读取电脑配置…"}),p.error&&R!=="computers"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"computer-error",role:"alert",children:p.error}),e.jsxs("button",{type:"button",className:"computer-menu-item",onClick:()=>{p.reload()},children:[e.jsx(be,{size:16}),e.jsx("span",{children:"重新加载配置"})]})]}),A&&e.jsx("p",{className:"computer-error",role:"alert",children:A})]})}),m),H&&m&&Te.createPortal(e.jsx(Ln,{mode:H,currentName:(g==null?void 0:g.name)||"",onClose:K,onNavigate:F,onRename:ee}),m),$&&m&&Te.createPortal(e.jsx(jn,{computerName:$.computer.name,page:$.page,onClose:ie,onSave:async b=>{if($.page&&!_.some(O=>O.id===b.id))throw new Error("这个页面已在其他设备删除,请重新添加。");await p.setSavedPages($.page?_.map(O=>O.id===b.id?b:O):[..._,b]),ie()}}),m)]})}function Ln({mode:r,currentName:o,onClose:a,onNavigate:s,onRename:c}){const[d,u]=t.useState(r==="rename"?o:""),p=t.useRef(d);p.current=d;const[j,y]=t.useState(""),[v,l]=t.useState(""),[C,E]=t.useState(!1),[P,m]=t.useState(!1),[k,x]=t.useState(!1),[w,R]=t.useState(!1),N=t.useRef(null),D=t.useRef(null),M=t.useRef(0),X=t.useRef(null),B=t.useRef(null),H=t.useRef(null),ne=t.useCallback(async $=>{var L;E(!0),(L=H.current)==null||L.stop(),m(!1),l("");try{await s($,p.current)}catch(A){l(A.message)}finally{E(!1)}},[s]);return t.useEffect(()=>{var A,S,I;x(st()),r==="rename"?(A=X.current)==null||A.focus():(I=(S=B.current)==null?void 0:S.querySelector("button"))==null||I.focus();const $=z=>{var ie;if(z.key==="Escape"&&a(),z.key!=="Tab")return;const g=(ie=B.current)==null?void 0:ie.querySelectorAll("button:not(:disabled), input:not(:disabled)");if(!(g!=null&&g.length))return;const _=g[0],K=g[g.length-1];z.shiftKey&&document.activeElement===_?(z.preventDefault(),K.focus()):!z.shiftKey&&document.activeElement===K&&(z.preventDefault(),_.focus())},L=()=>{document.hidden&&m(!1)};return document.addEventListener("keydown",$),document.addEventListener("visibilitychange",L),r==="add"&&N.current&&(H.current=Rn(N.current,ne,z=>{m(!1),l(z)})),()=>{var z;M.current++,document.removeEventListener("keydown",$),document.removeEventListener("visibilitychange",L),(z=H.current)==null||z.dispose(),H.current=null}},[r,ne,a]),e.jsx("div",{className:"computer-dialog-backdrop","data-toolbar-overlay":!0,onClick:$=>{$.target===$.currentTarget&&a()},children:e.jsxs("section",{ref:B,className:"computer-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"computer-dialog-title",children:[e.jsxs("div",{className:"computer-dialog-heading",children:[e.jsx("h2",{id:"computer-dialog-title",children:r==="add"?"添加电脑":"修改电脑名称"}),e.jsx("button",{type:"button",className:"computer-close","aria-label":"关闭",onClick:a,children:e.jsx(ke,{size:20})})]}),e.jsxs("form",{onSubmit:async $=>{if($.preventDefault(),!C)if(r==="add")await ne(j);else{E(!0);try{await c(d.trim())}catch(L){l(L.message)}finally{E(!1)}}},children:[e.jsxs("label",{htmlFor:"computer-name",children:["电脑名称",r==="add"?"(选填)":""]}),e.jsx("input",{ref:X,id:"computer-name",maxLength:60,value:d,required:r==="rename",disabled:C,onChange:$=>u($.target.value),placeholder:"例如:A 电脑 / 家里的电脑",autoComplete:"off"}),r==="add"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"computer-hint",children:"扫描另一台电脑上的 AgentRoam 授权二维码,连接后会保留已有电脑。"}),e.jsx("input",{ref:D,type:"file",accept:"image/*",capture:"environment",hidden:!0,"aria-label":"拍摄授权二维码",onChange:async $=>{var S,I;const L=(S=$.currentTarget.files)==null?void 0:S[0];if($.currentTarget.value="",!L)return;const A=++M.current;(I=H.current)==null||I.stop(),m(!1),R(!0),l("");try{const z=await Tn(L);A===M.current&&ne(z)}catch(z){A===M.current&&l(z.message)}finally{A===M.current&&R(!1)}}}),e.jsx("video",{ref:N,playsInline:!0,muted:!0,hidden:!P,"aria-label":"扫码相机画面"}),e.jsxs("button",{className:"computer-action",type:"button",disabled:w,onClick:()=>{var $,L,A;l(""),P?(($=H.current)==null||$.stop(),m(!1)):st()?(m(!0),(A=H.current)==null||A.start()):(L=D.current)==null||L.click()},children:[e.jsx(Ur,{size:17,"aria-hidden":"true"}),w?"正在识别二维码…":P?"取消扫码":k?"打开相机扫码":"拍照扫码"]}),k&&e.jsx("button",{className:"computer-action",type:"button",disabled:w,onClick:()=>{var $,L;($=H.current)==null||$.stop(),m(!1),(L=D.current)==null||L.click()},children:"拍照识别二维码"}),e.jsx("label",{htmlFor:"computer-link",children:"或粘贴授权二维码链接"}),e.jsx("input",{id:"computer-link",value:j,onChange:$=>y($.target.value),placeholder:"http(s)://…/pair#pair=…",autoComplete:"off",spellCheck:!1})]}),v&&e.jsx("p",{className:"computer-error",role:"alert",children:v}),e.jsx("button",{className:"computer-action computer-primary",type:"submit",disabled:C||(r==="add"?!j.trim()||w:!d.trim()),children:r==="add"?"连接这台电脑":C?"正在保存…":"保存名称"})]})]})})}const In=`
|
|
31
|
+
`;function jn({computerName:r,page:o,onClose:a,onSave:s}){const[l,d]=t.useState((o==null?void 0:o.name)??""),[u,p]=t.useState((o==null?void 0:o.url)??""),[j,v]=t.useState((o==null?void 0:o.openMode)??"current"),[C,c]=t.useState(!!o),[k,T]=t.useState(""),[L,m]=t.useState(!1),y=t.useRef(!1),w=t.useRef(null);return t.useEffect(()=>{var R,N;(N=(R=w.current)==null?void 0:R.querySelector("input"))==null||N.focus();const x=D=>{var H;if(D.key==="Escape"&&!y.current&&a(),D.key!=="Tab")return;const M=(H=w.current)==null?void 0:H.querySelectorAll("button:not(:disabled), input:not(:disabled), select:not(:disabled)");if(!(M!=null&&M.length))return;const X=M[0],B=M[M.length-1];D.shiftKey&&document.activeElement===X?(D.preventDefault(),B.focus()):!D.shiftKey&&document.activeElement===B&&(D.preventDefault(),X.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[a]),e.jsx("div",{className:"computer-dialog-backdrop","data-toolbar-overlay":!0,onClick:x=>{x.target===x.currentTarget&&!y.current&&a()},children:e.jsxs("section",{ref:w,className:"computer-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"computer-page-title",children:[e.jsxs("div",{className:"computer-dialog-heading",children:[e.jsx("h2",{id:"computer-page-title",children:o?"编辑页面":"添加页面"}),e.jsx("button",{type:"button",className:"computer-close","aria-label":"关闭",disabled:L,onClick:a,children:e.jsx(ke,{size:20})})]}),e.jsxs("p",{className:"computer-hint",children:["所属电脑:",r]}),e.jsxs("form",{onSubmit:async x=>{if(x.preventDefault(),!y.current){y.current=!0,m(!0),T("");try{const R=zr(u),N=(o==null?void 0:o.id)??Array.from(crypto.getRandomValues(new Uint8Array(16)),D=>D.toString(16).padStart(2,"0")).join("");await s({id:N,name:l.trim(),url:R,openMode:j})}catch(R){T(R.message)}finally{y.current=!1,m(!1)}}},children:[e.jsx("label",{htmlFor:"computer-page-name",children:"页面名称"}),e.jsx("input",{id:"computer-page-name",maxLength:60,required:!0,disabled:L,value:l,onChange:x=>d(x.target.value),placeholder:"例如:Zcode / Qoder",autoComplete:"off"}),e.jsx("label",{htmlFor:"computer-page-url",children:"页面地址"}),e.jsx("input",{id:"computer-page-url",required:!0,disabled:L,value:u,onChange:x=>{p(x.target.value),C||v(Ar(x.target.value))},placeholder:"https://…",autoComplete:"off",spellCheck:!1}),e.jsx("label",{htmlFor:"computer-page-mode",children:"打开方式"}),e.jsxs("select",{id:"computer-page-mode",disabled:L,value:j,onChange:x=>{v(x.target.value),c(!0)},children:[e.jsx("option",{value:"current",children:"当前页面打开,保留顶部图标栏"}),e.jsx("option",{value:"new-tab",children:"新页面打开,保留原会话页"})]}),e.jsx("p",{className:"computer-hint",children:"当前页面会显示网站自己的界面。若网站禁止内嵌(如 Qoder),可改为新页面打开。"}),k&&e.jsx("p",{className:"computer-error",role:"alert",children:k}),e.jsx("button",{type:"submit",className:"computer-action computer-primary",disabled:L||!l.trim()||!u.trim(),children:L?"正在保存…":"保存页面"})]})]})})}async function En(r,o){const a=new AbortController,s=()=>a.abort();if(o!=null&&o.aborted)return"offline";o==null||o.addEventListener("abort",s,{once:!0});const l=setTimeout(s,4e3);try{const d=new URL("/pwa/icon-192.png",r);d.searchParams.set("online",String(Date.now()));const u=await fetch(d,{mode:"no-cors",credentials:"omit",cache:"no-store",referrerPolicy:"no-referrer",signal:a.signal});return u.type==="opaque"||u.ok?"online":"offline"}catch{return"offline"}finally{clearTimeout(l),o==null||o.removeEventListener("abort",s)}}const Sn=20;function at(r){if(!Array.isArray(r)||r.length>Sn)throw new Error("最多可添加 20 台电脑。");const o=new Set;return r.map(a=>{if(!a||typeof a!="object"||Array.isArray(a)||Object.keys(a).some(l=>!["origin","name"].includes(l))||typeof a.origin!="string"||a.origin.length>2048)throw new Error("电脑地址无效。");let s;try{s=new URL(a.origin)}catch{throw new Error("电脑地址无效。")}if(!["http:","https:"].includes(s.protocol)||s.username||s.password||s.pathname!=="/"||s.search||s.hash||o.has(s.origin))throw new Error("电脑地址无效或重复。");if(typeof a.name!="string"||!a.name.trim()||a.name.trim().length>60)throw new Error("电脑名称需为 1–60 个字符。");return o.add(s.origin),{origin:s.origin,name:a.name.trim()}})}async function Jt(r,o="GET",a){var d;const s=await fetch("/api/web-console/computers",{method:o,credentials:"same-origin",cache:"no-store",headers:a?{"content-type":"application/json","x-csrf-token":r}:void 0,body:a?JSON.stringify(a):void 0,signal:AbortSignal.timeout(15e3)}).catch(()=>{throw new Error("无法连接当前电脑,请检查连接后重试。")}),l=await s.json().catch(()=>null);if(!s.ok)throw new Error(((d=l==null?void 0:l.error)==null?void 0:d.message)??"电脑列表保存失败,请重试。");return at(l==null?void 0:l.computers)}function Cn(r){const[o,a]=t.useState([]),[s,l]=t.useState(!1),[d,u]=t.useState(!1),[p,j]=t.useState(""),v=t.useRef(!0),C=t.useRef(!1),c=t.useRef(0),k=t.useRef(!1),T=t.useCallback(R=>{if(v.current){a(N=>N.length===R.length&&N.every((D,M)=>D.origin===R[M].origin&&D.name===R[M].name)?N:R),l(!0);try{const N=Re();cr(R.map(D=>({...N.find(M=>M.origin===D.origin),...D})))}catch{}}},[]),L=t.useCallback(async()=>{if(C.current)return;const R=++c.current;try{const N=k.current?void 0:Dr(Ne(),void 0).map(({origin:M,name:X})=>({origin:M,name:X})),D=await Jt(r,N?"POST":"GET",N?{computers:N}:void 0);if(!v.current||R!==c.current)return;k.current=!0,T(D),j("")}catch(N){v.current&&R===c.current&&j(N instanceof Error?N.message:"无法读取电脑列表。")}},[T,r]);t.useEffect(()=>{v.current=!0,L();const R=()=>{document.hidden||L()};window.addEventListener("focus",R),window.addEventListener("pageshow",R);const N=window.setInterval(R,15e3);return()=>{v.current=!1,c.current++,window.removeEventListener("focus",R),window.removeEventListener("pageshow",R),window.clearInterval(N)}},[L]);const m=t.useCallback(async(R,N)=>{if(!s||C.current)throw new Error("电脑列表尚未就绪,请稍后重试。");C.current=!0,c.current++,u(!0),j("");try{T(await Jt(r,R,N))}catch(D){const M=D instanceof Error?D.message:"电脑列表保存失败,请重试。";throw v.current&&j(M),new Error(M)}finally{C.current=!1,v.current&&u(!1)}},[T,r,s]),y=t.useCallback((R,N)=>m("PATCH",at([{origin:R,name:N}])[0]),[m]),w=t.useCallback(async R=>{if(new URL(R).origin===Ne())throw new Error("不能删除当前连接的电脑。");await m("DELETE",{origin:R})},[m]),x=t.useCallback((R,N)=>m("POST",{computers:at([{origin:R,name:N}]),restore:!0}),[m]);return{computers:o,loaded:s,saving:d,error:p,reload:L,rename:y,remove:w,add:x}}let Xt;function mr(){return window.jsQR?Promise.resolve():Xt||(Xt=new Promise((r,o)=>{const a=document.createElement("script");a.src="/pwa/qr-decoder.js";const s=()=>{clearTimeout(l),Xt=null,a.remove(),o(new Error("二维码识别器加载失败,请重试。"))},l=setTimeout(s,1e4);a.onload=()=>{clearTimeout(l),r()},a.onerror=s,document.head.append(a)}))}function st(){var r;return!!(window.isSecureContext&&((r=navigator.mediaDevices)!=null&&r.getUserMedia))}async function Tn(r){if(!r||r.type&&!r.type.startsWith("image/"))throw new Error("请选择二维码照片。");if(r.size>20*1024*1024)throw new Error("照片过大,请重新拍摄二维码。");await mr();const o=new Image,a=URL.createObjectURL(r);try{await new Promise((d,u)=>{const p=setTimeout(()=>u(new Error("照片加载超时,请重新拍摄。")),1e4);o.onload=()=>{clearTimeout(p),d()},o.onerror=()=>{clearTimeout(p),u(new Error("无法读取照片,请重新拍摄二维码。"))},o.src=a});const s=document.createElement("canvas"),l=s.getContext("2d",{willReadFrequently:!0});for(const d of[1600,1024,640]){const u=Math.min(1,d/Math.max(o.naturalWidth,o.naturalHeight));s.width=Math.max(1,Math.round(o.naturalWidth*u)),s.height=Math.max(1,Math.round(o.naturalHeight*u)),l.drawImage(o,0,0,s.width,s.height);const p=l.getImageData(0,0,s.width,s.height),j=window.jsQR(p.data,p.width,p.height);if(j)return j.data}throw new Error("照片中没有识别到二维码,请靠近电脑屏幕重新拍摄。")}finally{o.onload=null,o.onerror=null,URL.revokeObjectURL(a)}}function Rn(r,o,a){let s,l=0,d;const u=()=>{l++,clearTimeout(d),s==null||s.getTracks().forEach(C=>C.stop()),s=null,r.srcObject=null},p=(C,c)=>{C===l&&(u(),a((c==null?void 0:c.name)==="NotAllowedError"?"相机权限未开启,请允许相机或粘贴二维码链接。":(c==null?void 0:c.message)||"无法启动扫码,请重试。"))},j=async()=>{u();const C=l;if(!st()){a("实时扫码需要 HTTPS,请使用拍照扫码。");return}try{if(await mr(),C!==l)return;const c=await navigator.mediaDevices.getUserMedia({video:{facingMode:{ideal:"environment"}},audio:!1});if(C!==l){c.getTracks().forEach(y=>y.stop());return}s=c,r.srcObject=c;let k;try{await Promise.race([r.play(),new Promise((y,w)=>{k=setTimeout(()=>w(new Error("相机没有返回画面,请重试。")),1e4)})])}finally{clearTimeout(k)}if(C!==l)return;const T=document.createElement("canvas"),L=T.getContext("2d",{willReadFrequently:!0}),m=()=>{if(C===l)try{if(r.videoWidth&&r.videoHeight){T.width=Math.min(r.videoWidth,640),T.height=Math.round(r.videoHeight*T.width/r.videoWidth),L.drawImage(r,0,0,T.width,T.height);const y=L.getImageData(0,0,T.width,T.height),w=window.jsQR(y.data,y.width,y.height);if(w){u(),o(w.data);return}}d=setTimeout(m,250)}catch(y){u(),a((y==null?void 0:y.message)||"二维码识别失败,请重试。")}};m()}catch(c){p(C,c)}},v=()=>{document.hidden&&u()};return window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",v),{start:j,stop:u,dispose(){u(),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",v)}}}const Nn=[{id:"refresh",name:"刷新",Icon:be},{id:"collaboration",name:"群聊看板",Icon:ut},{id:"remote",name:"远程桌面",Icon:et},{id:"theme",name:"皮肤",Icon:lr},{id:"files",name:"文件树",Icon:dr},{id:"ai-hub",name:"AI Hub",Icon:ur},{id:"flow",name:"数字人",Icon:pt},{id:"install",name:"添加到主屏幕",Icon:pr}];function Pn({username:r,connected:o,accent:a,accentText:s,selectedPageId:l,onSelectPage:d,onUpdatePage:u,configuration:p,csrfToken:j}){const v=t.useRef(null),C=t.useRef(null),c=Cn(j),k=c.computers,[T,L]=t.useState(""),[m,y]=t.useState(null),[w,x]=t.useState(!1),[R,N]=t.useState("home"),[D,M]=t.useState(!1),[X,B]=t.useState({top:48,right:12}),[H,ne]=t.useState(null),[$,P]=t.useState(null),[A,E]=t.useState(""),[I,z]=t.useState({}),g=k.find(b=>b.origin===T),_=p.settings.savedPages??[];t.useEffect(()=>{var b;p.loaded&&l&&u(((b=p.settings.savedPages)==null?void 0:b.find(O=>O.id===l))??null)},[p.loaded,p.settings.savedPages,l,u]),t.useEffect(()=>{var Y;L(Ne()),y(((Y=v.current)==null?void 0:Y.closest(".web-root"))??document.body);const b=window.matchMedia("(max-width: 600px)"),O=()=>M(b.matches);return O(),b.addEventListener("change",O),()=>{b.removeEventListener("change",O)}},[]),t.useEffect(()=>{if(!w)return;const b=U=>{var V,G;!((V=C.current)!=null&&V.contains(U.target))&&!((G=v.current)!=null&&G.contains(U.target))&&x(!1)},O=U=>{var Ie,Me;if(U.key==="Escape"&&(x(!1),(Ie=v.current)==null||Ie.focus()),!D||U.key!=="Tab")return;const V=(Me=C.current)==null?void 0:Me.querySelectorAll("button:not(:disabled), input:not(:disabled)");if(!(V!=null&&V.length))return;const G=V[0],se=V[V.length-1];U.shiftKey&&document.activeElement===G?(U.preventDefault(),se.focus()):!U.shiftKey&&document.activeElement===se&&(U.preventDefault(),G.focus())},Y=()=>{var G;const U=(G=v.current)==null?void 0:G.getBoundingClientRect();if(!U)return;const V=Math.min(292,innerWidth-24);B({top:U.bottom+8,right:Math.max(12,Math.min(innerWidth-V-12,innerWidth-U.right))})};return document.addEventListener("pointerdown",b),document.addEventListener("keydown",O),window.addEventListener("resize",Y),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",O),window.removeEventListener("resize",Y)}},[w,D]),t.useEffect(()=>{var b,O;w&&((O=(b=C.current)==null?void 0:b.querySelector("button"))==null||O.focus())},[w,R]),t.useEffect(()=>{if(!w)return;const b=new AbortController,O=()=>{for(const U of k)U.origin!==T&&En(U.origin,b.signal).then(V=>{b.signal.aborted||z(G=>({...G,[U.origin]:V}))})};O();const Y=window.setInterval(O,15e3);return window.addEventListener("online",O),()=>{b.abort(),window.clearInterval(Y),window.removeEventListener("online",O)}},[w,k,T]);const K=t.useCallback(()=>{var b;ne(null),(b=v.current)==null||b.focus()},[]),ie=t.useCallback(()=>{var b;P(null),(b=v.current)==null||b.focus()},[]),F=t.useCallback(async(b,O)=>{var G;if(Fe()){await Fe().pair(b);return}const Y=Or(b),U={origin:Y.origin,name:O.trim()||((G=k.find(se=>se.origin===Y.origin))==null?void 0:G.name)||Y.hostname},V=Wr(b,qt(Re(),k,[U]),O);await c.add(U.origin,U.name),location.assign(V)},[k,c.add]),ee=t.useCallback(async b=>{await c.rename(Ne(),b),K()},[K,c.rename]);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:In}),e.jsxs("div",{className:"theme-avatar-with-status",children:[e.jsx("button",{ref:v,type:"button",className:"theme-avatar","aria-label":`电脑与连接状态(${r})`,title:r,style:{border:`1px solid ${a}`,background:a,color:s},"aria-expanded":w,"aria-haspopup":"true",onClick:()=>{const b=v.current.getBoundingClientRect(),O=Math.min(292,innerWidth-24);B({top:b.bottom+8,right:Math.max(12,Math.min(innerWidth-O-12,innerWidth-b.right))}),w||(N("home"),E(""),p.reload(),c.reload()),x(Y=>!Y)},children:(r.trim()[0]??"?").toUpperCase()}),e.jsx("span",{className:"theme-avatar-status","data-connected":o,"aria-label":o?"已连接":"未连接"})]}),w&&m&&Te.createPortal(e.jsx("div",{className:"computer-menu-backdrop","data-toolbar-overlay":!0,children:e.jsxs("div",{ref:C,className:"computer-menu",style:D?void 0:X,role:"dialog","aria-modal":D,"aria-label":R==="tools"?"配置顶部工具":R==="computers"?"选择电脑":"电脑与保存页面",children:[e.jsx("div",{className:"computer-menu-grip","aria-hidden":"true"}),e.jsxs("div",{className:"computer-menu-heading",children:[R!=="home"&&e.jsx("button",{type:"button",className:"computer-close","aria-label":"返回电脑菜单",onClick:()=>N("home"),children:e.jsx(_r,{size:20})}),R==="home"?e.jsxs("button",{type:"button",className:"computer-menu-item computer-current","aria-label":"选择电脑",onClick:()=>N("computers"),children:[e.jsx(Kt,{size:17}),e.jsxs("span",{children:[e.jsx("strong",{children:(g==null?void 0:g.name)||"当前电脑"}),e.jsx("small",{children:o?"当前 · 在线":"当前 · 未连接"})]}),e.jsx(Fr,{size:16})]}):e.jsx("strong",{children:R==="tools"?`${(g==null?void 0:g.name)||"当前电脑"} · 顶部工具`:"选择电脑"}),e.jsx("button",{type:"button",className:"computer-close","aria-label":"关闭电脑菜单",onClick:()=>{var b;x(!1),(b=v.current)==null||b.focus()},children:e.jsx(ke,{size:20})})]}),R==="computers"&&e.jsxs(e.Fragment,{children:[!c.loaded&&e.jsx("p",{className:"computer-save-status",role:"status",children:c.error?"电脑列表尚未加载":"正在读取电脑列表…"}),k.map(b=>{const O=b.origin===T?o?"online":"offline":I[b.origin]??"checking",Y=O==="online"?"在线":O==="offline"?"无法连接":"检测中";return e.jsxs("div",{className:"computer-menu-row",children:[e.jsxs("button",{type:"button",className:"computer-menu-item","data-computer-origin":b.origin,"aria-label":`${b.name},${Y}${b.origin===T?",当前电脑":""}`,"aria-current":b.origin===T?"true":void 0,onClick:()=>{if(b.origin===T)N("home");else try{const U=Fe();U?U.switchComputer(b.origin).catch(V=>E(V.message)):location.assign($r(b.origin,qt(Re(),k)))}catch(U){E(U.message)}},children:[e.jsx(Kt,{size:17,"aria-hidden":"true"}),e.jsxs("span",{children:[e.jsx("strong",{children:b.name}),e.jsx("small",{children:b.origin})]}),e.jsx("span",{className:"computer-status-dot","data-status":O,role:"img","aria-label":Y,title:Y}),b.origin===T&&e.jsx(nt,{size:16,"aria-label":"当前电脑"})]}),b.origin!==T&&e.jsx("button",{type:"button",className:"computer-page-control computer-delete-control","aria-label":`删除电脑:${b.name}`,title:`删除电脑:${b.name}`,disabled:c.saving,onClick:()=>{c.remove(b.origin).catch(()=>{})},children:e.jsx(mt,{size:15})})]},b.origin)}),e.jsx("div",{className:"computer-menu-divider"}),e.jsxs("button",{type:"button",className:"computer-menu-item",disabled:!c.loaded||c.saving,onClick:()=>{const b=Fe();b?b.scan().catch(O=>E(O.message)):(x(!1),ne("add"))},children:[e.jsx($e,{size:17,"aria-hidden":"true"}),e.jsx("span",{children:"扫码添加电脑"})]}),e.jsxs("button",{type:"button",className:"computer-menu-item",disabled:!c.loaded||c.saving||!g,onClick:()=>{x(!1),ne("rename")},children:[e.jsx(ot,{size:16,"aria-hidden":"true"}),e.jsx("span",{children:"修改当前电脑名称"})]}),c.error&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"computer-error",role:"alert",children:c.error}),e.jsxs("button",{type:"button",className:"computer-menu-item",onClick:()=>{c.reload()},children:[e.jsx(be,{size:16}),e.jsx("span",{children:"重新加载电脑列表"})]})]})]}),R==="home"&&e.jsxs(e.Fragment,{children:[e.jsx(vn,{csrfToken:j}),e.jsxs("div",{className:"computer-menu-label computer-pages-heading",children:[e.jsx("span",{children:"保存的页面"}),e.jsx("button",{type:"button",className:"computer-page-control","aria-label":"添加页面",disabled:!p.loaded||p.saving,onClick:()=>{x(!1),P({computer:g??{origin:T,name:"当前电脑"}})},children:e.jsx($e,{size:17})})]}),e.jsxs("button",{type:"button",className:"computer-menu-item","aria-current":l?void 0:"true",onClick:()=>{x(!1),d(null)},children:[e.jsx(bn,{size:17}),e.jsx("span",{children:"电脑会话"}),!l&&e.jsx(nt,{size:16})]}),_.map(b=>e.jsxs("div",{className:"computer-menu-row",children:[e.jsxs("button",{type:"button",className:"computer-menu-item","aria-label":`打开 ${b.name}`,"aria-current":l===b.id?"true":void 0,onClick:()=>{x(!1),d(b)},children:[e.jsx(it,{size:15,"aria-hidden":"true"}),e.jsxs("span",{children:[e.jsx("strong",{children:b.name}),e.jsxs("small",{children:[b.openMode==="current"?"当前页面":"新页面"," · ",new URL(b.url).hostname]})]}),b.openMode==="new-tab"&&e.jsx(ft,{size:13,"aria-hidden":"true"})]}),e.jsx("button",{type:"button",className:"computer-page-control","aria-label":`编辑 ${b.name}`,disabled:p.saving,onClick:()=>{x(!1),P({computer:g??{origin:T,name:"当前电脑"},page:b})},children:e.jsx(ot,{size:14})}),e.jsx("button",{type:"button",className:"computer-page-control","aria-label":`删除 ${b.name}`,disabled:p.saving,onClick:()=>{p.setSavedPages(_.filter(O=>O.id!==b.id)).catch(()=>{})},children:e.jsx(ke,{size:15})})]},b.id)),e.jsx("div",{className:"computer-menu-divider"}),e.jsxs("button",{type:"button",className:"computer-menu-item",onClick:()=>N("tools"),children:[e.jsx(en,{size:17}),e.jsx("span",{children:"配置顶部工具"}),e.jsx(sn,{size:16})]})]}),R==="tools"&&e.jsx("div",{className:"computer-tools-list",children:Nn.map(({id:b,name:O,Icon:Y})=>e.jsxs("label",{className:"computer-tool-option",children:[e.jsx(Y,{size:17,"aria-hidden":"true"}),e.jsx("span",{children:O}),e.jsx("input",{type:"checkbox","aria-label":`显示${O}`,checked:p.settings.visibleTools.includes(b),disabled:!p.loaded||p.saving,onChange:U=>{const V=p.settings.visibleTools;p.setVisibleTools(U.target.checked?[...V,b]:V.filter(G=>G!==b)).catch(()=>{})}})]},b))}),R!=="computers"&&e.jsx("p",{className:"computer-save-status",role:"status",children:p.loaded?p.saving?"正在保存…":p.notice:p.error?"配置尚未加载":"正在读取电脑配置…"}),p.error&&R!=="computers"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"computer-error",role:"alert",children:p.error}),e.jsxs("button",{type:"button",className:"computer-menu-item",onClick:()=>{p.reload()},children:[e.jsx(be,{size:16}),e.jsx("span",{children:"重新加载配置"})]})]}),A&&e.jsx("p",{className:"computer-error",role:"alert",children:A})]})}),m),H&&m&&Te.createPortal(e.jsx(Ln,{mode:H,currentName:(g==null?void 0:g.name)||"",onClose:K,onNavigate:F,onRename:ee}),m),$&&m&&Te.createPortal(e.jsx(jn,{computerName:$.computer.name,page:$.page,onClose:ie,onSave:async b=>{if($.page&&!_.some(O=>O.id===b.id))throw new Error("这个页面已在其他设备删除,请重新添加。");await p.setSavedPages($.page?_.map(O=>O.id===b.id?b:O):[..._,b]),ie()}}),m)]})}function Ln({mode:r,currentName:o,onClose:a,onNavigate:s,onRename:l}){const[d,u]=t.useState(r==="rename"?o:""),p=t.useRef(d);p.current=d;const[j,v]=t.useState(""),[C,c]=t.useState(""),[k,T]=t.useState(!1),[L,m]=t.useState(!1),[y,w]=t.useState(!1),[x,R]=t.useState(!1),N=t.useRef(null),D=t.useRef(null),M=t.useRef(0),X=t.useRef(null),B=t.useRef(null),H=t.useRef(null),ne=t.useCallback(async $=>{var P;T(!0),(P=H.current)==null||P.stop(),m(!1),c("");try{await s($,p.current)}catch(A){c(A.message)}finally{T(!1)}},[s]);return t.useEffect(()=>{var A,E,I;w(st()),r==="rename"?(A=X.current)==null||A.focus():(I=(E=B.current)==null?void 0:E.querySelector("button"))==null||I.focus();const $=z=>{var ie;if(z.key==="Escape"&&a(),z.key!=="Tab")return;const g=(ie=B.current)==null?void 0:ie.querySelectorAll("button:not(:disabled), input:not(:disabled)");if(!(g!=null&&g.length))return;const _=g[0],K=g[g.length-1];z.shiftKey&&document.activeElement===_?(z.preventDefault(),K.focus()):!z.shiftKey&&document.activeElement===K&&(z.preventDefault(),_.focus())},P=()=>{document.hidden&&m(!1)};return document.addEventListener("keydown",$),document.addEventListener("visibilitychange",P),r==="add"&&N.current&&(H.current=Rn(N.current,ne,z=>{m(!1),c(z)})),()=>{var z;M.current++,document.removeEventListener("keydown",$),document.removeEventListener("visibilitychange",P),(z=H.current)==null||z.dispose(),H.current=null}},[r,ne,a]),e.jsx("div",{className:"computer-dialog-backdrop","data-toolbar-overlay":!0,onClick:$=>{$.target===$.currentTarget&&a()},children:e.jsxs("section",{ref:B,className:"computer-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"computer-dialog-title",children:[e.jsxs("div",{className:"computer-dialog-heading",children:[e.jsx("h2",{id:"computer-dialog-title",children:r==="add"?"添加电脑":"修改电脑名称"}),e.jsx("button",{type:"button",className:"computer-close","aria-label":"关闭",onClick:a,children:e.jsx(ke,{size:20})})]}),e.jsxs("form",{onSubmit:async $=>{if($.preventDefault(),!k)if(r==="add")await ne(j);else{T(!0);try{await l(d.trim())}catch(P){c(P.message)}finally{T(!1)}}},children:[e.jsxs("label",{htmlFor:"computer-name",children:["电脑名称",r==="add"?"(选填)":""]}),e.jsx("input",{ref:X,id:"computer-name",maxLength:60,value:d,required:r==="rename",disabled:k,onChange:$=>u($.target.value),placeholder:"例如:A 电脑 / 家里的电脑",autoComplete:"off"}),r==="add"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"computer-hint",children:"扫描另一台电脑上的 AgentRoam 授权二维码,连接后会保留已有电脑。"}),e.jsx("input",{ref:D,type:"file",accept:"image/*",capture:"environment",hidden:!0,"aria-label":"拍摄授权二维码",onChange:async $=>{var E,I;const P=(E=$.currentTarget.files)==null?void 0:E[0];if($.currentTarget.value="",!P)return;const A=++M.current;(I=H.current)==null||I.stop(),m(!1),R(!0),c("");try{const z=await Tn(P);A===M.current&&ne(z)}catch(z){A===M.current&&c(z.message)}finally{A===M.current&&R(!1)}}}),e.jsx("video",{ref:N,playsInline:!0,muted:!0,hidden:!L,"aria-label":"扫码相机画面"}),e.jsxs("button",{className:"computer-action",type:"button",disabled:x,onClick:()=>{var $,P,A;c(""),L?(($=H.current)==null||$.stop(),m(!1)):st()?(m(!0),(A=H.current)==null||A.start()):(P=D.current)==null||P.click()},children:[e.jsx(Ur,{size:17,"aria-hidden":"true"}),x?"正在识别二维码…":L?"取消扫码":y?"打开相机扫码":"拍照扫码"]}),y&&e.jsx("button",{className:"computer-action",type:"button",disabled:x,onClick:()=>{var $,P;($=H.current)==null||$.stop(),m(!1),(P=D.current)==null||P.click()},children:"拍照识别二维码"}),e.jsx("label",{htmlFor:"computer-link",children:"或粘贴授权二维码链接"}),e.jsx("input",{id:"computer-link",value:j,onChange:$=>v($.target.value),placeholder:"http(s)://…/pair#pair=…",autoComplete:"off",spellCheck:!1})]}),C&&e.jsx("p",{className:"computer-error",role:"alert",children:C}),e.jsx("button",{className:"computer-action computer-primary",type:"submit",disabled:k||(r==="add"?!j.trim()||x:!d.trim()),children:r==="add"?"连接这台电脑":k?"正在保存…":"保存名称"})]})]})})}const In=`
|
|
32
32
|
.computer-menu-backdrop{position:fixed;inset:0;z-index:10000}
|
|
33
33
|
.computer-menu-heading{display:flex;align-items:center;gap:4px;padding:2px 4px}.computer-menu-heading>strong{flex:1;min-width:0;font-size:14px;font-weight:500;overflow-wrap:anywhere}.computer-menu-heading>.computer-current{flex:1;min-width:0}.computer-menu-heading>.computer-close{flex-shrink:0}
|
|
34
34
|
.computer-menu-grip{display:none}.computer-pages-heading{display:flex;align-items:center;justify-content:space-between}.computer-tool-option{display:flex;align-items:center;gap:12px;min-height:44px;padding:8px 12px;cursor:pointer}.computer-tool-option span{flex:1;font-size:14px}.computer-tool-option input{width:18px;height:18px;accent-color:var(--ui-tab-accent,#7aa2f7)}.computer-tool-option svg{flex-shrink:0}.computer-save-status{margin:6px 10px 2px;line-height:18px;color:var(--ui-muted-text,#999dab);font-size:12px}.computer-save-status:empty{display:none}.computer-menu button:disabled,.computer-tool-option:has(input:disabled){opacity:.55;cursor:default}
|
|
@@ -84,7 +84,7 @@ import{c as dt,r as t,j as e,P as $e,f as Te,R as be,m as Ar,n as zr,o as Re,s a
|
|
|
84
84
|
@keyframes flow-appear { from { opacity:0; } to { opacity:1; } }
|
|
85
85
|
@media (max-height:420px) { .flow-loading { gap:12px; } .flow-loader-art { width:200px; height:200px; zoom:.65; } }
|
|
86
86
|
@media (prefers-reduced-motion:reduce) { .flow-loading, .flow-loader-halo, .flow-loader-orbit, .flow-loader-core, .flow-loader-node, .flow-loader-track span { animation:none; } }
|
|
87
|
-
`})]})}function Mn(r){const o=new URL(r).hostname;return o==="qoder.com"||o.endsWith(".qoder.com")}function An({page:r,reloadKey:o}){const[a,s]=t.useState(!0),[c,d]=t.useState(!1);return t.useEffect(()=>{s(!0),d(!1);const u=window.setTimeout(()=>d(!0),12e3);return()=>window.clearTimeout(u)},[r.id,r.url,o]),Mn(r.url)?e.jsxs("main",{className:"computer-page-blocked",children:[e.jsx(it,{size:36,strokeWidth:1.5,"aria-hidden":"true"}),e.jsxs("h2",{children:[r.name," 不允许内嵌"]}),e.jsx("p",{children:"这个网站限制了当前页面打开。可以在新页面使用,也可以在电脑菜单中修改打开方式。"}),e.jsxs("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ft,{size:16,"aria-hidden":"true"}),"打开新页面"]})]}):e.jsxs("main",{className:"computer-page-pane","aria-label":r.name,"aria-busy":a,children:[e.jsx("iframe",{title:r.name,src:r.url,referrerPolicy:"no-referrer",allow:"clipboard-read; clipboard-write; microphone; camera",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads allow-modals",onLoad:()=>s(!1),onError:()=>{s(!1),d(!0)},style:{visibility:a?"hidden":"visible"}},`${r.id}:${o}`),a&&e.jsx(Be,{label:"REMOTE PAGE",title:`正在打开 ${r.name}`,caption:"正在连接页面",icon:e.jsx(it,{size:36,strokeWidth:1.5})}),c&&e.jsx("a",{className:"computer-page-fallback",href:r.url,target:"_blank",rel:"noopener noreferrer",children:"打开原页面"})]})}const Ze=["refresh","collaboration","remote","theme","files","ai-hub","flow","install"],zn=["refresh","remote","theme","files"];function Dn(r){return{userId:r,revision:0,visibleTools:[...zn],savedPages:null,updatedAt:""}}function fr(r){if(!Array.isArray(r)||r.length>Ze.length||r.some(o=>!Ze.includes(o)))throw new Error("顶部工具包含未知选项。");if(new Set(r).size!==r.length)throw new Error("顶部工具不能重复。");return Ze.filter(o=>r.includes(o))}function hr(r){if(!Array.isArray(r)||r.length>20)throw new Error("每台电脑最多可添加 20 个页面。");const o=new Set;return r.map(a=>{if(!a||typeof a.id!="string"||!/^[A-Za-z0-9_-]{1,80}$/.test(a.id)||o.has(a.id))throw new Error("页面标识无效或重复。");if(typeof a.name!="string"||!a.name.trim()||a.name.trim().length>60)throw new Error("页面名称需为 1–60 个字符。");if(!["current","new-tab"].includes(a.openMode))throw new Error("页面打开方式无效。");if(typeof a.url!="string"||a.url.length>8192)throw new Error("请填写有效的 http(s) 页面地址。");let s;try{s=new URL(a.url.trim())}catch{throw new Error("请填写有效的 http(s) 页面地址。")}if(!["http:","https:"].includes(s.protocol)||s.username||s.password)throw new Error("请填写无账号密码的 http(s) 页面地址。");return o.add(a.id),{id:a.id,name:a.name.trim(),url:s.href,openMode:a.openMode}})}class ct extends Error{constructor(o,a){super(o),this.status=a}}async function Ce(r,o){var c;const a=await fetch("/api/web-console/computer-settings",{method:o?"PATCH":"GET",credentials:"same-origin",cache:"no-store",headers:o?{"content-type":"application/json","x-csrf-token":r}:void 0,body:o?JSON.stringify(o):void 0,signal:AbortSignal.timeout(15e3)}).catch(d=>{throw new Error((d==null?void 0:d.name)==="TimeoutError"?"电脑响应超时,请检查连接后重试。":"无法连接当前电脑,请检查连接后重试。")}),s=await a.json().catch(()=>null);if(!a.ok)throw new ct(((c=s==null?void 0:s.error)==null?void 0:c.message)??"电脑配置保存失败,请检查连接后重试。",a.status);if(!(s!=null&&s.settings)||!Number.isSafeInteger(s.settings.revision))throw new Error("无法读取电脑配置,请重新加载。");return{...s.settings,visibleTools:fr(s.settings.visibleTools),savedPages:s.settings.savedPages===null?null:hr(s.settings.savedPages)}}function On(r){const[o,a]=t.useState(()=>Dn("")),s=t.useRef(o),[c,d]=t.useState(!1),[u,p]=t.useState(!1),j=t.useRef(!1),y=t.useRef(!0),v=t.useRef(0),[l,C]=t.useState(""),[E,P]=t.useState(""),m=t.useCallback(w=>{s.current=w,y.current&&a(w)},[]),k=t.useCallback(async()=>{var R;if(j.current)return;const w=++v.current;C(""),P("");try{let N=await Ce(r);if(N.savedPages===null){const D=((R=Re().find(M=>M.origin===location.origin))==null?void 0:R.pages)??[];try{N=await Ce(r,{expectedRevision:N.revision,initializePages:D})}catch(M){if(!(M instanceof ct)||M.status!==409)throw M;if(N=await Ce(r),N.savedPages===null)throw new Error("电脑配置已更新,请重试旧页面导入。")}}if(!y.current||w!==v.current)return;m(N),d(!0);try{cr(Re().map(D=>{if(D.origin!==location.origin)return D;const{pages:M,...X}=D;return{...X,pagesMigrated:!0}}))}catch{}}catch(N){y.current&&w===v.current&&C(N instanceof Error?N.message:"无法读取电脑配置。")}},[m,r]);t.useEffect(()=>{y.current=!0,k();const w=()=>{k()};return window.addEventListener("focus",w),()=>{y.current=!1,v.current++,window.removeEventListener("focus",w)}},[k]);const x=t.useCallback(async w=>{if(!c||j.current)throw new Error("配置尚未就绪,请稍后重试。");j.current=!0,v.current++,p(!0),C(""),P("");const R=s.current;w.visibleTools&&m({...R,visibleTools:w.visibleTools});try{m(await Ce(r,{...w,expectedRevision:R.revision})),y.current&&P("已保存到当前电脑")}catch(N){if(m(R),N instanceof ct&&N.status===409)try{m(await Ce(r))}catch{}const D=N instanceof Error?N.message:"电脑配置保存失败,请重试。";throw y.current&&C(D),new Error(D)}finally{j.current=!1,y.current&&p(!1)}},[m,r,c]);return{settings:o,loaded:c,saving:u,error:l,notice:E,reload:k,setVisibleTools:w=>x({visibleTools:fr(w)}),setSavedPages:w=>x({savedPages:hr(w)})}}const Wn=["codex","claude agents","opencode","agent-tui"];function _n(){return Wn.map((r,o)=>({id:`default-${o+1}`,command:r}))}async function Fn(r,o,a,s){const c=a.find(u=>u&&u===r.source);if(!c)return!1;const d=Br(r,o,c);if(!d)return!1;try{const u=await s(d.method,d.payload);c.postMessage({type:Ht,id:d.id,ok:!0,result:u},o)}catch(u){const p=u;c.postMessage({type:Ht,id:d.id,ok:!1,error:p.message||"项目操作失败",code:p.code},o)}return!0}const $n=1,lt={watcherFrame:4,producerFrame:5},Qt=10;function Un(r){const o=r instanceof Uint8Array?r:new Uint8Array(r.buffer,r.byteOffset,r.byteLength);if(o.byteLength<Qt||o[0]!==$n||o[1]!==lt.watcherFrame&&o[1]!==lt.producerFrame)return null;const a=new DataView(o.buffer,o.byteOffset,o.byteLength);return{type:o[1],channelId:a.getUint32(2,!1),sequence:a.getUint32(6,!1),payload:o.subarray(Qt)}}function Bn(){return Hr()}function qn(r,o,a){const[s,c]=t.useState({connected:!1,error:null}),[d,u]=t.useState(0),p=t.useRef(null),j=t.useRef(0),y=t.useRef(new Map),v=t.useRef([]),l=t.useRef(0),C=t.useRef(new Map),E=t.useRef(new Map),P=t.useRef(new Map),m=t.useRef(1e3),k=t.useRef(!1),x=t.useRef(null),w=t.useRef(r),R=t.useRef(o),N=t.useRef(a);w.current=r,R.current=o,N.current=a;const D=t.useCallback((L,A)=>{let S=C.current.get(L);return S||C.current.set(L,S=new Set),S.add(A),()=>S.delete(A)},[]),M=t.useCallback((L,A)=>{let S=E.current.get(L);return S||E.current.set(L,S=new Set),S.add(A),()=>S.delete(A)},[]),X=t.useCallback((L,A)=>{let S=P.current.get(L);return S||P.current.set(L,S=new Set),S.add(A),()=>S.delete(A)},[]),B=t.useCallback((L,A)=>{const S=p.current;if(!S||S.readyState!==WebSocket.OPEN)return!1;const I=new TextEncoder().encode(A),z=new Uint8Array(6+I.byteLength),g=new DataView(z.buffer);return z[0]=1,z[1]=1,g.setUint32(2,L),z.set(I,6),S.send(z),!0},[]),H=t.useCallback(L=>{const A=p.current;(A==null?void 0:A.readyState)===WebSocket.OPEN?A.send(L):v.current.push(L)},[]),ne=t.useCallback((L,A={},S=15e3)=>new Promise((I,z)=>{var K;if(L.startsWith("browser:")&&((K=p.current)==null?void 0:K.readyState)!==WebSocket.OPEN){z(Object.assign(new Error("远程连接已断开,请等待重新连接"),{code:"EOFFLINE"}));return}const g=++l.current,_=setTimeout(()=>{y.current.delete(g),z(new Error(`${L} timeout`))},S);y.current.set(g,{resolve:I,reject:z,timer:_,type:L}),H(JSON.stringify({type:L,_req:g,...A}))}),[H]),$=t.useCallback(async()=>{k.current=!1;const L=++j.current;x.current&&(clearInterval(x.current),x.current=null);const A=p.current;if(A){A.onopen=A.onmessage=A.onerror=A.onclose=null;try{A.close()}catch{}}let S;try{S=await R.current()}catch{L===j.current&&N.current();return}if(L!==j.current||k.current)return;let I;try{I=new WebSocket(`${Bn()}?nonce=${encodeURIComponent(S)}`)}catch(z){c({connected:!1,error:String(z)});return}I.binaryType="arraybuffer",p.current=I,I.onopen=()=>{if(L!==j.current||p.current!==I)return;m.current=1e3,c({connected:!0,error:null}),u(K=>K+1);const z=v.current.splice(0);for(const K of z)I.send(K);let g=Date.now();x.current=setInterval(()=>{if(p.current!==I||I.readyState!==WebSocket.OPEN){clearInterval(x.current),x.current=null;return}if(Date.now()-g>25e3){try{I.close()}catch{}return}try{I.send(JSON.stringify({type:"ping"}))}catch{}},1e4);const _=()=>{g=Date.now()};I.addEventListener("message",_),I.addEventListener("close",()=>I.removeEventListener("message",_),{once:!0})},I.onmessage=z=>{var _,K,ie;if(L!==j.current||p.current!==I)return;if(typeof z.data!="string"){const F=new Uint8Array(z.data);if(F.byteLength>=6&&F[0]===1&&(F[1]===2||F[1]===6)){const ee=new DataView(F.buffer,F.byteOffset,F.byteLength).getUint32(2);(_=E.current.get(ee))==null||_.forEach(b=>b(F.subarray(6),F[1]===6))}else if(F.byteLength>=6&&F[0]===1&&F[1]===3){const ee=new DataView(F.buffer,F.byteOffset,F.byteLength).getUint32(2);(K=P.current.get(ee))==null||K.forEach(b=>b())}else w.current(F);return}let g;try{g=JSON.parse(z.data)}catch{return}if(g.type==="error"&&g.id!=null){const F=y.current.get(g.id);if(F){y.current.delete(g.id),clearTimeout(F.timer);const ee=Object.assign(new Error(g.error||"gateway error"),{code:g.code});F.reject(ee)}return}if(g.id!=null&&typeof g.type=="string"&&g.type.endsWith(":result")){const F=y.current.get(g.id);(F==null?void 0:F.type)==="fs:preview-open"&&typeof g.url=="string"&&(g.url=qr(g.url)),F&&(y.current.delete(g.id),clearTimeout(F.timer),F.resolve(g));return}(ie=C.current.get(g.type))==null||ie.forEach(F=>F(g))},I.onclose=z=>{if(L!==j.current||p.current!==I)return;x.current&&(clearInterval(x.current),x.current=null),p.current=null;for(const[_,K]of y.current)K.type.startsWith("browser:")&&(clearTimeout(K.timer),y.current.delete(_),K.reject(Object.assign(new Error("远程连接已断开,请重新接管"),{code:"EOFFLINE"})));if(c({connected:!1,error:null}),z.code===4001||z.code===4003){N.current();return}if(k.current)return;const g=m.current;m.current=Math.min(g*2,8e3),setTimeout(()=>{!k.current&&L===j.current&&$()},g)},I.onerror=()=>{}},[]);return t.useEffect(()=>($(),()=>{k.current=!0,j.current++,x.current&&(clearInterval(x.current),x.current=null);const L=p.current;if(p.current=null,L){L.onopen=L.onmessage=L.onerror=L.onclose=null;try{L.close()}catch{}}}),[$]),{state:s,epoch:d,rpc:ne,onEvent:D,onTerminalData:M,onTerminalReset:X,sendTerminalInput:B,reconnect:$}}function Hn(){const[r,o]=t.useState("loading"),[a,s]=t.useState(null),[c]=t.useState("same-origin"),[d,u]=t.useState(null),p=t.useCallback(async()=>{o("loading"),u(null);try{const l=await fetch("/api/web-console/bootstrap",{credentials:"same-origin",cache:"no-store"});if(l.status===401||l.status===423){window.location.reload();return}if(!l.ok)throw new Error(`HTTP ${l.status}`);const C=await l.json();s(C.user),o("authenticated")}catch{u("无法连接远程控制台"),o("needsLogin")}},[]);t.useEffect(()=>{p()},[p]);const j=t.useCallback(async()=>{const l=await fetch("/api/web-console/bootstrap",{credentials:"same-origin",cache:"no-store"});if((l.status===401||l.status===423)&&window.location.reload(),!l.ok)throw new Error("bootstrap failed");const C=await l.json();return s(C.user),o("authenticated"),C.wsNonce},[]),y=t.useCallback(async()=>(window.location.reload(),!1),[]),v=t.useCallback(async()=>{const l=await fetch("/api/pairing/logout",{method:"POST",credentials:"same-origin"});l.ok||l.status===401||l.status===423?window.location.reload():u("退出失败,请重试")},[]);return{status:r,user:a,error:d,csrfToken:c,setup:y,login:y,logout:v,refresh:p,getWsNonce:j}}function Vn({children:r}){const o=Hn(),[a,s]=t.useState(!1),c=o.status==="authenticated",d=t.useCallback(()=>s(!0),[]);return t.useEffect(()=>{c||s(!1)},[c]),e.jsxs(e.Fragment,{children:[c?r(o,d):null,e.jsx(Vr,{ready:c&&a,error:o.error,onRetry:()=>void o.refresh()})]})}function Zt(r,o,a){const s=r.findIndex(p=>p.id===o),c=r.findIndex(p=>p.id===a);if(s<0||c<0||s===c)return[...r];const d=[...r],[u]=d.splice(s,1);return d.splice(c,0,u),d}function Kn(){return typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),r=>r.toString(16).padStart(2,"0")).join("")}function gr(r,o=Kn()){return{id:o,command:r.trim()}}function Gn({commands:r,onChange:o,onExecute:a}){const[s,c]=t.useState(null),[d,u]=t.useState(""),[p,j]=t.useState(null),y=t.useRef(null),v=()=>{if(!s)return;const m=s.value.trim();if(!m)return u("命令不能为空");if(m.length>1e3)return u("命令最多 1000 个字符");if(/[\r\n\0]/.test(m))return u("命令只能包含一行");s.id?o(r.map(k=>k.id===s.id?{...k,command:m}:k)):o([...r,gr(m)]),c(null),u("")},l=(m,k)=>{m.preventDefault(),m.stopPropagation(),y.current=k,j(k),m.currentTarget.setPointerCapture(m.pointerId)},C=m=>{var w;if(!y.current)return;const k=(w=document.elementFromPoint(m.clientX,m.clientY))==null?void 0:w.closest("[data-pinned-id]"),x=k==null?void 0:k.dataset.pinnedId;x&&x!==y.current&&o(Zt(r,y.current,x))},E=m=>{m.currentTarget.hasPointerCapture(m.pointerId)&&m.currentTarget.releasePointerCapture(m.pointerId),y.current=null,j(null)},P=(m,k)=>{if(m.key!=="ArrowUp"&&m.key!=="ArrowDown")return;m.preventDefault();const x=r.findIndex(R=>R.id===k),w=r[x+(m.key==="ArrowUp"?-1:1)];w&&o(Zt(r,k,w.id))};return e.jsxs("section",{className:"pinned-commands","aria-labelledby":"pinned-command-title",children:[e.jsxs("div",{className:"pinned-command-head",children:[e.jsx("span",{id:"pinned-command-title",children:"置顶命令"}),e.jsx("button",{className:"history-icon-button",onClick:()=>{c({id:null,value:""}),u("")},"aria-label":"新增置顶命令",title:"新增置顶命令",children:e.jsx($e,{size:14,"aria-hidden":"true"})})]}),r.map(m=>(s==null?void 0:s.id)===m.id?e.jsx(er,{editor:s,error:d,onChange:k=>{c({...s,value:k}),u("")},onSave:v,onCancel:()=>{c(null),u("")}},m.id):e.jsxs("div",{className:`pinned-command-row${p===m.id?" pinned-command-dragging":""}`,"data-pinned-id":m.id,role:"button",tabIndex:0,onClick:()=>a(m.command),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),a(m.command))},children:[e.jsx("button",{className:"pinned-command-grip",onPointerDown:k=>l(k,m.id),onPointerMove:C,onPointerUp:E,onPointerCancel:E,onKeyDown:k=>P(k,m.id),onClick:k=>k.stopPropagation(),"aria-label":`调整 ${m.command} 的顺序`,title:"拖动排序,或按上下方向键",children:e.jsx(tn,{size:14,"aria-hidden":"true"})}),e.jsx("code",{children:m.command}),e.jsxs("div",{className:"pinned-command-actions",onClick:k=>k.stopPropagation(),children:[e.jsx("button",{className:"history-icon-button",onClick:()=>{c({id:m.id,value:m.command}),u("")},"aria-label":`编辑 ${m.command}`,title:"编辑",children:e.jsx(ot,{size:12,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button history-icon-danger",onClick:()=>o(r.filter(k=>k.id!==m.id)),"aria-label":`删除 ${m.command}`,title:"删除",children:e.jsx(mt,{size:12,"aria-hidden":"true"})})]})]},m.id)),(s==null?void 0:s.id)===null&&e.jsx(er,{editor:s,error:d,onChange:m=>{c({...s,value:m}),u("")},onSave:v,onCancel:()=>{c(null),u("")}})]})}function er({editor:r,error:o,onChange:a,onSave:s,onCancel:c}){return e.jsxs("div",{className:"pinned-command-editor",children:[e.jsx("input",{autoFocus:!0,value:r.value,maxLength:1e3,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&s(),d.key==="Escape"&&c()},"aria-label":r.id?"编辑置顶命令":"新增置顶命令"}),e.jsx("button",{className:"history-icon-button",onClick:s,"aria-label":"保存命令",title:"保存",children:e.jsx(nt,{size:13,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button",onClick:c,"aria-label":"取消编辑",title:"取消",children:e.jsx(ke,{size:13,"aria-hidden":"true"})}),o&&e.jsx("small",{role:"alert",children:o})]})}function Yn({csrfToken:r,terminalId:o,pinnedCommands:a,onPinnedCommandsChange:s,onFill:c,onExecute:d}){const[u,p]=t.useState([]),[j,y]=t.useState(""),[v,l]=t.useState(""),C=t.useCallback(async()=>{const x=new URLSearchParams({q:j,limit:"200"}),w=await fetch(`/api/web-console/history?${x}`,{credentials:"same-origin"});w.ok&&p((await w.json()).history)},[j]);t.useEffect(()=>{const x=setTimeout(C,200);return()=>clearTimeout(x)},[C]);const E=async x=>{await fetch("/api/web-console/history",{method:"DELETE",credentials:"same-origin",headers:{"content-type":"application/json","x-csrf-token":r},body:JSON.stringify({id:x})}),C()},P=x=>{o&&c(x)},m=t.useCallback(x=>{x==="[REDACTED]"||a.some(w=>w.command===x)||s([...a,gr(x)])},[s,a]),k=async x=>{const w=await ln(x);l(w?"已复制命令":"复制失败,请长按命令手动复制")};return e.jsxs("div",{className:"history-panel",children:[e.jsx(Gn,{commands:a,onChange:s,onExecute:d}),e.jsxs("div",{className:"history-search",children:[e.jsx("input",{value:j,onChange:x=>y(x.target.value),placeholder:"搜索命令"}),e.jsx("button",{className:"history-icon-button",onClick:C,"aria-label":"刷新历史",title:"刷新历史",children:e.jsx(be,{size:13,"aria-hidden":"true"})})]}),v&&e.jsx("div",{className:"terminal-clipboard-notice",role:"status",children:v}),u.map(x=>e.jsxs("div",{className:`history-item${o?"":" history-item-disabled"}`,role:"button",tabIndex:o?0:-1,onClick:()=>P(x.command),onKeyDown:w=>{w.target===w.currentTarget&&(w.key==="Enter"||w.key===" ")&&o&&(w.preventDefault(),P(x.command))},children:[e.jsx("code",{children:x.command}),e.jsxs("small",{children:[x.cwd," · ",new Date(x.executedAt).toLocaleString()]}),e.jsxs("div",{className:"history-item-actions",onClick:w=>w.stopPropagation(),onPointerDown:w=>w.stopPropagation(),children:[e.jsx("button",{className:"history-icon-button",onClick:()=>void k(x.command),"aria-label":"复制命令",title:"复制",children:e.jsx(rn,{size:12,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button",disabled:!o,onClick:()=>P(x.command),"aria-label":"填入命令",title:"填入",children:e.jsx(wn,{size:12,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button",disabled:x.command==="[REDACTED]"||a.some(w=>w.command===x.command),onClick:()=>m(x.command),"aria-label":"置顶命令",title:"置顶",children:e.jsx(nn,{size:12,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button history-icon-danger",onClick:()=>E(x.id),"aria-label":"删除历史",title:"删除",children:e.jsx(mt,{size:12,"aria-hidden":"true"})})]})]},x.id)),!u.length&&e.jsx("div",{className:"history-empty",children:"暂无 Shell 命令历史"}),!o&&!!u.length&&e.jsx("div",{className:"history-empty",children:"请先打开一个终端页签"})]})}function Jn({themeId:r,onThemeChange:o}){const[a,s]=t.useState(!1),c=t.useRef(null),d=t.useRef(null),u=t.useRef(null),[p,j]=t.useState(null),[y,v]=t.useState({top:-1e3,left:0});return t.useEffect(()=>{var l;j(((l=c.current)==null?void 0:l.closest(".web-root"))??document.body)},[]),t.useLayoutEffect(()=>{if(!a)return;const l=()=>{var P;const C=(P=d.current)==null?void 0:P.getBoundingClientRect();if(!C)return;const E=Math.min(176,innerWidth-16);v({top:C.bottom+6,left:Math.max(8,Math.min(innerWidth-E-8,C.right-E))})};return l(),window.addEventListener("resize",l),window.addEventListener("scroll",l,!0),()=>{window.removeEventListener("resize",l),window.removeEventListener("scroll",l,!0)}},[a]),t.useEffect(()=>{if(!a)return;const l=E=>{var P,m;!((P=c.current)!=null&&P.contains(E.target))&&!((m=u.current)!=null&&m.contains(E.target))&&s(!1)},C=E=>{var P;E.key==="Escape"&&(s(!1),(P=d.current)==null||P.focus())};return document.addEventListener("pointerdown",l),document.addEventListener("keydown",C),()=>{document.removeEventListener("pointerdown",l),document.removeEventListener("keydown",C)}},[a]),e.jsxs("div",{ref:c,className:"theme-picker",children:[e.jsx("button",{ref:d,type:"button",className:"file-drawer-toggle","aria-label":"换肤",title:"换肤","aria-expanded":a,"aria-haspopup":"dialog",onClick:()=>s(l=>!l),children:e.jsx(lr,{size:17,"aria-hidden":"true"})}),a&&p&&Te.createPortal(e.jsxs("div",{ref:u,className:"theme-popover",role:"dialog","aria-label":"选择皮肤","data-toolbar-overlay":!0,style:{position:"fixed",...y,zIndex:210,width:Math.min(176,innerWidth-16),boxSizing:"border-box",padding:8,borderRadius:10,border:"1px solid var(--ui-tabbar-border, #282b36)",background:"var(--ui-tab-active-bg, #262b38)",boxShadow:"0 10px 28px rgba(0,0,0,.45)"},children:[e.jsx("div",{style:{fontSize:10,color:"var(--ui-connection-text, #777b8c)",margin:"2px 4px 6px",letterSpacing:.5},children:"皮肤"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:Kr.map(l=>{const C=l.id===r;return e.jsxs("button",{type:"button",className:"theme-popover-item","aria-label":l.label,"aria-pressed":C,onPointerDown:E=>E.stopPropagation(),onClick:()=>{o(l.id),s(!1)},style:{background:C?"color-mix(in srgb, var(--ui-tab-accent, #7aa2f7) 14%, transparent)":"transparent"},children:[e.jsx("span",{style:{width:18,height:18,borderRadius:5,flexShrink:0,background:`linear-gradient(135deg, ${l.preview[0]} 55%, ${l.preview[1]} 55%)`,boxShadow:"inset 0 0 0 1px rgba(128,128,160,.25)"}}),e.jsx("span",{style:{flex:1,textAlign:"left",fontSize:12,fontWeight:C?600:400,color:C?"var(--ui-tab-active-text, #edf0f7)":"var(--ui-tab-text, #8f93a4)"},children:l.label}),C&&e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--ui-tab-accent, #7aa2f7)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"m5 12 4 4L19 6"})})]},l.id)})})]}),p)]})}function Xn(r,o){return{height:Math.round((r==null?void 0:r.height)??o.height),width:Math.round((r==null?void 0:r.width)??o.width),top:Math.round((r==null?void 0:r.offsetTop)??0),left:Math.round((r==null?void 0:r.offsetLeft)??0)}}function Qn(r){r&&(r.scrollLeft=0)}const Zn="agent-webapp:tab-swipe:v1";function eo(r){if(!r||typeof r!="object")return null;const o=r;return o.type!==Zn||o.phase!=="move"&&o.phase!=="end"&&o.phase!=="cancel"||typeof o.deltaX!="number"||!Number.isFinite(o.deltaX)?null:o}function to(r,o,a){return r.origin!==o||r.source!==a?null:eo(r.data)}const tr="agent-webapp:ready:v1";function ro(r){return!r||typeof r!="object"||r.type!==tr?null:{type:tr}}function rr(r,o,a){return r.origin!==o||r.source!==a?null:ro(r.data)}function nr({groupId:r,title:o,onFrame:a,onLoad:s}){const c=t.useRef(null),[d,u]=t.useState("loading"),[p,j]=t.useState(0),y=r===void 0;return t.useEffect(()=>{const v=l=>{var C;dn(l,window.location.origin,((C=c.current)==null?void 0:C.contentWindow)??null,r??null)&&u("ready")};return window.addEventListener("message",v),()=>window.removeEventListener("message",v)},[r]),t.useEffect(()=>{if(d!=="loading")return;const v=window.setTimeout(()=>u(l=>l==="loading"?"error":l),3e4);return()=>window.clearTimeout(v)},[d,p]),e.jsxs("div",{className:"collaboration-pane","aria-busy":d==="loading",children:[e.jsx("iframe",{ref:v=>{c.current=v,a(v)},className:`webapp-frame collaboration-frame${d==="ready"?" is-ready":""}`,style:{visibility:d==="ready"?"visible":"hidden"},src:tt(y?"/app/?view=collaboration-dashboard":`/app/?view=collaboration&groupId=${encodeURIComponent(r)}`),title:o,onLoad:s,onError:()=>u("error")},p),d==="loading"&&e.jsx(Be,{label:"AGENT COLLABORATION",title:y?"正在打开群聊看板":"正在进入群聊",caption:y?"正在加载已保存的群聊":"正在加载群成员与聊天记录",icon:e.jsx(ut,{size:36,strokeWidth:1.5})}),d==="error"&&e.jsxs("div",{className:"collaboration-load-error",role:"alert",children:[e.jsx("strong",{children:y?"暂时无法打开群聊看板":"暂时无法打开群聊"}),e.jsx("span",{children:"请检查连接后重试。"}),e.jsxs("button",{onClick:()=>{u("loading"),j(v=>v+1)},children:[e.jsx(be,{size:15}),"重新加载"]})]}),e.jsx("style",{jsx:!0,children:`
|
|
87
|
+
`})]})}function Mn(r){const o=new URL(r).hostname;return o==="qoder.com"||o.endsWith(".qoder.com")}function An({page:r,reloadKey:o}){const[a,s]=t.useState(!0),[l,d]=t.useState(!1);return t.useEffect(()=>{s(!0),d(!1);const u=window.setTimeout(()=>d(!0),12e3);return()=>window.clearTimeout(u)},[r.id,r.url,o]),Mn(r.url)?e.jsxs("main",{className:"computer-page-blocked",children:[e.jsx(it,{size:36,strokeWidth:1.5,"aria-hidden":"true"}),e.jsxs("h2",{children:[r.name," 不允许内嵌"]}),e.jsx("p",{children:"这个网站限制了当前页面打开。可以在新页面使用,也可以在电脑菜单中修改打开方式。"}),e.jsxs("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(ft,{size:16,"aria-hidden":"true"}),"打开新页面"]})]}):e.jsxs("main",{className:"computer-page-pane","aria-label":r.name,"aria-busy":a,children:[e.jsx("iframe",{title:r.name,src:r.url,referrerPolicy:"no-referrer",allow:"clipboard-read; clipboard-write; microphone; camera",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads allow-modals",onLoad:()=>s(!1),onError:()=>{s(!1),d(!0)},style:{visibility:a?"hidden":"visible"}},`${r.id}:${o}`),a&&e.jsx(Be,{label:"REMOTE PAGE",title:`正在打开 ${r.name}`,caption:"正在连接页面",icon:e.jsx(it,{size:36,strokeWidth:1.5})}),l&&e.jsx("a",{className:"computer-page-fallback",href:r.url,target:"_blank",rel:"noopener noreferrer",children:"打开原页面"})]})}const Ze=["refresh","collaboration","remote","theme","files","ai-hub","flow","install"],zn=["refresh","remote","theme","files"];function Dn(r){return{userId:r,revision:0,visibleTools:[...zn],savedPages:null,updatedAt:""}}function fr(r){if(!Array.isArray(r)||r.length>Ze.length||r.some(o=>!Ze.includes(o)))throw new Error("顶部工具包含未知选项。");if(new Set(r).size!==r.length)throw new Error("顶部工具不能重复。");return Ze.filter(o=>r.includes(o))}function hr(r){if(!Array.isArray(r)||r.length>20)throw new Error("每台电脑最多可添加 20 个页面。");const o=new Set;return r.map(a=>{if(!a||typeof a.id!="string"||!/^[A-Za-z0-9_-]{1,80}$/.test(a.id)||o.has(a.id))throw new Error("页面标识无效或重复。");if(typeof a.name!="string"||!a.name.trim()||a.name.trim().length>60)throw new Error("页面名称需为 1–60 个字符。");if(!["current","new-tab"].includes(a.openMode))throw new Error("页面打开方式无效。");if(typeof a.url!="string"||a.url.length>8192)throw new Error("请填写有效的 http(s) 页面地址。");let s;try{s=new URL(a.url.trim())}catch{throw new Error("请填写有效的 http(s) 页面地址。")}if(!["http:","https:"].includes(s.protocol)||s.username||s.password)throw new Error("请填写无账号密码的 http(s) 页面地址。");return o.add(a.id),{id:a.id,name:a.name.trim(),url:s.href,openMode:a.openMode}})}class ct extends Error{constructor(o,a){super(o),this.status=a}}async function Ce(r,o){var l;const a=await fetch("/api/web-console/computer-settings",{method:o?"PATCH":"GET",credentials:"same-origin",cache:"no-store",headers:o?{"content-type":"application/json","x-csrf-token":r}:void 0,body:o?JSON.stringify(o):void 0,signal:AbortSignal.timeout(15e3)}).catch(d=>{throw new Error((d==null?void 0:d.name)==="TimeoutError"?"电脑响应超时,请检查连接后重试。":"无法连接当前电脑,请检查连接后重试。")}),s=await a.json().catch(()=>null);if(!a.ok)throw new ct(((l=s==null?void 0:s.error)==null?void 0:l.message)??"电脑配置保存失败,请检查连接后重试。",a.status);if(!(s!=null&&s.settings)||!Number.isSafeInteger(s.settings.revision))throw new Error("无法读取电脑配置,请重新加载。");return{...s.settings,visibleTools:fr(s.settings.visibleTools),savedPages:s.settings.savedPages===null?null:hr(s.settings.savedPages)}}function On(r){const[o,a]=t.useState(()=>Dn("")),s=t.useRef(o),[l,d]=t.useState(!1),[u,p]=t.useState(!1),j=t.useRef(!1),v=t.useRef(!0),C=t.useRef(0),[c,k]=t.useState(""),[T,L]=t.useState(""),m=t.useCallback(x=>{s.current=x,v.current&&a(x)},[]),y=t.useCallback(async()=>{var R;if(j.current)return;const x=++C.current;k(""),L("");try{let N=await Ce(r);if(N.savedPages===null){const D=((R=Re().find(M=>M.origin===location.origin))==null?void 0:R.pages)??[];try{N=await Ce(r,{expectedRevision:N.revision,initializePages:D})}catch(M){if(!(M instanceof ct)||M.status!==409)throw M;if(N=await Ce(r),N.savedPages===null)throw new Error("电脑配置已更新,请重试旧页面导入。")}}if(!v.current||x!==C.current)return;m(N),d(!0);try{cr(Re().map(D=>{if(D.origin!==location.origin)return D;const{pages:M,...X}=D;return{...X,pagesMigrated:!0}}))}catch{}}catch(N){v.current&&x===C.current&&k(N instanceof Error?N.message:"无法读取电脑配置。")}},[m,r]);t.useEffect(()=>{v.current=!0,y();const x=()=>{y()};return window.addEventListener("focus",x),()=>{v.current=!1,C.current++,window.removeEventListener("focus",x)}},[y]);const w=t.useCallback(async x=>{if(!l||j.current)throw new Error("配置尚未就绪,请稍后重试。");j.current=!0,C.current++,p(!0),k(""),L("");const R=s.current;x.visibleTools&&m({...R,visibleTools:x.visibleTools});try{m(await Ce(r,{...x,expectedRevision:R.revision})),v.current&&L("已保存到当前电脑")}catch(N){if(m(R),N instanceof ct&&N.status===409)try{m(await Ce(r))}catch{}const D=N instanceof Error?N.message:"电脑配置保存失败,请重试。";throw v.current&&k(D),new Error(D)}finally{j.current=!1,v.current&&p(!1)}},[m,r,l]);return{settings:o,loaded:l,saving:u,error:c,notice:T,reload:y,setVisibleTools:x=>w({visibleTools:fr(x)}),setSavedPages:x=>w({savedPages:hr(x)})}}const Wn=["codex","claude agents","opencode","agent-tui"];function _n(){return Wn.map((r,o)=>({id:`default-${o+1}`,command:r}))}async function Fn(r,o,a,s){const l=a.find(u=>u&&u===r.source);if(!l)return!1;const d=Br(r,o,l);if(!d)return!1;try{const u=await s(d.method,d.payload);l.postMessage({type:Ht,id:d.id,ok:!0,result:u},o)}catch(u){const p=u;l.postMessage({type:Ht,id:d.id,ok:!1,error:p.message||"项目操作失败",code:p.code},o)}return!0}const $n=1,lt={watcherFrame:4,producerFrame:5},Qt=10;function Un(r){const o=r instanceof Uint8Array?r:new Uint8Array(r.buffer,r.byteOffset,r.byteLength);if(o.byteLength<Qt||o[0]!==$n||o[1]!==lt.watcherFrame&&o[1]!==lt.producerFrame)return null;const a=new DataView(o.buffer,o.byteOffset,o.byteLength);return{type:o[1],channelId:a.getUint32(2,!1),sequence:a.getUint32(6,!1),payload:o.subarray(Qt)}}function Bn(){return Hr()}function qn(r,o,a){const[s,l]=t.useState({connected:!1,error:null}),[d,u]=t.useState(0),p=t.useRef(null),j=t.useRef(0),v=t.useRef(new Map),C=t.useRef([]),c=t.useRef(0),k=t.useRef(new Map),T=t.useRef(new Map),L=t.useRef(new Map),m=t.useRef(1e3),y=t.useRef(!1),w=t.useRef(null),x=t.useRef(r),R=t.useRef(o),N=t.useRef(a);x.current=r,R.current=o,N.current=a;const D=t.useCallback((P,A)=>{let E=k.current.get(P);return E||k.current.set(P,E=new Set),E.add(A),()=>E.delete(A)},[]),M=t.useCallback((P,A)=>{let E=T.current.get(P);return E||T.current.set(P,E=new Set),E.add(A),()=>E.delete(A)},[]),X=t.useCallback((P,A)=>{let E=L.current.get(P);return E||L.current.set(P,E=new Set),E.add(A),()=>E.delete(A)},[]),B=t.useCallback((P,A)=>{const E=p.current;if(!E||E.readyState!==WebSocket.OPEN)return!1;const I=new TextEncoder().encode(A),z=new Uint8Array(6+I.byteLength),g=new DataView(z.buffer);return z[0]=1,z[1]=1,g.setUint32(2,P),z.set(I,6),E.send(z),!0},[]),H=t.useCallback(P=>{const A=p.current;(A==null?void 0:A.readyState)===WebSocket.OPEN?A.send(P):C.current.push(P)},[]),ne=t.useCallback((P,A={},E=15e3)=>new Promise((I,z)=>{var K;if(P.startsWith("browser:")&&((K=p.current)==null?void 0:K.readyState)!==WebSocket.OPEN){z(Object.assign(new Error("远程连接已断开,请等待重新连接"),{code:"EOFFLINE"}));return}const g=++c.current,_=setTimeout(()=>{v.current.delete(g),z(new Error(`${P} timeout`))},E);v.current.set(g,{resolve:I,reject:z,timer:_,type:P}),H(JSON.stringify({type:P,_req:g,...A}))}),[H]),$=t.useCallback(async()=>{y.current=!1;const P=++j.current;w.current&&(clearInterval(w.current),w.current=null);const A=p.current;if(A){A.onopen=A.onmessage=A.onerror=A.onclose=null;try{A.close()}catch{}}let E;try{E=await R.current()}catch{P===j.current&&N.current();return}if(P!==j.current||y.current)return;let I;try{I=new WebSocket(`${Bn()}?nonce=${encodeURIComponent(E)}`)}catch(z){l({connected:!1,error:String(z)});return}I.binaryType="arraybuffer",p.current=I,I.onopen=()=>{if(P!==j.current||p.current!==I)return;m.current=1e3,l({connected:!0,error:null}),u(K=>K+1);const z=C.current.splice(0);for(const K of z)I.send(K);let g=Date.now();w.current=setInterval(()=>{if(p.current!==I||I.readyState!==WebSocket.OPEN){clearInterval(w.current),w.current=null;return}if(Date.now()-g>25e3){try{I.close()}catch{}return}try{I.send(JSON.stringify({type:"ping"}))}catch{}},1e4);const _=()=>{g=Date.now()};I.addEventListener("message",_),I.addEventListener("close",()=>I.removeEventListener("message",_),{once:!0})},I.onmessage=z=>{var _,K,ie;if(P!==j.current||p.current!==I)return;if(typeof z.data!="string"){const F=new Uint8Array(z.data);if(F.byteLength>=6&&F[0]===1&&(F[1]===2||F[1]===6)){const ee=new DataView(F.buffer,F.byteOffset,F.byteLength).getUint32(2);(_=T.current.get(ee))==null||_.forEach(b=>b(F.subarray(6),F[1]===6))}else if(F.byteLength>=6&&F[0]===1&&F[1]===3){const ee=new DataView(F.buffer,F.byteOffset,F.byteLength).getUint32(2);(K=L.current.get(ee))==null||K.forEach(b=>b())}else x.current(F);return}let g;try{g=JSON.parse(z.data)}catch{return}if(g.type==="error"&&g.id!=null){const F=v.current.get(g.id);if(F){v.current.delete(g.id),clearTimeout(F.timer);const ee=Object.assign(new Error(g.error||"gateway error"),{code:g.code});F.reject(ee)}return}if(g.id!=null&&typeof g.type=="string"&&g.type.endsWith(":result")){const F=v.current.get(g.id);(F==null?void 0:F.type)==="fs:preview-open"&&typeof g.url=="string"&&(g.url=qr(g.url)),F&&(v.current.delete(g.id),clearTimeout(F.timer),F.resolve(g));return}(ie=k.current.get(g.type))==null||ie.forEach(F=>F(g))},I.onclose=z=>{if(P!==j.current||p.current!==I)return;w.current&&(clearInterval(w.current),w.current=null),p.current=null;for(const[_,K]of v.current)K.type.startsWith("browser:")&&(clearTimeout(K.timer),v.current.delete(_),K.reject(Object.assign(new Error("远程连接已断开,请重新接管"),{code:"EOFFLINE"})));if(l({connected:!1,error:null}),z.code===4001||z.code===4003){N.current();return}if(y.current)return;const g=m.current;m.current=Math.min(g*2,8e3),setTimeout(()=>{!y.current&&P===j.current&&$()},g)},I.onerror=()=>{}},[]);return t.useEffect(()=>($(),()=>{y.current=!0,j.current++,w.current&&(clearInterval(w.current),w.current=null);const P=p.current;if(p.current=null,P){P.onopen=P.onmessage=P.onerror=P.onclose=null;try{P.close()}catch{}}}),[$]),{state:s,epoch:d,rpc:ne,onEvent:D,onTerminalData:M,onTerminalReset:X,sendTerminalInput:B,reconnect:$}}function Hn(){const[r,o]=t.useState("loading"),[a,s]=t.useState(null),[l]=t.useState("same-origin"),[d,u]=t.useState(null),p=t.useCallback(async()=>{o("loading"),u(null);try{const c=await fetch("/api/web-console/bootstrap",{credentials:"same-origin",cache:"no-store"});if(c.status===401||c.status===423){window.location.reload();return}if(!c.ok)throw new Error(`HTTP ${c.status}`);const k=await c.json();s(k.user),o("authenticated")}catch{u("无法连接远程控制台"),o("needsLogin")}},[]);t.useEffect(()=>{p()},[p]);const j=t.useCallback(async()=>{const c=await fetch("/api/web-console/bootstrap",{credentials:"same-origin",cache:"no-store"});if((c.status===401||c.status===423)&&window.location.reload(),!c.ok)throw new Error("bootstrap failed");const k=await c.json();return s(k.user),o("authenticated"),k.wsNonce},[]),v=t.useCallback(async()=>(window.location.reload(),!1),[]),C=t.useCallback(async()=>{const c=await fetch("/api/pairing/logout",{method:"POST",credentials:"same-origin"});c.ok||c.status===401||c.status===423?window.location.reload():u("退出失败,请重试")},[]);return{status:r,user:a,error:d,csrfToken:l,setup:v,login:v,logout:C,refresh:p,getWsNonce:j}}function Vn({children:r}){const o=Hn(),[a,s]=t.useState(!1),l=o.status==="authenticated",d=t.useCallback(()=>s(!0),[]);return t.useEffect(()=>{l||s(!1)},[l]),e.jsxs(e.Fragment,{children:[l?r(o,d):null,e.jsx(Vr,{ready:l&&a,error:o.error,onRetry:()=>void o.refresh()})]})}function Zt(r,o,a){const s=r.findIndex(p=>p.id===o),l=r.findIndex(p=>p.id===a);if(s<0||l<0||s===l)return[...r];const d=[...r],[u]=d.splice(s,1);return d.splice(l,0,u),d}function Kn(){return typeof crypto.randomUUID=="function"?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),r=>r.toString(16).padStart(2,"0")).join("")}function gr(r,o=Kn()){return{id:o,command:r.trim()}}function Gn({commands:r,onChange:o,onExecute:a}){const[s,l]=t.useState(null),[d,u]=t.useState(""),[p,j]=t.useState(null),v=t.useRef(null),C=()=>{if(!s)return;const m=s.value.trim();if(!m)return u("命令不能为空");if(m.length>1e3)return u("命令最多 1000 个字符");if(/[\r\n\0]/.test(m))return u("命令只能包含一行");s.id?o(r.map(y=>y.id===s.id?{...y,command:m}:y)):o([...r,gr(m)]),l(null),u("")},c=(m,y)=>{m.preventDefault(),m.stopPropagation(),v.current=y,j(y),m.currentTarget.setPointerCapture(m.pointerId)},k=m=>{var x;if(!v.current)return;const y=(x=document.elementFromPoint(m.clientX,m.clientY))==null?void 0:x.closest("[data-pinned-id]"),w=y==null?void 0:y.dataset.pinnedId;w&&w!==v.current&&o(Zt(r,v.current,w))},T=m=>{m.currentTarget.hasPointerCapture(m.pointerId)&&m.currentTarget.releasePointerCapture(m.pointerId),v.current=null,j(null)},L=(m,y)=>{if(m.key!=="ArrowUp"&&m.key!=="ArrowDown")return;m.preventDefault();const w=r.findIndex(R=>R.id===y),x=r[w+(m.key==="ArrowUp"?-1:1)];x&&o(Zt(r,y,x.id))};return e.jsxs("section",{className:"pinned-commands","aria-labelledby":"pinned-command-title",children:[e.jsxs("div",{className:"pinned-command-head",children:[e.jsx("span",{id:"pinned-command-title",children:"置顶命令"}),e.jsx("button",{className:"history-icon-button",onClick:()=>{l({id:null,value:""}),u("")},"aria-label":"新增置顶命令",title:"新增置顶命令",children:e.jsx($e,{size:14,"aria-hidden":"true"})})]}),r.map(m=>(s==null?void 0:s.id)===m.id?e.jsx(er,{editor:s,error:d,onChange:y=>{l({...s,value:y}),u("")},onSave:C,onCancel:()=>{l(null),u("")}},m.id):e.jsxs("div",{className:`pinned-command-row${p===m.id?" pinned-command-dragging":""}`,"data-pinned-id":m.id,role:"button",tabIndex:0,onClick:()=>a(m.command),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),a(m.command))},children:[e.jsx("button",{className:"pinned-command-grip",onPointerDown:y=>c(y,m.id),onPointerMove:k,onPointerUp:T,onPointerCancel:T,onKeyDown:y=>L(y,m.id),onClick:y=>y.stopPropagation(),"aria-label":`调整 ${m.command} 的顺序`,title:"拖动排序,或按上下方向键",children:e.jsx(tn,{size:14,"aria-hidden":"true"})}),e.jsx("code",{children:m.command}),e.jsxs("div",{className:"pinned-command-actions",onClick:y=>y.stopPropagation(),children:[e.jsx("button",{className:"history-icon-button",onClick:()=>{l({id:m.id,value:m.command}),u("")},"aria-label":`编辑 ${m.command}`,title:"编辑",children:e.jsx(ot,{size:12,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button history-icon-danger",onClick:()=>o(r.filter(y=>y.id!==m.id)),"aria-label":`删除 ${m.command}`,title:"删除",children:e.jsx(mt,{size:12,"aria-hidden":"true"})})]})]},m.id)),(s==null?void 0:s.id)===null&&e.jsx(er,{editor:s,error:d,onChange:m=>{l({...s,value:m}),u("")},onSave:C,onCancel:()=>{l(null),u("")}})]})}function er({editor:r,error:o,onChange:a,onSave:s,onCancel:l}){return e.jsxs("div",{className:"pinned-command-editor",children:[e.jsx("input",{autoFocus:!0,value:r.value,maxLength:1e3,onChange:d=>a(d.target.value),onKeyDown:d=>{d.key==="Enter"&&s(),d.key==="Escape"&&l()},"aria-label":r.id?"编辑置顶命令":"新增置顶命令"}),e.jsx("button",{className:"history-icon-button",onClick:s,"aria-label":"保存命令",title:"保存",children:e.jsx(nt,{size:13,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button",onClick:l,"aria-label":"取消编辑",title:"取消",children:e.jsx(ke,{size:13,"aria-hidden":"true"})}),o&&e.jsx("small",{role:"alert",children:o})]})}function Yn({csrfToken:r,terminalId:o,pinnedCommands:a,onPinnedCommandsChange:s,onFill:l,onExecute:d}){const[u,p]=t.useState([]),[j,v]=t.useState(""),[C,c]=t.useState(""),k=t.useCallback(async()=>{const w=new URLSearchParams({q:j,limit:"200"}),x=await fetch(`/api/web-console/history?${w}`,{credentials:"same-origin"});x.ok&&p((await x.json()).history)},[j]);t.useEffect(()=>{const w=setTimeout(k,200);return()=>clearTimeout(w)},[k]);const T=async w=>{await fetch("/api/web-console/history",{method:"DELETE",credentials:"same-origin",headers:{"content-type":"application/json","x-csrf-token":r},body:JSON.stringify({id:w})}),k()},L=w=>{o&&l(w)},m=t.useCallback(w=>{w==="[REDACTED]"||a.some(x=>x.command===w)||s([...a,gr(w)])},[s,a]),y=async w=>{const x=await ln(w);c(x?"已复制命令":"复制失败,请长按命令手动复制")};return e.jsxs("div",{className:"history-panel",children:[e.jsx(Gn,{commands:a,onChange:s,onExecute:d}),e.jsxs("div",{className:"history-search",children:[e.jsx("input",{value:j,onChange:w=>v(w.target.value),placeholder:"搜索命令"}),e.jsx("button",{className:"history-icon-button",onClick:k,"aria-label":"刷新历史",title:"刷新历史",children:e.jsx(be,{size:13,"aria-hidden":"true"})})]}),C&&e.jsx("div",{className:"terminal-clipboard-notice",role:"status",children:C}),u.map(w=>e.jsxs("div",{className:`history-item${o?"":" history-item-disabled"}`,role:"button",tabIndex:o?0:-1,onClick:()=>L(w.command),onKeyDown:x=>{x.target===x.currentTarget&&(x.key==="Enter"||x.key===" ")&&o&&(x.preventDefault(),L(w.command))},children:[e.jsx("code",{children:w.command}),e.jsxs("small",{children:[w.cwd," · ",new Date(w.executedAt).toLocaleString()]}),e.jsxs("div",{className:"history-item-actions",onClick:x=>x.stopPropagation(),onPointerDown:x=>x.stopPropagation(),children:[e.jsx("button",{className:"history-icon-button",onClick:()=>void y(w.command),"aria-label":"复制命令",title:"复制",children:e.jsx(rn,{size:12,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button",disabled:!o,onClick:()=>L(w.command),"aria-label":"填入命令",title:"填入",children:e.jsx(wn,{size:12,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button",disabled:w.command==="[REDACTED]"||a.some(x=>x.command===w.command),onClick:()=>m(w.command),"aria-label":"置顶命令",title:"置顶",children:e.jsx(nn,{size:12,"aria-hidden":"true"})}),e.jsx("button",{className:"history-icon-button history-icon-danger",onClick:()=>T(w.id),"aria-label":"删除历史",title:"删除",children:e.jsx(mt,{size:12,"aria-hidden":"true"})})]})]},w.id)),!u.length&&e.jsx("div",{className:"history-empty",children:"暂无 Shell 命令历史"}),!o&&!!u.length&&e.jsx("div",{className:"history-empty",children:"请先打开一个终端页签"})]})}function Jn({themeId:r,onThemeChange:o}){const[a,s]=t.useState(!1),l=t.useRef(null),d=t.useRef(null),u=t.useRef(null),[p,j]=t.useState(null),[v,C]=t.useState({top:-1e3,left:0});return t.useEffect(()=>{var c;j(((c=l.current)==null?void 0:c.closest(".web-root"))??document.body)},[]),t.useLayoutEffect(()=>{if(!a)return;const c=()=>{var L;const k=(L=d.current)==null?void 0:L.getBoundingClientRect();if(!k)return;const T=Math.min(176,innerWidth-16);C({top:k.bottom+6,left:Math.max(8,Math.min(innerWidth-T-8,k.right-T))})};return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}},[a]),t.useEffect(()=>{if(!a)return;const c=T=>{var L,m;!((L=l.current)!=null&&L.contains(T.target))&&!((m=u.current)!=null&&m.contains(T.target))&&s(!1)},k=T=>{var L;T.key==="Escape"&&(s(!1),(L=d.current)==null||L.focus())};return document.addEventListener("pointerdown",c),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",c),document.removeEventListener("keydown",k)}},[a]),e.jsxs("div",{ref:l,className:"theme-picker",children:[e.jsx("button",{ref:d,type:"button",className:"file-drawer-toggle","aria-label":"换肤",title:"换肤","aria-expanded":a,"aria-haspopup":"dialog",onClick:()=>s(c=>!c),children:e.jsx(lr,{size:17,"aria-hidden":"true"})}),a&&p&&Te.createPortal(e.jsxs("div",{ref:u,className:"theme-popover",role:"dialog","aria-label":"选择皮肤","data-toolbar-overlay":!0,style:{position:"fixed",...v,zIndex:210,width:Math.min(176,innerWidth-16),boxSizing:"border-box",padding:8,borderRadius:10,border:"1px solid var(--ui-tabbar-border, #282b36)",background:"var(--ui-tab-active-bg, #262b38)",boxShadow:"0 10px 28px rgba(0,0,0,.45)"},children:[e.jsx("div",{style:{fontSize:10,color:"var(--ui-connection-text, #777b8c)",margin:"2px 4px 6px",letterSpacing:.5},children:"皮肤"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:Kr.map(c=>{const k=c.id===r;return e.jsxs("button",{type:"button",className:"theme-popover-item","aria-label":c.label,"aria-pressed":k,onPointerDown:T=>T.stopPropagation(),onClick:()=>{o(c.id),s(!1)},style:{background:k?"color-mix(in srgb, var(--ui-tab-accent, #7aa2f7) 14%, transparent)":"transparent"},children:[e.jsx("span",{style:{width:18,height:18,borderRadius:5,flexShrink:0,background:`linear-gradient(135deg, ${c.preview[0]} 55%, ${c.preview[1]} 55%)`,boxShadow:"inset 0 0 0 1px rgba(128,128,160,.25)"}}),e.jsx("span",{style:{flex:1,textAlign:"left",fontSize:12,fontWeight:k?600:400,color:k?"var(--ui-tab-active-text, #edf0f7)":"var(--ui-tab-text, #8f93a4)"},children:c.label}),k&&e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--ui-tab-accent, #7aa2f7)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"m5 12 4 4L19 6"})})]},c.id)})})]}),p)]})}function Xn(r,o){return{height:Math.round((r==null?void 0:r.height)??o.height),width:Math.round((r==null?void 0:r.width)??o.width),top:Math.round((r==null?void 0:r.offsetTop)??0),left:Math.round((r==null?void 0:r.offsetLeft)??0)}}function Qn(r){r&&(r.scrollLeft=0)}const Zn="agent-webapp:tab-swipe:v1";function eo(r){if(!r||typeof r!="object")return null;const o=r;return o.type!==Zn||o.phase!=="move"&&o.phase!=="end"&&o.phase!=="cancel"||typeof o.deltaX!="number"||!Number.isFinite(o.deltaX)?null:o}function to(r,o,a){return r.origin!==o||r.source!==a?null:eo(r.data)}const tr="agent-webapp:ready:v1";function ro(r){return!r||typeof r!="object"||r.type!==tr?null:{type:tr}}function rr(r,o,a){return r.origin!==o||r.source!==a?null:ro(r.data)}function nr({groupId:r,title:o,onFrame:a,onLoad:s}){const l=t.useRef(null),[d,u]=t.useState("loading"),[p,j]=t.useState(0),v=r===void 0;return t.useEffect(()=>{const C=c=>{var k;dn(c,window.location.origin,((k=l.current)==null?void 0:k.contentWindow)??null,r??null)&&u("ready")};return window.addEventListener("message",C),()=>window.removeEventListener("message",C)},[r]),t.useEffect(()=>{if(d!=="loading")return;const C=window.setTimeout(()=>u(c=>c==="loading"?"error":c),3e4);return()=>window.clearTimeout(C)},[d,p]),e.jsxs("div",{className:"collaboration-pane","aria-busy":d==="loading",children:[e.jsx("iframe",{ref:C=>{l.current=C,a(C)},className:`webapp-frame collaboration-frame${d==="ready"?" is-ready":""}`,style:{visibility:d==="ready"?"visible":"hidden"},src:tt(v?"/app/?view=collaboration-dashboard":`/app/?view=collaboration&groupId=${encodeURIComponent(r)}`),title:o,onLoad:s,onError:()=>u("error")},p),d==="loading"&&e.jsx(Be,{label:"AGENT COLLABORATION",title:v?"正在打开群聊看板":"正在进入群聊",caption:v?"正在加载已保存的群聊":"正在加载群成员与聊天记录",icon:e.jsx(ut,{size:36,strokeWidth:1.5})}),d==="error"&&e.jsxs("div",{className:"collaboration-load-error",role:"alert",children:[e.jsx("strong",{children:v?"暂时无法打开群聊看板":"暂时无法打开群聊"}),e.jsx("span",{children:"请检查连接后重试。"}),e.jsxs("button",{onClick:()=>{u("loading"),j(C=>C+1)},children:[e.jsx(be,{size:15}),"重新加载"]})]}),e.jsx("style",{jsx:!0,children:`
|
|
88
88
|
.collaboration-pane { position:relative; height:100%; background:var(--ui-term-col-bg, #101014); }
|
|
89
89
|
.collaboration-frame.is-ready { animation:collaboration-appear 220ms ease-out both; }
|
|
90
90
|
.collaboration-load-error { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; color:var(--ui-text, #e5e7eb); background:var(--ui-term-col-bg, #101014); padding:20px; text-align:center; }
|
|
@@ -93,4 +93,4 @@ import{c as dt,r as t,j as e,P as $e,f as Te,R as be,m as Ar,n as zr,o as Re,s a
|
|
|
93
93
|
.collaboration-load-error button:focus-visible { outline:2px solid currentColor; outline-offset:3px; }
|
|
94
94
|
@keyframes collaboration-appear { from { opacity:0; } to { opacity:1; } }
|
|
95
95
|
@media (prefers-reduced-motion:reduce) { .collaboration-frame.is-ready { animation:none; } }
|
|
96
|
-
`})]})}function or(r){try{const o=JSON.parse(r||"null");if(!o||!Array.isArray(o.tabs))return null;const a=new Set,s=new Set(["webapp","aihub","flowstudio","remote-desktop","collaboration","collaboration-dashboard"]),c=[];for(const d of o.tabs.slice(0,100))!d||typeof d.id!="string"||typeof d.title!="string"||a.has(d.id)||d.kind!==void 0&&!s.has(d.kind)||d.kind==="collaboration"&&typeof d.groupId!="string"||(a.add(d.id),c.push({id:d.id,title:d.title,...d.kind?{kind:d.kind}:{},...typeof d.groupId=="string"?{groupId:d.groupId}:{}}));return{tabs:c,activeTerminalId:typeof o.activeTerminalId=="string"?o.activeTerminalId:null}}catch{return null}}function no(r,o,a){const s=new Map(o.filter(u=>u.status==="active"||u.status==="detached").map(u=>[u.id,{id:u.id,title:u.title}])),c=[],d=new Set;for(const u of[...(r==null?void 0:r.tabs)??[],...a,...s.values()])d.has(u.id)||!u.kind&&!s.has(u.id)||(d.add(u.id),c.push(u.kind?u:s.get(u.id)));return c}const ve={id:"remote-desktop",title:"远程桌面",kind:"remote-desktop"};function ir(r){const o=r.find(a=>a.kind==="remote-desktop");return o?r.map(a=>a===o?{...ve}:a):[...r,{...ve}]}const Ue={id:"collaboration-dashboard",title:"群聊看板",kind:"collaboration-dashboard"};function oo(r){return r.some(o=>o.id===Ue.id)?r:[...r,{...Ue}]}const io=Le(()=>Pe(()=>import("./TerminalPane-L6DN1Y0T.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),{ssr:!1}),ao=Le(()=>Pe(()=>import("./FileTree-CXiXQO4N.js"),__vite__mapDeps([11,1,2,12,5,13,7]),import.meta.url),{ssr:!1}),so=Le(()=>Pe(()=>import("./FilePreview-BQBYZYpb.js").then(r=>r.b),__vite__mapDeps([14,1,2,6,15,13,7,5,16]),import.meta.url),{ssr:!1}),co=Le(()=>Pe(()=>import("./AiHubPane-D3O__UGN.js"),__vite__mapDeps([17,1,2,5,13,18]),import.meta.url),{ssr:!1}),lo=Le(()=>Pe(()=>import("./FlowStudioPane-DUjBX_7t.js"),__vite__mapDeps([19,1,2,20,4,5,6,7,3,8,9]),import.meta.url),{ssr:!1,loading:()=>e.jsx(Be,{})});function uo(){return e.jsx(Vn,{children:(r,o)=>e.jsx(fo,{auth:r,onWorkspaceReady:o})})}const de={id:"webapp-agent",title:"智能助手",kind:"webapp"},ar={id:"ai-hub",title:"AI Hub",kind:"aihub"},sr={id:"flow-studio",title:"Flow Studio",kind:"flowstudio"};function po(){var r;return typeof document>"u"?Xr:rt((r=document.getElementById("web-theme-root"))==null?void 0:r.dataset.webTheme).id}const mo="agent-web-shell:skin:v1";function fo({auth:r,onWorkspaceReady:o}){var Nt,Pt,Lt,It;const[a,s]=t.useState(null),[c,d]=t.useState(0),u=t.useCallback(n=>{if((n==null?void 0:n.openMode)==="new-tab"){window.open(n.url,"_blank","noopener,noreferrer");return}s(n)},[]),p=t.useCallback(n=>s((n==null?void 0:n.openMode)==="current"?n:null),[]),j=t.useRef(null),y=t.useRef(null),v=t.useRef(null),[l,C]=t.useState({}),E=t.useRef(new Map),[P,m]=t.useState(0),[k,x]=t.useState(!1),[w,R]=t.useState(!1),N=t.useRef(()=>{}),D=t.useCallback(n=>{var f;const i=Un(n);if(!(!i||i.type!==lt.watcherFrame)){N.current(i.channelId,i.sequence);for(const h of[j,y]){if(!((f=h.current)!=null&&f.contentWindow))continue;const T=i.payload.slice().buffer;h.current.contentWindow.postMessage({type:Gr,channelId:i.channelId,sequence:i.sequence,data:T},window.location.origin,[T])}}},[]),{state:M,epoch:X,rpc:B,onEvent:H,onTerminalData:ne,onTerminalReset:$,sendTerminalInput:L}=qn(D,r.getWsNonce,r.refresh),A=t.useMemo(()=>({request:(n,i,f)=>B(n,i,f),subscribe:(n,i)=>H("fs:event",i)}),[H,B]);N.current=(n,i)=>{B("browser:frame-ack",{channelId:n,sequence:i}).catch(()=>{})};const[S,I]=t.useState([{...de}]),z=t.useRef(S);z.current=S;const[g,_]=t.useState(de.id),[K,ie]=t.useState({}),F=t.useRef(!1),[ee,b]=t.useState(!1),[O,Y]=t.useState(0),U=`agentroam:workspace:${typeof window>"u"?"":Ne()}:${((Nt=r.user)==null?void 0:Nt.id)??""}`,V=t.useRef(null),G=t.useRef(new Map),se=t.useRef(new Map),Ie=t.useCallback((n,i)=>{G.current.set(n,i);const f=window.setTimeout(()=>{if(G.current.get(n)!==i)return;const h=se.current.get(n);h&&(se.current.delete(n),i(h,!0))},180);return()=>{window.clearTimeout(f),G.current.get(n)===i&&G.current.delete(n)}},[]),Me=t.useCallback(n=>{var f;if(!g||(f=S.find(h=>h.id===g))!=null&&f.kind)return;const i=G.current.get(g);i?i(n):B("term:input",{id:g,data:`${n}`}).catch(()=>{}),le(!1)},[g,B,S]),[we,br]=t.useState(!1),[je,qe]=t.useState({}),[ue,Ae]=t.useState(null),[ce,le]=t.useState(!1),[he,ze]=t.useState("files"),[Ee,ht]=t.useState(null),[Se,gt]=t.useState(!0),[wr,xr]=t.useState(null),[He,bt]=t.useState(!1),[Ve,wt]=t.useState([]),[Ke,xt]=t.useState(_n()),[oe,yt]=t.useState(po),[vt,yr]=t.useState(!1),De=On(r.csrfToken),[kt,vr]=t.useState(!1),te=rt(oe),xe=t.useRef(null),[kr,Ge]=t.useState(0),[jr,Ye]=t.useState(!1),Je=t.useRef(null),jt=t.useRef(null),pe=t.useCallback(n=>{var f;const i=[j.current,y.current,v.current,...E.current.values()];for(const h of i)(f=h==null?void 0:h.contentWindow)==null||f.postMessage({type:mo,skin:n},window.location.origin)},[]);t.useEffect(()=>{pe(oe)},[oe,pe]),t.useEffect(()=>{const n=te.cssVars["--ui-root-bg"],i=te.cssVars["--ui-color-scheme"],f=document.getElementById("web-theme-root");for(const[T,W]of Object.entries(te.cssVars))f==null||f.style.setProperty(T,W);f&&(f.dataset.webTheme=te.id),document.documentElement.style.background=n,document.documentElement.style.colorScheme=i,document.body.style.background=n,document.body.style.colorScheme=i;let h=document.querySelector('meta[name="theme-color"]');h||(h=document.createElement("meta"),h.name="theme-color",document.head.append(h)),h.content=te.cssVars["--ui-tabbar-bg"]},[te]),t.useEffect(()=>{const n=i=>{var Mt,At,zt,Dt,Ot,Wt,_t,Ft,$t,Ut,Bt;const f=((Mt=v.current)==null?void 0:Mt.contentWindow)??null,h=un(i,window.location.origin,f);if(h){I(q=>h.deleted?q.filter(Q=>Q.groupId!==h.groupId):q.map(Q=>Q.groupId===h.groupId?{...Q,title:h.title}:Q)),h.deleted?_(q=>q===`collaboration-${h.groupId}`?Ue.id:q):C(q=>({...q,[h.groupId]:(q[h.groupId]||0)+1}));return}const T=pn(i,window.location.origin,i.source===f?f:((At=j.current)==null?void 0:At.contentWindow)??null);if(T){const q=`collaboration-${T.groupId}`;I(Q=>Q.some(_e=>_e.id===q)?Q:[...Q,{id:q,title:T.title,kind:"collaboration",groupId:T.groupId}]),_(q);return}const W=((zt=y.current)==null?void 0:zt.contentWindow)??null,J=fn(i,window.location.origin,W);if(J!==null){x(J);return}if(rr(i,window.location.origin,W)){x(!1),m(q=>q+1),R(!1),pe(oe);return}if(W&&i.origin===window.location.origin&&i.source===W&&((Dt=i.data)==null?void 0:Dt.type)===hn){R(!0);return}if(i.origin===window.location.origin&&i.source===W&&W&&((Ot=i.data)==null?void 0:Ot.type)===gn){x(!1),B("browser:unwatch").catch(()=>{}),I(q=>q.filter(Q=>Q.kind!=="remote-desktop")),m(0),R(!1),_(de.id);return}if(Qr(i,window.location.origin,((Wt=j.current)==null?void 0:Wt.contentWindow)??null)){I(ir),_(ve.id);return}if(rr(i,window.location.origin,((_t=j.current)==null?void 0:_t.contentWindow)??null)){vr(!0),o();return}const Z=(Ft=[...E.current.values()].find(q=>q.contentWindow===i.source))==null?void 0:Ft.contentWindow,re=on(i,window.location.origin,Z??(($t=j.current)==null?void 0:$t.contentWindow)??null);if(re){const q=Q=>{ze("files"),le(!Gt(Q)),Ae(Q),Gt(Q)||xr({...re,path:Q})};re.path.startsWith("~/")?B("hello").then(({home:Q})=>{const _e=an(re.path,null,Q);_e&&q(_e)}).catch(()=>{}):q(re.path);return}const ge=i.source===W&&W?W:((Ut=j.current)==null?void 0:Ut.contentWindow)??null,ye=Zr(i,window.location.origin,ge);if(ye){B(ye.method,{...ye.payload,...ye.method==="browser:watch"?{frameAck:!0}:{}}).then(q=>{ge==null||ge.postMessage({type:Vt,id:ye.id,ok:!0,result:q},window.location.origin)},q=>{ge==null||ge.postMessage({type:Vt,id:ye.id,ok:!1,error:q.message||"浏览器操作失败",code:q.code},window.location.origin)});return}Fn(i,window.location.origin,[((Bt=j.current)==null?void 0:Bt.contentWindow)??null,f,...[...E.current.values()].map(q=>q.contentWindow)],B)};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)},[o,B,pe,oe]),t.useEffect(()=>{const n=h=>{var T,W;for(const J of[j,y])(W=(T=J.current)==null?void 0:T.contentWindow)==null||W.postMessage({type:Qe,event:h},window.location.origin)},f=["browser:session","browser:frame","browser:state","browser:closed","browser:webrtc"].map(h=>H(h,n));return()=>f.forEach(h=>h())},[H]),t.useEffect(()=>{var n,i;kt&&((i=(n=j.current)==null?void 0:n.contentWindow)==null||i.postMessage({type:Qe,event:{type:"browser:connection",connected:M.connected,epoch:X}},window.location.origin))},[M.connected,X,kt]),t.useEffect(()=>{var n,i;P&&((i=(n=y.current)==null?void 0:n.contentWindow)==null||i.postMessage({type:mn,visible:g===ve.id},window.location.origin))},[g,P]),t.useEffect(()=>{var n,i;P&&((i=(n=y.current)==null?void 0:n.contentWindow)==null||i.postMessage({type:Qe,event:{type:"browser:connection",connected:M.connected,epoch:X}},window.location.origin))},[M.connected,X,P]);const Et=t.useRef(0),St=g?K[g]??null:null;t.useEffect(()=>{const n=window.visualViewport;let i=null,f="";const h=()=>{const T=Xn(n,{height:window.innerHeight,width:window.innerWidth}),W=`${T.width}x${T.height}+${T.top}+${T.left}`;W!==f&&(f=W,document.documentElement.style.setProperty("--vv-height",`${T.height}px`),document.documentElement.style.setProperty("--vv-width",`${T.width}px`),document.documentElement.style.setProperty("--vv-top",`${T.top}px`),document.documentElement.style.setProperty("--vv-left",`${T.left}px`),i&&window.clearTimeout(i),i=window.setTimeout(h,250))};return h(),n==null||n.addEventListener("resize",h),n==null||n.addEventListener("scroll",h),window.addEventListener("orientationchange",h),window.addEventListener("resize",h),document.addEventListener("visibilitychange",h),window.addEventListener("pageshow",h),()=>{n==null||n.removeEventListener("resize",h),n==null||n.removeEventListener("scroll",h),window.removeEventListener("orientationchange",h),window.removeEventListener("resize",h),document.removeEventListener("visibilitychange",h),window.removeEventListener("pageshow",h),i&&window.clearTimeout(i),document.documentElement.style.removeProperty("--vv-height"),document.documentElement.style.removeProperty("--vv-width"),document.documentElement.style.removeProperty("--vv-top"),document.documentElement.style.removeProperty("--vv-left")}},[]),t.useEffect(()=>{fetch("/api/web-console/preferences",{credentials:"same-origin"}).then(n=>n.json()).then(n=>{var i,f,h,T;typeof((i=n.preferences)==null?void 0:i.keybarHidden)=="boolean"&&bt(n.preferences.keybarHidden),Array.isArray((f=n.preferences)==null?void 0:f.keyOrder)&&wt(n.preferences.keyOrder),Array.isArray((h=n.preferences)==null?void 0:h.pinnedCommands)&&xt(n.preferences.pinnedCommands),(T=n.preferences)!=null&&T.theme&&yt(rt(n.preferences.theme).id)}).catch(()=>{}).finally(()=>yr(!0)),fetch("/api/web-console/device-state",{credentials:"same-origin"}).then(n=>n.json()).then(n=>{const i=n.deviceState;i!=null&&i.drawerTab&&ze(i.drawerTab),i!=null&&i.activeTerminalId&&(V.current=i.activeTerminalId),typeof(i==null?void 0:i.drawerOpen)=="boolean"&&le(i.drawerOpen),i!=null&&i.fileTreeRoot&&ht(i.fileTreeRoot),typeof(i==null?void 0:i.fileTreeFollowMode)=="boolean"&>(i.fileTreeFollowMode),i!=null&&i.selectedFile&&Ae(i.selectedFile),i!=null&&i.terminalScroll&&typeof i.terminalScroll=="object"&&qe(i.terminalScroll)}).catch(()=>{}).finally(()=>br(!0))},[]);const Ct=t.useCallback(n=>{fetch("/api/web-console/preferences",{method:"PATCH",credentials:"same-origin",headers:{"content-type":"application/json","x-csrf-token":r.csrfToken},body:JSON.stringify(n)}).catch(()=>{})},[r.csrfToken]);t.useEffect(()=>{if(!vt)return;const n=setTimeout(()=>Ct({keybarHidden:He,keyOrder:Ve,pinnedCommands:Ke,theme:oe}),500);return()=>clearTimeout(n)},[He,Ve,Ke,oe,vt,Ct]);const Oe=t.useCallback(n=>{r.csrfToken&&fetch("/api/web-console/device-state",{method:"PUT",credentials:"same-origin",keepalive:!0,headers:{"content-type":"application/json","x-csrf-token":r.csrfToken},body:JSON.stringify(n)}).catch(()=>{})},[r.csrfToken]);t.useEffect(()=>{if(!r.csrfToken||!ee||!we)return;const n=setTimeout(()=>Oe({activeTerminalId:g,drawerOpen:ce,drawerTab:he,fileTreeRoot:Ee,fileTreeFollowMode:Se,selectedFile:ue,terminalScroll:je}),500);return()=>clearTimeout(n)},[g,ce,he,Ee,Se,ue,je,r.csrfToken,Oe,ee,we]),t.useEffect(()=>{if(!r.csrfToken||!ee||!we)return;const n=()=>Oe({activeTerminalId:g,drawerOpen:ce,drawerTab:he,fileTreeRoot:Ee,fileTreeFollowMode:Se,selectedFile:ue,terminalScroll:je});return window.addEventListener("pagehide",n),()=>window.removeEventListener("pagehide",n)},[g,ce,he,Ee,Se,ue,je,r.csrfToken,Oe,ee,we]);const Er=t.useCallback(n=>{Ae(n),le(!1)},[]),Sr=t.useCallback(()=>{if(S.length>=8)return;const n=`t-web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;I(i=>i.length>=8?i:[...i,{id:n,title:`Terminal ${i.length+1}`}]),_(n)},[S.length]),Cr=t.useCallback(n=>{const i=S.find(T=>T.id===g);if(i!=null&&i.kind&&i.kind!=="webapp")return;if(i&&!i.kind){const T=G.current.get(i.id);T?T(n,!0):se.current.set(i.id,n),le(!1);return}const f=S.length>=8?S.find(T=>!T.kind):null,h=(f==null?void 0:f.id)??`t-web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;f?se.current.set(h,n):I(T=>[...T,{id:h,title:`Terminal ${T.length+1}`,initialCommand:n}]),_(h),le(!1)},[g,S]);t.useEffect(()=>{if(!M.connected||!we||F.current)return;F.current=!0;let n=!1,i=!1,f;return B("term:list").then(h=>{if(n)return;let T=null;try{T=or(localStorage.getItem(U))}catch{}const W=no(T,h.tabs,z.current);I(W),_(J=>{const fe=z.current.find(re=>re.id===J&&re.kind&&re.kind!=="webapp");if(fe)return fe.id;const Z=(T==null?void 0:T.activeTerminalId)||V.current||J||de.id;return Z===de.id?de.id:W.some(re=>re.id===Z)?Z:de.id}),i=!0,b(!0)}).catch(()=>{n||(F.current=!1,f=setTimeout(()=>Y(h=>h+1),2e3))}),()=>{n=!0,clearTimeout(f),i||(F.current=!1)}},[M.connected,we,B,U,O]),t.useLayoutEffect(()=>{if(ee)try{const n=or(JSON.stringify({tabs:S,activeTerminalId:g}));localStorage.setItem(U,JSON.stringify(n))}catch{}},[S,g,ee,U]);const Tr=n=>{var f;if(n===de.id)return;const i=(f=S.find(h=>h.id===n))==null?void 0:f.kind;i==="remote-desktop"&&(m(0),R(!1),B("browser:unwatch").catch(()=>{})),!(!i&&!window.confirm("关闭页签会终止该终端进程,确认关闭?"))&&(I(h=>{var W;const T=h.filter(J=>J.id!==n);return g===n&&_(((W=T[0])==null?void 0:W.id)??null),T}),i||B("term:kill",{id:n}).catch(()=>{}))},Rr=t.useCallback(()=>{I(n=>{const i=n.find(f=>f.kind==="aihub");return i?(_(i.id),n):(_(ar.id),[...n,{...ar}])})},[]),Nr=t.useCallback(()=>{I(n=>{const i=n.find(f=>f.kind==="flowstudio");return i?(_(i.id),n):(_(sr.id),[...n,{...sr}])})},[]),Pr=t.useCallback(()=>{I(ir),_(ve.id)},[]);t.useEffect(()=>{const n=H("term:exited",i=>{const f=i==null?void 0:i.id;f&&(I(h=>{const T=h.filter(W=>W.id!==f);return _(W=>{var J;return W===f?((J=T[0])==null?void 0:J.id)??null:W}),T}),qe(h=>{if(!(f in h))return h;const T={...h};return delete T[f],T}))});return()=>{n()}},[H]);const Tt=t.useCallback(n=>{if(!g||S.length<2)return;const f=(S.findIndex(h=>h.id===g)+n+S.length)%S.length;_(S[f].id)},[g,S]),Rt=Math.max(0,S.findIndex(n=>n.id===g)),Lr=((Pt=S[Rt])==null?void 0:Pt.kind)==="webapp"?te.cssVars["--ui-term-col-bg"]:te.termHostBg,Ir={...ae.root,...te.cssVars,"--ui-active-content-bg":Lr,"--ui-terminal-bg":te.termHostBg,"--ui-primary-text":te.keybar.accentText,background:"var(--ui-root-bg)",color:"var(--ui-text)"},me=t.useCallback(()=>{xe.current=null,Ge(0),Ye(!1)},[]),Xe=t.useCallback(n=>{Math.abs(n)>=64&&S.length>1&&Tt(n<0?1:-1),me()},[S.length,Tt,me]),Mr=n=>n instanceof Element&&!!n.closest(".terminal-screen");t.useEffect(()=>{const n=i=>{var h;if(g!==de.id)return;const f=to(i,window.location.origin,((h=j.current)==null?void 0:h.contentWindow)??null);f&&(f.phase==="move"?(Ye(!0),Ge(f.deltaX)):f.phase==="end"?Xe(f.deltaX):me())};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)},[g,Xe,me]);const We=t.useCallback((n="smooth")=>{const i=jt.current;if(!i||!g)return;const f=i.querySelector(`[data-terminal-id="${g}"]`);if(!f)return;if(f===i.querySelector("[data-terminal-id]")){Qn(i);return}const h=i.querySelector(".terminal-connection"),T=(h==null?void 0:h.offsetWidth)??0,W=8,J=f.offsetLeft,fe=J+f.offsetWidth,Z=i.scrollLeft,re=Z+i.clientWidth-T;J<Z+W?i.scrollTo({left:Math.max(0,J-W),behavior:n}):fe>re-W&&i.scrollTo({left:fe-i.clientWidth+T+W,behavior:n})},[g]);return t.useLayoutEffect(()=>{if(!g)return;const n=S.length>Et.current;Et.current=S.length,We(n?"auto":"smooth")},[g,S.length,We]),t.useEffect(()=>{const n=()=>requestAnimationFrame(()=>We("auto"));return window.addEventListener("pageshow",n),()=>window.removeEventListener("pageshow",n)},[We]),e.jsxs("div",{className:`web-root ${k&&g===ve.id&&!a?"is-remote-fullscreen":""}`,style:Ir,children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:Yr}}),e.jsxs("div",{className:"terminal-tabs",children:[a&&e.jsxs("div",{className:"computer-page-heading",children:[e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"返回电脑会话",title:"返回电脑会话",onClick:()=>s(null),children:e.jsx(cn,{size:18})}),e.jsx("span",{children:a.name}),e.jsx("a",{className:"file-drawer-toggle",href:a.url,target:"_blank",rel:"noopener noreferrer","aria-label":"在新页面打开当前页面",title:"打开原页面",children:e.jsx(ft,{size:16})})]}),e.jsx("div",{className:"terminal-tab-list",ref:jt,hidden:!!a,children:S.map(n=>e.jsxs("div",{"data-terminal-id":n.id,draggable:!0,className:`terminal-tab ${n.id===g?"active":""}`,onDragStart:()=>{Je.current=n.id},onDragOver:i=>i.preventDefault(),onDrop:i=>{i.preventDefault();const f=Je.current;Je.current=null,!(!f||f===n.id)&&I(h=>{const T=h.findIndex(Z=>Z.id===f),W=h.findIndex(Z=>Z.id===n.id);if(T<0||W<0)return h;const J=[...h],[fe]=J.splice(T,1);return J.splice(W,0,fe),B("term:reorder",{ids:J.filter(Z=>!Z.kind).map(Z=>Z.id)}).catch(()=>{}),J})},onClick:()=>_(n.id),onDoubleClick:()=>{var f;if(n.kind)return;const i=(f=window.prompt("页签名称",n.title))==null?void 0:f.trim();i&&B("term:rename",{id:n.id,title:i}).then(()=>I(h=>h.map(T=>T.id===n.id?{...T,title:i}:T))).catch(()=>{})},children:[e.jsx("span",{children:n.title}),n.kind!=="webapp"&&e.jsx("button",{tabIndex:-1,onClick:i=>{i.stopPropagation(),Tr(n.id)},children:"×"})]},n.id))}),e.jsx("button",{className:"terminal-add","aria-label":"新建终端页签",hidden:!!a,disabled:S.length>=8,onClick:Sr,children:"+"}),e.jsx("div",{className:"terminal-connection",children:e.jsx(Jr,{avatar:e.jsx(Pn,{username:((Lt=r.user)==null?void 0:Lt.username)??"?",connected:M.connected,accent:te.keybar.accent,accentText:te.keybar.accentText,selectedPageId:a==null?void 0:a.id,onSelectPage:u,onUpdatePage:p,configuration:De,csrfToken:r.csrfToken}),items:[{id:"refresh",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"刷新页面",title:"刷新页面",onClick:()=>a?d(n=>n+1):window.location.reload(),children:e.jsx(be,{size:17,"aria-hidden":"true"})})},{id:"collaboration",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"打开群聊看板",title:"群聊看板",onClick:()=>{s(null),I(oo),_(Ue.id)},children:e.jsx(ut,{size:17,"aria-hidden":"true"})})},{id:"install",content:e.jsx(yn,{})},{id:"remote",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"打开远程桌面",title:"远程桌面 · 浏览器直播",onClick:()=>{s(null),Pr()},children:e.jsx(et,{size:17,"aria-hidden":"true"})})},{id:"ai-hub",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"打开 AI Hub",title:"AI Hub · 多模型对比",onClick:()=>{s(null),Rr()},children:e.jsx(ur,{size:17,"aria-hidden":"true"})})},{id:"flow",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"打开数字人",title:"数字人 · Flow Studio",onClick:()=>{s(null),Nr()},children:e.jsx(pt,{size:17,"aria-hidden":"true"})})},{id:"theme",content:e.jsx(Jn,{themeId:oe,onThemeChange:yt})},{id:"files",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":ce?"关闭我的文件":"打开我的文件",title:"我的文件","aria-expanded":ce,onClick:()=>{s(null),le(n=>!n)},children:e.jsx(dr,{size:17,"aria-hidden":"true"})})}].filter(n=>De.settings.visibleTools.some(i=>i===n.id)).sort((n,i)=>De.settings.visibleTools.findIndex(f=>f===n.id)-De.settings.visibleTools.findIndex(f=>f===i.id))})})]}),e.jsxs("main",{className:`workspace ${ce?"show-tree":""} ${ue?"has-preview":""}`,hidden:!!a,style:ae.workspace,children:[e.jsx("section",{className:"term-col",style:ae.termCol,onPointerDownCapture:n=>{n.pointerType!=="touch"||!Mr(n.target)||(me(),xe.current={x:n.clientX,y:n.clientY,axis:"pending",pointerId:n.pointerId})},onPointerMoveCapture:n=>{const i=xe.current;if(!i||n.pointerId!==i.pointerId||n.pointerType!=="touch")return;const f=n.clientX-i.x,h=n.clientY-i.y;if(i.axis==="pending"){if(Math.max(Math.abs(f),Math.abs(h))<=8)return;if(Math.abs(h)>=Math.abs(f)*1.2){xe.current=null;return}i.axis="horizontal",Ye(!0);const T=W=>{window.removeEventListener("pointerup",T),window.removeEventListener("pointercancel",T),xe.current===i&&me()};window.addEventListener("pointerup",T),window.addEventListener("pointercancel",T)}i.axis==="horizontal"&&(n.preventDefault(),Ge(f))},onPointerUpCapture:n=>{const i=xe.current;if(!i||n.pointerId!==i.pointerId)return;const f=n.clientX-i.x;i.axis==="horizontal"&&Math.abs(f)>=64?Xe(f):me()},onPointerCancelCapture:me,children:e.jsx("div",{className:"terminal-track",style:{transform:`translate3d(calc(${-Rt*100}% + ${kr}px),0,0)`,transition:jr?"none":"transform 260ms cubic-bezier(.22,.8,.32,1)"},children:S.map(n=>e.jsx("div",{className:"terminal-slide",style:{position:"relative"},children:n.kind==="webapp"?e.jsx("iframe",{ref:j,className:"webapp-frame",src:tt("/app/"),title:n.title,onLoad:()=>pe(oe)}):n.kind==="collaboration-dashboard"?e.jsx(nr,{title:"群聊看板",onFrame:i=>{v.current=i},onLoad:()=>pe(oe)}):n.kind==="collaboration"?e.jsx(nr,{groupId:n.groupId||"",title:n.title,onFrame:i=>{i?E.current.set(n.id,i):E.current.delete(n.id)},onLoad:()=>pe(oe)},`${n.id}-${l[n.groupId||""]||0}`):n.kind==="remote-desktop"?e.jsxs("div",{style:{height:"100%",background:"var(--ui-term-col-bg, #101014)"},"aria-busy":!w,children:[e.jsx("iframe",{ref:y,className:"webapp-frame",style:{visibility:w?"visible":"hidden"},src:tt("/app/?view=remote-desktop"),title:"远程桌面",onLoad:()=>pe(oe)}),!w&&e.jsx(Be,{label:"REMOTE DESKTOP",title:"正在打开远程桌面",caption:"正在准备桌面与连接",icon:e.jsx(et,{size:36,strokeWidth:1.5})})]}):n.kind==="aihub"?e.jsx(co,{visible:n.id===g,rpc:B}):n.kind==="flowstudio"?e.jsx(lo,{visible:n.id===g}):e.jsx(io,{terminalId:n.id,title:n.title,initialCommand:n.initialCommand,visible:n.id===g,state:M,rpc:B,onEvent:H,onTerminalData:ne,onTerminalReset:$,sendTerminalInput:L,keyOrder:Ve,keybarHidden:He,onKeyOrderChange:wt,onKeybarHiddenChange:bt,terminalTheme:te,initialScrollLine:je[n.id]??null,onScrollLineChange:i=>qe(f=>f[n.id]===i?f:{...f,[n.id]:i}),onRegisterFill:i=>Ie(n.id,i),onCwdChange:i=>i&&ie(f=>({...f,[n.id]:i}))})},n.id))})}),ce&&e.jsx("div",{className:"drawer-mask",onClick:()=>le(!1)}),e.jsxs("aside",{className:`tree-col ${ce?"tree-col-open":""}`,style:ae.treeCol,children:[e.jsxs("div",{className:"tree-head",style:ae.treeHead,children:[e.jsx("button",{className:he==="files"?"drawer-tab-active":"",onClick:()=>ze("files"),children:"文件"}),e.jsx("button",{className:he==="history"?"drawer-tab-active":"",onClick:()=>ze("history"),children:"历史"}),e.jsx("span",{className:"tree-cwd",style:ae.treeCwd,children:St??""}),e.jsx("button",{style:{...ae.iconBtn,marginLeft:"auto",flexShrink:0},onClick:()=>le(!1),"aria-label":"close drawer",children:e.jsx(ke,{size:15,"aria-hidden":"true"})})]}),he==="files"?e.jsx(ao,{ready:X>0,followCwd:!0,cwd:St,gateway:A,onOpenFile:Er,selectedPath:ue,initialRoot:Ee,initialFollow:Se,revealRequest:wr,onTreeStateChange:(n,i)=>{ht(n),gt(i)}}):e.jsx(Yn,{csrfToken:r.csrfToken,terminalId:((It=S.find(n=>n.id===g))==null?void 0:It.kind)==="webapp"?null:g,pinnedCommands:Ke,onPinnedCommandsChange:xt,onFill:Me,onExecute:Cr}),e.jsxs("div",{style:ae.treeFoot,children:[e.jsx("span",{style:ae.treeFootDot}),e.jsx("span",{children:"实时同步"})]})]}),ue&&e.jsx("section",{className:"preview-col",style:ae.previewCol,children:e.jsx(so,{path:ue,gateway:A,onClose:()=>Ae(null)})})]}),a&&e.jsx(An,{page:a,reloadKey:c},a.id)]})}const ae={root:{height:"100dvh",display:"flex",flexDirection:"column",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif',overflow:"hidden"},iconBtn:{minWidth:28,height:28,borderRadius:7,border:"1px solid var(--ui-tabbar-border, #303442)",background:"var(--ui-tab-bg, #202029)",color:"var(--ui-tab-text, #aaaab8)",fontSize:13},workspace:{flex:1,minHeight:0,display:"grid",position:"relative"},treeCol:{background:"var(--ui-tree-bg, #121218)",minHeight:0,flexDirection:"column"},treeHead:{display:"flex",alignItems:"center",gap:8,padding:"10px 12px 4px",fontSize:11,textTransform:"uppercase",letterSpacing:1,color:"#778",flexShrink:0},treeCwd:{fontSize:10,color:"#556",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:150,textTransform:"none",letterSpacing:0},treeFoot:{display:"flex",alignItems:"center",gap:7,minHeight:31,padding:"6px 11px calc(env(safe-area-inset-bottom) + 6px)",borderTop:"1px solid var(--ui-tabbar-border, #282832)",boxShadow:"0 -5px 16px rgba(0,0,0,.22)",background:"var(--ui-tab-bg, #15151c)",color:"var(--ui-connection-text, #777789)",fontSize:10.5,flexShrink:0},treeFootDot:{width:6,height:6,borderRadius:99,background:"var(--ui-success, #9ece6a)",boxShadow:"0 0 0 2px color-mix(in srgb, var(--ui-success, #9ece6a) 12%, transparent)",flexShrink:0},termCol:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",background:"var(--ui-term-col-bg, #101014)",gridColumn:1,overflow:"hidden"},previewCol:{minWidth:0,minHeight:0}},jo=Object.freeze(Object.defineProperty({__proto__:null,default:uo},Symbol.toStringTag,{value:"Module"}));export{Be as F,jo as p,Qn as r};
|
|
96
|
+
`})]})}function or(r){try{const o=JSON.parse(r||"null");if(!o||!Array.isArray(o.tabs))return null;const a=new Set,s=new Set(["webapp","aihub","flowstudio","remote-desktop","collaboration","collaboration-dashboard"]),l=[];for(const d of o.tabs.slice(0,100))!d||typeof d.id!="string"||typeof d.title!="string"||a.has(d.id)||d.kind!==void 0&&!s.has(d.kind)||d.kind==="collaboration"&&typeof d.groupId!="string"||(a.add(d.id),l.push({id:d.id,title:d.title,...d.kind?{kind:d.kind}:{},...typeof d.groupId=="string"?{groupId:d.groupId}:{}}));return{tabs:l,activeTerminalId:typeof o.activeTerminalId=="string"?o.activeTerminalId:null}}catch{return null}}function no(r,o,a){const s=new Map(o.filter(u=>u.status==="active"||u.status==="detached").map(u=>[u.id,{id:u.id,title:u.title}])),l=[],d=new Set;for(const u of[...(r==null?void 0:r.tabs)??[],...a,...s.values()])d.has(u.id)||!u.kind&&!s.has(u.id)||(d.add(u.id),l.push(u.kind?u:s.get(u.id)));return l}const ve={id:"remote-desktop",title:"远程桌面",kind:"remote-desktop"};function ir(r){const o=r.find(a=>a.kind==="remote-desktop");return o?r.map(a=>a===o?{...ve}:a):[...r,{...ve}]}const Ue={id:"collaboration-dashboard",title:"群聊看板",kind:"collaboration-dashboard"};function oo(r){return r.some(o=>o.id===Ue.id)?r:[...r,{...Ue}]}const io=Le(()=>Pe(()=>import("./TerminalPane-B2s2ff23.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),{ssr:!1}),ao=Le(()=>Pe(()=>import("./FileTree-Cf8wDAVy.js"),__vite__mapDeps([11,1,2,12,5,13,7]),import.meta.url),{ssr:!1}),so=Le(()=>Pe(()=>import("./FilePreview-BdB8syBQ.js").then(r=>r.b),__vite__mapDeps([14,1,2,6,15,13,7,5,16]),import.meta.url),{ssr:!1}),co=Le(()=>Pe(()=>import("./AiHubPane-D1SGdI6y.js"),__vite__mapDeps([17,1,2,5,13,18]),import.meta.url),{ssr:!1}),lo=Le(()=>Pe(()=>import("./FlowStudioPane-DuUmV_ki.js"),__vite__mapDeps([19,1,2,20,4,5,6,7,3,8,9]),import.meta.url),{ssr:!1,loading:()=>e.jsx(Be,{})});function uo(){return e.jsx(Vn,{children:(r,o)=>e.jsx(fo,{auth:r,onWorkspaceReady:o})})}const de={id:"webapp-agent",title:"智能助手",kind:"webapp"},ar={id:"ai-hub",title:"AI Hub",kind:"aihub"},sr={id:"flow-studio",title:"Flow Studio",kind:"flowstudio"};function po(){var r;return typeof document>"u"?Xr:rt((r=document.getElementById("web-theme-root"))==null?void 0:r.dataset.webTheme).id}const mo="agent-web-shell:skin:v1";function fo({auth:r,onWorkspaceReady:o}){var Nt,Pt,Lt,It;const[a,s]=t.useState(null),[l,d]=t.useState(0),u=t.useCallback(n=>{if((n==null?void 0:n.openMode)==="new-tab"){window.open(n.url,"_blank","noopener,noreferrer");return}s(n)},[]),p=t.useCallback(n=>s((n==null?void 0:n.openMode)==="current"?n:null),[]),j=t.useRef(null),v=t.useRef(null),C=t.useRef(null),[c,k]=t.useState({}),T=t.useRef(new Map),[L,m]=t.useState(0),[y,w]=t.useState(!1),[x,R]=t.useState(!1),N=t.useRef(()=>{}),D=t.useCallback(n=>{var f;const i=Un(n);if(!(!i||i.type!==lt.watcherFrame)){N.current(i.channelId,i.sequence);for(const h of[j,v]){if(!((f=h.current)!=null&&f.contentWindow))continue;const S=i.payload.slice().buffer;h.current.contentWindow.postMessage({type:Gr,channelId:i.channelId,sequence:i.sequence,data:S},window.location.origin,[S])}}},[]),{state:M,epoch:X,rpc:B,onEvent:H,onTerminalData:ne,onTerminalReset:$,sendTerminalInput:P}=qn(D,r.getWsNonce,r.refresh),A=t.useMemo(()=>({request:(n,i,f)=>B(n,i,f),subscribe:(n,i)=>H("fs:event",i)}),[H,B]);N.current=(n,i)=>{B("browser:frame-ack",{channelId:n,sequence:i}).catch(()=>{})};const[E,I]=t.useState([{...de}]),z=t.useRef(E);z.current=E;const[g,_]=t.useState(de.id),[K,ie]=t.useState({}),F=t.useRef(!1),[ee,b]=t.useState(!1),[O,Y]=t.useState(0),U=`agentroam:workspace:${typeof window>"u"?"":Ne()}:${((Nt=r.user)==null?void 0:Nt.id)??""}`,V=t.useRef(null),G=t.useRef(new Map),se=t.useRef(new Map),Ie=t.useCallback((n,i)=>{G.current.set(n,i);const f=window.setTimeout(()=>{if(G.current.get(n)!==i)return;const h=se.current.get(n);h&&(se.current.delete(n),i(h,!0))},180);return()=>{window.clearTimeout(f),G.current.get(n)===i&&G.current.delete(n)}},[]),Me=t.useCallback(n=>{var f;if(!g||(f=E.find(h=>h.id===g))!=null&&f.kind)return;const i=G.current.get(g);i?i(n):B("term:input",{id:g,data:`${n}`}).catch(()=>{}),le(!1)},[g,B,E]),[we,br]=t.useState(!1),[je,qe]=t.useState({}),[ue,Ae]=t.useState(null),[ce,le]=t.useState(!1),[he,ze]=t.useState("files"),[Ee,ht]=t.useState(null),[Se,gt]=t.useState(!0),[wr,xr]=t.useState(null),[He,bt]=t.useState(!1),[Ve,wt]=t.useState([]),[Ke,xt]=t.useState(_n()),[oe,yt]=t.useState(po),[vt,yr]=t.useState(!1),De=On(r.csrfToken),[kt,vr]=t.useState(!1),te=rt(oe),xe=t.useRef(null),[kr,Ge]=t.useState(0),[jr,Ye]=t.useState(!1),Je=t.useRef(null),jt=t.useRef(null),pe=t.useCallback(n=>{var f;const i=[j.current,v.current,C.current,...T.current.values()];for(const h of i)(f=h==null?void 0:h.contentWindow)==null||f.postMessage({type:mo,skin:n},window.location.origin)},[]);t.useEffect(()=>{pe(oe)},[oe,pe]),t.useEffect(()=>{const n=te.cssVars["--ui-root-bg"],i=te.cssVars["--ui-color-scheme"],f=document.getElementById("web-theme-root");for(const[S,W]of Object.entries(te.cssVars))f==null||f.style.setProperty(S,W);f&&(f.dataset.webTheme=te.id),document.documentElement.style.background=n,document.documentElement.style.colorScheme=i,document.body.style.background=n,document.body.style.colorScheme=i;let h=document.querySelector('meta[name="theme-color"]');h||(h=document.createElement("meta"),h.name="theme-color",document.head.append(h)),h.content=te.cssVars["--ui-tabbar-bg"]},[te]),t.useEffect(()=>{const n=i=>{var Mt,At,zt,Dt,Ot,Wt,_t,Ft,$t,Ut,Bt;const f=((Mt=C.current)==null?void 0:Mt.contentWindow)??null,h=un(i,window.location.origin,f);if(h){I(q=>h.deleted?q.filter(Q=>Q.groupId!==h.groupId):q.map(Q=>Q.groupId===h.groupId?{...Q,title:h.title}:Q)),h.deleted?_(q=>q===`collaboration-${h.groupId}`?Ue.id:q):k(q=>({...q,[h.groupId]:(q[h.groupId]||0)+1}));return}const S=pn(i,window.location.origin,i.source===f?f:((At=j.current)==null?void 0:At.contentWindow)??null);if(S){const q=`collaboration-${S.groupId}`;I(Q=>Q.some(_e=>_e.id===q)?Q:[...Q,{id:q,title:S.title,kind:"collaboration",groupId:S.groupId}]),_(q);return}const W=((zt=v.current)==null?void 0:zt.contentWindow)??null,J=fn(i,window.location.origin,W);if(J!==null){w(J);return}if(rr(i,window.location.origin,W)){w(!1),m(q=>q+1),R(!1),pe(oe);return}if(W&&i.origin===window.location.origin&&i.source===W&&((Dt=i.data)==null?void 0:Dt.type)===hn){R(!0);return}if(i.origin===window.location.origin&&i.source===W&&W&&((Ot=i.data)==null?void 0:Ot.type)===gn){w(!1),B("browser:unwatch").catch(()=>{}),I(q=>q.filter(Q=>Q.kind!=="remote-desktop")),m(0),R(!1),_(de.id);return}if(Qr(i,window.location.origin,((Wt=j.current)==null?void 0:Wt.contentWindow)??null)){I(ir),_(ve.id);return}if(rr(i,window.location.origin,((_t=j.current)==null?void 0:_t.contentWindow)??null)){vr(!0),o();return}const Z=(Ft=[...T.current.values()].find(q=>q.contentWindow===i.source))==null?void 0:Ft.contentWindow,re=on(i,window.location.origin,Z??(($t=j.current)==null?void 0:$t.contentWindow)??null);if(re){const q=Q=>{ze("files"),le(!Gt(Q)),Ae(Q),Gt(Q)||xr({...re,path:Q})};re.path.startsWith("~/")?B("hello").then(({home:Q})=>{const _e=an(re.path,null,Q);_e&&q(_e)}).catch(()=>{}):q(re.path);return}const ge=i.source===W&&W?W:((Ut=j.current)==null?void 0:Ut.contentWindow)??null,ye=Zr(i,window.location.origin,ge);if(ye){B(ye.method,{...ye.payload,...ye.method==="browser:watch"?{frameAck:!0}:{}}).then(q=>{ge==null||ge.postMessage({type:Vt,id:ye.id,ok:!0,result:q},window.location.origin)},q=>{ge==null||ge.postMessage({type:Vt,id:ye.id,ok:!1,error:q.message||"浏览器操作失败",code:q.code},window.location.origin)});return}Fn(i,window.location.origin,[((Bt=j.current)==null?void 0:Bt.contentWindow)??null,f,...[...T.current.values()].map(q=>q.contentWindow)],B)};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)},[o,B,pe,oe]),t.useEffect(()=>{const n=h=>{var S,W;for(const J of[j,v])(W=(S=J.current)==null?void 0:S.contentWindow)==null||W.postMessage({type:Qe,event:h},window.location.origin)},f=["browser:session","browser:frame","browser:state","browser:closed","browser:webrtc"].map(h=>H(h,n));return()=>f.forEach(h=>h())},[H]),t.useEffect(()=>{var n,i;kt&&((i=(n=j.current)==null?void 0:n.contentWindow)==null||i.postMessage({type:Qe,event:{type:"browser:connection",connected:M.connected,epoch:X}},window.location.origin))},[M.connected,X,kt]),t.useEffect(()=>{var n,i;L&&((i=(n=v.current)==null?void 0:n.contentWindow)==null||i.postMessage({type:mn,visible:g===ve.id},window.location.origin))},[g,L]),t.useEffect(()=>{var n,i;L&&((i=(n=v.current)==null?void 0:n.contentWindow)==null||i.postMessage({type:Qe,event:{type:"browser:connection",connected:M.connected,epoch:X}},window.location.origin))},[M.connected,X,L]);const Et=t.useRef(0),St=g?K[g]??null:null;t.useEffect(()=>{const n=window.visualViewport;let i=null,f="";const h=()=>{const S=Xn(n,{height:window.innerHeight,width:window.innerWidth}),W=`${S.width}x${S.height}+${S.top}+${S.left}`;W!==f&&(f=W,document.documentElement.style.setProperty("--vv-height",`${S.height}px`),document.documentElement.style.setProperty("--vv-width",`${S.width}px`),document.documentElement.style.setProperty("--vv-top",`${S.top}px`),document.documentElement.style.setProperty("--vv-left",`${S.left}px`),i&&window.clearTimeout(i),i=window.setTimeout(h,250))};return h(),n==null||n.addEventListener("resize",h),n==null||n.addEventListener("scroll",h),window.addEventListener("orientationchange",h),window.addEventListener("resize",h),document.addEventListener("visibilitychange",h),window.addEventListener("pageshow",h),()=>{n==null||n.removeEventListener("resize",h),n==null||n.removeEventListener("scroll",h),window.removeEventListener("orientationchange",h),window.removeEventListener("resize",h),document.removeEventListener("visibilitychange",h),window.removeEventListener("pageshow",h),i&&window.clearTimeout(i),document.documentElement.style.removeProperty("--vv-height"),document.documentElement.style.removeProperty("--vv-width"),document.documentElement.style.removeProperty("--vv-top"),document.documentElement.style.removeProperty("--vv-left")}},[]),t.useEffect(()=>{fetch("/api/web-console/preferences",{credentials:"same-origin"}).then(n=>n.json()).then(n=>{var i,f,h,S;typeof((i=n.preferences)==null?void 0:i.keybarHidden)=="boolean"&&bt(n.preferences.keybarHidden),Array.isArray((f=n.preferences)==null?void 0:f.keyOrder)&&wt(n.preferences.keyOrder),Array.isArray((h=n.preferences)==null?void 0:h.pinnedCommands)&&xt(n.preferences.pinnedCommands),(S=n.preferences)!=null&&S.theme&&yt(rt(n.preferences.theme).id)}).catch(()=>{}).finally(()=>yr(!0)),fetch("/api/web-console/device-state",{credentials:"same-origin"}).then(n=>n.json()).then(n=>{const i=n.deviceState;i!=null&&i.drawerTab&&ze(i.drawerTab),i!=null&&i.activeTerminalId&&(V.current=i.activeTerminalId),typeof(i==null?void 0:i.drawerOpen)=="boolean"&&le(i.drawerOpen),i!=null&&i.fileTreeRoot&&ht(i.fileTreeRoot),typeof(i==null?void 0:i.fileTreeFollowMode)=="boolean"&>(i.fileTreeFollowMode),i!=null&&i.selectedFile&&Ae(i.selectedFile),i!=null&&i.terminalScroll&&typeof i.terminalScroll=="object"&&qe(i.terminalScroll)}).catch(()=>{}).finally(()=>br(!0))},[]);const Ct=t.useCallback(n=>{fetch("/api/web-console/preferences",{method:"PATCH",credentials:"same-origin",headers:{"content-type":"application/json","x-csrf-token":r.csrfToken},body:JSON.stringify(n)}).catch(()=>{})},[r.csrfToken]);t.useEffect(()=>{if(!vt)return;const n=setTimeout(()=>Ct({keybarHidden:He,keyOrder:Ve,pinnedCommands:Ke,theme:oe}),500);return()=>clearTimeout(n)},[He,Ve,Ke,oe,vt,Ct]);const Oe=t.useCallback(n=>{r.csrfToken&&fetch("/api/web-console/device-state",{method:"PUT",credentials:"same-origin",keepalive:!0,headers:{"content-type":"application/json","x-csrf-token":r.csrfToken},body:JSON.stringify(n)}).catch(()=>{})},[r.csrfToken]);t.useEffect(()=>{if(!r.csrfToken||!ee||!we)return;const n=setTimeout(()=>Oe({activeTerminalId:g,drawerOpen:ce,drawerTab:he,fileTreeRoot:Ee,fileTreeFollowMode:Se,selectedFile:ue,terminalScroll:je}),500);return()=>clearTimeout(n)},[g,ce,he,Ee,Se,ue,je,r.csrfToken,Oe,ee,we]),t.useEffect(()=>{if(!r.csrfToken||!ee||!we)return;const n=()=>Oe({activeTerminalId:g,drawerOpen:ce,drawerTab:he,fileTreeRoot:Ee,fileTreeFollowMode:Se,selectedFile:ue,terminalScroll:je});return window.addEventListener("pagehide",n),()=>window.removeEventListener("pagehide",n)},[g,ce,he,Ee,Se,ue,je,r.csrfToken,Oe,ee,we]);const Er=t.useCallback(n=>{Ae(n),le(!1)},[]),Sr=t.useCallback(()=>{if(E.length>=8)return;const n=`t-web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;I(i=>i.length>=8?i:[...i,{id:n,title:`Terminal ${i.length+1}`}]),_(n)},[E.length]),Cr=t.useCallback(n=>{const i=E.find(S=>S.id===g);if(i!=null&&i.kind&&i.kind!=="webapp")return;if(i&&!i.kind){const S=G.current.get(i.id);S?S(n,!0):se.current.set(i.id,n),le(!1);return}const f=E.length>=8?E.find(S=>!S.kind):null,h=(f==null?void 0:f.id)??`t-web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;f?se.current.set(h,n):I(S=>[...S,{id:h,title:`Terminal ${S.length+1}`,initialCommand:n}]),_(h),le(!1)},[g,E]);t.useEffect(()=>{if(!M.connected||!we||F.current)return;F.current=!0;let n=!1,i=!1,f;return B("term:list").then(h=>{if(n)return;let S=null;try{S=or(localStorage.getItem(U))}catch{}const W=no(S,h.tabs,z.current);I(W),_(J=>{const fe=z.current.find(re=>re.id===J&&re.kind&&re.kind!=="webapp");if(fe)return fe.id;const Z=(S==null?void 0:S.activeTerminalId)||V.current||J||de.id;return Z===de.id?de.id:W.some(re=>re.id===Z)?Z:de.id}),i=!0,b(!0)}).catch(()=>{n||(F.current=!1,f=setTimeout(()=>Y(h=>h+1),2e3))}),()=>{n=!0,clearTimeout(f),i||(F.current=!1)}},[M.connected,we,B,U,O]),t.useLayoutEffect(()=>{if(ee)try{const n=or(JSON.stringify({tabs:E,activeTerminalId:g}));localStorage.setItem(U,JSON.stringify(n))}catch{}},[E,g,ee,U]);const Tr=n=>{var f;if(n===de.id)return;const i=(f=E.find(h=>h.id===n))==null?void 0:f.kind;i==="remote-desktop"&&(m(0),R(!1),B("browser:unwatch").catch(()=>{})),!(!i&&!window.confirm("关闭页签会终止该终端进程,确认关闭?"))&&(I(h=>{var W;const S=h.filter(J=>J.id!==n);return g===n&&_(((W=S[0])==null?void 0:W.id)??null),S}),i||B("term:kill",{id:n}).catch(()=>{}))},Rr=t.useCallback(()=>{I(n=>{const i=n.find(f=>f.kind==="aihub");return i?(_(i.id),n):(_(ar.id),[...n,{...ar}])})},[]),Nr=t.useCallback(()=>{I(n=>{const i=n.find(f=>f.kind==="flowstudio");return i?(_(i.id),n):(_(sr.id),[...n,{...sr}])})},[]),Pr=t.useCallback(()=>{I(ir),_(ve.id)},[]);t.useEffect(()=>{const n=H("term:exited",i=>{const f=i==null?void 0:i.id;f&&(I(h=>{const S=h.filter(W=>W.id!==f);return _(W=>{var J;return W===f?((J=S[0])==null?void 0:J.id)??null:W}),S}),qe(h=>{if(!(f in h))return h;const S={...h};return delete S[f],S}))});return()=>{n()}},[H]);const Tt=t.useCallback(n=>{if(!g||E.length<2)return;const f=(E.findIndex(h=>h.id===g)+n+E.length)%E.length;_(E[f].id)},[g,E]),Rt=Math.max(0,E.findIndex(n=>n.id===g)),Lr=((Pt=E[Rt])==null?void 0:Pt.kind)==="webapp"?te.cssVars["--ui-term-col-bg"]:te.termHostBg,Ir={...ae.root,...te.cssVars,"--ui-active-content-bg":Lr,"--ui-terminal-bg":te.termHostBg,"--ui-primary-text":te.keybar.accentText,background:"var(--ui-root-bg)",color:"var(--ui-text)"},me=t.useCallback(()=>{xe.current=null,Ge(0),Ye(!1)},[]),Xe=t.useCallback(n=>{Math.abs(n)>=64&&E.length>1&&Tt(n<0?1:-1),me()},[E.length,Tt,me]),Mr=n=>n instanceof Element&&!!n.closest(".terminal-screen");t.useEffect(()=>{const n=i=>{var h;if(g!==de.id)return;const f=to(i,window.location.origin,((h=j.current)==null?void 0:h.contentWindow)??null);f&&(f.phase==="move"?(Ye(!0),Ge(f.deltaX)):f.phase==="end"?Xe(f.deltaX):me())};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)},[g,Xe,me]);const We=t.useCallback((n="smooth")=>{const i=jt.current;if(!i||!g)return;const f=i.querySelector(`[data-terminal-id="${g}"]`);if(!f)return;if(f===i.querySelector("[data-terminal-id]")){Qn(i);return}const h=i.querySelector(".terminal-connection"),S=(h==null?void 0:h.offsetWidth)??0,W=8,J=f.offsetLeft,fe=J+f.offsetWidth,Z=i.scrollLeft,re=Z+i.clientWidth-S;J<Z+W?i.scrollTo({left:Math.max(0,J-W),behavior:n}):fe>re-W&&i.scrollTo({left:fe-i.clientWidth+S+W,behavior:n})},[g]);return t.useLayoutEffect(()=>{if(!g)return;const n=E.length>Et.current;Et.current=E.length,We(n?"auto":"smooth")},[g,E.length,We]),t.useEffect(()=>{const n=()=>requestAnimationFrame(()=>We("auto"));return window.addEventListener("pageshow",n),()=>window.removeEventListener("pageshow",n)},[We]),e.jsxs("div",{className:`web-root ${y&&g===ve.id&&!a?"is-remote-fullscreen":""}`,style:Ir,children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:Yr}}),e.jsxs("div",{className:"terminal-tabs",children:[a&&e.jsxs("div",{className:"computer-page-heading",children:[e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"返回电脑会话",title:"返回电脑会话",onClick:()=>s(null),children:e.jsx(cn,{size:18})}),e.jsx("span",{children:a.name}),e.jsx("a",{className:"file-drawer-toggle",href:a.url,target:"_blank",rel:"noopener noreferrer","aria-label":"在新页面打开当前页面",title:"打开原页面",children:e.jsx(ft,{size:16})})]}),e.jsx("div",{className:"terminal-tab-list",ref:jt,hidden:!!a,children:E.map(n=>e.jsxs("div",{"data-terminal-id":n.id,draggable:!0,className:`terminal-tab ${n.id===g?"active":""}`,onDragStart:()=>{Je.current=n.id},onDragOver:i=>i.preventDefault(),onDrop:i=>{i.preventDefault();const f=Je.current;Je.current=null,!(!f||f===n.id)&&I(h=>{const S=h.findIndex(Z=>Z.id===f),W=h.findIndex(Z=>Z.id===n.id);if(S<0||W<0)return h;const J=[...h],[fe]=J.splice(S,1);return J.splice(W,0,fe),B("term:reorder",{ids:J.filter(Z=>!Z.kind).map(Z=>Z.id)}).catch(()=>{}),J})},onClick:()=>_(n.id),onDoubleClick:()=>{var f;if(n.kind)return;const i=(f=window.prompt("页签名称",n.title))==null?void 0:f.trim();i&&B("term:rename",{id:n.id,title:i}).then(()=>I(h=>h.map(S=>S.id===n.id?{...S,title:i}:S))).catch(()=>{})},children:[e.jsx("span",{children:n.title}),n.kind!=="webapp"&&e.jsx("button",{tabIndex:-1,onClick:i=>{i.stopPropagation(),Tr(n.id)},children:"×"})]},n.id))}),e.jsx("button",{className:"terminal-add","aria-label":"新建终端页签",hidden:!!a,disabled:E.length>=8,onClick:Sr,children:"+"}),e.jsx("div",{className:"terminal-connection",children:e.jsx(Jr,{avatar:e.jsx(Pn,{username:((Lt=r.user)==null?void 0:Lt.username)??"?",connected:M.connected,accent:te.keybar.accent,accentText:te.keybar.accentText,selectedPageId:a==null?void 0:a.id,onSelectPage:u,onUpdatePage:p,configuration:De,csrfToken:r.csrfToken}),items:[{id:"refresh",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"刷新页面",title:"刷新页面",onClick:()=>a?d(n=>n+1):window.location.reload(),children:e.jsx(be,{size:17,"aria-hidden":"true"})})},{id:"collaboration",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"打开群聊看板",title:"群聊看板",onClick:()=>{s(null),I(oo),_(Ue.id)},children:e.jsx(ut,{size:17,"aria-hidden":"true"})})},{id:"install",content:e.jsx(yn,{})},{id:"remote",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"打开远程桌面",title:"远程桌面 · 浏览器直播",onClick:()=>{s(null),Pr()},children:e.jsx(et,{size:17,"aria-hidden":"true"})})},{id:"ai-hub",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"打开 AI Hub",title:"AI Hub · 多模型对比",onClick:()=>{s(null),Rr()},children:e.jsx(ur,{size:17,"aria-hidden":"true"})})},{id:"flow",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":"打开数字人",title:"数字人 · Flow Studio",onClick:()=>{s(null),Nr()},children:e.jsx(pt,{size:17,"aria-hidden":"true"})})},{id:"theme",content:e.jsx(Jn,{themeId:oe,onThemeChange:yt})},{id:"files",content:e.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":ce?"关闭我的文件":"打开我的文件",title:"我的文件","aria-expanded":ce,onClick:()=>{s(null),le(n=>!n)},children:e.jsx(dr,{size:17,"aria-hidden":"true"})})}].filter(n=>De.settings.visibleTools.some(i=>i===n.id)).sort((n,i)=>De.settings.visibleTools.findIndex(f=>f===n.id)-De.settings.visibleTools.findIndex(f=>f===i.id))})})]}),e.jsxs("main",{className:`workspace ${ce?"show-tree":""} ${ue?"has-preview":""}`,hidden:!!a,style:ae.workspace,children:[e.jsx("section",{className:"term-col",style:ae.termCol,onPointerDownCapture:n=>{n.pointerType!=="touch"||!Mr(n.target)||(me(),xe.current={x:n.clientX,y:n.clientY,axis:"pending",pointerId:n.pointerId})},onPointerMoveCapture:n=>{const i=xe.current;if(!i||n.pointerId!==i.pointerId||n.pointerType!=="touch")return;const f=n.clientX-i.x,h=n.clientY-i.y;if(i.axis==="pending"){if(Math.max(Math.abs(f),Math.abs(h))<=8)return;if(Math.abs(h)>=Math.abs(f)*1.2){xe.current=null;return}i.axis="horizontal",Ye(!0);const S=W=>{window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),xe.current===i&&me()};window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S)}i.axis==="horizontal"&&(n.preventDefault(),Ge(f))},onPointerUpCapture:n=>{const i=xe.current;if(!i||n.pointerId!==i.pointerId)return;const f=n.clientX-i.x;i.axis==="horizontal"&&Math.abs(f)>=64?Xe(f):me()},onPointerCancelCapture:me,children:e.jsx("div",{className:"terminal-track",style:{transform:`translate3d(calc(${-Rt*100}% + ${kr}px),0,0)`,transition:jr?"none":"transform 260ms cubic-bezier(.22,.8,.32,1)"},children:E.map(n=>e.jsx("div",{className:"terminal-slide",style:{position:"relative"},children:n.kind==="webapp"?e.jsx("iframe",{ref:j,className:"webapp-frame",src:tt("/app/"),title:n.title,onLoad:()=>pe(oe)}):n.kind==="collaboration-dashboard"?e.jsx(nr,{title:"群聊看板",onFrame:i=>{C.current=i},onLoad:()=>pe(oe)}):n.kind==="collaboration"?e.jsx(nr,{groupId:n.groupId||"",title:n.title,onFrame:i=>{i?T.current.set(n.id,i):T.current.delete(n.id)},onLoad:()=>pe(oe)},`${n.id}-${c[n.groupId||""]||0}`):n.kind==="remote-desktop"?e.jsxs("div",{style:{height:"100%",background:"var(--ui-term-col-bg, #101014)"},"aria-busy":!x,children:[e.jsx("iframe",{ref:v,className:"webapp-frame",style:{visibility:x?"visible":"hidden"},src:tt("/app/?view=remote-desktop"),title:"远程桌面",onLoad:()=>pe(oe)}),!x&&e.jsx(Be,{label:"REMOTE DESKTOP",title:"正在打开远程桌面",caption:"正在准备桌面与连接",icon:e.jsx(et,{size:36,strokeWidth:1.5})})]}):n.kind==="aihub"?e.jsx(co,{visible:n.id===g,rpc:B}):n.kind==="flowstudio"?e.jsx(lo,{visible:n.id===g}):e.jsx(io,{terminalId:n.id,title:n.title,initialCommand:n.initialCommand,visible:n.id===g,state:M,rpc:B,onEvent:H,onTerminalData:ne,onTerminalReset:$,sendTerminalInput:P,keyOrder:Ve,keybarHidden:He,onKeyOrderChange:wt,onKeybarHiddenChange:bt,terminalTheme:te,initialScrollLine:je[n.id]??null,onScrollLineChange:i=>qe(f=>f[n.id]===i?f:{...f,[n.id]:i}),onRegisterFill:i=>Ie(n.id,i),onCwdChange:i=>i&&ie(f=>({...f,[n.id]:i}))})},n.id))})}),ce&&e.jsx("div",{className:"drawer-mask",onClick:()=>le(!1)}),e.jsxs("aside",{className:`tree-col ${ce?"tree-col-open":""}`,style:ae.treeCol,children:[e.jsxs("div",{className:"tree-head",style:ae.treeHead,children:[e.jsx("button",{className:he==="files"?"drawer-tab-active":"",onClick:()=>ze("files"),children:"文件"}),e.jsx("button",{className:he==="history"?"drawer-tab-active":"",onClick:()=>ze("history"),children:"历史"}),e.jsx("span",{className:"tree-cwd",style:ae.treeCwd,children:St??""}),e.jsx("button",{style:{...ae.iconBtn,marginLeft:"auto",flexShrink:0},onClick:()=>le(!1),"aria-label":"close drawer",children:e.jsx(ke,{size:15,"aria-hidden":"true"})})]}),he==="files"?e.jsx(ao,{ready:X>0,followCwd:!0,cwd:St,gateway:A,onOpenFile:Er,selectedPath:ue,initialRoot:Ee,initialFollow:Se,revealRequest:wr,onTreeStateChange:(n,i)=>{ht(n),gt(i)}}):e.jsx(Yn,{csrfToken:r.csrfToken,terminalId:((It=E.find(n=>n.id===g))==null?void 0:It.kind)==="webapp"?null:g,pinnedCommands:Ke,onPinnedCommandsChange:xt,onFill:Me,onExecute:Cr}),e.jsxs("div",{style:ae.treeFoot,children:[e.jsx("span",{style:ae.treeFootDot}),e.jsx("span",{children:"实时同步"})]})]}),ue&&e.jsx("section",{className:"preview-col",style:ae.previewCol,children:e.jsx(so,{path:ue,gateway:A,onClose:()=>Ae(null)})})]}),a&&e.jsx(An,{page:a,reloadKey:l},a.id)]})}const ae={root:{height:"100dvh",display:"flex",flexDirection:"column",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif',overflow:"hidden"},iconBtn:{minWidth:28,height:28,borderRadius:7,border:"1px solid var(--ui-tabbar-border, #303442)",background:"var(--ui-tab-bg, #202029)",color:"var(--ui-tab-text, #aaaab8)",fontSize:13},workspace:{flex:1,minHeight:0,display:"grid",position:"relative"},treeCol:{background:"var(--ui-tree-bg, #121218)",minHeight:0,flexDirection:"column"},treeHead:{display:"flex",alignItems:"center",gap:8,padding:"10px 12px 4px",fontSize:11,textTransform:"uppercase",letterSpacing:1,color:"#778",flexShrink:0},treeCwd:{fontSize:10,color:"#556",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:150,textTransform:"none",letterSpacing:0},treeFoot:{display:"flex",alignItems:"center",gap:7,minHeight:31,padding:"6px 11px calc(env(safe-area-inset-bottom) + 6px)",borderTop:"1px solid var(--ui-tabbar-border, #282832)",boxShadow:"0 -5px 16px rgba(0,0,0,.22)",background:"var(--ui-tab-bg, #15151c)",color:"var(--ui-connection-text, #777789)",fontSize:10.5,flexShrink:0},treeFootDot:{width:6,height:6,borderRadius:99,background:"var(--ui-success, #9ece6a)",boxShadow:"0 0 0 2px color-mix(in srgb, var(--ui-success, #9ece6a) 12%, transparent)",flexShrink:0},termCol:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",background:"var(--ui-term-col-bg, #101014)",gridColumn:1,overflow:"hidden"},previewCol:{minWidth:0,minHeight:0}},jo=Object.freeze(Object.defineProperty({__proto__:null,default:uo},Symbol.toStringTag,{value:"Module"}));export{Be as F,jo as p,Qn as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as l,r as m,d as a}from"./chunk-SVP7TREG-
|
|
1
|
+
import{g as l,r as m,d as a}from"./chunk-SVP7TREG-a6VVTk08.js";import{p}from"./chunk-JWPE2WC7-Zu8gSQip.js";import{_ as t,l as o}from"./mermaid.core-DIjc2ZR6.js";import{M as u,d as c}from"./cynefin-OW5HDTMX-CYPV2qwK.js";import"./index-Ddj6oQ7t.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},G={parser:b,db:a,renderer:m,styles:l};export{G as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as rt}from"./chunk-JWPE2WC7-
|
|
1
|
+
import{p as rt}from"./chunk-JWPE2WC7-Zu8gSQip.js";import{a1 as T,a4 as B,b3 as nt,g as it,s as ot,a as st,b as lt,o as ct,n as ut,_ as d,l as G,c as gt,A as dt,D as pt,L as ht,d as ft,p as mt,B as vt}from"./mermaid.core-DIjc2ZR6.js";import{p as xt}from"./cynefin-OW5HDTMX-CYPV2qwK.js";import{d as J}from"./arc-B4CNFgtV.js";import{o as St}from"./ordinal-BENe2yWM.js";import"./index-Ddj6oQ7t.js";import"./init-Gi6I4Gst.js";function yt(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function wt(t){return t}function At(){var t=wt,n=yt,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=nt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,R=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=R*(E<0?-1:1),A;for(r=0;r<s;++r)(A=o[f[r]=r]=+t(e[r],r,e))>0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r<s;++r,D=k)h=f[r],A=o[h],k=D+(A>0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:R};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var Ct=vt.pie,I={sections:new Map,showData:!1},F=I.sections,V=I.showData,$t=structuredClone(Ct),Dt=d(()=>structuredClone($t),"getConfig"),Tt=d(()=>{F=new Map,V=I.showData,mt()},"clear"),bt=d(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);F.has(t)||(F.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),kt=d(()=>F,"getSections"),zt=d(t=>{V=t},"setShowData"),Et=d(()=>V,"getShowData"),K={getConfig:Dt,clear:Tt,setDiagramTitle:ut,getDiagramTitle:ct,setAccTitle:lt,getAccTitle:st,setAccDescription:ot,getAccDescription:it,addSection:bt,getSections:kt,setShowData:zt,getShowData:Et},Mt=d((t,n)=>{rt(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Lt={parse:d(async t=>{const n=await xt("pie",t);G.debug(n),Mt(n,K)},"parse")},Rt=d(t=>`
|
|
2
2
|
.pieCircle{
|
|
3
3
|
stroke: ${t.pieStrokeColor};
|
|
4
4
|
stroke-width : ${t.pieStrokeWidth};
|