@very_aq/codex-cli-web 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -2
- package/README.zh-CN.md +45 -2
- package/bin/ccw +6 -29
- package/bin/ccw.js +88 -0
- package/package.json +6 -5
- package/server/dist/admin/mcpAdminRoutes.d.ts +7 -0
- package/server/dist/admin/mcpAdminRoutes.js +72 -0
- package/server/dist/admin/mcpAdminRoutes.js.map +1 -0
- package/server/dist/app.d.ts +2 -0
- package/server/dist/app.js +138 -3
- package/server/dist/app.js.map +1 -1
- package/server/dist/auth/sqlite/authDb.d.ts +2 -2
- package/server/dist/auth/sqlite/authDb.js +4 -3
- package/server/dist/auth/sqlite/authDb.js.map +1 -1
- package/server/dist/chat/markdown/markdownAst.js +19 -6
- package/server/dist/chat/markdown/markdownAst.js.map +1 -1
- package/server/dist/codex/appServerProcess.d.ts +0 -1
- package/server/dist/codex/appServerProcess.js +9 -14
- package/server/dist/codex/appServerProcess.js.map +1 -1
- package/server/dist/codex/cliArgs.js +10 -8
- package/server/dist/codex/cliArgs.js.map +1 -1
- package/server/dist/codex/codexAppServer.d.ts +18 -0
- package/server/dist/codex/codexAppServer.js +46 -31
- package/server/dist/codex/codexAppServer.js.map +1 -1
- package/server/dist/codex/codexMcpCli.d.ts +25 -0
- package/server/dist/codex/codexMcpCli.js +132 -0
- package/server/dist/codex/codexMcpCli.js.map +1 -0
- package/server/dist/codex/codexSpawn.d.ts +34 -0
- package/server/dist/codex/codexSpawn.js +86 -0
- package/server/dist/codex/codexSpawn.js.map +1 -0
- package/server/dist/config/serverConfig.d.ts +19 -0
- package/server/dist/config/serverConfig.js +4 -1
- package/server/dist/config/serverConfig.js.map +1 -1
- package/server/dist/env.d.ts +25 -0
- package/server/dist/env.js +93 -0
- package/server/dist/env.js.map +1 -1
- package/server/dist/history/http/historyRoutes.js +24 -6
- package/server/dist/history/http/historyRoutes.js.map +1 -1
- package/server/dist/history/index.d.ts +6 -0
- package/server/dist/history/index.js +19 -0
- package/server/dist/history/index.js.map +1 -1
- package/server/dist/history/query/historyQueryService.d.ts +23 -3
- package/server/dist/history/query/historyQueryService.js +140 -4
- package/server/dist/history/query/historyQueryService.js.map +1 -1
- package/server/dist/history/sqlite/schema.js +47 -0
- package/server/dist/history/sqlite/schema.js.map +1 -1
- package/server/dist/history/sqlite/sqliteHistoryStore.d.ts +31 -0
- package/server/dist/history/sqlite/sqliteHistoryStore.js +289 -19
- package/server/dist/history/sqlite/sqliteHistoryStore.js.map +1 -1
- package/server/dist/history/worker/historyWorker.d.ts +1 -0
- package/server/dist/history/worker/historyWorker.js +99 -0
- package/server/dist/history/worker/historyWorker.js.map +1 -0
- package/server/dist/history/worker/historyWorkerClient.d.ts +21 -0
- package/server/dist/history/worker/historyWorkerClient.js +128 -0
- package/server/dist/history/worker/historyWorkerClient.js.map +1 -0
- package/server/dist/history/worker/historyWorkerPool.d.ts +24 -0
- package/server/dist/history/worker/historyWorkerPool.js +59 -0
- package/server/dist/history/worker/historyWorkerPool.js.map +1 -0
- package/server/dist/history/worker/historyWorkerTypes.d.ts +54 -0
- package/server/dist/{codex/protocol/Tool.js → history/worker/historyWorkerTypes.js} +1 -2
- package/server/dist/history/worker/historyWorkerTypes.js.map +1 -0
- package/server/dist/index.js +4 -10
- package/server/dist/index.js.map +1 -1
- package/server/dist/workspace/threadListVisibility.js +5 -39
- package/server/dist/workspace/threadListVisibility.js.map +1 -1
- package/web/dist/assets/index-B87op2EF.js +175 -0
- package/web/dist/assets/{index-DI7kJHr2.css → index-BcS4cW0r.css} +1 -1
- package/web/dist/index.html +2 -2
- package/server/dist/chat/markdown/markdownProcessor.d.ts +0 -27
- package/server/dist/chat/markdown/markdownProcessor.js +0 -71
- package/server/dist/chat/markdown/markdownProcessor.js.map +0 -1
- package/server/dist/chat/markdown/sanitizeUrl.d.ts +0 -7
- package/server/dist/chat/markdown/sanitizeUrl.js +0 -66
- package/server/dist/chat/markdown/sanitizeUrl.js.map +0 -1
- package/server/dist/codex/protocol/AbsolutePathBuf.d.ts +0 -10
- package/server/dist/codex/protocol/AbsolutePathBuf.js +0 -4
- package/server/dist/codex/protocol/AbsolutePathBuf.js.map +0 -1
- package/server/dist/codex/protocol/AddConversationListenerParams.d.ts +0 -5
- package/server/dist/codex/protocol/AddConversationListenerParams.js +0 -4
- package/server/dist/codex/protocol/AddConversationListenerParams.js.map +0 -1
- package/server/dist/codex/protocol/AddConversationSubscriptionResponse.d.ts +0 -3
- package/server/dist/codex/protocol/AddConversationSubscriptionResponse.js +0 -4
- package/server/dist/codex/protocol/AddConversationSubscriptionResponse.js.map +0 -1
- package/server/dist/codex/protocol/AgentMessageContent.d.ts +0 -4
- package/server/dist/codex/protocol/AgentMessageContent.js +0 -4
- package/server/dist/codex/protocol/AgentMessageContent.js.map +0 -1
- package/server/dist/codex/protocol/AgentMessageContentDeltaEvent.d.ts +0 -6
- package/server/dist/codex/protocol/AgentMessageContentDeltaEvent.js +0 -4
- package/server/dist/codex/protocol/AgentMessageContentDeltaEvent.js.map +0 -1
- package/server/dist/codex/protocol/AgentMessageDeltaEvent.d.ts +0 -3
- package/server/dist/codex/protocol/AgentMessageDeltaEvent.js +0 -4
- package/server/dist/codex/protocol/AgentMessageDeltaEvent.js.map +0 -1
- package/server/dist/codex/protocol/AgentMessageEvent.d.ts +0 -5
- package/server/dist/codex/protocol/AgentMessageEvent.js +0 -4
- package/server/dist/codex/protocol/AgentMessageEvent.js.map +0 -1
- package/server/dist/codex/protocol/AgentMessageItem.d.ts +0 -20
- package/server/dist/codex/protocol/AgentMessageItem.js +0 -4
- package/server/dist/codex/protocol/AgentMessageItem.js.map +0 -1
- package/server/dist/codex/protocol/AgentReasoningDeltaEvent.d.ts +0 -3
- package/server/dist/codex/protocol/AgentReasoningDeltaEvent.js +0 -4
- package/server/dist/codex/protocol/AgentReasoningDeltaEvent.js.map +0 -1
- package/server/dist/codex/protocol/AgentReasoningEvent.d.ts +0 -3
- package/server/dist/codex/protocol/AgentReasoningEvent.js +0 -4
- package/server/dist/codex/protocol/AgentReasoningEvent.js.map +0 -1
- package/server/dist/codex/protocol/AgentReasoningRawContentDeltaEvent.d.ts +0 -3
- package/server/dist/codex/protocol/AgentReasoningRawContentDeltaEvent.js +0 -4
- package/server/dist/codex/protocol/AgentReasoningRawContentDeltaEvent.js.map +0 -1
- package/server/dist/codex/protocol/AgentReasoningRawContentEvent.d.ts +0 -3
- package/server/dist/codex/protocol/AgentReasoningRawContentEvent.js +0 -4
- package/server/dist/codex/protocol/AgentReasoningRawContentEvent.js.map +0 -1
- package/server/dist/codex/protocol/AgentReasoningSectionBreakEvent.d.ts +0 -4
- package/server/dist/codex/protocol/AgentReasoningSectionBreakEvent.js +0 -4
- package/server/dist/codex/protocol/AgentReasoningSectionBreakEvent.js.map +0 -1
- package/server/dist/codex/protocol/AgentStatus.d.ts +0 -8
- package/server/dist/codex/protocol/AgentStatus.js +0 -4
- package/server/dist/codex/protocol/AgentStatus.js.map +0 -1
- package/server/dist/codex/protocol/ApplyPatchApprovalParams.d.ts +0 -22
- package/server/dist/codex/protocol/ApplyPatchApprovalParams.js +0 -4
- package/server/dist/codex/protocol/ApplyPatchApprovalParams.js.map +0 -1
- package/server/dist/codex/protocol/ApplyPatchApprovalRequestEvent.d.ts +0 -23
- package/server/dist/codex/protocol/ApplyPatchApprovalRequestEvent.js +0 -4
- package/server/dist/codex/protocol/ApplyPatchApprovalRequestEvent.js.map +0 -1
- package/server/dist/codex/protocol/ApplyPatchApprovalResponse.d.ts +0 -4
- package/server/dist/codex/protocol/ApplyPatchApprovalResponse.js +0 -4
- package/server/dist/codex/protocol/ApplyPatchApprovalResponse.js.map +0 -1
- package/server/dist/codex/protocol/ArchiveConversationParams.d.ts +0 -5
- package/server/dist/codex/protocol/ArchiveConversationParams.js +0 -4
- package/server/dist/codex/protocol/ArchiveConversationParams.js.map +0 -1
- package/server/dist/codex/protocol/ArchiveConversationResponse.d.ts +0 -1
- package/server/dist/codex/protocol/ArchiveConversationResponse.js +0 -4
- package/server/dist/codex/protocol/ArchiveConversationResponse.js.map +0 -1
- package/server/dist/codex/protocol/AskForApproval.d.ts +0 -8
- package/server/dist/codex/protocol/AskForApproval.js +0 -4
- package/server/dist/codex/protocol/AskForApproval.js.map +0 -1
- package/server/dist/codex/protocol/AuthMode.d.ts +0 -4
- package/server/dist/codex/protocol/AuthMode.js +0 -4
- package/server/dist/codex/protocol/AuthMode.js.map +0 -1
- package/server/dist/codex/protocol/AuthStatusChangeNotification.d.ts +0 -7
- package/server/dist/codex/protocol/AuthStatusChangeNotification.js +0 -4
- package/server/dist/codex/protocol/AuthStatusChangeNotification.js.map +0 -1
- package/server/dist/codex/protocol/BackgroundEventEvent.d.ts +0 -3
- package/server/dist/codex/protocol/BackgroundEventEvent.js +0 -4
- package/server/dist/codex/protocol/BackgroundEventEvent.js.map +0 -1
- package/server/dist/codex/protocol/ByteRange.d.ts +0 -10
- package/server/dist/codex/protocol/ByteRange.js +0 -4
- package/server/dist/codex/protocol/ByteRange.js.map +0 -1
- package/server/dist/codex/protocol/CallToolResult.d.ts +0 -10
- package/server/dist/codex/protocol/CallToolResult.js +0 -4
- package/server/dist/codex/protocol/CallToolResult.js.map +0 -1
- package/server/dist/codex/protocol/CancelLoginChatGptParams.d.ts +0 -3
- package/server/dist/codex/protocol/CancelLoginChatGptParams.js +0 -4
- package/server/dist/codex/protocol/CancelLoginChatGptParams.js.map +0 -1
- package/server/dist/codex/protocol/CancelLoginChatGptResponse.d.ts +0 -1
- package/server/dist/codex/protocol/CancelLoginChatGptResponse.js +0 -4
- package/server/dist/codex/protocol/CancelLoginChatGptResponse.js.map +0 -1
- package/server/dist/codex/protocol/ClientInfo.d.ts +0 -5
- package/server/dist/codex/protocol/ClientInfo.js +0 -4
- package/server/dist/codex/protocol/ClientInfo.js.map +0 -1
- package/server/dist/codex/protocol/ClientNotification.d.ts +0 -3
- package/server/dist/codex/protocol/ClientNotification.js +0 -4
- package/server/dist/codex/protocol/ClientNotification.js.map +0 -1
- package/server/dist/codex/protocol/ClientRequest.d.ts +0 -316
- package/server/dist/codex/protocol/ClientRequest.js +0 -4
- package/server/dist/codex/protocol/ClientRequest.js.map +0 -1
- package/server/dist/codex/protocol/CodexErrorInfo.d.ts +0 -20
- package/server/dist/codex/protocol/CodexErrorInfo.js +0 -4
- package/server/dist/codex/protocol/CodexErrorInfo.js.map +0 -1
- package/server/dist/codex/protocol/CollabAgentInteractionBeginEvent.d.ts +0 -20
- package/server/dist/codex/protocol/CollabAgentInteractionBeginEvent.js +0 -4
- package/server/dist/codex/protocol/CollabAgentInteractionBeginEvent.js.map +0 -1
- package/server/dist/codex/protocol/CollabAgentInteractionEndEvent.d.ts +0 -33
- package/server/dist/codex/protocol/CollabAgentInteractionEndEvent.js +0 -4
- package/server/dist/codex/protocol/CollabAgentInteractionEndEvent.js.map +0 -1
- package/server/dist/codex/protocol/CollabAgentRef.d.ts +0 -15
- package/server/dist/codex/protocol/CollabAgentRef.js +0 -4
- package/server/dist/codex/protocol/CollabAgentRef.js.map +0 -1
- package/server/dist/codex/protocol/CollabAgentSpawnBeginEvent.d.ts +0 -16
- package/server/dist/codex/protocol/CollabAgentSpawnBeginEvent.js +0 -4
- package/server/dist/codex/protocol/CollabAgentSpawnBeginEvent.js.map +0 -1
- package/server/dist/codex/protocol/CollabAgentSpawnEndEvent.d.ts +0 -33
- package/server/dist/codex/protocol/CollabAgentSpawnEndEvent.js +0 -4
- package/server/dist/codex/protocol/CollabAgentSpawnEndEvent.js.map +0 -1
- package/server/dist/codex/protocol/CollabAgentStatusEntry.d.ts +0 -20
- package/server/dist/codex/protocol/CollabAgentStatusEntry.js +0 -4
- package/server/dist/codex/protocol/CollabAgentStatusEntry.js.map +0 -1
- package/server/dist/codex/protocol/CollabCloseBeginEvent.d.ts +0 -15
- package/server/dist/codex/protocol/CollabCloseBeginEvent.js +0 -4
- package/server/dist/codex/protocol/CollabCloseBeginEvent.js.map +0 -1
- package/server/dist/codex/protocol/CollabCloseEndEvent.d.ts +0 -29
- package/server/dist/codex/protocol/CollabCloseEndEvent.js +0 -4
- package/server/dist/codex/protocol/CollabCloseEndEvent.js.map +0 -1
- package/server/dist/codex/protocol/CollabResumeBeginEvent.d.ts +0 -23
- package/server/dist/codex/protocol/CollabResumeBeginEvent.js +0 -4
- package/server/dist/codex/protocol/CollabResumeBeginEvent.js.map +0 -1
- package/server/dist/codex/protocol/CollabResumeEndEvent.d.ts +0 -29
- package/server/dist/codex/protocol/CollabResumeEndEvent.js +0 -4
- package/server/dist/codex/protocol/CollabResumeEndEvent.js.map +0 -1
- package/server/dist/codex/protocol/CollabWaitingBeginEvent.d.ts +0 -20
- package/server/dist/codex/protocol/CollabWaitingBeginEvent.js +0 -4
- package/server/dist/codex/protocol/CollabWaitingBeginEvent.js.map +0 -1
- package/server/dist/codex/protocol/CollabWaitingEndEvent.d.ts +0 -23
- package/server/dist/codex/protocol/CollabWaitingEndEvent.js +0 -4
- package/server/dist/codex/protocol/CollabWaitingEndEvent.js.map +0 -1
- package/server/dist/codex/protocol/CollaborationMode.d.ts +0 -9
- package/server/dist/codex/protocol/CollaborationMode.js +0 -4
- package/server/dist/codex/protocol/CollaborationMode.js.map +0 -1
- package/server/dist/codex/protocol/ContentItem.d.ts +0 -10
- package/server/dist/codex/protocol/ContentItem.js +0 -4
- package/server/dist/codex/protocol/ContentItem.js.map +0 -1
- package/server/dist/codex/protocol/ContextCompactedEvent.d.ts +0 -1
- package/server/dist/codex/protocol/ContextCompactedEvent.js +0 -4
- package/server/dist/codex/protocol/ContextCompactedEvent.js.map +0 -1
- package/server/dist/codex/protocol/ContextCompactionItem.d.ts +0 -3
- package/server/dist/codex/protocol/ContextCompactionItem.js +0 -4
- package/server/dist/codex/protocol/ContextCompactionItem.js.map +0 -1
- package/server/dist/codex/protocol/ConversationGitInfo.d.ts +0 -5
- package/server/dist/codex/protocol/ConversationGitInfo.js +0 -4
- package/server/dist/codex/protocol/ConversationGitInfo.js.map +0 -1
- package/server/dist/codex/protocol/ConversationSummary.d.ts +0 -15
- package/server/dist/codex/protocol/ConversationSummary.js +0 -4
- package/server/dist/codex/protocol/ConversationSummary.js.map +0 -1
- package/server/dist/codex/protocol/CreditsSnapshot.d.ts +0 -5
- package/server/dist/codex/protocol/CreditsSnapshot.js +0 -4
- package/server/dist/codex/protocol/CreditsSnapshot.js.map +0 -1
- package/server/dist/codex/protocol/CustomPrompt.d.ts +0 -7
- package/server/dist/codex/protocol/CustomPrompt.js +0 -4
- package/server/dist/codex/protocol/CustomPrompt.js.map +0 -1
- package/server/dist/codex/protocol/DeprecationNoticeEvent.d.ts +0 -10
- package/server/dist/codex/protocol/DeprecationNoticeEvent.js +0 -4
- package/server/dist/codex/protocol/DeprecationNoticeEvent.js.map +0 -1
- package/server/dist/codex/protocol/DynamicToolCallOutputContentItem.d.ts +0 -7
- package/server/dist/codex/protocol/DynamicToolCallOutputContentItem.js +0 -4
- package/server/dist/codex/protocol/DynamicToolCallOutputContentItem.js.map +0 -1
- package/server/dist/codex/protocol/DynamicToolCallRequest.d.ts +0 -7
- package/server/dist/codex/protocol/DynamicToolCallRequest.js +0 -4
- package/server/dist/codex/protocol/DynamicToolCallRequest.js.map +0 -1
- package/server/dist/codex/protocol/DynamicToolCallResponseEvent.d.ts +0 -36
- package/server/dist/codex/protocol/DynamicToolCallResponseEvent.js +0 -4
- package/server/dist/codex/protocol/DynamicToolCallResponseEvent.js.map +0 -1
- package/server/dist/codex/protocol/ElicitationRequestEvent.d.ts +0 -5
- package/server/dist/codex/protocol/ElicitationRequestEvent.js +0 -4
- package/server/dist/codex/protocol/ElicitationRequestEvent.js.map +0 -1
- package/server/dist/codex/protocol/ErrorEvent.d.ts +0 -5
- package/server/dist/codex/protocol/ErrorEvent.js +0 -4
- package/server/dist/codex/protocol/ErrorEvent.js.map +0 -1
- package/server/dist/codex/protocol/EventMsg.d.ts +0 -228
- package/server/dist/codex/protocol/EventMsg.js +0 -4
- package/server/dist/codex/protocol/EventMsg.js.map +0 -1
- package/server/dist/codex/protocol/ExecApprovalRequestEvent.d.ts +0 -60
- package/server/dist/codex/protocol/ExecApprovalRequestEvent.js +0 -4
- package/server/dist/codex/protocol/ExecApprovalRequestEvent.js.map +0 -1
- package/server/dist/codex/protocol/ExecCommandApprovalParams.d.ts +0 -18
- package/server/dist/codex/protocol/ExecCommandApprovalParams.js +0 -4
- package/server/dist/codex/protocol/ExecCommandApprovalParams.js.map +0 -1
- package/server/dist/codex/protocol/ExecCommandApprovalResponse.d.ts +0 -4
- package/server/dist/codex/protocol/ExecCommandApprovalResponse.js +0 -4
- package/server/dist/codex/protocol/ExecCommandApprovalResponse.js.map +0 -1
- package/server/dist/codex/protocol/ExecCommandBeginEvent.d.ts +0 -33
- package/server/dist/codex/protocol/ExecCommandBeginEvent.js +0 -4
- package/server/dist/codex/protocol/ExecCommandBeginEvent.js.map +0 -1
- package/server/dist/codex/protocol/ExecCommandEndEvent.d.ts +0 -62
- package/server/dist/codex/protocol/ExecCommandEndEvent.js +0 -4
- package/server/dist/codex/protocol/ExecCommandEndEvent.js.map +0 -1
- package/server/dist/codex/protocol/ExecCommandOutputDeltaEvent.d.ts +0 -15
- package/server/dist/codex/protocol/ExecCommandOutputDeltaEvent.js +0 -4
- package/server/dist/codex/protocol/ExecCommandOutputDeltaEvent.js.map +0 -1
- package/server/dist/codex/protocol/ExecCommandSource.d.ts +0 -1
- package/server/dist/codex/protocol/ExecCommandSource.js +0 -4
- package/server/dist/codex/protocol/ExecCommandSource.js.map +0 -1
- package/server/dist/codex/protocol/ExecCommandStatus.d.ts +0 -1
- package/server/dist/codex/protocol/ExecCommandStatus.js +0 -4
- package/server/dist/codex/protocol/ExecCommandStatus.js.map +0 -1
- package/server/dist/codex/protocol/ExecOneOffCommandParams.d.ts +0 -7
- package/server/dist/codex/protocol/ExecOneOffCommandParams.js +0 -4
- package/server/dist/codex/protocol/ExecOneOffCommandParams.js.map +0 -1
- package/server/dist/codex/protocol/ExecOneOffCommandResponse.d.ts +0 -5
- package/server/dist/codex/protocol/ExecOneOffCommandResponse.js +0 -4
- package/server/dist/codex/protocol/ExecOneOffCommandResponse.js.map +0 -1
- package/server/dist/codex/protocol/ExecOutputStream.d.ts +0 -1
- package/server/dist/codex/protocol/ExecOutputStream.js +0 -4
- package/server/dist/codex/protocol/ExecOutputStream.js.map +0 -1
- package/server/dist/codex/protocol/ExecPolicyAmendment.d.ts +0 -8
- package/server/dist/codex/protocol/ExecPolicyAmendment.js +0 -4
- package/server/dist/codex/protocol/ExecPolicyAmendment.js.map +0 -1
- package/server/dist/codex/protocol/ExitedReviewModeEvent.d.ts +0 -4
- package/server/dist/codex/protocol/ExitedReviewModeEvent.js +0 -4
- package/server/dist/codex/protocol/ExitedReviewModeEvent.js.map +0 -1
- package/server/dist/codex/protocol/FileChange.d.ts +0 -11
- package/server/dist/codex/protocol/FileChange.js +0 -4
- package/server/dist/codex/protocol/FileChange.js.map +0 -1
- package/server/dist/codex/protocol/FileSystemPermissions.d.ts +0 -4
- package/server/dist/codex/protocol/FileSystemPermissions.js +0 -4
- package/server/dist/codex/protocol/FileSystemPermissions.js.map +0 -1
- package/server/dist/codex/protocol/ForcedLoginMethod.d.ts +0 -1
- package/server/dist/codex/protocol/ForcedLoginMethod.js +0 -4
- package/server/dist/codex/protocol/ForcedLoginMethod.js.map +0 -1
- package/server/dist/codex/protocol/ForkConversationParams.d.ts +0 -7
- package/server/dist/codex/protocol/ForkConversationParams.js +0 -4
- package/server/dist/codex/protocol/ForkConversationParams.js.map +0 -1
- package/server/dist/codex/protocol/ForkConversationResponse.d.ts +0 -8
- package/server/dist/codex/protocol/ForkConversationResponse.js +0 -4
- package/server/dist/codex/protocol/ForkConversationResponse.js.map +0 -1
- package/server/dist/codex/protocol/FunctionCallOutputBody.d.ts +0 -2
- package/server/dist/codex/protocol/FunctionCallOutputBody.js +0 -4
- package/server/dist/codex/protocol/FunctionCallOutputBody.js.map +0 -1
- package/server/dist/codex/protocol/FunctionCallOutputContentItem.d.ts +0 -11
- package/server/dist/codex/protocol/FunctionCallOutputContentItem.js +0 -4
- package/server/dist/codex/protocol/FunctionCallOutputContentItem.js.map +0 -1
- package/server/dist/codex/protocol/FunctionCallOutputPayload.d.ts +0 -11
- package/server/dist/codex/protocol/FunctionCallOutputPayload.js +0 -4
- package/server/dist/codex/protocol/FunctionCallOutputPayload.js.map +0 -1
- package/server/dist/codex/protocol/FuzzyFileSearchParams.d.ts +0 -5
- package/server/dist/codex/protocol/FuzzyFileSearchParams.js +0 -4
- package/server/dist/codex/protocol/FuzzyFileSearchParams.js.map +0 -1
- package/server/dist/codex/protocol/FuzzyFileSearchResponse.d.ts +0 -4
- package/server/dist/codex/protocol/FuzzyFileSearchResponse.js +0 -4
- package/server/dist/codex/protocol/FuzzyFileSearchResponse.js.map +0 -1
- package/server/dist/codex/protocol/FuzzyFileSearchResult.d.ts +0 -10
- package/server/dist/codex/protocol/FuzzyFileSearchResult.js +0 -4
- package/server/dist/codex/protocol/FuzzyFileSearchResult.js.map +0 -1
- package/server/dist/codex/protocol/FuzzyFileSearchSessionCompletedNotification.d.ts +0 -3
- package/server/dist/codex/protocol/FuzzyFileSearchSessionCompletedNotification.js +0 -4
- package/server/dist/codex/protocol/FuzzyFileSearchSessionCompletedNotification.js.map +0 -1
- package/server/dist/codex/protocol/FuzzyFileSearchSessionUpdatedNotification.d.ts +0 -6
- package/server/dist/codex/protocol/FuzzyFileSearchSessionUpdatedNotification.js +0 -4
- package/server/dist/codex/protocol/FuzzyFileSearchSessionUpdatedNotification.js.map +0 -1
- package/server/dist/codex/protocol/GetAuthStatusParams.d.ts +0 -4
- package/server/dist/codex/protocol/GetAuthStatusParams.js +0 -4
- package/server/dist/codex/protocol/GetAuthStatusParams.js.map +0 -1
- package/server/dist/codex/protocol/GetAuthStatusResponse.d.ts +0 -6
- package/server/dist/codex/protocol/GetAuthStatusResponse.js +0 -4
- package/server/dist/codex/protocol/GetAuthStatusResponse.js.map +0 -1
- package/server/dist/codex/protocol/GetConversationSummaryParams.d.ts +0 -6
- package/server/dist/codex/protocol/GetConversationSummaryParams.js +0 -4
- package/server/dist/codex/protocol/GetConversationSummaryParams.js.map +0 -1
- package/server/dist/codex/protocol/GetConversationSummaryResponse.d.ts +0 -4
- package/server/dist/codex/protocol/GetConversationSummaryResponse.js +0 -4
- package/server/dist/codex/protocol/GetConversationSummaryResponse.js.map +0 -1
- package/server/dist/codex/protocol/GetHistoryEntryResponseEvent.d.ts +0 -9
- package/server/dist/codex/protocol/GetHistoryEntryResponseEvent.js +0 -4
- package/server/dist/codex/protocol/GetHistoryEntryResponseEvent.js.map +0 -1
- package/server/dist/codex/protocol/GetUserAgentResponse.d.ts +0 -3
- package/server/dist/codex/protocol/GetUserAgentResponse.js +0 -4
- package/server/dist/codex/protocol/GetUserAgentResponse.js.map +0 -1
- package/server/dist/codex/protocol/GetUserSavedConfigResponse.d.ts +0 -4
- package/server/dist/codex/protocol/GetUserSavedConfigResponse.js +0 -4
- package/server/dist/codex/protocol/GetUserSavedConfigResponse.js.map +0 -1
- package/server/dist/codex/protocol/GhostCommit.d.ts +0 -9
- package/server/dist/codex/protocol/GhostCommit.js +0 -4
- package/server/dist/codex/protocol/GhostCommit.js.map +0 -1
- package/server/dist/codex/protocol/GitDiffToRemoteParams.d.ts +0 -3
- package/server/dist/codex/protocol/GitDiffToRemoteParams.js +0 -4
- package/server/dist/codex/protocol/GitDiffToRemoteParams.js.map +0 -1
- package/server/dist/codex/protocol/GitDiffToRemoteResponse.d.ts +0 -5
- package/server/dist/codex/protocol/GitDiffToRemoteResponse.js +0 -4
- package/server/dist/codex/protocol/GitDiffToRemoteResponse.js.map +0 -1
- package/server/dist/codex/protocol/GitSha.d.ts +0 -1
- package/server/dist/codex/protocol/GitSha.js +0 -4
- package/server/dist/codex/protocol/GitSha.js.map +0 -1
- package/server/dist/codex/protocol/HistoryEntry.d.ts +0 -5
- package/server/dist/codex/protocol/HistoryEntry.js +0 -4
- package/server/dist/codex/protocol/HistoryEntry.js.map +0 -1
- package/server/dist/codex/protocol/InitializeCapabilities.d.ts +0 -14
- package/server/dist/codex/protocol/InitializeCapabilities.js +0 -4
- package/server/dist/codex/protocol/InitializeCapabilities.js.map +0 -1
- package/server/dist/codex/protocol/InitializeParams.d.ts +0 -6
- package/server/dist/codex/protocol/InitializeParams.js +0 -4
- package/server/dist/codex/protocol/InitializeParams.js.map +0 -1
- package/server/dist/codex/protocol/InitializeResponse.d.ts +0 -3
- package/server/dist/codex/protocol/InitializeResponse.js +0 -4
- package/server/dist/codex/protocol/InitializeResponse.js.map +0 -1
- package/server/dist/codex/protocol/InputItem.d.ts +0 -21
- package/server/dist/codex/protocol/InputItem.js +0 -4
- package/server/dist/codex/protocol/InputItem.js.map +0 -1
- package/server/dist/codex/protocol/InputModality.d.ts +0 -4
- package/server/dist/codex/protocol/InputModality.js +0 -4
- package/server/dist/codex/protocol/InputModality.js.map +0 -1
- package/server/dist/codex/protocol/InterruptConversationParams.d.ts +0 -4
- package/server/dist/codex/protocol/InterruptConversationParams.js +0 -4
- package/server/dist/codex/protocol/InterruptConversationParams.js.map +0 -1
- package/server/dist/codex/protocol/InterruptConversationResponse.d.ts +0 -4
- package/server/dist/codex/protocol/InterruptConversationResponse.js +0 -4
- package/server/dist/codex/protocol/InterruptConversationResponse.js.map +0 -1
- package/server/dist/codex/protocol/ItemCompletedEvent.d.ts +0 -7
- package/server/dist/codex/protocol/ItemCompletedEvent.js +0 -4
- package/server/dist/codex/protocol/ItemCompletedEvent.js.map +0 -1
- package/server/dist/codex/protocol/ItemStartedEvent.d.ts +0 -7
- package/server/dist/codex/protocol/ItemStartedEvent.js +0 -4
- package/server/dist/codex/protocol/ItemStartedEvent.js.map +0 -1
- package/server/dist/codex/protocol/ListConversationsParams.d.ts +0 -5
- package/server/dist/codex/protocol/ListConversationsParams.js +0 -4
- package/server/dist/codex/protocol/ListConversationsParams.js.map +0 -1
- package/server/dist/codex/protocol/ListConversationsResponse.d.ts +0 -5
- package/server/dist/codex/protocol/ListConversationsResponse.js +0 -4
- package/server/dist/codex/protocol/ListConversationsResponse.js.map +0 -1
- package/server/dist/codex/protocol/ListCustomPromptsResponseEvent.d.ts +0 -7
- package/server/dist/codex/protocol/ListCustomPromptsResponseEvent.js +0 -4
- package/server/dist/codex/protocol/ListCustomPromptsResponseEvent.js.map +0 -1
- package/server/dist/codex/protocol/ListRemoteSkillsResponseEvent.d.ts +0 -7
- package/server/dist/codex/protocol/ListRemoteSkillsResponseEvent.js +0 -4
- package/server/dist/codex/protocol/ListRemoteSkillsResponseEvent.js.map +0 -1
- package/server/dist/codex/protocol/ListSkillsResponseEvent.d.ts +0 -7
- package/server/dist/codex/protocol/ListSkillsResponseEvent.js +0 -4
- package/server/dist/codex/protocol/ListSkillsResponseEvent.js.map +0 -1
- package/server/dist/codex/protocol/LocalShellAction.d.ts +0 -4
- package/server/dist/codex/protocol/LocalShellAction.js +0 -4
- package/server/dist/codex/protocol/LocalShellAction.js.map +0 -1
- package/server/dist/codex/protocol/LocalShellExecAction.d.ts +0 -9
- package/server/dist/codex/protocol/LocalShellExecAction.js +0 -4
- package/server/dist/codex/protocol/LocalShellExecAction.js.map +0 -1
- package/server/dist/codex/protocol/LocalShellStatus.d.ts +0 -1
- package/server/dist/codex/protocol/LocalShellStatus.js +0 -4
- package/server/dist/codex/protocol/LocalShellStatus.js.map +0 -1
- package/server/dist/codex/protocol/LoginApiKeyParams.d.ts +0 -3
- package/server/dist/codex/protocol/LoginApiKeyParams.js +0 -4
- package/server/dist/codex/protocol/LoginApiKeyParams.js.map +0 -1
- package/server/dist/codex/protocol/LoginApiKeyResponse.d.ts +0 -1
- package/server/dist/codex/protocol/LoginApiKeyResponse.js +0 -4
- package/server/dist/codex/protocol/LoginApiKeyResponse.js.map +0 -1
- package/server/dist/codex/protocol/LoginChatGptCompleteNotification.d.ts +0 -8
- package/server/dist/codex/protocol/LoginChatGptCompleteNotification.js +0 -4
- package/server/dist/codex/protocol/LoginChatGptCompleteNotification.js.map +0 -1
- package/server/dist/codex/protocol/LoginChatGptResponse.d.ts +0 -4
- package/server/dist/codex/protocol/LoginChatGptResponse.js +0 -4
- package/server/dist/codex/protocol/LoginChatGptResponse.js.map +0 -1
- package/server/dist/codex/protocol/LogoutChatGptResponse.d.ts +0 -1
- package/server/dist/codex/protocol/LogoutChatGptResponse.js +0 -4
- package/server/dist/codex/protocol/LogoutChatGptResponse.js.map +0 -1
- package/server/dist/codex/protocol/MacOsAutomationValue.d.ts +0 -1
- package/server/dist/codex/protocol/MacOsAutomationValue.js +0 -4
- package/server/dist/codex/protocol/MacOsAutomationValue.js.map +0 -1
- package/server/dist/codex/protocol/MacOsPermissions.d.ts +0 -8
- package/server/dist/codex/protocol/MacOsPermissions.js +0 -4
- package/server/dist/codex/protocol/MacOsPermissions.js.map +0 -1
- package/server/dist/codex/protocol/MacOsPreferencesValue.d.ts +0 -1
- package/server/dist/codex/protocol/MacOsPreferencesValue.js +0 -4
- package/server/dist/codex/protocol/MacOsPreferencesValue.js.map +0 -1
- package/server/dist/codex/protocol/McpAuthStatus.d.ts +0 -1
- package/server/dist/codex/protocol/McpAuthStatus.js +0 -4
- package/server/dist/codex/protocol/McpAuthStatus.js.map +0 -1
- package/server/dist/codex/protocol/McpInvocation.d.ts +0 -15
- package/server/dist/codex/protocol/McpInvocation.js +0 -4
- package/server/dist/codex/protocol/McpInvocation.js.map +0 -1
- package/server/dist/codex/protocol/McpListToolsResponseEvent.d.ts +0 -30
- package/server/dist/codex/protocol/McpListToolsResponseEvent.js +0 -4
- package/server/dist/codex/protocol/McpListToolsResponseEvent.js.map +0 -1
- package/server/dist/codex/protocol/McpStartupCompleteEvent.d.ts +0 -6
- package/server/dist/codex/protocol/McpStartupCompleteEvent.js +0 -4
- package/server/dist/codex/protocol/McpStartupCompleteEvent.js.map +0 -1
- package/server/dist/codex/protocol/McpStartupFailure.d.ts +0 -4
- package/server/dist/codex/protocol/McpStartupFailure.js +0 -4
- package/server/dist/codex/protocol/McpStartupFailure.js.map +0 -1
- package/server/dist/codex/protocol/McpStartupStatus.d.ts +0 -10
- package/server/dist/codex/protocol/McpStartupStatus.js +0 -4
- package/server/dist/codex/protocol/McpStartupStatus.js.map +0 -1
- package/server/dist/codex/protocol/McpStartupUpdateEvent.d.ts +0 -11
- package/server/dist/codex/protocol/McpStartupUpdateEvent.js +0 -4
- package/server/dist/codex/protocol/McpStartupUpdateEvent.js.map +0 -1
- package/server/dist/codex/protocol/McpToolCallBeginEvent.d.ts +0 -8
- package/server/dist/codex/protocol/McpToolCallBeginEvent.js +0 -4
- package/server/dist/codex/protocol/McpToolCallBeginEvent.js.map +0 -1
- package/server/dist/codex/protocol/McpToolCallEndEvent.d.ts +0 -18
- package/server/dist/codex/protocol/McpToolCallEndEvent.js +0 -4
- package/server/dist/codex/protocol/McpToolCallEndEvent.js.map +0 -1
- package/server/dist/codex/protocol/MessagePhase.d.ts +0 -7
- package/server/dist/codex/protocol/MessagePhase.js +0 -4
- package/server/dist/codex/protocol/MessagePhase.js.map +0 -1
- package/server/dist/codex/protocol/ModeKind.d.ts +0 -4
- package/server/dist/codex/protocol/ModeKind.js +0 -4
- package/server/dist/codex/protocol/ModeKind.js.map +0 -1
- package/server/dist/codex/protocol/ModelRerouteEvent.d.ts +0 -6
- package/server/dist/codex/protocol/ModelRerouteEvent.js +0 -4
- package/server/dist/codex/protocol/ModelRerouteEvent.js.map +0 -1
- package/server/dist/codex/protocol/ModelRerouteReason.d.ts +0 -1
- package/server/dist/codex/protocol/ModelRerouteReason.js +0 -4
- package/server/dist/codex/protocol/ModelRerouteReason.js.map +0 -1
- package/server/dist/codex/protocol/NetworkAccess.d.ts +0 -4
- package/server/dist/codex/protocol/NetworkAccess.js +0 -4
- package/server/dist/codex/protocol/NetworkAccess.js.map +0 -1
- package/server/dist/codex/protocol/NetworkApprovalContext.d.ts +0 -5
- package/server/dist/codex/protocol/NetworkApprovalContext.js +0 -4
- package/server/dist/codex/protocol/NetworkApprovalContext.js.map +0 -1
- package/server/dist/codex/protocol/NetworkApprovalProtocol.d.ts +0 -1
- package/server/dist/codex/protocol/NetworkApprovalProtocol.js +0 -4
- package/server/dist/codex/protocol/NetworkApprovalProtocol.js.map +0 -1
- package/server/dist/codex/protocol/NetworkPolicyAmendment.d.ts +0 -5
- package/server/dist/codex/protocol/NetworkPolicyAmendment.js +0 -4
- package/server/dist/codex/protocol/NetworkPolicyAmendment.js.map +0 -1
- package/server/dist/codex/protocol/NetworkPolicyRuleAction.d.ts +0 -1
- package/server/dist/codex/protocol/NetworkPolicyRuleAction.js +0 -4
- package/server/dist/codex/protocol/NetworkPolicyRuleAction.js.map +0 -1
- package/server/dist/codex/protocol/NewConversationParams.d.ts +0 -18
- package/server/dist/codex/protocol/NewConversationParams.js +0 -4
- package/server/dist/codex/protocol/NewConversationParams.js.map +0 -1
- package/server/dist/codex/protocol/NewConversationResponse.d.ts +0 -8
- package/server/dist/codex/protocol/NewConversationResponse.js +0 -4
- package/server/dist/codex/protocol/NewConversationResponse.js.map +0 -1
- package/server/dist/codex/protocol/ParsedCommand.d.ts +0 -24
- package/server/dist/codex/protocol/ParsedCommand.js +0 -4
- package/server/dist/codex/protocol/ParsedCommand.js.map +0 -1
- package/server/dist/codex/protocol/PatchApplyBeginEvent.d.ts +0 -22
- package/server/dist/codex/protocol/PatchApplyBeginEvent.js +0 -4
- package/server/dist/codex/protocol/PatchApplyBeginEvent.js.map +0 -1
- package/server/dist/codex/protocol/PatchApplyEndEvent.d.ts +0 -35
- package/server/dist/codex/protocol/PatchApplyEndEvent.js +0 -4
- package/server/dist/codex/protocol/PatchApplyEndEvent.js.map +0 -1
- package/server/dist/codex/protocol/PatchApplyStatus.d.ts +0 -1
- package/server/dist/codex/protocol/PatchApplyStatus.js +0 -4
- package/server/dist/codex/protocol/PatchApplyStatus.js.map +0 -1
- package/server/dist/codex/protocol/PermissionProfile.d.ts +0 -7
- package/server/dist/codex/protocol/PermissionProfile.js +0 -4
- package/server/dist/codex/protocol/PermissionProfile.js.map +0 -1
- package/server/dist/codex/protocol/Personality.d.ts +0 -1
- package/server/dist/codex/protocol/Personality.js +0 -4
- package/server/dist/codex/protocol/Personality.js.map +0 -1
- package/server/dist/codex/protocol/PlanDeltaEvent.d.ts +0 -6
- package/server/dist/codex/protocol/PlanDeltaEvent.js +0 -4
- package/server/dist/codex/protocol/PlanDeltaEvent.js.map +0 -1
- package/server/dist/codex/protocol/PlanItem.d.ts +0 -4
- package/server/dist/codex/protocol/PlanItem.js +0 -4
- package/server/dist/codex/protocol/PlanItem.js.map +0 -1
- package/server/dist/codex/protocol/PlanItemArg.d.ts +0 -5
- package/server/dist/codex/protocol/PlanItemArg.js +0 -4
- package/server/dist/codex/protocol/PlanItemArg.js.map +0 -1
- package/server/dist/codex/protocol/PlanType.d.ts +0 -1
- package/server/dist/codex/protocol/PlanType.js +0 -4
- package/server/dist/codex/protocol/PlanType.js.map +0 -1
- package/server/dist/codex/protocol/Profile.d.ts +0 -13
- package/server/dist/codex/protocol/Profile.js +0 -4
- package/server/dist/codex/protocol/Profile.js.map +0 -1
- package/server/dist/codex/protocol/RateLimitSnapshot.d.ts +0 -11
- package/server/dist/codex/protocol/RateLimitSnapshot.js +0 -4
- package/server/dist/codex/protocol/RateLimitSnapshot.js.map +0 -1
- package/server/dist/codex/protocol/RateLimitWindow.d.ts +0 -14
- package/server/dist/codex/protocol/RateLimitWindow.js +0 -4
- package/server/dist/codex/protocol/RateLimitWindow.js.map +0 -1
- package/server/dist/codex/protocol/RawResponseItemEvent.d.ts +0 -4
- package/server/dist/codex/protocol/RawResponseItemEvent.js +0 -4
- package/server/dist/codex/protocol/RawResponseItemEvent.js.map +0 -1
- package/server/dist/codex/protocol/ReadOnlyAccess.d.ts +0 -19
- package/server/dist/codex/protocol/ReadOnlyAccess.js +0 -4
- package/server/dist/codex/protocol/ReadOnlyAccess.js.map +0 -1
- package/server/dist/codex/protocol/RealtimeAudioFrame.d.ts +0 -6
- package/server/dist/codex/protocol/RealtimeAudioFrame.js +0 -4
- package/server/dist/codex/protocol/RealtimeAudioFrame.js.map +0 -1
- package/server/dist/codex/protocol/RealtimeConversationClosedEvent.d.ts +0 -3
- package/server/dist/codex/protocol/RealtimeConversationClosedEvent.js +0 -4
- package/server/dist/codex/protocol/RealtimeConversationClosedEvent.js.map +0 -1
- package/server/dist/codex/protocol/RealtimeConversationRealtimeEvent.d.ts +0 -4
- package/server/dist/codex/protocol/RealtimeConversationRealtimeEvent.js +0 -4
- package/server/dist/codex/protocol/RealtimeConversationRealtimeEvent.js.map +0 -1
- package/server/dist/codex/protocol/RealtimeConversationStartedEvent.d.ts +0 -3
- package/server/dist/codex/protocol/RealtimeConversationStartedEvent.js +0 -4
- package/server/dist/codex/protocol/RealtimeConversationStartedEvent.js.map +0 -1
- package/server/dist/codex/protocol/RealtimeEvent.d.ts +0 -17
- package/server/dist/codex/protocol/RealtimeEvent.js +0 -4
- package/server/dist/codex/protocol/RealtimeEvent.js.map +0 -1
- package/server/dist/codex/protocol/ReasoningContentDeltaEvent.d.ts +0 -7
- package/server/dist/codex/protocol/ReasoningContentDeltaEvent.js +0 -4
- package/server/dist/codex/protocol/ReasoningContentDeltaEvent.js.map +0 -1
- package/server/dist/codex/protocol/ReasoningEffort.d.ts +0 -4
- package/server/dist/codex/protocol/ReasoningEffort.js +0 -4
- package/server/dist/codex/protocol/ReasoningEffort.js.map +0 -1
- package/server/dist/codex/protocol/ReasoningItem.d.ts +0 -5
- package/server/dist/codex/protocol/ReasoningItem.js +0 -4
- package/server/dist/codex/protocol/ReasoningItem.js.map +0 -1
- package/server/dist/codex/protocol/ReasoningItemContent.d.ts +0 -7
- package/server/dist/codex/protocol/ReasoningItemContent.js +0 -4
- package/server/dist/codex/protocol/ReasoningItemContent.js.map +0 -1
- package/server/dist/codex/protocol/ReasoningItemReasoningSummary.d.ts +0 -4
- package/server/dist/codex/protocol/ReasoningItemReasoningSummary.js +0 -4
- package/server/dist/codex/protocol/ReasoningItemReasoningSummary.js.map +0 -1
- package/server/dist/codex/protocol/ReasoningRawContentDeltaEvent.d.ts +0 -7
- package/server/dist/codex/protocol/ReasoningRawContentDeltaEvent.js +0 -4
- package/server/dist/codex/protocol/ReasoningRawContentDeltaEvent.js.map +0 -1
- package/server/dist/codex/protocol/ReasoningSummary.d.ts +0 -6
- package/server/dist/codex/protocol/ReasoningSummary.js +0 -4
- package/server/dist/codex/protocol/ReasoningSummary.js.map +0 -1
- package/server/dist/codex/protocol/RejectConfig.d.ts +0 -14
- package/server/dist/codex/protocol/RejectConfig.js +0 -4
- package/server/dist/codex/protocol/RejectConfig.js.map +0 -1
- package/server/dist/codex/protocol/RemoteSkillDownloadedEvent.d.ts +0 -8
- package/server/dist/codex/protocol/RemoteSkillDownloadedEvent.js +0 -4
- package/server/dist/codex/protocol/RemoteSkillDownloadedEvent.js.map +0 -1
- package/server/dist/codex/protocol/RemoteSkillSummary.d.ts +0 -5
- package/server/dist/codex/protocol/RemoteSkillSummary.js +0 -4
- package/server/dist/codex/protocol/RemoteSkillSummary.js.map +0 -1
- package/server/dist/codex/protocol/RemoveConversationListenerParams.d.ts +0 -3
- package/server/dist/codex/protocol/RemoveConversationListenerParams.js +0 -4
- package/server/dist/codex/protocol/RemoveConversationListenerParams.js.map +0 -1
- package/server/dist/codex/protocol/RemoveConversationSubscriptionResponse.d.ts +0 -1
- package/server/dist/codex/protocol/RemoveConversationSubscriptionResponse.js +0 -4
- package/server/dist/codex/protocol/RemoveConversationSubscriptionResponse.js.map +0 -1
- package/server/dist/codex/protocol/RequestId.d.ts +0 -1
- package/server/dist/codex/protocol/RequestId.js +0 -4
- package/server/dist/codex/protocol/RequestId.js.map +0 -1
- package/server/dist/codex/protocol/RequestUserInputEvent.d.ts +0 -13
- package/server/dist/codex/protocol/RequestUserInputEvent.js +0 -4
- package/server/dist/codex/protocol/RequestUserInputEvent.js.map +0 -1
- package/server/dist/codex/protocol/RequestUserInputQuestion.d.ts +0 -9
- package/server/dist/codex/protocol/RequestUserInputQuestion.js +0 -4
- package/server/dist/codex/protocol/RequestUserInputQuestion.js.map +0 -1
- package/server/dist/codex/protocol/RequestUserInputQuestionOption.d.ts +0 -4
- package/server/dist/codex/protocol/RequestUserInputQuestionOption.js +0 -4
- package/server/dist/codex/protocol/RequestUserInputQuestionOption.js.map +0 -1
- package/server/dist/codex/protocol/Resource.d.ts +0 -15
- package/server/dist/codex/protocol/Resource.js +0 -4
- package/server/dist/codex/protocol/Resource.js.map +0 -1
- package/server/dist/codex/protocol/ResourceTemplate.d.ts +0 -12
- package/server/dist/codex/protocol/ResourceTemplate.js +0 -4
- package/server/dist/codex/protocol/ResourceTemplate.js.map +0 -1
- package/server/dist/codex/protocol/ResponseItem.d.ts +0 -60
- package/server/dist/codex/protocol/ResponseItem.js +0 -4
- package/server/dist/codex/protocol/ResponseItem.js.map +0 -1
- package/server/dist/codex/protocol/ResumeConversationParams.d.ts +0 -9
- package/server/dist/codex/protocol/ResumeConversationParams.js +0 -4
- package/server/dist/codex/protocol/ResumeConversationParams.js.map +0 -1
- package/server/dist/codex/protocol/ResumeConversationResponse.d.ts +0 -8
- package/server/dist/codex/protocol/ResumeConversationResponse.js +0 -4
- package/server/dist/codex/protocol/ResumeConversationResponse.js.map +0 -1
- package/server/dist/codex/protocol/ReviewCodeLocation.d.ts +0 -8
- package/server/dist/codex/protocol/ReviewCodeLocation.js +0 -4
- package/server/dist/codex/protocol/ReviewCodeLocation.js.map +0 -1
- package/server/dist/codex/protocol/ReviewDecision.d.ts +0 -14
- package/server/dist/codex/protocol/ReviewDecision.js +0 -4
- package/server/dist/codex/protocol/ReviewDecision.js.map +0 -1
- package/server/dist/codex/protocol/ReviewFinding.d.ts +0 -11
- package/server/dist/codex/protocol/ReviewFinding.js +0 -4
- package/server/dist/codex/protocol/ReviewFinding.js.map +0 -1
- package/server/dist/codex/protocol/ReviewLineRange.d.ts +0 -7
- package/server/dist/codex/protocol/ReviewLineRange.js +0 -4
- package/server/dist/codex/protocol/ReviewLineRange.js.map +0 -1
- package/server/dist/codex/protocol/ReviewOutputEvent.d.ts +0 -10
- package/server/dist/codex/protocol/ReviewOutputEvent.js +0 -4
- package/server/dist/codex/protocol/ReviewOutputEvent.js.map +0 -1
- package/server/dist/codex/protocol/ReviewRequest.d.ts +0 -8
- package/server/dist/codex/protocol/ReviewRequest.js +0 -4
- package/server/dist/codex/protocol/ReviewRequest.js.map +0 -1
- package/server/dist/codex/protocol/ReviewTarget.d.ts +0 -16
- package/server/dist/codex/protocol/ReviewTarget.js +0 -4
- package/server/dist/codex/protocol/ReviewTarget.js.map +0 -1
- package/server/dist/codex/protocol/SandboxMode.d.ts +0 -1
- package/server/dist/codex/protocol/SandboxMode.js +0 -4
- package/server/dist/codex/protocol/SandboxMode.js.map +0 -1
- package/server/dist/codex/protocol/SandboxPolicy.d.ts +0 -48
- package/server/dist/codex/protocol/SandboxPolicy.js +0 -4
- package/server/dist/codex/protocol/SandboxPolicy.js.map +0 -1
- package/server/dist/codex/protocol/SandboxSettings.d.ts +0 -7
- package/server/dist/codex/protocol/SandboxSettings.js +0 -4
- package/server/dist/codex/protocol/SandboxSettings.js.map +0 -1
- package/server/dist/codex/protocol/SendUserMessageParams.d.ts +0 -6
- package/server/dist/codex/protocol/SendUserMessageParams.js +0 -4
- package/server/dist/codex/protocol/SendUserMessageParams.js.map +0 -1
- package/server/dist/codex/protocol/SendUserMessageResponse.d.ts +0 -1
- package/server/dist/codex/protocol/SendUserMessageResponse.js +0 -4
- package/server/dist/codex/protocol/SendUserMessageResponse.js.map +0 -1
- package/server/dist/codex/protocol/SendUserTurnParams.d.ts +0 -21
- package/server/dist/codex/protocol/SendUserTurnParams.js +0 -4
- package/server/dist/codex/protocol/SendUserTurnParams.js.map +0 -1
- package/server/dist/codex/protocol/SendUserTurnResponse.d.ts +0 -1
- package/server/dist/codex/protocol/SendUserTurnResponse.js +0 -4
- package/server/dist/codex/protocol/SendUserTurnResponse.js.map +0 -1
- package/server/dist/codex/protocol/ServerNotification.d.ts +0 -184
- package/server/dist/codex/protocol/ServerNotification.js +0 -4
- package/server/dist/codex/protocol/ServerNotification.js.map +0 -1
- package/server/dist/codex/protocol/ServerRequest.d.ts +0 -40
- package/server/dist/codex/protocol/ServerRequest.js +0 -4
- package/server/dist/codex/protocol/ServerRequest.js.map +0 -1
- package/server/dist/codex/protocol/SessionConfiguredEvent.d.ts +0 -57
- package/server/dist/codex/protocol/SessionConfiguredEvent.js +0 -4
- package/server/dist/codex/protocol/SessionConfiguredEvent.js.map +0 -1
- package/server/dist/codex/protocol/SessionConfiguredNotification.d.ts +0 -12
- package/server/dist/codex/protocol/SessionConfiguredNotification.js +0 -4
- package/server/dist/codex/protocol/SessionConfiguredNotification.js.map +0 -1
- package/server/dist/codex/protocol/SessionNetworkProxyRuntime.d.ts +0 -5
- package/server/dist/codex/protocol/SessionNetworkProxyRuntime.js +0 -4
- package/server/dist/codex/protocol/SessionNetworkProxyRuntime.js.map +0 -1
- package/server/dist/codex/protocol/SessionSource.d.ts +0 -4
- package/server/dist/codex/protocol/SessionSource.js +0 -4
- package/server/dist/codex/protocol/SessionSource.js.map +0 -1
- package/server/dist/codex/protocol/SetDefaultModelParams.d.ts +0 -5
- package/server/dist/codex/protocol/SetDefaultModelParams.js +0 -4
- package/server/dist/codex/protocol/SetDefaultModelParams.js.map +0 -1
- package/server/dist/codex/protocol/SetDefaultModelResponse.d.ts +0 -1
- package/server/dist/codex/protocol/SetDefaultModelResponse.js +0 -4
- package/server/dist/codex/protocol/SetDefaultModelResponse.js.map +0 -1
- package/server/dist/codex/protocol/Settings.d.ts +0 -9
- package/server/dist/codex/protocol/Settings.js +0 -4
- package/server/dist/codex/protocol/Settings.js.map +0 -1
- package/server/dist/codex/protocol/SkillDependencies.d.ts +0 -4
- package/server/dist/codex/protocol/SkillDependencies.js +0 -4
- package/server/dist/codex/protocol/SkillDependencies.js.map +0 -1
- package/server/dist/codex/protocol/SkillErrorInfo.d.ts +0 -4
- package/server/dist/codex/protocol/SkillErrorInfo.js +0 -4
- package/server/dist/codex/protocol/SkillErrorInfo.js.map +0 -1
- package/server/dist/codex/protocol/SkillInterface.d.ts +0 -8
- package/server/dist/codex/protocol/SkillInterface.js +0 -4
- package/server/dist/codex/protocol/SkillInterface.js.map +0 -1
- package/server/dist/codex/protocol/SkillMetadata.d.ts +0 -16
- package/server/dist/codex/protocol/SkillMetadata.js +0 -4
- package/server/dist/codex/protocol/SkillMetadata.js.map +0 -1
- package/server/dist/codex/protocol/SkillScope.d.ts +0 -1
- package/server/dist/codex/protocol/SkillScope.js +0 -4
- package/server/dist/codex/protocol/SkillScope.js.map +0 -1
- package/server/dist/codex/protocol/SkillToolDependency.d.ts +0 -8
- package/server/dist/codex/protocol/SkillToolDependency.js +0 -4
- package/server/dist/codex/protocol/SkillToolDependency.js.map +0 -1
- package/server/dist/codex/protocol/SkillsListEntry.d.ts +0 -7
- package/server/dist/codex/protocol/SkillsListEntry.js +0 -4
- package/server/dist/codex/protocol/SkillsListEntry.js.map +0 -1
- package/server/dist/codex/protocol/StepStatus.d.ts +0 -1
- package/server/dist/codex/protocol/StepStatus.js +0 -4
- package/server/dist/codex/protocol/StepStatus.js.map +0 -1
- package/server/dist/codex/protocol/StreamErrorEvent.d.ts +0 -11
- package/server/dist/codex/protocol/StreamErrorEvent.js +0 -4
- package/server/dist/codex/protocol/StreamErrorEvent.js.map +0 -1
- package/server/dist/codex/protocol/SubAgentSource.d.ts +0 -11
- package/server/dist/codex/protocol/SubAgentSource.js +0 -4
- package/server/dist/codex/protocol/SubAgentSource.js.map +0 -1
- package/server/dist/codex/protocol/TerminalInteractionEvent.d.ts +0 -14
- package/server/dist/codex/protocol/TerminalInteractionEvent.js +0 -4
- package/server/dist/codex/protocol/TerminalInteractionEvent.js.map +0 -1
- package/server/dist/codex/protocol/TextElement.d.ts +0 -11
- package/server/dist/codex/protocol/TextElement.js +0 -4
- package/server/dist/codex/protocol/TextElement.js.map +0 -1
- package/server/dist/codex/protocol/ThreadId.d.ts +0 -1
- package/server/dist/codex/protocol/ThreadId.js +0 -4
- package/server/dist/codex/protocol/ThreadId.js.map +0 -1
- package/server/dist/codex/protocol/ThreadNameUpdatedEvent.d.ts +0 -5
- package/server/dist/codex/protocol/ThreadNameUpdatedEvent.js +0 -4
- package/server/dist/codex/protocol/ThreadNameUpdatedEvent.js.map +0 -1
- package/server/dist/codex/protocol/ThreadRolledBackEvent.d.ts +0 -6
- package/server/dist/codex/protocol/ThreadRolledBackEvent.js +0 -4
- package/server/dist/codex/protocol/ThreadRolledBackEvent.js.map +0 -1
- package/server/dist/codex/protocol/TokenCountEvent.d.ts +0 -6
- package/server/dist/codex/protocol/TokenCountEvent.js +0 -4
- package/server/dist/codex/protocol/TokenCountEvent.js.map +0 -1
- package/server/dist/codex/protocol/TokenUsage.d.ts +0 -7
- package/server/dist/codex/protocol/TokenUsage.js +0 -4
- package/server/dist/codex/protocol/TokenUsage.js.map +0 -1
- package/server/dist/codex/protocol/TokenUsageInfo.d.ts +0 -6
- package/server/dist/codex/protocol/TokenUsageInfo.js +0 -4
- package/server/dist/codex/protocol/TokenUsageInfo.js.map +0 -1
- package/server/dist/codex/protocol/Tool.d.ts +0 -14
- package/server/dist/codex/protocol/Tool.js.map +0 -1
- package/server/dist/codex/protocol/Tools.d.ts +0 -4
- package/server/dist/codex/protocol/Tools.js +0 -4
- package/server/dist/codex/protocol/Tools.js.map +0 -1
- package/server/dist/codex/protocol/TurnAbortReason.d.ts +0 -1
- package/server/dist/codex/protocol/TurnAbortReason.js +0 -4
- package/server/dist/codex/protocol/TurnAbortReason.js.map +0 -1
- package/server/dist/codex/protocol/TurnAbortedEvent.d.ts +0 -5
- package/server/dist/codex/protocol/TurnAbortedEvent.js +0 -4
- package/server/dist/codex/protocol/TurnAbortedEvent.js.map +0 -1
- package/server/dist/codex/protocol/TurnCompleteEvent.d.ts +0 -4
- package/server/dist/codex/protocol/TurnCompleteEvent.js +0 -4
- package/server/dist/codex/protocol/TurnCompleteEvent.js.map +0 -1
- package/server/dist/codex/protocol/TurnDiffEvent.d.ts +0 -3
- package/server/dist/codex/protocol/TurnDiffEvent.js +0 -4
- package/server/dist/codex/protocol/TurnDiffEvent.js.map +0 -1
- package/server/dist/codex/protocol/TurnItem.d.ts +0 -19
- package/server/dist/codex/protocol/TurnItem.js +0 -4
- package/server/dist/codex/protocol/TurnItem.js.map +0 -1
- package/server/dist/codex/protocol/TurnStartedEvent.d.ts +0 -6
- package/server/dist/codex/protocol/TurnStartedEvent.js +0 -4
- package/server/dist/codex/protocol/TurnStartedEvent.js.map +0 -1
- package/server/dist/codex/protocol/UndoCompletedEvent.d.ts +0 -4
- package/server/dist/codex/protocol/UndoCompletedEvent.js +0 -4
- package/server/dist/codex/protocol/UndoCompletedEvent.js.map +0 -1
- package/server/dist/codex/protocol/UndoStartedEvent.d.ts +0 -3
- package/server/dist/codex/protocol/UndoStartedEvent.js +0 -4
- package/server/dist/codex/protocol/UndoStartedEvent.js.map +0 -1
- package/server/dist/codex/protocol/UpdatePlanArgs.d.ts +0 -8
- package/server/dist/codex/protocol/UpdatePlanArgs.js +0 -4
- package/server/dist/codex/protocol/UpdatePlanArgs.js.map +0 -1
- package/server/dist/codex/protocol/UserInfoResponse.d.ts +0 -3
- package/server/dist/codex/protocol/UserInfoResponse.js +0 -4
- package/server/dist/codex/protocol/UserInfoResponse.js.map +0 -1
- package/server/dist/codex/protocol/UserInput.d.ts +0 -29
- package/server/dist/codex/protocol/UserInput.js +0 -4
- package/server/dist/codex/protocol/UserInput.js.map +0 -1
- package/server/dist/codex/protocol/UserMessageEvent.d.ts +0 -20
- package/server/dist/codex/protocol/UserMessageEvent.js +0 -4
- package/server/dist/codex/protocol/UserMessageEvent.js.map +0 -1
- package/server/dist/codex/protocol/UserMessageItem.d.ts +0 -5
- package/server/dist/codex/protocol/UserMessageItem.js +0 -4
- package/server/dist/codex/protocol/UserMessageItem.js.map +0 -1
- package/server/dist/codex/protocol/UserSavedConfig.d.ts +0 -25
- package/server/dist/codex/protocol/UserSavedConfig.js +0 -4
- package/server/dist/codex/protocol/UserSavedConfig.js.map +0 -1
- package/server/dist/codex/protocol/Verbosity.d.ts +0 -5
- package/server/dist/codex/protocol/Verbosity.js +0 -4
- package/server/dist/codex/protocol/Verbosity.js.map +0 -1
- package/server/dist/codex/protocol/ViewImageToolCallEvent.d.ts +0 -10
- package/server/dist/codex/protocol/ViewImageToolCallEvent.js +0 -4
- package/server/dist/codex/protocol/ViewImageToolCallEvent.js.map +0 -1
- package/server/dist/codex/protocol/WarningEvent.d.ts +0 -3
- package/server/dist/codex/protocol/WarningEvent.js +0 -4
- package/server/dist/codex/protocol/WarningEvent.js.map +0 -1
- package/server/dist/codex/protocol/WebSearchAction.d.ts +0 -14
- package/server/dist/codex/protocol/WebSearchAction.js +0 -4
- package/server/dist/codex/protocol/WebSearchAction.js.map +0 -1
- package/server/dist/codex/protocol/WebSearchBeginEvent.d.ts +0 -3
- package/server/dist/codex/protocol/WebSearchBeginEvent.js +0 -4
- package/server/dist/codex/protocol/WebSearchBeginEvent.js.map +0 -1
- package/server/dist/codex/protocol/WebSearchEndEvent.d.ts +0 -6
- package/server/dist/codex/protocol/WebSearchEndEvent.js +0 -4
- package/server/dist/codex/protocol/WebSearchEndEvent.js.map +0 -1
- package/server/dist/codex/protocol/WebSearchItem.d.ts +0 -6
- package/server/dist/codex/protocol/WebSearchItem.js +0 -4
- package/server/dist/codex/protocol/WebSearchItem.js.map +0 -1
- package/server/dist/codex/protocol/WebSearchMode.d.ts +0 -1
- package/server/dist/codex/protocol/WebSearchMode.js +0 -4
- package/server/dist/codex/protocol/WebSearchMode.js.map +0 -1
- package/server/dist/codex/protocol/index.d.ts +0 -248
- package/server/dist/codex/protocol/index.js +0 -39
- package/server/dist/codex/protocol/index.js.map +0 -1
- package/server/dist/codex/protocol/serde_json/JsonValue.d.ts +0 -3
- package/server/dist/codex/protocol/serde_json/JsonValue.js +0 -4
- package/server/dist/codex/protocol/serde_json/JsonValue.js.map +0 -1
- package/server/dist/codex/protocol/v2/Account.d.ts +0 -8
- package/server/dist/codex/protocol/v2/Account.js +0 -4
- package/server/dist/codex/protocol/v2/Account.js.map +0 -1
- package/server/dist/codex/protocol/v2/AccountLoginCompletedNotification.d.ts +0 -5
- package/server/dist/codex/protocol/v2/AccountLoginCompletedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/AccountLoginCompletedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/AccountRateLimitsUpdatedNotification.d.ts +0 -4
- package/server/dist/codex/protocol/v2/AccountRateLimitsUpdatedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/AccountRateLimitsUpdatedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/AccountUpdatedNotification.d.ts +0 -4
- package/server/dist/codex/protocol/v2/AccountUpdatedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/AccountUpdatedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/AdditionalFileSystemPermissions.d.ts +0 -4
- package/server/dist/codex/protocol/v2/AdditionalFileSystemPermissions.js +0 -4
- package/server/dist/codex/protocol/v2/AdditionalFileSystemPermissions.js.map +0 -1
- package/server/dist/codex/protocol/v2/AdditionalMacOsPermissions.d.ts +0 -8
- package/server/dist/codex/protocol/v2/AdditionalMacOsPermissions.js +0 -4
- package/server/dist/codex/protocol/v2/AdditionalMacOsPermissions.js.map +0 -1
- package/server/dist/codex/protocol/v2/AdditionalPermissionProfile.d.ts +0 -7
- package/server/dist/codex/protocol/v2/AdditionalPermissionProfile.js +0 -4
- package/server/dist/codex/protocol/v2/AdditionalPermissionProfile.js.map +0 -1
- package/server/dist/codex/protocol/v2/AgentMessageDeltaNotification.d.ts +0 -6
- package/server/dist/codex/protocol/v2/AgentMessageDeltaNotification.js +0 -4
- package/server/dist/codex/protocol/v2/AgentMessageDeltaNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/AnalyticsConfig.d.ts +0 -8
- package/server/dist/codex/protocol/v2/AnalyticsConfig.js +0 -4
- package/server/dist/codex/protocol/v2/AnalyticsConfig.js.map +0 -1
- package/server/dist/codex/protocol/v2/AppBranding.d.ts +0 -11
- package/server/dist/codex/protocol/v2/AppBranding.js +0 -4
- package/server/dist/codex/protocol/v2/AppBranding.js.map +0 -1
- package/server/dist/codex/protocol/v2/AppInfo.d.ts +0 -29
- package/server/dist/codex/protocol/v2/AppInfo.js +0 -4
- package/server/dist/codex/protocol/v2/AppInfo.js.map +0 -1
- package/server/dist/codex/protocol/v2/AppListUpdatedNotification.d.ts +0 -7
- package/server/dist/codex/protocol/v2/AppListUpdatedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/AppListUpdatedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/AppMetadata.d.ts +0 -16
- package/server/dist/codex/protocol/v2/AppMetadata.js +0 -4
- package/server/dist/codex/protocol/v2/AppMetadata.js.map +0 -1
- package/server/dist/codex/protocol/v2/AppReview.d.ts +0 -3
- package/server/dist/codex/protocol/v2/AppReview.js +0 -4
- package/server/dist/codex/protocol/v2/AppReview.js.map +0 -1
- package/server/dist/codex/protocol/v2/AppScreenshot.d.ts +0 -5
- package/server/dist/codex/protocol/v2/AppScreenshot.js +0 -4
- package/server/dist/codex/protocol/v2/AppScreenshot.js.map +0 -1
- package/server/dist/codex/protocol/v2/AppToolApproval.d.ts +0 -1
- package/server/dist/codex/protocol/v2/AppToolApproval.js +0 -4
- package/server/dist/codex/protocol/v2/AppToolApproval.js.map +0 -1
- package/server/dist/codex/protocol/v2/AppToolsConfig.d.ts +0 -7
- package/server/dist/codex/protocol/v2/AppToolsConfig.js +0 -4
- package/server/dist/codex/protocol/v2/AppToolsConfig.js.map +0 -1
- package/server/dist/codex/protocol/v2/AppsConfig.d.ts +0 -15
- package/server/dist/codex/protocol/v2/AppsConfig.js +0 -4
- package/server/dist/codex/protocol/v2/AppsConfig.js.map +0 -1
- package/server/dist/codex/protocol/v2/AppsDefaultConfig.d.ts +0 -5
- package/server/dist/codex/protocol/v2/AppsDefaultConfig.js +0 -4
- package/server/dist/codex/protocol/v2/AppsDefaultConfig.js.map +0 -1
- package/server/dist/codex/protocol/v2/AppsListParams.d.ts +0 -21
- package/server/dist/codex/protocol/v2/AppsListParams.js +0 -4
- package/server/dist/codex/protocol/v2/AppsListParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/AppsListResponse.d.ts +0 -12
- package/server/dist/codex/protocol/v2/AppsListResponse.js +0 -4
- package/server/dist/codex/protocol/v2/AppsListResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/AskForApproval.d.ts +0 -7
- package/server/dist/codex/protocol/v2/AskForApproval.js +0 -4
- package/server/dist/codex/protocol/v2/AskForApproval.js.map +0 -1
- package/server/dist/codex/protocol/v2/ByteRange.d.ts +0 -4
- package/server/dist/codex/protocol/v2/ByteRange.js +0 -4
- package/server/dist/codex/protocol/v2/ByteRange.js.map +0 -1
- package/server/dist/codex/protocol/v2/CancelLoginAccountParams.d.ts +0 -3
- package/server/dist/codex/protocol/v2/CancelLoginAccountParams.js +0 -4
- package/server/dist/codex/protocol/v2/CancelLoginAccountParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/CancelLoginAccountResponse.d.ts +0 -4
- package/server/dist/codex/protocol/v2/CancelLoginAccountResponse.js +0 -4
- package/server/dist/codex/protocol/v2/CancelLoginAccountResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/CancelLoginAccountStatus.d.ts +0 -1
- package/server/dist/codex/protocol/v2/CancelLoginAccountStatus.js +0 -4
- package/server/dist/codex/protocol/v2/CancelLoginAccountStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/ChatgptAuthTokensRefreshParams.d.ts +0 -14
- package/server/dist/codex/protocol/v2/ChatgptAuthTokensRefreshParams.js +0 -4
- package/server/dist/codex/protocol/v2/ChatgptAuthTokensRefreshParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ChatgptAuthTokensRefreshReason.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ChatgptAuthTokensRefreshReason.js +0 -4
- package/server/dist/codex/protocol/v2/ChatgptAuthTokensRefreshReason.js.map +0 -1
- package/server/dist/codex/protocol/v2/ChatgptAuthTokensRefreshResponse.d.ts +0 -5
- package/server/dist/codex/protocol/v2/ChatgptAuthTokensRefreshResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ChatgptAuthTokensRefreshResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/CodexErrorInfo.d.ts +0 -23
- package/server/dist/codex/protocol/v2/CodexErrorInfo.js +0 -4
- package/server/dist/codex/protocol/v2/CodexErrorInfo.js.map +0 -1
- package/server/dist/codex/protocol/v2/CollabAgentState.d.ts +0 -5
- package/server/dist/codex/protocol/v2/CollabAgentState.js +0 -4
- package/server/dist/codex/protocol/v2/CollabAgentState.js.map +0 -1
- package/server/dist/codex/protocol/v2/CollabAgentStatus.d.ts +0 -1
- package/server/dist/codex/protocol/v2/CollabAgentStatus.js +0 -4
- package/server/dist/codex/protocol/v2/CollabAgentStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/CollabAgentTool.d.ts +0 -1
- package/server/dist/codex/protocol/v2/CollabAgentTool.js +0 -4
- package/server/dist/codex/protocol/v2/CollabAgentTool.js.map +0 -1
- package/server/dist/codex/protocol/v2/CollabAgentToolCallStatus.d.ts +0 -1
- package/server/dist/codex/protocol/v2/CollabAgentToolCallStatus.js +0 -4
- package/server/dist/codex/protocol/v2/CollabAgentToolCallStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/CollaborationModeMask.d.ts +0 -11
- package/server/dist/codex/protocol/v2/CollaborationModeMask.js +0 -4
- package/server/dist/codex/protocol/v2/CollaborationModeMask.js.map +0 -1
- package/server/dist/codex/protocol/v2/CommandAction.d.ts +0 -18
- package/server/dist/codex/protocol/v2/CommandAction.js +0 -4
- package/server/dist/codex/protocol/v2/CommandAction.js.map +0 -1
- package/server/dist/codex/protocol/v2/CommandExecParams.d.ts +0 -7
- package/server/dist/codex/protocol/v2/CommandExecParams.js +0 -4
- package/server/dist/codex/protocol/v2/CommandExecParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/CommandExecResponse.d.ts +0 -5
- package/server/dist/codex/protocol/v2/CommandExecResponse.js +0 -4
- package/server/dist/codex/protocol/v2/CommandExecResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/CommandExecutionApprovalDecision.d.ts +0 -11
- package/server/dist/codex/protocol/v2/CommandExecutionApprovalDecision.js +0 -4
- package/server/dist/codex/protocol/v2/CommandExecutionApprovalDecision.js.map +0 -1
- package/server/dist/codex/protocol/v2/CommandExecutionOutputDeltaNotification.d.ts +0 -6
- package/server/dist/codex/protocol/v2/CommandExecutionOutputDeltaNotification.js +0 -4
- package/server/dist/codex/protocol/v2/CommandExecutionOutputDeltaNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/CommandExecutionRequestApprovalParams.d.ts +0 -57
- package/server/dist/codex/protocol/v2/CommandExecutionRequestApprovalParams.js +0 -4
- package/server/dist/codex/protocol/v2/CommandExecutionRequestApprovalParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/CommandExecutionRequestApprovalResponse.d.ts +0 -4
- package/server/dist/codex/protocol/v2/CommandExecutionRequestApprovalResponse.js +0 -4
- package/server/dist/codex/protocol/v2/CommandExecutionRequestApprovalResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/CommandExecutionStatus.d.ts +0 -1
- package/server/dist/codex/protocol/v2/CommandExecutionStatus.js +0 -4
- package/server/dist/codex/protocol/v2/CommandExecutionStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/Config.d.ts +0 -41
- package/server/dist/codex/protocol/v2/Config.js +0 -4
- package/server/dist/codex/protocol/v2/Config.js.map +0 -1
- package/server/dist/codex/protocol/v2/ConfigBatchWriteParams.d.ts +0 -9
- package/server/dist/codex/protocol/v2/ConfigBatchWriteParams.js +0 -4
- package/server/dist/codex/protocol/v2/ConfigBatchWriteParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ConfigEdit.d.ts +0 -7
- package/server/dist/codex/protocol/v2/ConfigEdit.js +0 -4
- package/server/dist/codex/protocol/v2/ConfigEdit.js.map +0 -1
- package/server/dist/codex/protocol/v2/ConfigLayer.d.ts +0 -8
- package/server/dist/codex/protocol/v2/ConfigLayer.js +0 -4
- package/server/dist/codex/protocol/v2/ConfigLayer.js.map +0 -1
- package/server/dist/codex/protocol/v2/ConfigLayerMetadata.d.ts +0 -5
- package/server/dist/codex/protocol/v2/ConfigLayerMetadata.js +0 -4
- package/server/dist/codex/protocol/v2/ConfigLayerMetadata.js.map +0 -1
- package/server/dist/codex/protocol/v2/ConfigLayerSource.d.ts +0 -30
- package/server/dist/codex/protocol/v2/ConfigLayerSource.js +0 -4
- package/server/dist/codex/protocol/v2/ConfigLayerSource.js.map +0 -1
- package/server/dist/codex/protocol/v2/ConfigReadParams.d.ts +0 -9
- package/server/dist/codex/protocol/v2/ConfigReadParams.js +0 -4
- package/server/dist/codex/protocol/v2/ConfigReadParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ConfigReadResponse.d.ts +0 -10
- package/server/dist/codex/protocol/v2/ConfigReadResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ConfigReadResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ConfigRequirements.d.ts +0 -10
- package/server/dist/codex/protocol/v2/ConfigRequirements.js +0 -4
- package/server/dist/codex/protocol/v2/ConfigRequirements.js.map +0 -1
- package/server/dist/codex/protocol/v2/ConfigRequirementsReadResponse.d.ts +0 -7
- package/server/dist/codex/protocol/v2/ConfigRequirementsReadResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ConfigRequirementsReadResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ConfigValueWriteParams.d.ts +0 -12
- package/server/dist/codex/protocol/v2/ConfigValueWriteParams.js +0 -4
- package/server/dist/codex/protocol/v2/ConfigValueWriteParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ConfigWarningNotification.d.ts +0 -19
- package/server/dist/codex/protocol/v2/ConfigWarningNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ConfigWarningNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ConfigWriteResponse.d.ts +0 -12
- package/server/dist/codex/protocol/v2/ConfigWriteResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ConfigWriteResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ContextCompactedNotification.d.ts +0 -7
- package/server/dist/codex/protocol/v2/ContextCompactedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ContextCompactedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/CreditsSnapshot.d.ts +0 -5
- package/server/dist/codex/protocol/v2/CreditsSnapshot.js +0 -4
- package/server/dist/codex/protocol/v2/CreditsSnapshot.js.map +0 -1
- package/server/dist/codex/protocol/v2/DeprecationNoticeNotification.d.ts +0 -10
- package/server/dist/codex/protocol/v2/DeprecationNoticeNotification.js +0 -4
- package/server/dist/codex/protocol/v2/DeprecationNoticeNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/DynamicToolCallOutputContentItem.d.ts +0 -7
- package/server/dist/codex/protocol/v2/DynamicToolCallOutputContentItem.js +0 -4
- package/server/dist/codex/protocol/v2/DynamicToolCallOutputContentItem.js.map +0 -1
- package/server/dist/codex/protocol/v2/DynamicToolCallParams.d.ts +0 -8
- package/server/dist/codex/protocol/v2/DynamicToolCallParams.js +0 -4
- package/server/dist/codex/protocol/v2/DynamicToolCallParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/DynamicToolCallResponse.d.ts +0 -5
- package/server/dist/codex/protocol/v2/DynamicToolCallResponse.js +0 -4
- package/server/dist/codex/protocol/v2/DynamicToolCallResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/DynamicToolCallStatus.d.ts +0 -1
- package/server/dist/codex/protocol/v2/DynamicToolCallStatus.js +0 -4
- package/server/dist/codex/protocol/v2/DynamicToolCallStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/DynamicToolSpec.d.ts +0 -6
- package/server/dist/codex/protocol/v2/DynamicToolSpec.js +0 -4
- package/server/dist/codex/protocol/v2/DynamicToolSpec.js.map +0 -1
- package/server/dist/codex/protocol/v2/ErrorNotification.d.ts +0 -7
- package/server/dist/codex/protocol/v2/ErrorNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ErrorNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ExecPolicyAmendment.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ExecPolicyAmendment.js +0 -4
- package/server/dist/codex/protocol/v2/ExecPolicyAmendment.js.map +0 -1
- package/server/dist/codex/protocol/v2/ExperimentalFeature.d.ts +0 -34
- package/server/dist/codex/protocol/v2/ExperimentalFeature.js +0 -4
- package/server/dist/codex/protocol/v2/ExperimentalFeature.js.map +0 -1
- package/server/dist/codex/protocol/v2/ExperimentalFeatureListParams.d.ts +0 -10
- package/server/dist/codex/protocol/v2/ExperimentalFeatureListParams.js +0 -4
- package/server/dist/codex/protocol/v2/ExperimentalFeatureListParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ExperimentalFeatureListResponse.d.ts +0 -9
- package/server/dist/codex/protocol/v2/ExperimentalFeatureListResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ExperimentalFeatureListResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ExperimentalFeatureStage.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ExperimentalFeatureStage.js +0 -4
- package/server/dist/codex/protocol/v2/ExperimentalFeatureStage.js.map +0 -1
- package/server/dist/codex/protocol/v2/ExternalAgentConfigDetectParams.d.ts +0 -10
- package/server/dist/codex/protocol/v2/ExternalAgentConfigDetectParams.js +0 -4
- package/server/dist/codex/protocol/v2/ExternalAgentConfigDetectParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ExternalAgentConfigDetectResponse.d.ts +0 -4
- package/server/dist/codex/protocol/v2/ExternalAgentConfigDetectResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ExternalAgentConfigDetectResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ExternalAgentConfigImportParams.d.ts +0 -4
- package/server/dist/codex/protocol/v2/ExternalAgentConfigImportParams.js +0 -4
- package/server/dist/codex/protocol/v2/ExternalAgentConfigImportParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ExternalAgentConfigImportResponse.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ExternalAgentConfigImportResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ExternalAgentConfigImportResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ExternalAgentConfigMigrationItem.d.ts +0 -9
- package/server/dist/codex/protocol/v2/ExternalAgentConfigMigrationItem.js +0 -4
- package/server/dist/codex/protocol/v2/ExternalAgentConfigMigrationItem.js.map +0 -1
- package/server/dist/codex/protocol/v2/ExternalAgentConfigMigrationItemType.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ExternalAgentConfigMigrationItemType.js +0 -4
- package/server/dist/codex/protocol/v2/ExternalAgentConfigMigrationItemType.js.map +0 -1
- package/server/dist/codex/protocol/v2/FeedbackUploadParams.d.ts +0 -7
- package/server/dist/codex/protocol/v2/FeedbackUploadParams.js +0 -4
- package/server/dist/codex/protocol/v2/FeedbackUploadParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/FeedbackUploadResponse.d.ts +0 -3
- package/server/dist/codex/protocol/v2/FeedbackUploadResponse.js +0 -4
- package/server/dist/codex/protocol/v2/FeedbackUploadResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/FileChangeApprovalDecision.d.ts +0 -1
- package/server/dist/codex/protocol/v2/FileChangeApprovalDecision.js +0 -4
- package/server/dist/codex/protocol/v2/FileChangeApprovalDecision.js.map +0 -1
- package/server/dist/codex/protocol/v2/FileChangeOutputDeltaNotification.d.ts +0 -6
- package/server/dist/codex/protocol/v2/FileChangeOutputDeltaNotification.js +0 -4
- package/server/dist/codex/protocol/v2/FileChangeOutputDeltaNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/FileChangeRequestApprovalParams.d.ts +0 -14
- package/server/dist/codex/protocol/v2/FileChangeRequestApprovalParams.js +0 -4
- package/server/dist/codex/protocol/v2/FileChangeRequestApprovalParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/FileChangeRequestApprovalResponse.d.ts +0 -4
- package/server/dist/codex/protocol/v2/FileChangeRequestApprovalResponse.js +0 -4
- package/server/dist/codex/protocol/v2/FileChangeRequestApprovalResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/FileUpdateChange.d.ts +0 -6
- package/server/dist/codex/protocol/v2/FileUpdateChange.js +0 -4
- package/server/dist/codex/protocol/v2/FileUpdateChange.js.map +0 -1
- package/server/dist/codex/protocol/v2/GetAccountParams.d.ts +0 -10
- package/server/dist/codex/protocol/v2/GetAccountParams.js +0 -4
- package/server/dist/codex/protocol/v2/GetAccountParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/GetAccountRateLimitsResponse.d.ts +0 -13
- package/server/dist/codex/protocol/v2/GetAccountRateLimitsResponse.js +0 -4
- package/server/dist/codex/protocol/v2/GetAccountRateLimitsResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/GetAccountResponse.d.ts +0 -5
- package/server/dist/codex/protocol/v2/GetAccountResponse.js +0 -4
- package/server/dist/codex/protocol/v2/GetAccountResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/GitInfo.d.ts +0 -5
- package/server/dist/codex/protocol/v2/GitInfo.js +0 -4
- package/server/dist/codex/protocol/v2/GitInfo.js.map +0 -1
- package/server/dist/codex/protocol/v2/HazelnutScope.d.ts +0 -1
- package/server/dist/codex/protocol/v2/HazelnutScope.js +0 -4
- package/server/dist/codex/protocol/v2/HazelnutScope.js.map +0 -1
- package/server/dist/codex/protocol/v2/ItemCompletedNotification.d.ts +0 -6
- package/server/dist/codex/protocol/v2/ItemCompletedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ItemCompletedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ItemStartedNotification.d.ts +0 -6
- package/server/dist/codex/protocol/v2/ItemStartedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ItemStartedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ListMcpServerStatusParams.d.ts +0 -10
- package/server/dist/codex/protocol/v2/ListMcpServerStatusParams.js +0 -4
- package/server/dist/codex/protocol/v2/ListMcpServerStatusParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ListMcpServerStatusResponse.d.ts +0 -9
- package/server/dist/codex/protocol/v2/ListMcpServerStatusResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ListMcpServerStatusResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/LoginAccountParams.d.ts +0 -24
- package/server/dist/codex/protocol/v2/LoginAccountParams.js +0 -4
- package/server/dist/codex/protocol/v2/LoginAccountParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/LoginAccountResponse.d.ts +0 -12
- package/server/dist/codex/protocol/v2/LoginAccountResponse.js +0 -4
- package/server/dist/codex/protocol/v2/LoginAccountResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/LogoutAccountResponse.d.ts +0 -1
- package/server/dist/codex/protocol/v2/LogoutAccountResponse.js +0 -4
- package/server/dist/codex/protocol/v2/LogoutAccountResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/McpAuthStatus.d.ts +0 -1
- package/server/dist/codex/protocol/v2/McpAuthStatus.js +0 -4
- package/server/dist/codex/protocol/v2/McpAuthStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/McpServerOauthLoginCompletedNotification.d.ts +0 -5
- package/server/dist/codex/protocol/v2/McpServerOauthLoginCompletedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/McpServerOauthLoginCompletedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/McpServerOauthLoginParams.d.ts +0 -5
- package/server/dist/codex/protocol/v2/McpServerOauthLoginParams.js +0 -4
- package/server/dist/codex/protocol/v2/McpServerOauthLoginParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/McpServerOauthLoginResponse.d.ts +0 -3
- package/server/dist/codex/protocol/v2/McpServerOauthLoginResponse.js +0 -4
- package/server/dist/codex/protocol/v2/McpServerOauthLoginResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/McpServerRefreshResponse.d.ts +0 -1
- package/server/dist/codex/protocol/v2/McpServerRefreshResponse.js +0 -4
- package/server/dist/codex/protocol/v2/McpServerRefreshResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/McpServerStatus.d.ts +0 -13
- package/server/dist/codex/protocol/v2/McpServerStatus.js +0 -4
- package/server/dist/codex/protocol/v2/McpServerStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/McpToolCallError.d.ts +0 -3
- package/server/dist/codex/protocol/v2/McpToolCallError.js +0 -4
- package/server/dist/codex/protocol/v2/McpToolCallError.js.map +0 -1
- package/server/dist/codex/protocol/v2/McpToolCallProgressNotification.d.ts +0 -6
- package/server/dist/codex/protocol/v2/McpToolCallProgressNotification.js +0 -4
- package/server/dist/codex/protocol/v2/McpToolCallProgressNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/McpToolCallResult.d.ts +0 -5
- package/server/dist/codex/protocol/v2/McpToolCallResult.js +0 -4
- package/server/dist/codex/protocol/v2/McpToolCallResult.js.map +0 -1
- package/server/dist/codex/protocol/v2/McpToolCallStatus.d.ts +0 -1
- package/server/dist/codex/protocol/v2/McpToolCallStatus.js +0 -4
- package/server/dist/codex/protocol/v2/McpToolCallStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/MergeStrategy.d.ts +0 -1
- package/server/dist/codex/protocol/v2/MergeStrategy.js +0 -4
- package/server/dist/codex/protocol/v2/MergeStrategy.js.map +0 -1
- package/server/dist/codex/protocol/v2/Model.d.ts +0 -16
- package/server/dist/codex/protocol/v2/Model.js +0 -4
- package/server/dist/codex/protocol/v2/Model.js.map +0 -1
- package/server/dist/codex/protocol/v2/ModelListParams.d.ts +0 -14
- package/server/dist/codex/protocol/v2/ModelListParams.js +0 -4
- package/server/dist/codex/protocol/v2/ModelListParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ModelListResponse.d.ts +0 -9
- package/server/dist/codex/protocol/v2/ModelListResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ModelListResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ModelRerouteReason.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ModelRerouteReason.js +0 -4
- package/server/dist/codex/protocol/v2/ModelRerouteReason.js.map +0 -1
- package/server/dist/codex/protocol/v2/ModelReroutedNotification.d.ts +0 -8
- package/server/dist/codex/protocol/v2/ModelReroutedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ModelReroutedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/NetworkAccess.d.ts +0 -1
- package/server/dist/codex/protocol/v2/NetworkAccess.js +0 -4
- package/server/dist/codex/protocol/v2/NetworkAccess.js.map +0 -1
- package/server/dist/codex/protocol/v2/NetworkApprovalContext.d.ts +0 -5
- package/server/dist/codex/protocol/v2/NetworkApprovalContext.js +0 -4
- package/server/dist/codex/protocol/v2/NetworkApprovalContext.js.map +0 -1
- package/server/dist/codex/protocol/v2/NetworkApprovalProtocol.d.ts +0 -1
- package/server/dist/codex/protocol/v2/NetworkApprovalProtocol.js +0 -4
- package/server/dist/codex/protocol/v2/NetworkApprovalProtocol.js.map +0 -1
- package/server/dist/codex/protocol/v2/NetworkPolicyAmendment.d.ts +0 -5
- package/server/dist/codex/protocol/v2/NetworkPolicyAmendment.js +0 -4
- package/server/dist/codex/protocol/v2/NetworkPolicyAmendment.js.map +0 -1
- package/server/dist/codex/protocol/v2/NetworkPolicyRuleAction.d.ts +0 -1
- package/server/dist/codex/protocol/v2/NetworkPolicyRuleAction.js +0 -4
- package/server/dist/codex/protocol/v2/NetworkPolicyRuleAction.js.map +0 -1
- package/server/dist/codex/protocol/v2/NetworkRequirements.d.ts +0 -13
- package/server/dist/codex/protocol/v2/NetworkRequirements.js +0 -4
- package/server/dist/codex/protocol/v2/NetworkRequirements.js.map +0 -1
- package/server/dist/codex/protocol/v2/OverriddenMetadata.d.ts +0 -7
- package/server/dist/codex/protocol/v2/OverriddenMetadata.js +0 -4
- package/server/dist/codex/protocol/v2/OverriddenMetadata.js.map +0 -1
- package/server/dist/codex/protocol/v2/PatchApplyStatus.d.ts +0 -1
- package/server/dist/codex/protocol/v2/PatchApplyStatus.js +0 -4
- package/server/dist/codex/protocol/v2/PatchApplyStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/PatchChangeKind.d.ts +0 -8
- package/server/dist/codex/protocol/v2/PatchChangeKind.js +0 -4
- package/server/dist/codex/protocol/v2/PatchChangeKind.js.map +0 -1
- package/server/dist/codex/protocol/v2/PlanDeltaNotification.d.ts +0 -10
- package/server/dist/codex/protocol/v2/PlanDeltaNotification.js +0 -4
- package/server/dist/codex/protocol/v2/PlanDeltaNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ProductSurface.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ProductSurface.js +0 -4
- package/server/dist/codex/protocol/v2/ProductSurface.js.map +0 -1
- package/server/dist/codex/protocol/v2/ProfileV2.d.ts +0 -20
- package/server/dist/codex/protocol/v2/ProfileV2.js +0 -4
- package/server/dist/codex/protocol/v2/ProfileV2.js.map +0 -1
- package/server/dist/codex/protocol/v2/RateLimitSnapshot.d.ts +0 -11
- package/server/dist/codex/protocol/v2/RateLimitSnapshot.js +0 -4
- package/server/dist/codex/protocol/v2/RateLimitSnapshot.js.map +0 -1
- package/server/dist/codex/protocol/v2/RateLimitWindow.d.ts +0 -5
- package/server/dist/codex/protocol/v2/RateLimitWindow.js +0 -4
- package/server/dist/codex/protocol/v2/RateLimitWindow.js.map +0 -1
- package/server/dist/codex/protocol/v2/RawResponseItemCompletedNotification.d.ts +0 -6
- package/server/dist/codex/protocol/v2/RawResponseItemCompletedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/RawResponseItemCompletedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ReadOnlyAccess.d.ts +0 -8
- package/server/dist/codex/protocol/v2/ReadOnlyAccess.js +0 -4
- package/server/dist/codex/protocol/v2/ReadOnlyAccess.js.map +0 -1
- package/server/dist/codex/protocol/v2/ReasoningEffortOption.d.ts +0 -5
- package/server/dist/codex/protocol/v2/ReasoningEffortOption.js +0 -4
- package/server/dist/codex/protocol/v2/ReasoningEffortOption.js.map +0 -1
- package/server/dist/codex/protocol/v2/ReasoningSummaryPartAddedNotification.d.ts +0 -6
- package/server/dist/codex/protocol/v2/ReasoningSummaryPartAddedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ReasoningSummaryPartAddedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ReasoningSummaryTextDeltaNotification.d.ts +0 -7
- package/server/dist/codex/protocol/v2/ReasoningSummaryTextDeltaNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ReasoningSummaryTextDeltaNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ReasoningTextDeltaNotification.d.ts +0 -7
- package/server/dist/codex/protocol/v2/ReasoningTextDeltaNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ReasoningTextDeltaNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/RemoteSkillSummary.d.ts +0 -5
- package/server/dist/codex/protocol/v2/RemoteSkillSummary.js +0 -4
- package/server/dist/codex/protocol/v2/RemoteSkillSummary.js.map +0 -1
- package/server/dist/codex/protocol/v2/ResidencyRequirement.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ResidencyRequirement.js +0 -4
- package/server/dist/codex/protocol/v2/ResidencyRequirement.js.map +0 -1
- package/server/dist/codex/protocol/v2/ReviewDelivery.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ReviewDelivery.js +0 -4
- package/server/dist/codex/protocol/v2/ReviewDelivery.js.map +0 -1
- package/server/dist/codex/protocol/v2/ReviewStartParams.d.ts +0 -11
- package/server/dist/codex/protocol/v2/ReviewStartParams.js +0 -4
- package/server/dist/codex/protocol/v2/ReviewStartParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ReviewStartResponse.d.ts +0 -11
- package/server/dist/codex/protocol/v2/ReviewStartResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ReviewStartResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ReviewTarget.d.ts +0 -16
- package/server/dist/codex/protocol/v2/ReviewTarget.js +0 -4
- package/server/dist/codex/protocol/v2/ReviewTarget.js.map +0 -1
- package/server/dist/codex/protocol/v2/SandboxMode.d.ts +0 -1
- package/server/dist/codex/protocol/v2/SandboxMode.js +0 -4
- package/server/dist/codex/protocol/v2/SandboxMode.js.map +0 -1
- package/server/dist/codex/protocol/v2/SandboxPolicy.d.ts +0 -19
- package/server/dist/codex/protocol/v2/SandboxPolicy.js +0 -4
- package/server/dist/codex/protocol/v2/SandboxPolicy.js.map +0 -1
- package/server/dist/codex/protocol/v2/SandboxWorkspaceWrite.d.ts +0 -6
- package/server/dist/codex/protocol/v2/SandboxWorkspaceWrite.js +0 -4
- package/server/dist/codex/protocol/v2/SandboxWorkspaceWrite.js.map +0 -1
- package/server/dist/codex/protocol/v2/SessionSource.d.ts +0 -4
- package/server/dist/codex/protocol/v2/SessionSource.js +0 -4
- package/server/dist/codex/protocol/v2/SessionSource.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillDependencies.d.ts +0 -4
- package/server/dist/codex/protocol/v2/SkillDependencies.js +0 -4
- package/server/dist/codex/protocol/v2/SkillDependencies.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillErrorInfo.d.ts +0 -4
- package/server/dist/codex/protocol/v2/SkillErrorInfo.js +0 -4
- package/server/dist/codex/protocol/v2/SkillErrorInfo.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillInterface.d.ts +0 -8
- package/server/dist/codex/protocol/v2/SkillInterface.js +0 -4
- package/server/dist/codex/protocol/v2/SkillInterface.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillMetadata.d.ts +0 -16
- package/server/dist/codex/protocol/v2/SkillMetadata.js +0 -4
- package/server/dist/codex/protocol/v2/SkillMetadata.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillScope.d.ts +0 -1
- package/server/dist/codex/protocol/v2/SkillScope.js +0 -4
- package/server/dist/codex/protocol/v2/SkillScope.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillToolDependency.d.ts +0 -8
- package/server/dist/codex/protocol/v2/SkillToolDependency.js +0 -4
- package/server/dist/codex/protocol/v2/SkillToolDependency.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillsConfigWriteParams.d.ts +0 -4
- package/server/dist/codex/protocol/v2/SkillsConfigWriteParams.js +0 -4
- package/server/dist/codex/protocol/v2/SkillsConfigWriteParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillsConfigWriteResponse.d.ts +0 -3
- package/server/dist/codex/protocol/v2/SkillsConfigWriteResponse.js +0 -4
- package/server/dist/codex/protocol/v2/SkillsConfigWriteResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillsListEntry.d.ts +0 -7
- package/server/dist/codex/protocol/v2/SkillsListEntry.js +0 -4
- package/server/dist/codex/protocol/v2/SkillsListEntry.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillsListExtraRootsForCwd.d.ts +0 -4
- package/server/dist/codex/protocol/v2/SkillsListExtraRootsForCwd.js +0 -4
- package/server/dist/codex/protocol/v2/SkillsListExtraRootsForCwd.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillsListParams.d.ts +0 -15
- package/server/dist/codex/protocol/v2/SkillsListParams.js +0 -4
- package/server/dist/codex/protocol/v2/SkillsListParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillsListResponse.d.ts +0 -4
- package/server/dist/codex/protocol/v2/SkillsListResponse.js +0 -4
- package/server/dist/codex/protocol/v2/SkillsListResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillsRemoteReadParams.d.ts +0 -7
- package/server/dist/codex/protocol/v2/SkillsRemoteReadParams.js +0 -4
- package/server/dist/codex/protocol/v2/SkillsRemoteReadParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillsRemoteReadResponse.d.ts +0 -4
- package/server/dist/codex/protocol/v2/SkillsRemoteReadResponse.js +0 -4
- package/server/dist/codex/protocol/v2/SkillsRemoteReadResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillsRemoteWriteParams.d.ts +0 -3
- package/server/dist/codex/protocol/v2/SkillsRemoteWriteParams.js +0 -4
- package/server/dist/codex/protocol/v2/SkillsRemoteWriteParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/SkillsRemoteWriteResponse.d.ts +0 -4
- package/server/dist/codex/protocol/v2/SkillsRemoteWriteResponse.js +0 -4
- package/server/dist/codex/protocol/v2/SkillsRemoteWriteResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/TerminalInteractionNotification.d.ts +0 -7
- package/server/dist/codex/protocol/v2/TerminalInteractionNotification.js +0 -4
- package/server/dist/codex/protocol/v2/TerminalInteractionNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/TextElement.d.ts +0 -11
- package/server/dist/codex/protocol/v2/TextElement.js +0 -4
- package/server/dist/codex/protocol/v2/TextElement.js.map +0 -1
- package/server/dist/codex/protocol/v2/TextPosition.d.ts +0 -10
- package/server/dist/codex/protocol/v2/TextPosition.js +0 -4
- package/server/dist/codex/protocol/v2/TextPosition.js.map +0 -1
- package/server/dist/codex/protocol/v2/TextRange.d.ts +0 -5
- package/server/dist/codex/protocol/v2/TextRange.js +0 -4
- package/server/dist/codex/protocol/v2/TextRange.js.map +0 -1
- package/server/dist/codex/protocol/v2/Thread.d.ts +0 -66
- package/server/dist/codex/protocol/v2/Thread.js +0 -4
- package/server/dist/codex/protocol/v2/Thread.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadActiveFlag.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ThreadActiveFlag.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadActiveFlag.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadArchiveParams.d.ts +0 -3
- package/server/dist/codex/protocol/v2/ThreadArchiveParams.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadArchiveParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadArchiveResponse.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ThreadArchiveResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadArchiveResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadArchivedNotification.d.ts +0 -3
- package/server/dist/codex/protocol/v2/ThreadArchivedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadArchivedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadClosedNotification.d.ts +0 -3
- package/server/dist/codex/protocol/v2/ThreadClosedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadClosedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadCompactStartParams.d.ts +0 -3
- package/server/dist/codex/protocol/v2/ThreadCompactStartParams.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadCompactStartParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadCompactStartResponse.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ThreadCompactStartResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadCompactStartResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadForkParams.d.ts +0 -35
- package/server/dist/codex/protocol/v2/ThreadForkParams.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadForkParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadForkResponse.d.ts +0 -13
- package/server/dist/codex/protocol/v2/ThreadForkResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadForkResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadItem.d.ts +0 -152
- package/server/dist/codex/protocol/v2/ThreadItem.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadItem.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadListParams.d.ts +0 -40
- package/server/dist/codex/protocol/v2/ThreadListParams.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadListParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadListResponse.d.ts +0 -9
- package/server/dist/codex/protocol/v2/ThreadListResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadListResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadLoadedListParams.d.ts +0 -10
- package/server/dist/codex/protocol/v2/ThreadLoadedListParams.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadLoadedListParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadLoadedListResponse.d.ts +0 -11
- package/server/dist/codex/protocol/v2/ThreadLoadedListResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadLoadedListResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadNameUpdatedNotification.d.ts +0 -4
- package/server/dist/codex/protocol/v2/ThreadNameUpdatedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadNameUpdatedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadReadParams.d.ts +0 -7
- package/server/dist/codex/protocol/v2/ThreadReadParams.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadReadParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadReadResponse.d.ts +0 -4
- package/server/dist/codex/protocol/v2/ThreadReadResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadReadResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadRealtimeAudioChunk.d.ts +0 -9
- package/server/dist/codex/protocol/v2/ThreadRealtimeAudioChunk.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadRealtimeAudioChunk.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadRealtimeClosedNotification.d.ts +0 -7
- package/server/dist/codex/protocol/v2/ThreadRealtimeClosedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadRealtimeClosedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadRealtimeErrorNotification.d.ts +0 -7
- package/server/dist/codex/protocol/v2/ThreadRealtimeErrorNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadRealtimeErrorNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadRealtimeItemAddedNotification.d.ts +0 -8
- package/server/dist/codex/protocol/v2/ThreadRealtimeItemAddedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadRealtimeItemAddedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadRealtimeOutputAudioDeltaNotification.d.ts +0 -8
- package/server/dist/codex/protocol/v2/ThreadRealtimeOutputAudioDeltaNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadRealtimeOutputAudioDeltaNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadRealtimeStartedNotification.d.ts +0 -7
- package/server/dist/codex/protocol/v2/ThreadRealtimeStartedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadRealtimeStartedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadResumeParams.d.ts +0 -45
- package/server/dist/codex/protocol/v2/ThreadResumeParams.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadResumeParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadResumeResponse.d.ts +0 -13
- package/server/dist/codex/protocol/v2/ThreadResumeResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadResumeResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadRollbackParams.d.ts +0 -10
- package/server/dist/codex/protocol/v2/ThreadRollbackParams.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadRollbackParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadRollbackResponse.d.ts +0 -11
- package/server/dist/codex/protocol/v2/ThreadRollbackResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadRollbackResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadSetNameParams.d.ts +0 -4
- package/server/dist/codex/protocol/v2/ThreadSetNameParams.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadSetNameParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadSetNameResponse.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ThreadSetNameResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadSetNameResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadSortKey.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ThreadSortKey.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadSortKey.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadSourceKind.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ThreadSourceKind.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadSourceKind.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadStartParams.d.ts +0 -27
- package/server/dist/codex/protocol/v2/ThreadStartParams.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadStartParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadStartResponse.d.ts +0 -13
- package/server/dist/codex/protocol/v2/ThreadStartResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadStartResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadStartedNotification.d.ts +0 -4
- package/server/dist/codex/protocol/v2/ThreadStartedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadStartedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadStatus.d.ts +0 -11
- package/server/dist/codex/protocol/v2/ThreadStatus.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadStatusChangedNotification.d.ts +0 -5
- package/server/dist/codex/protocol/v2/ThreadStatusChangedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadStatusChangedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadTokenUsage.d.ts +0 -6
- package/server/dist/codex/protocol/v2/ThreadTokenUsage.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadTokenUsage.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadTokenUsageUpdatedNotification.d.ts +0 -6
- package/server/dist/codex/protocol/v2/ThreadTokenUsageUpdatedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadTokenUsageUpdatedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadUnarchiveParams.d.ts +0 -3
- package/server/dist/codex/protocol/v2/ThreadUnarchiveParams.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadUnarchiveParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadUnarchiveResponse.d.ts +0 -4
- package/server/dist/codex/protocol/v2/ThreadUnarchiveResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadUnarchiveResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadUnarchivedNotification.d.ts +0 -3
- package/server/dist/codex/protocol/v2/ThreadUnarchivedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadUnarchivedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadUnsubscribeParams.d.ts +0 -3
- package/server/dist/codex/protocol/v2/ThreadUnsubscribeParams.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadUnsubscribeParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadUnsubscribeResponse.d.ts +0 -4
- package/server/dist/codex/protocol/v2/ThreadUnsubscribeResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadUnsubscribeResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ThreadUnsubscribeStatus.d.ts +0 -1
- package/server/dist/codex/protocol/v2/ThreadUnsubscribeStatus.js +0 -4
- package/server/dist/codex/protocol/v2/ThreadUnsubscribeStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/TokenUsageBreakdown.d.ts +0 -7
- package/server/dist/codex/protocol/v2/TokenUsageBreakdown.js +0 -4
- package/server/dist/codex/protocol/v2/TokenUsageBreakdown.js.map +0 -1
- package/server/dist/codex/protocol/v2/ToolRequestUserInputAnswer.d.ts +0 -6
- package/server/dist/codex/protocol/v2/ToolRequestUserInputAnswer.js +0 -4
- package/server/dist/codex/protocol/v2/ToolRequestUserInputAnswer.js.map +0 -1
- package/server/dist/codex/protocol/v2/ToolRequestUserInputOption.d.ts +0 -7
- package/server/dist/codex/protocol/v2/ToolRequestUserInputOption.js +0 -4
- package/server/dist/codex/protocol/v2/ToolRequestUserInputOption.js.map +0 -1
- package/server/dist/codex/protocol/v2/ToolRequestUserInputParams.d.ts +0 -10
- package/server/dist/codex/protocol/v2/ToolRequestUserInputParams.js +0 -4
- package/server/dist/codex/protocol/v2/ToolRequestUserInputParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/ToolRequestUserInputQuestion.d.ts +0 -12
- package/server/dist/codex/protocol/v2/ToolRequestUserInputQuestion.js +0 -4
- package/server/dist/codex/protocol/v2/ToolRequestUserInputQuestion.js.map +0 -1
- package/server/dist/codex/protocol/v2/ToolRequestUserInputResponse.d.ts +0 -9
- package/server/dist/codex/protocol/v2/ToolRequestUserInputResponse.js +0 -4
- package/server/dist/codex/protocol/v2/ToolRequestUserInputResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/ToolsV2.d.ts +0 -4
- package/server/dist/codex/protocol/v2/ToolsV2.js +0 -4
- package/server/dist/codex/protocol/v2/ToolsV2.js.map +0 -1
- package/server/dist/codex/protocol/v2/Turn.d.ts +0 -17
- package/server/dist/codex/protocol/v2/Turn.js +0 -4
- package/server/dist/codex/protocol/v2/Turn.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnCompletedNotification.d.ts +0 -5
- package/server/dist/codex/protocol/v2/TurnCompletedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/TurnCompletedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnDiffUpdatedNotification.d.ts +0 -9
- package/server/dist/codex/protocol/v2/TurnDiffUpdatedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/TurnDiffUpdatedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnError.d.ts +0 -6
- package/server/dist/codex/protocol/v2/TurnError.js +0 -4
- package/server/dist/codex/protocol/v2/TurnError.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnInterruptParams.d.ts +0 -4
- package/server/dist/codex/protocol/v2/TurnInterruptParams.js +0 -4
- package/server/dist/codex/protocol/v2/TurnInterruptParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnInterruptResponse.d.ts +0 -1
- package/server/dist/codex/protocol/v2/TurnInterruptResponse.js +0 -4
- package/server/dist/codex/protocol/v2/TurnInterruptResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnPlanStep.d.ts +0 -5
- package/server/dist/codex/protocol/v2/TurnPlanStep.js +0 -4
- package/server/dist/codex/protocol/v2/TurnPlanStep.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnPlanStepStatus.d.ts +0 -1
- package/server/dist/codex/protocol/v2/TurnPlanStepStatus.js +0 -4
- package/server/dist/codex/protocol/v2/TurnPlanStepStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnPlanUpdatedNotification.d.ts +0 -7
- package/server/dist/codex/protocol/v2/TurnPlanUpdatedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/TurnPlanUpdatedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnStartParams.d.ts +0 -43
- package/server/dist/codex/protocol/v2/TurnStartParams.js +0 -4
- package/server/dist/codex/protocol/v2/TurnStartParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnStartResponse.d.ts +0 -4
- package/server/dist/codex/protocol/v2/TurnStartResponse.js +0 -4
- package/server/dist/codex/protocol/v2/TurnStartResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnStartedNotification.d.ts +0 -5
- package/server/dist/codex/protocol/v2/TurnStartedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/TurnStartedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnStatus.d.ts +0 -1
- package/server/dist/codex/protocol/v2/TurnStatus.js +0 -4
- package/server/dist/codex/protocol/v2/TurnStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnSteerParams.d.ts +0 -10
- package/server/dist/codex/protocol/v2/TurnSteerParams.js +0 -4
- package/server/dist/codex/protocol/v2/TurnSteerParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/TurnSteerResponse.d.ts +0 -3
- package/server/dist/codex/protocol/v2/TurnSteerResponse.js +0 -4
- package/server/dist/codex/protocol/v2/TurnSteerResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/UserInput.d.ts +0 -23
- package/server/dist/codex/protocol/v2/UserInput.js +0 -4
- package/server/dist/codex/protocol/v2/UserInput.js.map +0 -1
- package/server/dist/codex/protocol/v2/WebSearchAction.d.ts +0 -14
- package/server/dist/codex/protocol/v2/WebSearchAction.js +0 -4
- package/server/dist/codex/protocol/v2/WebSearchAction.js.map +0 -1
- package/server/dist/codex/protocol/v2/WindowsSandboxSetupCompletedNotification.d.ts +0 -6
- package/server/dist/codex/protocol/v2/WindowsSandboxSetupCompletedNotification.js +0 -4
- package/server/dist/codex/protocol/v2/WindowsSandboxSetupCompletedNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/WindowsSandboxSetupMode.d.ts +0 -1
- package/server/dist/codex/protocol/v2/WindowsSandboxSetupMode.js +0 -4
- package/server/dist/codex/protocol/v2/WindowsSandboxSetupMode.js.map +0 -1
- package/server/dist/codex/protocol/v2/WindowsSandboxSetupStartParams.d.ts +0 -4
- package/server/dist/codex/protocol/v2/WindowsSandboxSetupStartParams.js +0 -4
- package/server/dist/codex/protocol/v2/WindowsSandboxSetupStartParams.js.map +0 -1
- package/server/dist/codex/protocol/v2/WindowsSandboxSetupStartResponse.d.ts +0 -3
- package/server/dist/codex/protocol/v2/WindowsSandboxSetupStartResponse.js +0 -4
- package/server/dist/codex/protocol/v2/WindowsSandboxSetupStartResponse.js.map +0 -1
- package/server/dist/codex/protocol/v2/WindowsWorldWritableWarningNotification.d.ts +0 -5
- package/server/dist/codex/protocol/v2/WindowsWorldWritableWarningNotification.js +0 -4
- package/server/dist/codex/protocol/v2/WindowsWorldWritableWarningNotification.js.map +0 -1
- package/server/dist/codex/protocol/v2/WriteStatus.d.ts +0 -1
- package/server/dist/codex/protocol/v2/WriteStatus.js +0 -4
- package/server/dist/codex/protocol/v2/WriteStatus.js.map +0 -1
- package/server/dist/codex/protocol/v2/index.d.ts +0 -236
- package/server/dist/codex/protocol/v2/index.js +0 -4
- package/server/dist/codex/protocol/v2/index.js.map +0 -1
- package/server/dist/sqlite/nodeSqlite.d.ts +0 -31
- package/server/dist/sqlite/nodeSqlite.js +0 -72
- package/server/dist/sqlite/nodeSqlite.js.map +0 -1
- package/web/dist/assets/index-CY6cnwQz.js +0 -174
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
var Sk=Object.defineProperty;var wk=(e,t,r)=>t in e?Sk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Qg=(e,t,r)=>wk(e,typeof t!="symbol"?t+"":t,r);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var Ac=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function km(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var OS={exports:{}},_u={},$S={exports:{}},Te={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Ya=Symbol.for("react.element"),bk=Symbol.for("react.portal"),Ck=Symbol.for("react.fragment"),xk=Symbol.for("react.strict_mode"),kk=Symbol.for("react.profiler"),Tk=Symbol.for("react.provider"),Ek=Symbol.for("react.context"),Ik=Symbol.for("react.forward_ref"),Rk=Symbol.for("react.suspense"),Mk=Symbol.for("react.memo"),Pk=Symbol.for("react.lazy"),Zg=Symbol.iterator;function Lk(e){return e===null||typeof e!="object"?null:(e=Zg&&e[Zg]||e["@@iterator"],typeof e=="function"?e:null)}var jS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zS=Object.assign,FS={};function ao(e,t,r){this.props=e,this.context=t,this.refs=FS,this.updater=r||jS}ao.prototype.isReactComponent={};ao.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ao.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function HS(){}HS.prototype=ao.prototype;function Tm(e,t,r){this.props=e,this.context=t,this.refs=FS,this.updater=r||jS}var Em=Tm.prototype=new HS;Em.constructor=Tm;zS(Em,ao.prototype);Em.isPureReactComponent=!0;var ev=Array.isArray,WS=Object.prototype.hasOwnProperty,Im={current:null},US={key:!0,ref:!0,__self:!0,__source:!0};function KS(e,t,r){var n,i={},s=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)WS.call(t,n)&&!US.hasOwnProperty(n)&&(i[n]=t[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(n in a=e.defaultProps,a)i[n]===void 0&&(i[n]=a[n]);return{$$typeof:Ya,type:e,key:s,ref:o,props:i,_owner:Im.current}}function Ak(e,t){return{$$typeof:Ya,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Rm(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ya}function Nk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var tv=/\/+/g;function pd(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Nk(""+e.key):t.toString(36)}function sc(e,t,r,n,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Ya:case bk:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+pd(o,0):n,ev(i)?(r="",e!=null&&(r=e.replace(tv,"$&/")+"/"),sc(i,t,r,"",function(c){return c})):i!=null&&(Rm(i)&&(i=Ak(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(tv,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",ev(e))for(var a=0;a<e.length;a++){s=e[a];var l=n+pd(s,a);o+=sc(s,t,r,l,i)}else if(l=Lk(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=n+pd(s,a++),o+=sc(s,t,r,l,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Tl(e,t,r){if(e==null)return e;var n=[],i=0;return sc(e,n,"","",function(s){return t.call(r,s,i++)}),n}function Dk(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Zt={current:null},oc={transition:null},Bk={ReactCurrentDispatcher:Zt,ReactCurrentBatchConfig:oc,ReactCurrentOwner:Im};function VS(){throw Error("act(...) is not supported in production builds of React.")}Te.Children={map:Tl,forEach:function(e,t,r){Tl(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Tl(e,function(){t++}),t},toArray:function(e){return Tl(e,function(t){return t})||[]},only:function(e){if(!Rm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Te.Component=ao;Te.Fragment=Ck;Te.Profiler=kk;Te.PureComponent=Tm;Te.StrictMode=xk;Te.Suspense=Rk;Te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Bk;Te.act=VS;Te.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=zS({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Im.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)WS.call(t,l)&&!US.hasOwnProperty(l)&&(n[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];n.children=a}return{$$typeof:Ya,type:e.type,key:i,ref:s,props:n,_owner:o}};Te.createContext=function(e){return e={$$typeof:Ek,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Tk,_context:e},e.Consumer=e};Te.createElement=KS;Te.createFactory=function(e){var t=KS.bind(null,e);return t.type=e,t};Te.createRef=function(){return{current:null}};Te.forwardRef=function(e){return{$$typeof:Ik,render:e}};Te.isValidElement=Rm;Te.lazy=function(e){return{$$typeof:Pk,_payload:{_status:-1,_result:e},_init:Dk}};Te.memo=function(e,t){return{$$typeof:Mk,type:e,compare:t===void 0?null:t}};Te.startTransition=function(e){var t=oc.transition;oc.transition={};try{e()}finally{oc.transition=t}};Te.unstable_act=VS;Te.useCallback=function(e,t){return Zt.current.useCallback(e,t)};Te.useContext=function(e){return Zt.current.useContext(e)};Te.useDebugValue=function(){};Te.useDeferredValue=function(e){return Zt.current.useDeferredValue(e)};Te.useEffect=function(e,t){return Zt.current.useEffect(e,t)};Te.useId=function(){return Zt.current.useId()};Te.useImperativeHandle=function(e,t,r){return Zt.current.useImperativeHandle(e,t,r)};Te.useInsertionEffect=function(e,t){return Zt.current.useInsertionEffect(e,t)};Te.useLayoutEffect=function(e,t){return Zt.current.useLayoutEffect(e,t)};Te.useMemo=function(e,t){return Zt.current.useMemo(e,t)};Te.useReducer=function(e,t,r){return Zt.current.useReducer(e,t,r)};Te.useRef=function(e){return Zt.current.useRef(e)};Te.useState=function(e){return Zt.current.useState(e)};Te.useSyncExternalStore=function(e,t,r){return Zt.current.useSyncExternalStore(e,t,r)};Te.useTransition=function(){return Zt.current.useTransition()};Te.version="18.3.1";$S.exports=Te;var p=$S.exports;const ne=km(p);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Ok=p,$k=Symbol.for("react.element"),jk=Symbol.for("react.fragment"),zk=Object.prototype.hasOwnProperty,Fk=Ok.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Hk={key:!0,ref:!0,__self:!0,__source:!0};function qS(e,t,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)zk.call(t,n)&&!Hk.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:$k,type:e,key:s,ref:o,props:i,_owner:Fk.current}}_u.Fragment=jk;_u.jsx=qS;_u.jsxs=qS;OS.exports=_u;var u=OS.exports,gh={},YS={exports:{}},xr={},GS={exports:{}},XS={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(N,V){var D=N.length;N.push(V);e:for(;0<D;){var W=D-1>>>1,j=N[W];if(0<i(j,V))N[W]=V,N[D]=j,D=W;else break e}}function r(N){return N.length===0?null:N[0]}function n(N){if(N.length===0)return null;var V=N[0],D=N.pop();if(D!==V){N[0]=D;e:for(var W=0,j=N.length,ee=j>>>1;W<ee;){var te=2*(W+1)-1,ae=N[te],H=te+1,se=N[H];if(0>i(ae,D))H<j&&0>i(se,ae)?(N[W]=se,N[H]=D,W=H):(N[W]=ae,N[te]=D,W=te);else if(H<j&&0>i(se,D))N[W]=se,N[H]=D,W=H;else break e}}return V}function i(N,V){var D=N.sortIndex-V.sortIndex;return D!==0?D:N.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,h=null,f=3,v=!1,m=!1,S=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(N){for(var V=r(c);V!==null;){if(V.callback===null)n(c);else if(V.startTime<=N)n(c),V.sortIndex=V.expirationTime,t(l,V);else break;V=r(c)}}function b(N){if(S=!1,w(N),!m)if(r(l)!==null)m=!0,E(C);else{var V=r(c);V!==null&&F(b,V.startTime-N)}}function C(N,V){m=!1,S&&(S=!1,g(T),T=-1),v=!0;var D=f;try{for(w(V),h=r(l);h!==null&&(!(h.expirationTime>V)||N&&!L());){var W=h.callback;if(typeof W=="function"){h.callback=null,f=h.priorityLevel;var j=W(h.expirationTime<=V);V=e.unstable_now(),typeof j=="function"?h.callback=j:h===r(l)&&n(l),w(V)}else n(l);h=r(l)}if(h!==null)var ee=!0;else{var te=r(c);te!==null&&F(b,te.startTime-V),ee=!1}return ee}finally{h=null,f=D,v=!1}}var M=!1,x=null,T=-1,k=5,I=-1;function L(){return!(e.unstable_now()-I<k)}function R(){if(x!==null){var N=e.unstable_now();I=N;var V=!0;try{V=x(!0,N)}finally{V?A():(M=!1,x=null)}}else M=!1}var A;if(typeof _=="function")A=function(){_(R)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,P=O.port2;O.port1.onmessage=R,A=function(){P.postMessage(null)}}else A=function(){y(R,0)};function E(N){x=N,M||(M=!0,A())}function F(N,V){T=y(function(){N(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(N){N.callback=null},e.unstable_continueExecution=function(){m||v||(m=!0,E(C))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return r(l)},e.unstable_next=function(N){switch(f){case 1:case 2:case 3:var V=3;break;default:V=f}var D=f;f=V;try{return N()}finally{f=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,V){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var D=f;f=N;try{return V()}finally{f=D}},e.unstable_scheduleCallback=function(N,V,D){var W=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?W+D:W):D=W,N){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=D+j,N={id:d++,callback:V,priorityLevel:N,startTime:D,expirationTime:j,sortIndex:-1},D>W?(N.sortIndex=D,t(c,N),r(l)===null&&N===r(c)&&(S?(g(T),T=-1):S=!0,F(b,D-W))):(N.sortIndex=j,t(l,N),m||v||(m=!0,E(C))),N},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(N){var V=f;return function(){var D=f;f=V;try{return N.apply(this,arguments)}finally{f=D}}}})(XS);GS.exports=XS;var Wk=GS.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Uk=p,Cr=Wk;function G(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var JS=new Set,ga={};function Qi(e,t){Xs(e,t),Xs(e+"Capture",t)}function Xs(e,t){for(ga[e]=t,e=0;e<t.length;e++)JS.add(t[e])}var Mn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vh=Object.prototype.hasOwnProperty,Kk=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,rv={},nv={};function Vk(e){return vh.call(nv,e)?!0:vh.call(rv,e)?!1:Kk.test(e)?nv[e]=!0:(rv[e]=!0,!1)}function qk(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Yk(e,t,r,n){if(t===null||typeof t>"u"||qk(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function er(e,t,r,n,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var $t={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$t[e]=new er(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$t[t]=new er(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$t[e]=new er(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$t[e]=new er(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$t[e]=new er(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$t[e]=new er(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$t[e]=new er(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$t[e]=new er(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$t[e]=new er(e,5,!1,e.toLowerCase(),null,!1,!1)});var Mm=/[\-:]([a-z])/g;function Pm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Mm,Pm);$t[t]=new er(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Mm,Pm);$t[t]=new er(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Mm,Pm);$t[t]=new er(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$t[e]=new er(e,1,!1,e.toLowerCase(),null,!1,!1)});$t.xlinkHref=new er("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$t[e]=new er(e,1,!1,e.toLowerCase(),null,!0,!0)});function Lm(e,t,r,n){var i=$t.hasOwnProperty(t)?$t[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Yk(t,r,i,n)&&(r=null),n||i===null?Vk(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Nn=Uk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,El=Symbol.for("react.element"),Cs=Symbol.for("react.portal"),xs=Symbol.for("react.fragment"),Am=Symbol.for("react.strict_mode"),_h=Symbol.for("react.profiler"),QS=Symbol.for("react.provider"),ZS=Symbol.for("react.context"),Nm=Symbol.for("react.forward_ref"),yh=Symbol.for("react.suspense"),Sh=Symbol.for("react.suspense_list"),Dm=Symbol.for("react.memo"),Wn=Symbol.for("react.lazy"),ew=Symbol.for("react.offscreen"),iv=Symbol.iterator;function Ro(e){return e===null||typeof e!="object"?null:(e=iv&&e[iv]||e["@@iterator"],typeof e=="function"?e:null)}var tt=Object.assign,gd;function Vo(e){if(gd===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);gd=t&&t[1]||""}return`
|
|
34
|
-
`+gd+e}var vd=!1;function _d(e,t){if(!e||vd)return"";vd=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&typeof c.stack=="string"){for(var i=c.stack.split(`
|
|
35
|
-
`),s=n.stack.split(`
|
|
36
|
-
`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
|
|
37
|
-
`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{vd=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Vo(e):""}function Gk(e){switch(e.tag){case 5:return Vo(e.type);case 16:return Vo("Lazy");case 13:return Vo("Suspense");case 19:return Vo("SuspenseList");case 0:case 2:case 15:return e=_d(e.type,!1),e;case 11:return e=_d(e.type.render,!1),e;case 1:return e=_d(e.type,!0),e;default:return""}}function wh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case xs:return"Fragment";case Cs:return"Portal";case _h:return"Profiler";case Am:return"StrictMode";case yh:return"Suspense";case Sh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ZS:return(e.displayName||"Context")+".Consumer";case QS:return(e._context.displayName||"Context")+".Provider";case Nm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Dm:return t=e.displayName||null,t!==null?t:wh(e.type)||"Memo";case Wn:t=e._payload,e=e._init;try{return wh(e(t))}catch{}}return null}function Xk(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return wh(t);case 8:return t===Am?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ci(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jk(e){var t=tw(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Il(e){e._valueTracker||(e._valueTracker=Jk(e))}function rw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=tw(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Nc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function bh(e,t){var r=t.checked;return tt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function sv(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ci(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function nw(e,t){t=t.checked,t!=null&&Lm(e,"checked",t,!1)}function Ch(e,t){nw(e,t);var r=ci(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?xh(e,t.type,r):t.hasOwnProperty("defaultValue")&&xh(e,t.type,ci(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ov(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function xh(e,t,r){(t!=="number"||Nc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var qo=Array.isArray;function Os(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+ci(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function kh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return tt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function av(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(G(92));if(qo(r)){if(1<r.length)throw Error(G(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:ci(r)}}function iw(e,t){var r=ci(t.value),n=ci(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function lv(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function sw(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Th(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?sw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Rl,ow=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Rl=Rl||document.createElement("div"),Rl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Rl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function va(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var na={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Qk=["Webkit","ms","Moz","O"];Object.keys(na).forEach(function(e){Qk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),na[t]=na[e]})});function aw(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||na.hasOwnProperty(e)&&na[e]?(""+t).trim():t+"px"}function lw(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=aw(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var Zk=tt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Eh(e,t){if(t){if(Zk[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function Ih(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Rh=null;function Bm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mh=null,$s=null,js=null;function cv(e){if(e=Ja(e)){if(typeof Mh!="function")throw Error(G(280));var t=e.stateNode;t&&(t=Cu(t),Mh(e.stateNode,e.type,t))}}function cw(e){$s?js?js.push(e):js=[e]:$s=e}function uw(){if($s){var e=$s,t=js;if(js=$s=null,cv(e),t)for(e=0;e<t.length;e++)cv(t[e])}}function dw(e,t){return e(t)}function hw(){}var yd=!1;function fw(e,t,r){if(yd)return e(t,r);yd=!0;try{return dw(e,t,r)}finally{yd=!1,($s!==null||js!==null)&&(hw(),uw())}}function _a(e,t){var r=e.stateNode;if(r===null)return null;var n=Cu(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(G(231,t,typeof r));return r}var Ph=!1;if(Mn)try{var Mo={};Object.defineProperty(Mo,"passive",{get:function(){Ph=!0}}),window.addEventListener("test",Mo,Mo),window.removeEventListener("test",Mo,Mo)}catch{Ph=!1}function eT(e,t,r,n,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(d){this.onError(d)}}var ia=!1,Dc=null,Bc=!1,Lh=null,tT={onError:function(e){ia=!0,Dc=e}};function rT(e,t,r,n,i,s,o,a,l){ia=!1,Dc=null,eT.apply(tT,arguments)}function nT(e,t,r,n,i,s,o,a,l){if(rT.apply(this,arguments),ia){if(ia){var c=Dc;ia=!1,Dc=null}else throw Error(G(198));Bc||(Bc=!0,Lh=c)}}function Zi(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function mw(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function uv(e){if(Zi(e)!==e)throw Error(G(188))}function iT(e){var t=e.alternate;if(!t){if(t=Zi(e),t===null)throw Error(G(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var s=i.alternate;if(s===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return uv(i),e;if(s===n)return uv(i),t;s=s.sibling}throw Error(G(188))}if(r.return!==n.return)r=i,n=s;else{for(var o=!1,a=i.child;a;){if(a===r){o=!0,r=i,n=s;break}if(a===n){o=!0,n=i,r=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===r){o=!0,r=s,n=i;break}if(a===n){o=!0,n=s,r=i;break}a=a.sibling}if(!o)throw Error(G(189))}}if(r.alternate!==n)throw Error(G(190))}if(r.tag!==3)throw Error(G(188));return r.stateNode.current===r?e:t}function pw(e){return e=iT(e),e!==null?gw(e):null}function gw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=gw(e);if(t!==null)return t;e=e.sibling}return null}var vw=Cr.unstable_scheduleCallback,dv=Cr.unstable_cancelCallback,sT=Cr.unstable_shouldYield,oT=Cr.unstable_requestPaint,at=Cr.unstable_now,aT=Cr.unstable_getCurrentPriorityLevel,Om=Cr.unstable_ImmediatePriority,_w=Cr.unstable_UserBlockingPriority,Oc=Cr.unstable_NormalPriority,lT=Cr.unstable_LowPriority,yw=Cr.unstable_IdlePriority,yu=null,hn=null;function cT(e){if(hn&&typeof hn.onCommitFiberRoot=="function")try{hn.onCommitFiberRoot(yu,e,void 0,(e.current.flags&128)===128)}catch{}}var Yr=Math.clz32?Math.clz32:hT,uT=Math.log,dT=Math.LN2;function hT(e){return e>>>=0,e===0?32:31-(uT(e)/dT|0)|0}var Ml=64,Pl=4194304;function Yo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function $c(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Yo(a):(s&=o,s!==0&&(n=Yo(s)))}else o=r&~i,o!==0?n=Yo(o):s!==0&&(n=Yo(s));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Yr(t),i=1<<r,n|=e[r],t&=~i;return n}function fT(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function mT(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Yr(s),a=1<<o,l=i[o];l===-1?(!(a&r)||a&n)&&(i[o]=fT(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Ah(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Sw(){var e=Ml;return Ml<<=1,!(Ml&4194240)&&(Ml=64),e}function Sd(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ga(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Yr(t),e[t]=r}function pT(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-Yr(r),s=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~s}}function $m(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Yr(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Ne=0;function ww(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var bw,jm,Cw,xw,kw,Nh=!1,Ll=[],Zn=null,ei=null,ti=null,ya=new Map,Sa=new Map,Vn=[],gT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function hv(e,t){switch(e){case"focusin":case"focusout":Zn=null;break;case"dragenter":case"dragleave":ei=null;break;case"mouseover":case"mouseout":ti=null;break;case"pointerover":case"pointerout":ya.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sa.delete(t.pointerId)}}function Po(e,t,r,n,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Ja(t),t!==null&&jm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function vT(e,t,r,n,i){switch(t){case"focusin":return Zn=Po(Zn,e,t,r,n,i),!0;case"dragenter":return ei=Po(ei,e,t,r,n,i),!0;case"mouseover":return ti=Po(ti,e,t,r,n,i),!0;case"pointerover":var s=i.pointerId;return ya.set(s,Po(ya.get(s)||null,e,t,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,Sa.set(s,Po(Sa.get(s)||null,e,t,r,n,i)),!0}return!1}function Tw(e){var t=Li(e.target);if(t!==null){var r=Zi(t);if(r!==null){if(t=r.tag,t===13){if(t=mw(r),t!==null){e.blockedOn=t,kw(e.priority,function(){Cw(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ac(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Dh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Rh=n,r.target.dispatchEvent(n),Rh=null}else return t=Ja(r),t!==null&&jm(t),e.blockedOn=r,!1;t.shift()}return!0}function fv(e,t,r){ac(e)&&r.delete(t)}function _T(){Nh=!1,Zn!==null&&ac(Zn)&&(Zn=null),ei!==null&&ac(ei)&&(ei=null),ti!==null&&ac(ti)&&(ti=null),ya.forEach(fv),Sa.forEach(fv)}function Lo(e,t){e.blockedOn===t&&(e.blockedOn=null,Nh||(Nh=!0,Cr.unstable_scheduleCallback(Cr.unstable_NormalPriority,_T)))}function wa(e){function t(i){return Lo(i,e)}if(0<Ll.length){Lo(Ll[0],e);for(var r=1;r<Ll.length;r++){var n=Ll[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Zn!==null&&Lo(Zn,e),ei!==null&&Lo(ei,e),ti!==null&&Lo(ti,e),ya.forEach(t),Sa.forEach(t),r=0;r<Vn.length;r++)n=Vn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Vn.length&&(r=Vn[0],r.blockedOn===null);)Tw(r),r.blockedOn===null&&Vn.shift()}var zs=Nn.ReactCurrentBatchConfig,jc=!0;function yT(e,t,r,n){var i=Ne,s=zs.transition;zs.transition=null;try{Ne=1,zm(e,t,r,n)}finally{Ne=i,zs.transition=s}}function ST(e,t,r,n){var i=Ne,s=zs.transition;zs.transition=null;try{Ne=4,zm(e,t,r,n)}finally{Ne=i,zs.transition=s}}function zm(e,t,r,n){if(jc){var i=Dh(e,t,r,n);if(i===null)Md(e,t,n,zc,r),hv(e,n);else if(vT(i,e,t,r,n))n.stopPropagation();else if(hv(e,n),t&4&&-1<gT.indexOf(e)){for(;i!==null;){var s=Ja(i);if(s!==null&&bw(s),s=Dh(e,t,r,n),s===null&&Md(e,t,n,zc,r),s===i)break;i=s}i!==null&&n.stopPropagation()}else Md(e,t,n,null,r)}}var zc=null;function Dh(e,t,r,n){if(zc=null,e=Bm(n),e=Li(e),e!==null)if(t=Zi(e),t===null)e=null;else if(r=t.tag,r===13){if(e=mw(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return zc=e,null}function Ew(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(aT()){case Om:return 1;case _w:return 4;case Oc:case lT:return 16;case yw:return 536870912;default:return 16}default:return 16}}var Xn=null,Fm=null,lc=null;function Iw(){if(lc)return lc;var e,t=Fm,r=t.length,n,i="value"in Xn?Xn.value:Xn.textContent,s=i.length;for(e=0;e<r&&t[e]===i[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===i[s-n];n++);return lc=i.slice(e,1<n?1-n:void 0)}function cc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Al(){return!0}function mv(){return!1}function kr(e){function t(r,n,i,s,o){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(r=e[a],this[a]=r?r(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Al:mv,this.isPropagationStopped=mv,this}return tt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Al)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Al)},persist:function(){},isPersistent:Al}),t}var lo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hm=kr(lo),Xa=tt({},lo,{view:0,detail:0}),wT=kr(Xa),wd,bd,Ao,Su=tt({},Xa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wm,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ao&&(Ao&&e.type==="mousemove"?(wd=e.screenX-Ao.screenX,bd=e.screenY-Ao.screenY):bd=wd=0,Ao=e),wd)},movementY:function(e){return"movementY"in e?e.movementY:bd}}),pv=kr(Su),bT=tt({},Su,{dataTransfer:0}),CT=kr(bT),xT=tt({},Xa,{relatedTarget:0}),Cd=kr(xT),kT=tt({},lo,{animationName:0,elapsedTime:0,pseudoElement:0}),TT=kr(kT),ET=tt({},lo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),IT=kr(ET),RT=tt({},lo,{data:0}),gv=kr(RT),MT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PT={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},LT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AT(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=LT[e])?!!t[e]:!1}function Wm(){return AT}var NT=tt({},Xa,{key:function(e){if(e.key){var t=MT[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=cc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?PT[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wm,charCode:function(e){return e.type==="keypress"?cc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?cc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),DT=kr(NT),BT=tt({},Su,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vv=kr(BT),OT=tt({},Xa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wm}),$T=kr(OT),jT=tt({},lo,{propertyName:0,elapsedTime:0,pseudoElement:0}),zT=kr(jT),FT=tt({},Su,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),HT=kr(FT),WT=[9,13,27,32],Um=Mn&&"CompositionEvent"in window,sa=null;Mn&&"documentMode"in document&&(sa=document.documentMode);var UT=Mn&&"TextEvent"in window&&!sa,Rw=Mn&&(!Um||sa&&8<sa&&11>=sa),_v=" ",yv=!1;function Mw(e,t){switch(e){case"keyup":return WT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ks=!1;function KT(e,t){switch(e){case"compositionend":return Pw(t);case"keypress":return t.which!==32?null:(yv=!0,_v);case"textInput":return e=t.data,e===_v&&yv?null:e;default:return null}}function VT(e,t){if(ks)return e==="compositionend"||!Um&&Mw(e,t)?(e=Iw(),lc=Fm=Xn=null,ks=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Rw&&t.locale!=="ko"?null:t.data;default:return null}}var qT={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Sv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!qT[e.type]:t==="textarea"}function Lw(e,t,r,n){cw(n),t=Fc(t,"onChange"),0<t.length&&(r=new Hm("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var oa=null,ba=null;function YT(e){Ww(e,0)}function wu(e){var t=Is(e);if(rw(t))return e}function GT(e,t){if(e==="change")return t}var Aw=!1;if(Mn){var xd;if(Mn){var kd="oninput"in document;if(!kd){var wv=document.createElement("div");wv.setAttribute("oninput","return;"),kd=typeof wv.oninput=="function"}xd=kd}else xd=!1;Aw=xd&&(!document.documentMode||9<document.documentMode)}function bv(){oa&&(oa.detachEvent("onpropertychange",Nw),ba=oa=null)}function Nw(e){if(e.propertyName==="value"&&wu(ba)){var t=[];Lw(t,ba,e,Bm(e)),fw(YT,t)}}function XT(e,t,r){e==="focusin"?(bv(),oa=t,ba=r,oa.attachEvent("onpropertychange",Nw)):e==="focusout"&&bv()}function JT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return wu(ba)}function QT(e,t){if(e==="click")return wu(t)}function ZT(e,t){if(e==="input"||e==="change")return wu(t)}function eE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jr=typeof Object.is=="function"?Object.is:eE;function Ca(e,t){if(Jr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!vh.call(t,i)||!Jr(e[i],t[i]))return!1}return!0}function Cv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xv(e,t){var r=Cv(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Cv(r)}}function Dw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bw(){for(var e=window,t=Nc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Nc(e.document)}return t}function Km(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function tE(e){var t=Bw(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Dw(r.ownerDocument.documentElement,r)){if(n!==null&&Km(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!e.extend&&s>n&&(i=n,n=s,s=i),i=xv(r,s);var o=xv(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var rE=Mn&&"documentMode"in document&&11>=document.documentMode,Ts=null,Bh=null,aa=null,Oh=!1;function kv(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Oh||Ts==null||Ts!==Nc(n)||(n=Ts,"selectionStart"in n&&Km(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),aa&&Ca(aa,n)||(aa=n,n=Fc(Bh,"onSelect"),0<n.length&&(t=new Hm("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ts)))}function Nl(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Es={animationend:Nl("Animation","AnimationEnd"),animationiteration:Nl("Animation","AnimationIteration"),animationstart:Nl("Animation","AnimationStart"),transitionend:Nl("Transition","TransitionEnd")},Td={},Ow={};Mn&&(Ow=document.createElement("div").style,"AnimationEvent"in window||(delete Es.animationend.animation,delete Es.animationiteration.animation,delete Es.animationstart.animation),"TransitionEvent"in window||delete Es.transitionend.transition);function bu(e){if(Td[e])return Td[e];if(!Es[e])return e;var t=Es[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Ow)return Td[e]=t[r];return e}var $w=bu("animationend"),jw=bu("animationiteration"),zw=bu("animationstart"),Fw=bu("transitionend"),Hw=new Map,Tv="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function fi(e,t){Hw.set(e,t),Qi(t,[e])}for(var Ed=0;Ed<Tv.length;Ed++){var Id=Tv[Ed],nE=Id.toLowerCase(),iE=Id[0].toUpperCase()+Id.slice(1);fi(nE,"on"+iE)}fi($w,"onAnimationEnd");fi(jw,"onAnimationIteration");fi(zw,"onAnimationStart");fi("dblclick","onDoubleClick");fi("focusin","onFocus");fi("focusout","onBlur");fi(Fw,"onTransitionEnd");Xs("onMouseEnter",["mouseout","mouseover"]);Xs("onMouseLeave",["mouseout","mouseover"]);Xs("onPointerEnter",["pointerout","pointerover"]);Xs("onPointerLeave",["pointerout","pointerover"]);Qi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Qi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Qi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Qi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Qi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Qi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Go="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),sE=new Set("cancel close invalid load scroll toggle".split(" ").concat(Go));function Ev(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,nT(n,t,void 0,e),e.currentTarget=null}function Ww(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var o=n.length-1;0<=o;o--){var a=n[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Ev(i,a,c),s=l}else for(o=0;o<n.length;o++){if(a=n[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Ev(i,a,c),s=l}}}if(Bc)throw e=Lh,Bc=!1,Lh=null,e}function Fe(e,t){var r=t[Hh];r===void 0&&(r=t[Hh]=new Set);var n=e+"__bubble";r.has(n)||(Uw(t,e,2,!1),r.add(n))}function Rd(e,t,r){var n=0;t&&(n|=4),Uw(r,e,n,t)}var Dl="_reactListening"+Math.random().toString(36).slice(2);function xa(e){if(!e[Dl]){e[Dl]=!0,JS.forEach(function(r){r!=="selectionchange"&&(sE.has(r)||Rd(r,!1,e),Rd(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Dl]||(t[Dl]=!0,Rd("selectionchange",!1,t))}}function Uw(e,t,r,n){switch(Ew(t)){case 1:var i=yT;break;case 4:i=ST;break;default:i=zm}r=i.bind(null,t,r,e),i=void 0,!Ph||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Md(e,t,r,n,i){var s=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var a=n.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=n.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Li(a),o===null)return;if(l=o.tag,l===5||l===6){n=s=o;continue e}a=a.parentNode}}n=n.return}fw(function(){var c=s,d=Bm(r),h=[];e:{var f=Hw.get(e);if(f!==void 0){var v=Hm,m=e;switch(e){case"keypress":if(cc(r)===0)break e;case"keydown":case"keyup":v=DT;break;case"focusin":m="focus",v=Cd;break;case"focusout":m="blur",v=Cd;break;case"beforeblur":case"afterblur":v=Cd;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=pv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=CT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=$T;break;case $w:case jw:case zw:v=TT;break;case Fw:v=zT;break;case"scroll":v=wT;break;case"wheel":v=HT;break;case"copy":case"cut":case"paste":v=IT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=vv}var S=(t&4)!==0,y=!S&&e==="scroll",g=S?f!==null?f+"Capture":null:f;S=[];for(var _=c,w;_!==null;){w=_;var b=w.stateNode;if(w.tag===5&&b!==null&&(w=b,g!==null&&(b=_a(_,g),b!=null&&S.push(ka(_,b,w)))),y)break;_=_.return}0<S.length&&(f=new v(f,m,null,r,d),h.push({event:f,listeners:S}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",f&&r!==Rh&&(m=r.relatedTarget||r.fromElement)&&(Li(m)||m[Pn]))break e;if((v||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,v?(m=r.relatedTarget||r.toElement,v=c,m=m?Li(m):null,m!==null&&(y=Zi(m),m!==y||m.tag!==5&&m.tag!==6)&&(m=null)):(v=null,m=c),v!==m)){if(S=pv,b="onMouseLeave",g="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(S=vv,b="onPointerLeave",g="onPointerEnter",_="pointer"),y=v==null?f:Is(v),w=m==null?f:Is(m),f=new S(b,_+"leave",v,r,d),f.target=y,f.relatedTarget=w,b=null,Li(d)===c&&(S=new S(g,_+"enter",m,r,d),S.target=w,S.relatedTarget=y,b=S),y=b,v&&m)t:{for(S=v,g=m,_=0,w=S;w;w=vs(w))_++;for(w=0,b=g;b;b=vs(b))w++;for(;0<_-w;)S=vs(S),_--;for(;0<w-_;)g=vs(g),w--;for(;_--;){if(S===g||g!==null&&S===g.alternate)break t;S=vs(S),g=vs(g)}S=null}else S=null;v!==null&&Iv(h,f,v,S,!1),m!==null&&y!==null&&Iv(h,y,m,S,!0)}}e:{if(f=c?Is(c):window,v=f.nodeName&&f.nodeName.toLowerCase(),v==="select"||v==="input"&&f.type==="file")var C=GT;else if(Sv(f))if(Aw)C=ZT;else{C=JT;var M=XT}else(v=f.nodeName)&&v.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(C=QT);if(C&&(C=C(e,c))){Lw(h,C,r,d);break e}M&&M(e,f,c),e==="focusout"&&(M=f._wrapperState)&&M.controlled&&f.type==="number"&&xh(f,"number",f.value)}switch(M=c?Is(c):window,e){case"focusin":(Sv(M)||M.contentEditable==="true")&&(Ts=M,Bh=c,aa=null);break;case"focusout":aa=Bh=Ts=null;break;case"mousedown":Oh=!0;break;case"contextmenu":case"mouseup":case"dragend":Oh=!1,kv(h,r,d);break;case"selectionchange":if(rE)break;case"keydown":case"keyup":kv(h,r,d)}var x;if(Um)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else ks?Mw(e,r)&&(T="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(T="onCompositionStart");T&&(Rw&&r.locale!=="ko"&&(ks||T!=="onCompositionStart"?T==="onCompositionEnd"&&ks&&(x=Iw()):(Xn=d,Fm="value"in Xn?Xn.value:Xn.textContent,ks=!0)),M=Fc(c,T),0<M.length&&(T=new gv(T,e,null,r,d),h.push({event:T,listeners:M}),x?T.data=x:(x=Pw(r),x!==null&&(T.data=x)))),(x=UT?KT(e,r):VT(e,r))&&(c=Fc(c,"onBeforeInput"),0<c.length&&(d=new gv("onBeforeInput","beforeinput",null,r,d),h.push({event:d,listeners:c}),d.data=x))}Ww(h,t)})}function ka(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Fc(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=_a(e,r),s!=null&&n.unshift(ka(e,s,i)),s=_a(e,t),s!=null&&n.push(ka(e,s,i))),e=e.return}return n}function vs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Iv(e,t,r,n,i){for(var s=t._reactName,o=[];r!==null&&r!==n;){var a=r,l=a.alternate,c=a.stateNode;if(l!==null&&l===n)break;a.tag===5&&c!==null&&(a=c,i?(l=_a(r,s),l!=null&&o.unshift(ka(r,l,a))):i||(l=_a(r,s),l!=null&&o.push(ka(r,l,a)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var oE=/\r\n?/g,aE=/\u0000|\uFFFD/g;function Rv(e){return(typeof e=="string"?e:""+e).replace(oE,`
|
|
38
|
-
`).replace(aE,"")}function Bl(e,t,r){if(t=Rv(t),Rv(e)!==t&&r)throw Error(G(425))}function Hc(){}var $h=null,jh=null;function zh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Fh=typeof setTimeout=="function"?setTimeout:void 0,lE=typeof clearTimeout=="function"?clearTimeout:void 0,Mv=typeof Promise=="function"?Promise:void 0,cE=typeof queueMicrotask=="function"?queueMicrotask:typeof Mv<"u"?function(e){return Mv.resolve(null).then(e).catch(uE)}:Fh;function uE(e){setTimeout(function(){throw e})}function Pd(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),wa(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);wa(t)}function ri(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Pv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var co=Math.random().toString(36).slice(2),cn="__reactFiber$"+co,Ta="__reactProps$"+co,Pn="__reactContainer$"+co,Hh="__reactEvents$"+co,dE="__reactListeners$"+co,hE="__reactHandles$"+co;function Li(e){var t=e[cn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Pn]||r[cn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Pv(e);e!==null;){if(r=e[cn])return r;e=Pv(e)}return t}e=r,r=e.parentNode}return null}function Ja(e){return e=e[cn]||e[Pn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Is(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function Cu(e){return e[Ta]||null}var Wh=[],Rs=-1;function mi(e){return{current:e}}function Ue(e){0>Rs||(e.current=Wh[Rs],Wh[Rs]=null,Rs--)}function je(e,t){Rs++,Wh[Rs]=e.current,e.current=t}var ui={},qt=mi(ui),cr=mi(!1),zi=ui;function Js(e,t){var r=e.type.contextTypes;if(!r)return ui;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ur(e){return e=e.childContextTypes,e!=null}function Wc(){Ue(cr),Ue(qt)}function Lv(e,t,r){if(qt.current!==ui)throw Error(G(168));je(qt,t),je(cr,r)}function Kw(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(G(108,Xk(e)||"Unknown",i));return tt({},r,n)}function Uc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ui,zi=qt.current,je(qt,e),je(cr,cr.current),!0}function Av(e,t,r){var n=e.stateNode;if(!n)throw Error(G(169));r?(e=Kw(e,t,zi),n.__reactInternalMemoizedMergedChildContext=e,Ue(cr),Ue(qt),je(qt,e)):Ue(cr),je(cr,r)}var xn=null,xu=!1,Ld=!1;function Vw(e){xn===null?xn=[e]:xn.push(e)}function fE(e){xu=!0,Vw(e)}function pi(){if(!Ld&&xn!==null){Ld=!0;var e=0,t=Ne;try{var r=xn;for(Ne=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}xn=null,xu=!1}catch(i){throw xn!==null&&(xn=xn.slice(e+1)),vw(Om,pi),i}finally{Ne=t,Ld=!1}}return null}var Ms=[],Ps=0,Kc=null,Vc=0,Rr=[],Mr=0,Fi=null,kn=1,Tn="";function Ti(e,t){Ms[Ps++]=Vc,Ms[Ps++]=Kc,Kc=e,Vc=t}function qw(e,t,r){Rr[Mr++]=kn,Rr[Mr++]=Tn,Rr[Mr++]=Fi,Fi=e;var n=kn;e=Tn;var i=32-Yr(n)-1;n&=~(1<<i),r+=1;var s=32-Yr(t)+i;if(30<s){var o=i-i%5;s=(n&(1<<o)-1).toString(32),n>>=o,i-=o,kn=1<<32-Yr(t)+i|r<<i|n,Tn=s+e}else kn=1<<s|r<<i|n,Tn=e}function Vm(e){e.return!==null&&(Ti(e,1),qw(e,1,0))}function qm(e){for(;e===Kc;)Kc=Ms[--Ps],Ms[Ps]=null,Vc=Ms[--Ps],Ms[Ps]=null;for(;e===Fi;)Fi=Rr[--Mr],Rr[Mr]=null,Tn=Rr[--Mr],Rr[Mr]=null,kn=Rr[--Mr],Rr[Mr]=null}var wr=null,Sr=null,Ge=!1,Vr=null;function Yw(e,t){var r=Lr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Nv(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,wr=e,Sr=ri(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,wr=e,Sr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Fi!==null?{id:kn,overflow:Tn}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Lr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,wr=e,Sr=null,!0):!1;default:return!1}}function Uh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Kh(e){if(Ge){var t=Sr;if(t){var r=t;if(!Nv(e,t)){if(Uh(e))throw Error(G(418));t=ri(r.nextSibling);var n=wr;t&&Nv(e,t)?Yw(n,r):(e.flags=e.flags&-4097|2,Ge=!1,wr=e)}}else{if(Uh(e))throw Error(G(418));e.flags=e.flags&-4097|2,Ge=!1,wr=e}}}function Dv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;wr=e}function Ol(e){if(e!==wr)return!1;if(!Ge)return Dv(e),Ge=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!zh(e.type,e.memoizedProps)),t&&(t=Sr)){if(Uh(e))throw Gw(),Error(G(418));for(;t;)Yw(e,t),t=ri(t.nextSibling)}if(Dv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Sr=ri(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Sr=null}}else Sr=wr?ri(e.stateNode.nextSibling):null;return!0}function Gw(){for(var e=Sr;e;)e=ri(e.nextSibling)}function Qs(){Sr=wr=null,Ge=!1}function Ym(e){Vr===null?Vr=[e]:Vr.push(e)}var mE=Nn.ReactCurrentBatchConfig;function No(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(G(309));var n=r.stateNode}if(!n)throw Error(G(147,e));var i=n,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(G(284));if(!r._owner)throw Error(G(290,e))}return e}function $l(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Bv(e){var t=e._init;return t(e._payload)}function Xw(e){function t(g,_){if(e){var w=g.deletions;w===null?(g.deletions=[_],g.flags|=16):w.push(_)}}function r(g,_){if(!e)return null;for(;_!==null;)t(g,_),_=_.sibling;return null}function n(g,_){for(g=new Map;_!==null;)_.key!==null?g.set(_.key,_):g.set(_.index,_),_=_.sibling;return g}function i(g,_){return g=oi(g,_),g.index=0,g.sibling=null,g}function s(g,_,w){return g.index=w,e?(w=g.alternate,w!==null?(w=w.index,w<_?(g.flags|=2,_):w):(g.flags|=2,_)):(g.flags|=1048576,_)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,_,w,b){return _===null||_.tag!==6?(_=jd(w,g.mode,b),_.return=g,_):(_=i(_,w),_.return=g,_)}function l(g,_,w,b){var C=w.type;return C===xs?d(g,_,w.props.children,b,w.key):_!==null&&(_.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Wn&&Bv(C)===_.type)?(b=i(_,w.props),b.ref=No(g,_,w),b.return=g,b):(b=gc(w.type,w.key,w.props,null,g.mode,b),b.ref=No(g,_,w),b.return=g,b)}function c(g,_,w,b){return _===null||_.tag!==4||_.stateNode.containerInfo!==w.containerInfo||_.stateNode.implementation!==w.implementation?(_=zd(w,g.mode,b),_.return=g,_):(_=i(_,w.children||[]),_.return=g,_)}function d(g,_,w,b,C){return _===null||_.tag!==7?(_=$i(w,g.mode,b,C),_.return=g,_):(_=i(_,w),_.return=g,_)}function h(g,_,w){if(typeof _=="string"&&_!==""||typeof _=="number")return _=jd(""+_,g.mode,w),_.return=g,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case El:return w=gc(_.type,_.key,_.props,null,g.mode,w),w.ref=No(g,null,_),w.return=g,w;case Cs:return _=zd(_,g.mode,w),_.return=g,_;case Wn:var b=_._init;return h(g,b(_._payload),w)}if(qo(_)||Ro(_))return _=$i(_,g.mode,w,null),_.return=g,_;$l(g,_)}return null}function f(g,_,w,b){var C=_!==null?_.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return C!==null?null:a(g,_,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case El:return w.key===C?l(g,_,w,b):null;case Cs:return w.key===C?c(g,_,w,b):null;case Wn:return C=w._init,f(g,_,C(w._payload),b)}if(qo(w)||Ro(w))return C!==null?null:d(g,_,w,b,null);$l(g,w)}return null}function v(g,_,w,b,C){if(typeof b=="string"&&b!==""||typeof b=="number")return g=g.get(w)||null,a(_,g,""+b,C);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case El:return g=g.get(b.key===null?w:b.key)||null,l(_,g,b,C);case Cs:return g=g.get(b.key===null?w:b.key)||null,c(_,g,b,C);case Wn:var M=b._init;return v(g,_,w,M(b._payload),C)}if(qo(b)||Ro(b))return g=g.get(w)||null,d(_,g,b,C,null);$l(_,b)}return null}function m(g,_,w,b){for(var C=null,M=null,x=_,T=_=0,k=null;x!==null&&T<w.length;T++){x.index>T?(k=x,x=null):k=x.sibling;var I=f(g,x,w[T],b);if(I===null){x===null&&(x=k);break}e&&x&&I.alternate===null&&t(g,x),_=s(I,_,T),M===null?C=I:M.sibling=I,M=I,x=k}if(T===w.length)return r(g,x),Ge&&Ti(g,T),C;if(x===null){for(;T<w.length;T++)x=h(g,w[T],b),x!==null&&(_=s(x,_,T),M===null?C=x:M.sibling=x,M=x);return Ge&&Ti(g,T),C}for(x=n(g,x);T<w.length;T++)k=v(x,g,T,w[T],b),k!==null&&(e&&k.alternate!==null&&x.delete(k.key===null?T:k.key),_=s(k,_,T),M===null?C=k:M.sibling=k,M=k);return e&&x.forEach(function(L){return t(g,L)}),Ge&&Ti(g,T),C}function S(g,_,w,b){var C=Ro(w);if(typeof C!="function")throw Error(G(150));if(w=C.call(w),w==null)throw Error(G(151));for(var M=C=null,x=_,T=_=0,k=null,I=w.next();x!==null&&!I.done;T++,I=w.next()){x.index>T?(k=x,x=null):k=x.sibling;var L=f(g,x,I.value,b);if(L===null){x===null&&(x=k);break}e&&x&&L.alternate===null&&t(g,x),_=s(L,_,T),M===null?C=L:M.sibling=L,M=L,x=k}if(I.done)return r(g,x),Ge&&Ti(g,T),C;if(x===null){for(;!I.done;T++,I=w.next())I=h(g,I.value,b),I!==null&&(_=s(I,_,T),M===null?C=I:M.sibling=I,M=I);return Ge&&Ti(g,T),C}for(x=n(g,x);!I.done;T++,I=w.next())I=v(x,g,T,I.value,b),I!==null&&(e&&I.alternate!==null&&x.delete(I.key===null?T:I.key),_=s(I,_,T),M===null?C=I:M.sibling=I,M=I);return e&&x.forEach(function(R){return t(g,R)}),Ge&&Ti(g,T),C}function y(g,_,w,b){if(typeof w=="object"&&w!==null&&w.type===xs&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case El:e:{for(var C=w.key,M=_;M!==null;){if(M.key===C){if(C=w.type,C===xs){if(M.tag===7){r(g,M.sibling),_=i(M,w.props.children),_.return=g,g=_;break e}}else if(M.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Wn&&Bv(C)===M.type){r(g,M.sibling),_=i(M,w.props),_.ref=No(g,M,w),_.return=g,g=_;break e}r(g,M);break}else t(g,M);M=M.sibling}w.type===xs?(_=$i(w.props.children,g.mode,b,w.key),_.return=g,g=_):(b=gc(w.type,w.key,w.props,null,g.mode,b),b.ref=No(g,_,w),b.return=g,g=b)}return o(g);case Cs:e:{for(M=w.key;_!==null;){if(_.key===M)if(_.tag===4&&_.stateNode.containerInfo===w.containerInfo&&_.stateNode.implementation===w.implementation){r(g,_.sibling),_=i(_,w.children||[]),_.return=g,g=_;break e}else{r(g,_);break}else t(g,_);_=_.sibling}_=zd(w,g.mode,b),_.return=g,g=_}return o(g);case Wn:return M=w._init,y(g,_,M(w._payload),b)}if(qo(w))return m(g,_,w,b);if(Ro(w))return S(g,_,w,b);$l(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,_!==null&&_.tag===6?(r(g,_.sibling),_=i(_,w),_.return=g,g=_):(r(g,_),_=jd(w,g.mode,b),_.return=g,g=_),o(g)):r(g,_)}return y}var Zs=Xw(!0),Jw=Xw(!1),qc=mi(null),Yc=null,Ls=null,Gm=null;function Xm(){Gm=Ls=Yc=null}function Jm(e){var t=qc.current;Ue(qc),e._currentValue=t}function Vh(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Fs(e,t){Yc=e,Gm=Ls=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ar=!0),e.firstContext=null)}function Or(e){var t=e._currentValue;if(Gm!==e)if(e={context:e,memoizedValue:t,next:null},Ls===null){if(Yc===null)throw Error(G(308));Ls=e,Yc.dependencies={lanes:0,firstContext:e}}else Ls=Ls.next=e;return t}var Ai=null;function Qm(e){Ai===null?Ai=[e]:Ai.push(e)}function Qw(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Qm(t)):(r.next=i.next,i.next=r),t.interleaved=r,Ln(e,n)}function Ln(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Un=!1;function Zm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Rn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ni(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Pe&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Ln(e,r)}return i=n.interleaved,i===null?(t.next=t,Qm(n)):(t.next=i.next,i.next=t),n.interleaved=t,Ln(e,r)}function uc(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,$m(e,r)}}function Ov(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=t:s=s.next=t}else i=s=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Gc(e,t,r,n){var i=e.updateQueue;Un=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var h=i.baseState;o=0,d=c=l=null,a=s;do{var f=a.lane,v=a.eventTime;if((n&f)===f){d!==null&&(d=d.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,S=a;switch(f=t,v=r,S.tag){case 1:if(m=S.payload,typeof m=="function"){h=m.call(v,h,f);break e}h=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=S.payload,f=typeof m=="function"?m.call(v,h,f):m,f==null)break e;h=tt({},h,f);break e;case 2:Un=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else v={eventTime:v,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=v,l=h):d=d.next=v,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(l=h),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Wi|=o,e.lanes=o,e.memoizedState=h}}function $v(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(G(191,i));i.call(n)}}}var Qa={},fn=mi(Qa),Ea=mi(Qa),Ia=mi(Qa);function Ni(e){if(e===Qa)throw Error(G(174));return e}function ep(e,t){switch(je(Ia,t),je(Ea,e),je(fn,Qa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Th(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Th(t,e)}Ue(fn),je(fn,t)}function eo(){Ue(fn),Ue(Ea),Ue(Ia)}function e0(e){Ni(Ia.current);var t=Ni(fn.current),r=Th(t,e.type);t!==r&&(je(Ea,e),je(fn,r))}function tp(e){Ea.current===e&&(Ue(fn),Ue(Ea))}var Ze=mi(0);function Xc(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ad=[];function rp(){for(var e=0;e<Ad.length;e++)Ad[e]._workInProgressVersionPrimary=null;Ad.length=0}var dc=Nn.ReactCurrentDispatcher,Nd=Nn.ReactCurrentBatchConfig,Hi=0,et=null,vt=null,kt=null,Jc=!1,la=!1,Ra=0,pE=0;function zt(){throw Error(G(321))}function np(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Jr(e[r],t[r]))return!1;return!0}function ip(e,t,r,n,i,s){if(Hi=s,et=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,dc.current=e===null||e.memoizedState===null?yE:SE,e=r(n,i),la){s=0;do{if(la=!1,Ra=0,25<=s)throw Error(G(301));s+=1,kt=vt=null,t.updateQueue=null,dc.current=wE,e=r(n,i)}while(la)}if(dc.current=Qc,t=vt!==null&&vt.next!==null,Hi=0,kt=vt=et=null,Jc=!1,t)throw Error(G(300));return e}function sp(){var e=Ra!==0;return Ra=0,e}function an(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return kt===null?et.memoizedState=kt=e:kt=kt.next=e,kt}function $r(){if(vt===null){var e=et.alternate;e=e!==null?e.memoizedState:null}else e=vt.next;var t=kt===null?et.memoizedState:kt.next;if(t!==null)kt=t,vt=e;else{if(e===null)throw Error(G(310));vt=e,e={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},kt===null?et.memoizedState=kt=e:kt=kt.next=e}return kt}function Ma(e,t){return typeof t=="function"?t(e):t}function Dd(e){var t=$r(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var n=vt,i=n.baseQueue,s=r.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}n.baseQueue=i=s,r.pending=null}if(i!==null){s=i.next,n=n.baseState;var a=o=null,l=null,c=s;do{var d=c.lane;if((Hi&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var h={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=h,o=n):l=l.next=h,et.lanes|=d,Wi|=d}c=c.next}while(c!==null&&c!==s);l===null?o=n:l.next=a,Jr(n,t.memoizedState)||(ar=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=l,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do s=i.lane,et.lanes|=s,Wi|=s,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Bd(e){var t=$r(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,s=t.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);Jr(s,t.memoizedState)||(ar=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),r.lastRenderedState=s}return[s,n]}function t0(){}function r0(e,t){var r=et,n=$r(),i=t(),s=!Jr(n.memoizedState,i);if(s&&(n.memoizedState=i,ar=!0),n=n.queue,op(s0.bind(null,r,n,e),[e]),n.getSnapshot!==t||s||kt!==null&&kt.memoizedState.tag&1){if(r.flags|=2048,Pa(9,i0.bind(null,r,n,i,t),void 0,null),Mt===null)throw Error(G(349));Hi&30||n0(r,t,i)}return i}function n0(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=et.updateQueue,t===null?(t={lastEffect:null,stores:null},et.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function i0(e,t,r,n){t.value=r,t.getSnapshot=n,o0(t)&&a0(e)}function s0(e,t,r){return r(function(){o0(t)&&a0(e)})}function o0(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Jr(e,r)}catch{return!0}}function a0(e){var t=Ln(e,1);t!==null&&Gr(t,e,1,-1)}function jv(e){var t=an();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:e},t.queue=e,e=e.dispatch=_E.bind(null,et,e),[t.memoizedState,e]}function Pa(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=et.updateQueue,t===null?(t={lastEffect:null,stores:null},et.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function l0(){return $r().memoizedState}function hc(e,t,r,n){var i=an();et.flags|=e,i.memoizedState=Pa(1|t,r,void 0,n===void 0?null:n)}function ku(e,t,r,n){var i=$r();n=n===void 0?null:n;var s=void 0;if(vt!==null){var o=vt.memoizedState;if(s=o.destroy,n!==null&&np(n,o.deps)){i.memoizedState=Pa(t,r,s,n);return}}et.flags|=e,i.memoizedState=Pa(1|t,r,s,n)}function zv(e,t){return hc(8390656,8,e,t)}function op(e,t){return ku(2048,8,e,t)}function c0(e,t){return ku(4,2,e,t)}function u0(e,t){return ku(4,4,e,t)}function d0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function h0(e,t,r){return r=r!=null?r.concat([e]):null,ku(4,4,d0.bind(null,t,e),r)}function ap(){}function f0(e,t){var r=$r();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&np(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function m0(e,t){var r=$r();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&np(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function p0(e,t,r){return Hi&21?(Jr(r,t)||(r=Sw(),et.lanes|=r,Wi|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ar=!0),e.memoizedState=r)}function gE(e,t){var r=Ne;Ne=r!==0&&4>r?r:4,e(!0);var n=Nd.transition;Nd.transition={};try{e(!1),t()}finally{Ne=r,Nd.transition=n}}function g0(){return $r().memoizedState}function vE(e,t,r){var n=si(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},v0(e))_0(t,r);else if(r=Qw(e,t,r,n),r!==null){var i=Qt();Gr(r,e,n,i),y0(r,t,n)}}function _E(e,t,r){var n=si(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(v0(e))_0(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,Jr(a,o)){var l=t.interleaved;l===null?(i.next=i,Qm(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=Qw(e,t,i,n),r!==null&&(i=Qt(),Gr(r,e,n,i),y0(r,t,n))}}function v0(e){var t=e.alternate;return e===et||t!==null&&t===et}function _0(e,t){la=Jc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function y0(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,$m(e,r)}}var Qc={readContext:Or,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useInsertionEffect:zt,useLayoutEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useMutableSource:zt,useSyncExternalStore:zt,useId:zt,unstable_isNewReconciler:!1},yE={readContext:Or,useCallback:function(e,t){return an().memoizedState=[e,t===void 0?null:t],e},useContext:Or,useEffect:zv,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,hc(4194308,4,d0.bind(null,t,e),r)},useLayoutEffect:function(e,t){return hc(4194308,4,e,t)},useInsertionEffect:function(e,t){return hc(4,2,e,t)},useMemo:function(e,t){var r=an();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=an();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=vE.bind(null,et,e),[n.memoizedState,e]},useRef:function(e){var t=an();return e={current:e},t.memoizedState=e},useState:jv,useDebugValue:ap,useDeferredValue:function(e){return an().memoizedState=e},useTransition:function(){var e=jv(!1),t=e[0];return e=gE.bind(null,e[1]),an().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=et,i=an();if(Ge){if(r===void 0)throw Error(G(407));r=r()}else{if(r=t(),Mt===null)throw Error(G(349));Hi&30||n0(n,t,r)}i.memoizedState=r;var s={value:r,getSnapshot:t};return i.queue=s,zv(s0.bind(null,n,s,e),[e]),n.flags|=2048,Pa(9,i0.bind(null,n,s,r,t),void 0,null),r},useId:function(){var e=an(),t=Mt.identifierPrefix;if(Ge){var r=Tn,n=kn;r=(n&~(1<<32-Yr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ra++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=pE++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},SE={readContext:Or,useCallback:f0,useContext:Or,useEffect:op,useImperativeHandle:h0,useInsertionEffect:c0,useLayoutEffect:u0,useMemo:m0,useReducer:Dd,useRef:l0,useState:function(){return Dd(Ma)},useDebugValue:ap,useDeferredValue:function(e){var t=$r();return p0(t,vt.memoizedState,e)},useTransition:function(){var e=Dd(Ma)[0],t=$r().memoizedState;return[e,t]},useMutableSource:t0,useSyncExternalStore:r0,useId:g0,unstable_isNewReconciler:!1},wE={readContext:Or,useCallback:f0,useContext:Or,useEffect:op,useImperativeHandle:h0,useInsertionEffect:c0,useLayoutEffect:u0,useMemo:m0,useReducer:Bd,useRef:l0,useState:function(){return Bd(Ma)},useDebugValue:ap,useDeferredValue:function(e){var t=$r();return vt===null?t.memoizedState=e:p0(t,vt.memoizedState,e)},useTransition:function(){var e=Bd(Ma)[0],t=$r().memoizedState;return[e,t]},useMutableSource:t0,useSyncExternalStore:r0,useId:g0,unstable_isNewReconciler:!1};function Wr(e,t){if(e&&e.defaultProps){t=tt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function qh(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:tt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Tu={isMounted:function(e){return(e=e._reactInternals)?Zi(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Qt(),i=si(e),s=Rn(n,i);s.payload=t,r!=null&&(s.callback=r),t=ni(e,s,i),t!==null&&(Gr(t,e,i,n),uc(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Qt(),i=si(e),s=Rn(n,i);s.tag=1,s.payload=t,r!=null&&(s.callback=r),t=ni(e,s,i),t!==null&&(Gr(t,e,i,n),uc(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Qt(),n=si(e),i=Rn(r,n);i.tag=2,t!=null&&(i.callback=t),t=ni(e,i,n),t!==null&&(Gr(t,e,n,r),uc(t,e,n))}};function Fv(e,t,r,n,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,o):t.prototype&&t.prototype.isPureReactComponent?!Ca(r,n)||!Ca(i,s):!0}function S0(e,t,r){var n=!1,i=ui,s=t.contextType;return typeof s=="object"&&s!==null?s=Or(s):(i=ur(t)?zi:qt.current,n=t.contextTypes,s=(n=n!=null)?Js(e,i):ui),t=new t(r,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Tu,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Hv(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Tu.enqueueReplaceState(t,t.state,null)}function Yh(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},Zm(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Or(s):(s=ur(t)?zi:qt.current,i.context=Js(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(qh(e,t,s,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Tu.enqueueReplaceState(i,i.state,null),Gc(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function to(e,t){try{var r="",n=t;do r+=Gk(n),n=n.return;while(n);var i=r}catch(s){i=`
|
|
39
|
-
Error generating stack: `+s.message+`
|
|
40
|
-
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function Od(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Gh(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var bE=typeof WeakMap=="function"?WeakMap:Map;function w0(e,t,r){r=Rn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){eu||(eu=!0,of=n),Gh(e,t)},r}function b0(e,t,r){r=Rn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){Gh(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){Gh(e,t),typeof n!="function"&&(ii===null?ii=new Set([this]):ii.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function Wv(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new bE;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=BE.bind(null,e,t,r),t.then(e,e))}function Uv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Kv(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Rn(-1,1),t.tag=2,ni(r,t,1))),r.lanes|=1),e)}var CE=Nn.ReactCurrentOwner,ar=!1;function Jt(e,t,r,n){t.child=e===null?Jw(t,null,r,n):Zs(t,e.child,r,n)}function Vv(e,t,r,n,i){r=r.render;var s=t.ref;return Fs(t,i),n=ip(e,t,r,n,s,i),r=sp(),e!==null&&!ar?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,An(e,t,i)):(Ge&&r&&Vm(t),t.flags|=1,Jt(e,t,n,i),t.child)}function qv(e,t,r,n,i){if(e===null){var s=r.type;return typeof s=="function"&&!pp(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=s,C0(e,t,s,n,i)):(e=gc(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:Ca,r(o,n)&&e.ref===t.ref)return An(e,t,i)}return t.flags|=1,e=oi(s,n),e.ref=t.ref,e.return=t,t.child=e}function C0(e,t,r,n,i){if(e!==null){var s=e.memoizedProps;if(Ca(s,n)&&e.ref===t.ref)if(ar=!1,t.pendingProps=n=s,(e.lanes&i)!==0)e.flags&131072&&(ar=!0);else return t.lanes=e.lanes,An(e,t,i)}return Xh(e,t,r,n,i)}function x0(e,t,r){var n=t.pendingProps,i=n.children,s=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},je(Ns,_r),_r|=r;else{if(!(r&1073741824))return e=s!==null?s.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,je(Ns,_r),_r|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,je(Ns,_r),_r|=n}else s!==null?(n=s.baseLanes|r,t.memoizedState=null):n=r,je(Ns,_r),_r|=n;return Jt(e,t,i,r),t.child}function k0(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Xh(e,t,r,n,i){var s=ur(r)?zi:qt.current;return s=Js(t,s),Fs(t,i),r=ip(e,t,r,n,s,i),n=sp(),e!==null&&!ar?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,An(e,t,i)):(Ge&&n&&Vm(t),t.flags|=1,Jt(e,t,r,i),t.child)}function Yv(e,t,r,n,i){if(ur(r)){var s=!0;Uc(t)}else s=!1;if(Fs(t,i),t.stateNode===null)fc(e,t),S0(t,r,n),Yh(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=r.contextType;typeof c=="object"&&c!==null?c=Or(c):(c=ur(r)?zi:qt.current,c=Js(t,c));var d=r.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==c)&&Hv(t,o,n,c),Un=!1;var f=t.memoizedState;o.state=f,Gc(t,n,o,i),l=t.memoizedState,a!==n||f!==l||cr.current||Un?(typeof d=="function"&&(qh(t,r,d,n),l=t.memoizedState),(a=Un||Fv(t,r,a,n,f,l,c))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),o.props=n,o.state=l,o.context=c,n=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,Zw(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Wr(t.type,a),o.props=c,h=t.pendingProps,f=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=Or(l):(l=ur(r)?zi:qt.current,l=Js(t,l));var v=r.getDerivedStateFromProps;(d=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||f!==l)&&Hv(t,o,n,l),Un=!1,f=t.memoizedState,o.state=f,Gc(t,n,o,i);var m=t.memoizedState;a!==h||f!==m||cr.current||Un?(typeof v=="function"&&(qh(t,r,v,n),m=t.memoizedState),(c=Un||Fv(t,r,c,n,f,m,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=m),o.props=n,o.state=m,o.context=l,n=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),n=!1)}return Jh(e,t,r,n,s,i)}function Jh(e,t,r,n,i,s){k0(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&Av(t,r,!1),An(e,t,s);n=t.stateNode,CE.current=t;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Zs(t,e.child,null,s),t.child=Zs(t,null,a,s)):Jt(e,t,a,s),t.memoizedState=n.state,i&&Av(t,r,!0),t.child}function T0(e){var t=e.stateNode;t.pendingContext?Lv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Lv(e,t.context,!1),ep(e,t.containerInfo)}function Gv(e,t,r,n,i){return Qs(),Ym(i),t.flags|=256,Jt(e,t,r,n),t.child}var Qh={dehydrated:null,treeContext:null,retryLane:0};function Zh(e){return{baseLanes:e,cachePool:null,transitions:null}}function E0(e,t,r){var n=t.pendingProps,i=Ze.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),je(Ze,i&1),e===null)return Kh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,s?(n=t.mode,s=t.child,o={mode:"hidden",children:o},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Ru(o,n,0,null),e=$i(e,n,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Zh(r),t.memoizedState=Qh,e):lp(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return xE(e,t,o,n,a,i,r);if(s){s=n.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:n.children};return!(o&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=l,t.deletions=null):(n=oi(i,l),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=oi(a,s):(s=$i(s,o,r,null),s.flags|=2),s.return=t,n.return=t,n.sibling=s,t.child=n,n=s,s=t.child,o=e.child.memoizedState,o=o===null?Zh(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~r,t.memoizedState=Qh,n}return s=e.child,e=s.sibling,n=oi(s,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function lp(e,t){return t=Ru({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function jl(e,t,r,n){return n!==null&&Ym(n),Zs(t,e.child,null,r),e=lp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xE(e,t,r,n,i,s,o){if(r)return t.flags&256?(t.flags&=-257,n=Od(Error(G(422))),jl(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=n.fallback,i=t.mode,n=Ru({mode:"visible",children:n.children},i,0,null),s=$i(s,i,o,null),s.flags|=2,n.return=t,s.return=t,n.sibling=s,t.child=n,t.mode&1&&Zs(t,e.child,null,o),t.child.memoizedState=Zh(o),t.memoizedState=Qh,s);if(!(t.mode&1))return jl(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var a=n.dgst;return n=a,s=Error(G(419)),n=Od(s,n,void 0),jl(e,t,o,n)}if(a=(o&e.childLanes)!==0,ar||a){if(n=Mt,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Ln(e,i),Gr(n,e,i,-1))}return mp(),n=Od(Error(G(421))),jl(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=OE.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Sr=ri(i.nextSibling),wr=t,Ge=!0,Vr=null,e!==null&&(Rr[Mr++]=kn,Rr[Mr++]=Tn,Rr[Mr++]=Fi,kn=e.id,Tn=e.overflow,Fi=t),t=lp(t,n.children),t.flags|=4096,t)}function Xv(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Vh(e.return,t,r)}function $d(e,t,r,n,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function I0(e,t,r){var n=t.pendingProps,i=n.revealOrder,s=n.tail;if(Jt(e,t,n.children,r),n=Ze.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xv(e,r,t);else if(e.tag===19)Xv(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(je(Ze,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&Xc(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),$d(t,!1,i,r,s);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Xc(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}$d(t,!0,r,null,s);break;case"together":$d(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function fc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function An(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Wi|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,r=oi(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=oi(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function kE(e,t,r){switch(t.tag){case 3:T0(t),Qs();break;case 5:e0(t);break;case 1:ur(t.type)&&Uc(t);break;case 4:ep(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;je(qc,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(je(Ze,Ze.current&1),t.flags|=128,null):r&t.child.childLanes?E0(e,t,r):(je(Ze,Ze.current&1),e=An(e,t,r),e!==null?e.sibling:null);je(Ze,Ze.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return I0(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),je(Ze,Ze.current),n)break;return null;case 22:case 23:return t.lanes=0,x0(e,t,r)}return An(e,t,r)}var R0,ef,M0,P0;R0=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};ef=function(){};M0=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Ni(fn.current);var s=null;switch(r){case"input":i=bh(e,i),n=bh(e,n),s=[];break;case"select":i=tt({},i,{value:void 0}),n=tt({},n,{value:void 0}),s=[];break;case"textarea":i=kh(e,i),n=kh(e,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Hc)}Eh(r,n);var o;r=null;for(c in i)if(!n.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ga.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in n){var l=n[c];if(a=i!=null?i[c]:void 0,n.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(s||(s=[]),s.push(c,r)),r=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ga.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Fe("scroll",e),s||a===l||(s=[])):(s=s||[]).push(c,l))}r&&(s=s||[]).push("style",r);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};P0=function(e,t,r,n){r!==n&&(t.flags|=4)};function Do(e,t){if(!Ge)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function TE(e,t,r){var n=t.pendingProps;switch(qm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(t),null;case 1:return ur(t.type)&&Wc(),Ft(t),null;case 3:return n=t.stateNode,eo(),Ue(cr),Ue(qt),rp(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ol(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vr!==null&&(cf(Vr),Vr=null))),ef(e,t),Ft(t),null;case 5:tp(t);var i=Ni(Ia.current);if(r=t.type,e!==null&&t.stateNode!=null)M0(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(G(166));return Ft(t),null}if(e=Ni(fn.current),Ol(t)){n=t.stateNode,r=t.type;var s=t.memoizedProps;switch(n[cn]=t,n[Ta]=s,e=(t.mode&1)!==0,r){case"dialog":Fe("cancel",n),Fe("close",n);break;case"iframe":case"object":case"embed":Fe("load",n);break;case"video":case"audio":for(i=0;i<Go.length;i++)Fe(Go[i],n);break;case"source":Fe("error",n);break;case"img":case"image":case"link":Fe("error",n),Fe("load",n);break;case"details":Fe("toggle",n);break;case"input":sv(n,s),Fe("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},Fe("invalid",n);break;case"textarea":av(n,s),Fe("invalid",n)}Eh(r,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?n.textContent!==a&&(s.suppressHydrationWarning!==!0&&Bl(n.textContent,a,e),i=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Bl(n.textContent,a,e),i=["children",""+a]):ga.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Fe("scroll",n)}switch(r){case"input":Il(n),ov(n,s,!0);break;case"textarea":Il(n),lv(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=Hc)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=sw(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[cn]=t,e[Ta]=n,R0(e,t,!1,!1),t.stateNode=e;e:{switch(o=Ih(r,n),r){case"dialog":Fe("cancel",e),Fe("close",e),i=n;break;case"iframe":case"object":case"embed":Fe("load",e),i=n;break;case"video":case"audio":for(i=0;i<Go.length;i++)Fe(Go[i],e);i=n;break;case"source":Fe("error",e),i=n;break;case"img":case"image":case"link":Fe("error",e),Fe("load",e),i=n;break;case"details":Fe("toggle",e),i=n;break;case"input":sv(e,n),i=bh(e,n),Fe("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=tt({},n,{value:void 0}),Fe("invalid",e);break;case"textarea":av(e,n),i=kh(e,n),Fe("invalid",e);break;default:i=n}Eh(r,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?lw(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&ow(e,l)):s==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&va(e,l):typeof l=="number"&&va(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ga.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Fe("scroll",e):l!=null&&Lm(e,s,l,o))}switch(r){case"input":Il(e),ov(e,n,!1);break;case"textarea":Il(e),lv(e);break;case"option":n.value!=null&&e.setAttribute("value",""+ci(n.value));break;case"select":e.multiple=!!n.multiple,s=n.value,s!=null?Os(e,!!n.multiple,s,!1):n.defaultValue!=null&&Os(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Hc)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ft(t),null;case 6:if(e&&t.stateNode!=null)P0(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(G(166));if(r=Ni(Ia.current),Ni(fn.current),Ol(t)){if(n=t.stateNode,r=t.memoizedProps,n[cn]=t,(s=n.nodeValue!==r)&&(e=wr,e!==null))switch(e.tag){case 3:Bl(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Bl(n.nodeValue,r,(e.mode&1)!==0)}s&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[cn]=t,t.stateNode=n}return Ft(t),null;case 13:if(Ue(Ze),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ge&&Sr!==null&&t.mode&1&&!(t.flags&128))Gw(),Qs(),t.flags|=98560,s=!1;else if(s=Ol(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(G(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(G(317));s[cn]=t}else Qs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ft(t),s=!1}else Vr!==null&&(cf(Vr),Vr=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Ze.current&1?yt===0&&(yt=3):mp())),t.updateQueue!==null&&(t.flags|=4),Ft(t),null);case 4:return eo(),ef(e,t),e===null&&xa(t.stateNode.containerInfo),Ft(t),null;case 10:return Jm(t.type._context),Ft(t),null;case 17:return ur(t.type)&&Wc(),Ft(t),null;case 19:if(Ue(Ze),s=t.memoizedState,s===null)return Ft(t),null;if(n=(t.flags&128)!==0,o=s.rendering,o===null)if(n)Do(s,!1);else{if(yt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Xc(e),o!==null){for(t.flags|=128,Do(s,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)s=r,e=n,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return je(Ze,Ze.current&1|2),t.child}e=e.sibling}s.tail!==null&&at()>ro&&(t.flags|=128,n=!0,Do(s,!1),t.lanes=4194304)}else{if(!n)if(e=Xc(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Do(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ge)return Ft(t),null}else 2*at()-s.renderingStartTime>ro&&r!==1073741824&&(t.flags|=128,n=!0,Do(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(r=s.last,r!==null?r.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=at(),t.sibling=null,r=Ze.current,je(Ze,n?r&1|2:r&1),t):(Ft(t),null);case 22:case 23:return fp(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?_r&1073741824&&(Ft(t),t.subtreeFlags&6&&(t.flags|=8192)):Ft(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function EE(e,t){switch(qm(t),t.tag){case 1:return ur(t.type)&&Wc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return eo(),Ue(cr),Ue(qt),rp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return tp(t),null;case 13:if(Ue(Ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));Qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ue(Ze),null;case 4:return eo(),null;case 10:return Jm(t.type._context),null;case 22:case 23:return fp(),null;case 24:return null;default:return null}}var zl=!1,Wt=!1,IE=typeof WeakSet=="function"?WeakSet:Set,le=null;function As(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){nt(e,t,n)}else r.current=null}function tf(e,t,r){try{r()}catch(n){nt(e,t,n)}}var Jv=!1;function RE(e,t){if($h=jc,e=Bw(),Km(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,c=0,d=0,h=e,f=null;t:for(;;){for(var v;h!==r||i!==0&&h.nodeType!==3||(a=o+i),h!==s||n!==0&&h.nodeType!==3||(l=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(v=h.firstChild)!==null;)f=h,h=v;for(;;){if(h===e)break t;if(f===r&&++c===i&&(a=o),f===s&&++d===n&&(l=o),(v=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=v}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(jh={focusedElem:e,selectionRange:r},jc=!1,le=t;le!==null;)if(t=le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,le=e;else for(;le!==null;){t=le;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var S=m.memoizedProps,y=m.memoizedState,g=t.stateNode,_=g.getSnapshotBeforeUpdate(t.elementType===t.type?S:Wr(t.type,S),y);g.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(b){nt(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,le=e;break}le=t.return}return m=Jv,Jv=!1,m}function ca(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&tf(t,r,s)}i=i.next}while(i!==n)}}function Eu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function rf(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function L0(e){var t=e.alternate;t!==null&&(e.alternate=null,L0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[cn],delete t[Ta],delete t[Hh],delete t[dE],delete t[hE])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function A0(e){return e.tag===5||e.tag===3||e.tag===4}function Qv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||A0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nf(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Hc));else if(n!==4&&(e=e.child,e!==null))for(nf(e,t,r),e=e.sibling;e!==null;)nf(e,t,r),e=e.sibling}function sf(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(sf(e,t,r),e=e.sibling;e!==null;)sf(e,t,r),e=e.sibling}var At=null,Ur=!1;function jn(e,t,r){for(r=r.child;r!==null;)N0(e,t,r),r=r.sibling}function N0(e,t,r){if(hn&&typeof hn.onCommitFiberUnmount=="function")try{hn.onCommitFiberUnmount(yu,r)}catch{}switch(r.tag){case 5:Wt||As(r,t);case 6:var n=At,i=Ur;At=null,jn(e,t,r),At=n,Ur=i,At!==null&&(Ur?(e=At,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):At.removeChild(r.stateNode));break;case 18:At!==null&&(Ur?(e=At,r=r.stateNode,e.nodeType===8?Pd(e.parentNode,r):e.nodeType===1&&Pd(e,r),wa(e)):Pd(At,r.stateNode));break;case 4:n=At,i=Ur,At=r.stateNode.containerInfo,Ur=!0,jn(e,t,r),At=n,Ur=i;break;case 0:case 11:case 14:case 15:if(!Wt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&tf(r,t,o),i=i.next}while(i!==n)}jn(e,t,r);break;case 1:if(!Wt&&(As(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){nt(r,t,a)}jn(e,t,r);break;case 21:jn(e,t,r);break;case 22:r.mode&1?(Wt=(n=Wt)||r.memoizedState!==null,jn(e,t,r),Wt=n):jn(e,t,r);break;default:jn(e,t,r)}}function Zv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new IE),t.forEach(function(n){var i=$E.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Fr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:At=a.stateNode,Ur=!1;break e;case 3:At=a.stateNode.containerInfo,Ur=!0;break e;case 4:At=a.stateNode.containerInfo,Ur=!0;break e}a=a.return}if(At===null)throw Error(G(160));N0(s,o,i),At=null,Ur=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){nt(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)D0(t,e),t=t.sibling}function D0(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Fr(t,e),tn(e),n&4){try{ca(3,e,e.return),Eu(3,e)}catch(S){nt(e,e.return,S)}try{ca(5,e,e.return)}catch(S){nt(e,e.return,S)}}break;case 1:Fr(t,e),tn(e),n&512&&r!==null&&As(r,r.return);break;case 5:if(Fr(t,e),tn(e),n&512&&r!==null&&As(r,r.return),e.flags&32){var i=e.stateNode;try{va(i,"")}catch(S){nt(e,e.return,S)}}if(n&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=r!==null?r.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&nw(i,s),Ih(a,o);var c=Ih(a,s);for(o=0;o<l.length;o+=2){var d=l[o],h=l[o+1];d==="style"?lw(i,h):d==="dangerouslySetInnerHTML"?ow(i,h):d==="children"?va(i,h):Lm(i,d,h,c)}switch(a){case"input":Ch(i,s);break;case"textarea":iw(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var v=s.value;v!=null?Os(i,!!s.multiple,v,!1):f!==!!s.multiple&&(s.defaultValue!=null?Os(i,!!s.multiple,s.defaultValue,!0):Os(i,!!s.multiple,s.multiple?[]:"",!1))}i[Ta]=s}catch(S){nt(e,e.return,S)}}break;case 6:if(Fr(t,e),tn(e),n&4){if(e.stateNode===null)throw Error(G(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(S){nt(e,e.return,S)}}break;case 3:if(Fr(t,e),tn(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{wa(t.containerInfo)}catch(S){nt(e,e.return,S)}break;case 4:Fr(t,e),tn(e);break;case 13:Fr(t,e),tn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(dp=at())),n&4&&Zv(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(Wt=(c=Wt)||d,Fr(t,e),Wt=c):Fr(t,e),tn(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(le=e,d=e.child;d!==null;){for(h=le=d;le!==null;){switch(f=le,v=f.child,f.tag){case 0:case 11:case 14:case 15:ca(4,f,f.return);break;case 1:As(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){n=f,r=f.return;try{t=n,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(S){nt(n,r,S)}}break;case 5:As(f,f.return);break;case 22:if(f.memoizedState!==null){t_(h);continue}}v!==null?(v.return=f,le=v):t_(h)}d=d.sibling}e:for(d=null,h=e;;){if(h.tag===5){if(d===null){d=h;try{i=h.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=aw("display",o))}catch(S){nt(e,e.return,S)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(S){nt(e,e.return,S)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Fr(t,e),tn(e),n&4&&Zv(e);break;case 21:break;default:Fr(t,e),tn(e)}}function tn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(A0(r)){var n=r;break e}r=r.return}throw Error(G(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(va(i,""),n.flags&=-33);var s=Qv(e);sf(e,s,i);break;case 3:case 4:var o=n.stateNode.containerInfo,a=Qv(e);nf(e,a,o);break;default:throw Error(G(161))}}catch(l){nt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ME(e,t,r){le=e,B0(e)}function B0(e,t,r){for(var n=(e.mode&1)!==0;le!==null;){var i=le,s=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||zl;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Wt;a=zl;var c=Wt;if(zl=o,(Wt=l)&&!c)for(le=i;le!==null;)o=le,l=o.child,o.tag===22&&o.memoizedState!==null?r_(i):l!==null?(l.return=o,le=l):r_(i);for(;s!==null;)le=s,B0(s),s=s.sibling;le=i,zl=a,Wt=c}e_(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,le=s):e_(e)}}function e_(e){for(;le!==null;){var t=le;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Wt||Eu(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Wt)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:Wr(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&$v(t,s,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}$v(t,o,r)}break;case 5:var a=t.stateNode;if(r===null&&t.flags&4){r=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&wa(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}Wt||t.flags&512&&rf(t)}catch(f){nt(t,t.return,f)}}if(t===e){le=null;break}if(r=t.sibling,r!==null){r.return=t.return,le=r;break}le=t.return}}function t_(e){for(;le!==null;){var t=le;if(t===e){le=null;break}var r=t.sibling;if(r!==null){r.return=t.return,le=r;break}le=t.return}}function r_(e){for(;le!==null;){var t=le;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Eu(4,t)}catch(l){nt(t,r,l)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(l){nt(t,i,l)}}var s=t.return;try{rf(t)}catch(l){nt(t,s,l)}break;case 5:var o=t.return;try{rf(t)}catch(l){nt(t,o,l)}}}catch(l){nt(t,t.return,l)}if(t===e){le=null;break}var a=t.sibling;if(a!==null){a.return=t.return,le=a;break}le=t.return}}var PE=Math.ceil,Zc=Nn.ReactCurrentDispatcher,cp=Nn.ReactCurrentOwner,Dr=Nn.ReactCurrentBatchConfig,Pe=0,Mt=null,ht=null,Ot=0,_r=0,Ns=mi(0),yt=0,La=null,Wi=0,Iu=0,up=0,ua=null,or=null,dp=0,ro=1/0,Cn=null,eu=!1,of=null,ii=null,Fl=!1,Jn=null,tu=0,da=0,af=null,mc=-1,pc=0;function Qt(){return Pe&6?at():mc!==-1?mc:mc=at()}function si(e){return e.mode&1?Pe&2&&Ot!==0?Ot&-Ot:mE.transition!==null?(pc===0&&(pc=Sw()),pc):(e=Ne,e!==0||(e=window.event,e=e===void 0?16:Ew(e.type)),e):1}function Gr(e,t,r,n){if(50<da)throw da=0,af=null,Error(G(185));Ga(e,r,n),(!(Pe&2)||e!==Mt)&&(e===Mt&&(!(Pe&2)&&(Iu|=r),yt===4&&qn(e,Ot)),dr(e,n),r===1&&Pe===0&&!(t.mode&1)&&(ro=at()+500,xu&&pi()))}function dr(e,t){var r=e.callbackNode;mT(e,t);var n=$c(e,e===Mt?Ot:0);if(n===0)r!==null&&dv(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&dv(r),t===1)e.tag===0?fE(n_.bind(null,e)):Vw(n_.bind(null,e)),cE(function(){!(Pe&6)&&pi()}),r=null;else{switch(ww(n)){case 1:r=Om;break;case 4:r=_w;break;case 16:r=Oc;break;case 536870912:r=yw;break;default:r=Oc}r=U0(r,O0.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function O0(e,t){if(mc=-1,pc=0,Pe&6)throw Error(G(327));var r=e.callbackNode;if(Hs()&&e.callbackNode!==r)return null;var n=$c(e,e===Mt?Ot:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=ru(e,n);else{t=n;var i=Pe;Pe|=2;var s=j0();(Mt!==e||Ot!==t)&&(Cn=null,ro=at()+500,Oi(e,t));do try{NE();break}catch(a){$0(e,a)}while(!0);Xm(),Zc.current=s,Pe=i,ht!==null?t=0:(Mt=null,Ot=0,t=yt)}if(t!==0){if(t===2&&(i=Ah(e),i!==0&&(n=i,t=lf(e,i))),t===1)throw r=La,Oi(e,0),qn(e,n),dr(e,at()),r;if(t===6)qn(e,n);else{if(i=e.current.alternate,!(n&30)&&!LE(i)&&(t=ru(e,n),t===2&&(s=Ah(e),s!==0&&(n=s,t=lf(e,s))),t===1))throw r=La,Oi(e,0),qn(e,n),dr(e,at()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(G(345));case 2:Ei(e,or,Cn);break;case 3:if(qn(e,n),(n&130023424)===n&&(t=dp+500-at(),10<t)){if($c(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){Qt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Fh(Ei.bind(null,e,or,Cn),t);break}Ei(e,or,Cn);break;case 4:if(qn(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-Yr(n);s=1<<o,o=t[o],o>i&&(i=o),n&=~s}if(n=i,n=at()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*PE(n/1960))-n,10<n){e.timeoutHandle=Fh(Ei.bind(null,e,or,Cn),n);break}Ei(e,or,Cn);break;case 5:Ei(e,or,Cn);break;default:throw Error(G(329))}}}return dr(e,at()),e.callbackNode===r?O0.bind(null,e):null}function lf(e,t){var r=ua;return e.current.memoizedState.isDehydrated&&(Oi(e,t).flags|=256),e=ru(e,t),e!==2&&(t=or,or=r,t!==null&&cf(t)),e}function cf(e){or===null?or=e:or.push.apply(or,e)}function LE(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],s=i.getSnapshot;i=i.value;try{if(!Jr(s(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function qn(e,t){for(t&=~up,t&=~Iu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Yr(t),n=1<<r;e[r]=-1,t&=~n}}function n_(e){if(Pe&6)throw Error(G(327));Hs();var t=$c(e,0);if(!(t&1))return dr(e,at()),null;var r=ru(e,t);if(e.tag!==0&&r===2){var n=Ah(e);n!==0&&(t=n,r=lf(e,n))}if(r===1)throw r=La,Oi(e,0),qn(e,t),dr(e,at()),r;if(r===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ei(e,or,Cn),dr(e,at()),null}function hp(e,t){var r=Pe;Pe|=1;try{return e(t)}finally{Pe=r,Pe===0&&(ro=at()+500,xu&&pi())}}function Ui(e){Jn!==null&&Jn.tag===0&&!(Pe&6)&&Hs();var t=Pe;Pe|=1;var r=Dr.transition,n=Ne;try{if(Dr.transition=null,Ne=1,e)return e()}finally{Ne=n,Dr.transition=r,Pe=t,!(Pe&6)&&pi()}}function fp(){_r=Ns.current,Ue(Ns)}function Oi(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,lE(r)),ht!==null)for(r=ht.return;r!==null;){var n=r;switch(qm(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Wc();break;case 3:eo(),Ue(cr),Ue(qt),rp();break;case 5:tp(n);break;case 4:eo();break;case 13:Ue(Ze);break;case 19:Ue(Ze);break;case 10:Jm(n.type._context);break;case 22:case 23:fp()}r=r.return}if(Mt=e,ht=e=oi(e.current,null),Ot=_r=t,yt=0,La=null,up=Iu=Wi=0,or=ua=null,Ai!==null){for(t=0;t<Ai.length;t++)if(r=Ai[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,s=r.pending;if(s!==null){var o=s.next;s.next=i,n.next=o}r.pending=n}Ai=null}return e}function $0(e,t){do{var r=ht;try{if(Xm(),dc.current=Qc,Jc){for(var n=et.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Jc=!1}if(Hi=0,kt=vt=et=null,la=!1,Ra=0,cp.current=null,r===null||r.return===null){yt=1,La=t,ht=null;break}e:{var s=e,o=r.return,a=r,l=t;if(t=Ot,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var v=Uv(o);if(v!==null){v.flags&=-257,Kv(v,o,a,s,t),v.mode&1&&Wv(s,c,t),t=v,l=c;var m=t.updateQueue;if(m===null){var S=new Set;S.add(l),t.updateQueue=S}else m.add(l);break e}else{if(!(t&1)){Wv(s,c,t),mp();break e}l=Error(G(426))}}else if(Ge&&a.mode&1){var y=Uv(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),Kv(y,o,a,s,t),Ym(to(l,a));break e}}s=l=to(l,a),yt!==4&&(yt=2),ua===null?ua=[s]:ua.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var g=w0(s,l,t);Ov(s,g);break e;case 1:a=l;var _=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof _.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ii===null||!ii.has(w)))){s.flags|=65536,t&=-t,s.lanes|=t;var b=b0(s,a,t);Ov(s,b);break e}}s=s.return}while(s!==null)}F0(r)}catch(C){t=C,ht===r&&r!==null&&(ht=r=r.return);continue}break}while(!0)}function j0(){var e=Zc.current;return Zc.current=Qc,e===null?Qc:e}function mp(){(yt===0||yt===3||yt===2)&&(yt=4),Mt===null||!(Wi&268435455)&&!(Iu&268435455)||qn(Mt,Ot)}function ru(e,t){var r=Pe;Pe|=2;var n=j0();(Mt!==e||Ot!==t)&&(Cn=null,Oi(e,t));do try{AE();break}catch(i){$0(e,i)}while(!0);if(Xm(),Pe=r,Zc.current=n,ht!==null)throw Error(G(261));return Mt=null,Ot=0,yt}function AE(){for(;ht!==null;)z0(ht)}function NE(){for(;ht!==null&&!sT();)z0(ht)}function z0(e){var t=W0(e.alternate,e,_r);e.memoizedProps=e.pendingProps,t===null?F0(e):ht=t,cp.current=null}function F0(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=EE(r,t),r!==null){r.flags&=32767,ht=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{yt=6,ht=null;return}}else if(r=TE(r,t,_r),r!==null){ht=r;return}if(t=t.sibling,t!==null){ht=t;return}ht=t=e}while(t!==null);yt===0&&(yt=5)}function Ei(e,t,r){var n=Ne,i=Dr.transition;try{Dr.transition=null,Ne=1,DE(e,t,r,n)}finally{Dr.transition=i,Ne=n}return null}function DE(e,t,r,n){do Hs();while(Jn!==null);if(Pe&6)throw Error(G(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var s=r.lanes|r.childLanes;if(pT(e,s),e===Mt&&(ht=Mt=null,Ot=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Fl||(Fl=!0,U0(Oc,function(){return Hs(),null})),s=(r.flags&15990)!==0,r.subtreeFlags&15990||s){s=Dr.transition,Dr.transition=null;var o=Ne;Ne=1;var a=Pe;Pe|=4,cp.current=null,RE(e,r),D0(r,e),tE(jh),jc=!!$h,jh=$h=null,e.current=r,ME(r),oT(),Pe=a,Ne=o,Dr.transition=s}else e.current=r;if(Fl&&(Fl=!1,Jn=e,tu=i),s=e.pendingLanes,s===0&&(ii=null),cT(r.stateNode),dr(e,at()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(eu)throw eu=!1,e=of,of=null,e;return tu&1&&e.tag!==0&&Hs(),s=e.pendingLanes,s&1?e===af?da++:(da=0,af=e):da=0,pi(),null}function Hs(){if(Jn!==null){var e=ww(tu),t=Dr.transition,r=Ne;try{if(Dr.transition=null,Ne=16>e?16:e,Jn===null)var n=!1;else{if(e=Jn,Jn=null,tu=0,Pe&6)throw Error(G(331));var i=Pe;for(Pe|=4,le=e.current;le!==null;){var s=le,o=s.child;if(le.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(le=c;le!==null;){var d=le;switch(d.tag){case 0:case 11:case 15:ca(8,d,s)}var h=d.child;if(h!==null)h.return=d,le=h;else for(;le!==null;){d=le;var f=d.sibling,v=d.return;if(L0(d),d===c){le=null;break}if(f!==null){f.return=v,le=f;break}le=v}}}var m=s.alternate;if(m!==null){var S=m.child;if(S!==null){m.child=null;do{var y=S.sibling;S.sibling=null,S=y}while(S!==null)}}le=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,le=o;else e:for(;le!==null;){if(s=le,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ca(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,le=g;break e}le=s.return}}var _=e.current;for(le=_;le!==null;){o=le;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,le=w;else e:for(o=_;le!==null;){if(a=le,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Eu(9,a)}}catch(C){nt(a,a.return,C)}if(a===o){le=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,le=b;break e}le=a.return}}if(Pe=i,pi(),hn&&typeof hn.onPostCommitFiberRoot=="function")try{hn.onPostCommitFiberRoot(yu,e)}catch{}n=!0}return n}finally{Ne=r,Dr.transition=t}}return!1}function i_(e,t,r){t=to(r,t),t=w0(e,t,1),e=ni(e,t,1),t=Qt(),e!==null&&(Ga(e,1,t),dr(e,t))}function nt(e,t,r){if(e.tag===3)i_(e,e,r);else for(;t!==null;){if(t.tag===3){i_(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(ii===null||!ii.has(n))){e=to(r,e),e=b0(t,e,1),t=ni(t,e,1),e=Qt(),t!==null&&(Ga(t,1,e),dr(t,e));break}}t=t.return}}function BE(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Qt(),e.pingedLanes|=e.suspendedLanes&r,Mt===e&&(Ot&r)===r&&(yt===4||yt===3&&(Ot&130023424)===Ot&&500>at()-dp?Oi(e,0):up|=r),dr(e,t)}function H0(e,t){t===0&&(e.mode&1?(t=Pl,Pl<<=1,!(Pl&130023424)&&(Pl=4194304)):t=1);var r=Qt();e=Ln(e,t),e!==null&&(Ga(e,t,r),dr(e,r))}function OE(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),H0(e,r)}function $E(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(G(314))}n!==null&&n.delete(t),H0(e,r)}var W0;W0=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||cr.current)ar=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return ar=!1,kE(e,t,r);ar=!!(e.flags&131072)}else ar=!1,Ge&&t.flags&1048576&&qw(t,Vc,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;fc(e,t),e=t.pendingProps;var i=Js(t,qt.current);Fs(t,r),i=ip(null,t,n,e,i,r);var s=sp();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ur(n)?(s=!0,Uc(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Zm(t),i.updater=Tu,t.stateNode=i,i._reactInternals=t,Yh(t,n,e,r),t=Jh(null,t,n,!0,s,r)):(t.tag=0,Ge&&s&&Vm(t),Jt(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(fc(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=zE(n),e=Wr(n,e),i){case 0:t=Xh(null,t,n,e,r);break e;case 1:t=Yv(null,t,n,e,r);break e;case 11:t=Vv(null,t,n,e,r);break e;case 14:t=qv(null,t,n,Wr(n.type,e),r);break e}throw Error(G(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),Xh(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),Yv(e,t,n,i,r);case 3:e:{if(T0(t),e===null)throw Error(G(387));n=t.pendingProps,s=t.memoizedState,i=s.element,Zw(e,t),Gc(t,n,null,r);var o=t.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=to(Error(G(423)),t),t=Gv(e,t,n,r,i);break e}else if(n!==i){i=to(Error(G(424)),t),t=Gv(e,t,n,r,i);break e}else for(Sr=ri(t.stateNode.containerInfo.firstChild),wr=t,Ge=!0,Vr=null,r=Jw(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Qs(),n===i){t=An(e,t,r);break e}Jt(e,t,n,r)}t=t.child}return t;case 5:return e0(t),e===null&&Kh(t),n=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,zh(n,i)?o=null:s!==null&&zh(n,s)&&(t.flags|=32),k0(e,t),Jt(e,t,o,r),t.child;case 6:return e===null&&Kh(t),null;case 13:return E0(e,t,r);case 4:return ep(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Zs(t,null,n,r):Jt(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),Vv(e,t,n,i,r);case 7:return Jt(e,t,t.pendingProps,r),t.child;case 8:return Jt(e,t,t.pendingProps.children,r),t.child;case 12:return Jt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,je(qc,n._currentValue),n._currentValue=o,s!==null)if(Jr(s.value,o)){if(s.children===i.children&&!cr.current){t=An(e,t,r);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(s.tag===1){l=Rn(-1,r&-r),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),Vh(s.return,r,t),a.lanes|=r;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(G(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Vh(o,r,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Jt(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Fs(t,r),i=Or(i),n=n(i),t.flags|=1,Jt(e,t,n,r),t.child;case 14:return n=t.type,i=Wr(n,t.pendingProps),i=Wr(n.type,i),qv(e,t,n,i,r);case 15:return C0(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),fc(e,t),t.tag=1,ur(n)?(e=!0,Uc(t)):e=!1,Fs(t,r),S0(t,n,i),Yh(t,n,i,r),Jh(null,t,n,!0,e,r);case 19:return I0(e,t,r);case 22:return x0(e,t,r)}throw Error(G(156,t.tag))};function U0(e,t){return vw(e,t)}function jE(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lr(e,t,r,n){return new jE(e,t,r,n)}function pp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zE(e){if(typeof e=="function")return pp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Nm)return 11;if(e===Dm)return 14}return 2}function oi(e,t){var r=e.alternate;return r===null?(r=Lr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function gc(e,t,r,n,i,s){var o=2;if(n=e,typeof e=="function")pp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case xs:return $i(r.children,i,s,t);case Am:o=8,i|=8;break;case _h:return e=Lr(12,r,t,i|2),e.elementType=_h,e.lanes=s,e;case yh:return e=Lr(13,r,t,i),e.elementType=yh,e.lanes=s,e;case Sh:return e=Lr(19,r,t,i),e.elementType=Sh,e.lanes=s,e;case ew:return Ru(r,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case QS:o=10;break e;case ZS:o=9;break e;case Nm:o=11;break e;case Dm:o=14;break e;case Wn:o=16,n=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=Lr(o,r,t,i),t.elementType=e,t.type=n,t.lanes=s,t}function $i(e,t,r,n){return e=Lr(7,e,n,t),e.lanes=r,e}function Ru(e,t,r,n){return e=Lr(22,e,n,t),e.elementType=ew,e.lanes=r,e.stateNode={isHidden:!1},e}function jd(e,t,r){return e=Lr(6,e,null,t),e.lanes=r,e}function zd(e,t,r){return t=Lr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function FE(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sd(0),this.expirationTimes=Sd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sd(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function gp(e,t,r,n,i,s,o,a,l){return e=new FE(e,t,r,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Lr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zm(s),e}function HE(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Cs,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function K0(e){if(!e)return ui;e=e._reactInternals;e:{if(Zi(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ur(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var r=e.type;if(ur(r))return Kw(e,r,t)}return t}function V0(e,t,r,n,i,s,o,a,l){return e=gp(r,n,!0,e,i,s,o,a,l),e.context=K0(null),r=e.current,n=Qt(),i=si(r),s=Rn(n,i),s.callback=t??null,ni(r,s,i),e.current.lanes=i,Ga(e,i,n),dr(e,n),e}function Mu(e,t,r,n){var i=t.current,s=Qt(),o=si(i);return r=K0(r),t.context===null?t.context=r:t.pendingContext=r,t=Rn(s,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=ni(i,t,o),e!==null&&(Gr(e,i,o,s),uc(e,i,o)),o}function nu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function s_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function vp(e,t){s_(e,t),(e=e.alternate)&&s_(e,t)}function WE(){return null}var q0=typeof reportError=="function"?reportError:function(e){console.error(e)};function _p(e){this._internalRoot=e}Pu.prototype.render=_p.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));Mu(e,t,null,null)};Pu.prototype.unmount=_p.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ui(function(){Mu(null,e,null,null)}),t[Pn]=null}};function Pu(e){this._internalRoot=e}Pu.prototype.unstable_scheduleHydration=function(e){if(e){var t=xw();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Vn.length&&t!==0&&t<Vn[r].priority;r++);Vn.splice(r,0,e),r===0&&Tw(e)}};function yp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Lu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function o_(){}function UE(e,t,r,n,i){if(i){if(typeof n=="function"){var s=n;n=function(){var c=nu(o);s.call(c)}}var o=V0(t,n,e,0,null,!1,!1,"",o_);return e._reactRootContainer=o,e[Pn]=o.current,xa(e.nodeType===8?e.parentNode:e),Ui(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var a=n;n=function(){var c=nu(l);a.call(c)}}var l=gp(e,0,!1,null,null,!1,!1,"",o_);return e._reactRootContainer=l,e[Pn]=l.current,xa(e.nodeType===8?e.parentNode:e),Ui(function(){Mu(t,l,r,n)}),l}function Au(e,t,r,n,i){var s=r._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=nu(o);a.call(l)}}Mu(t,o,e,i)}else o=UE(r,t,e,i,n);return nu(o)}bw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Yo(t.pendingLanes);r!==0&&($m(t,r|1),dr(t,at()),!(Pe&6)&&(ro=at()+500,pi()))}break;case 13:Ui(function(){var n=Ln(e,1);if(n!==null){var i=Qt();Gr(n,e,1,i)}}),vp(e,1)}};jm=function(e){if(e.tag===13){var t=Ln(e,134217728);if(t!==null){var r=Qt();Gr(t,e,134217728,r)}vp(e,134217728)}};Cw=function(e){if(e.tag===13){var t=si(e),r=Ln(e,t);if(r!==null){var n=Qt();Gr(r,e,t,n)}vp(e,t)}};xw=function(){return Ne};kw=function(e,t){var r=Ne;try{return Ne=e,t()}finally{Ne=r}};Mh=function(e,t,r){switch(t){case"input":if(Ch(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=Cu(n);if(!i)throw Error(G(90));rw(n),Ch(n,i)}}}break;case"textarea":iw(e,r);break;case"select":t=r.value,t!=null&&Os(e,!!r.multiple,t,!1)}};dw=hp;hw=Ui;var KE={usingClientEntryPoint:!1,Events:[Ja,Is,Cu,cw,uw,hp]},Bo={findFiberByHostInstance:Li,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},VE={bundleType:Bo.bundleType,version:Bo.version,rendererPackageName:Bo.rendererPackageName,rendererConfig:Bo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Nn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=pw(e),e===null?null:e.stateNode},findFiberByHostInstance:Bo.findFiberByHostInstance||WE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hl.isDisabled&&Hl.supportsFiber)try{yu=Hl.inject(VE),hn=Hl}catch{}}xr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=KE;xr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!yp(t))throw Error(G(200));return HE(e,t,null,r)};xr.createRoot=function(e,t){if(!yp(e))throw Error(G(299));var r=!1,n="",i=q0;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=gp(e,1,!1,null,null,r,!1,n,i),e[Pn]=t.current,xa(e.nodeType===8?e.parentNode:e),new _p(t)};xr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=pw(t),e=e===null?null:e.stateNode,e};xr.flushSync=function(e){return Ui(e)};xr.hydrate=function(e,t,r){if(!Lu(t))throw Error(G(200));return Au(null,e,t,!0,r)};xr.hydrateRoot=function(e,t,r){if(!yp(e))throw Error(G(405));var n=r!=null&&r.hydratedSources||null,i=!1,s="",o=q0;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(s=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=V0(t,null,e,1,r??null,i,!1,s,o),e[Pn]=t.current,xa(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Pu(t)};xr.render=function(e,t,r){if(!Lu(t))throw Error(G(200));return Au(null,e,t,!1,r)};xr.unmountComponentAtNode=function(e){if(!Lu(e))throw Error(G(40));return e._reactRootContainer?(Ui(function(){Au(null,null,e,!1,function(){e._reactRootContainer=null,e[Pn]=null})}),!0):!1};xr.unstable_batchedUpdates=hp;xr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Lu(r))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return Au(e,t,r,!1,n)};xr.version="18.3.1-next-f1338f8080-20240426";function Y0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Y0)}catch(e){console.error(e)}}Y0(),YS.exports=xr;var G0=YS.exports;const qE=km(G0);var a_=G0;gh.createRoot=a_.createRoot,gh.hydrateRoot=a_.hydrateRoot;async function X0(e,t){const r=await fetch(e,{credentials:"same-origin",...t??{}}),n=await r.json();return{res:r,data:n}}async function YE(){const{res:e,data:t}=await X0("/api/auth/bootstrap-admin/status");if(!e.ok||!(t!=null&&t.ok))throw new Error(t!=null&&t.details?String(t.details):`HTTP ${e.status}`);const r=t;return{adminExists:!!r.adminExists,isDefaultPassword:!!r.isDefaultPassword,requiresSetup:!!r.requiresSetup}}async function GE(e){const t=String(e.username??""),r=String(e.password??""),{res:n,data:i}=await X0("/api/auth/bootstrap-admin/setup",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:t,password:r})});if(!n.ok||!(i!=null&&i.ok)){const s=i!=null&&i.details?String(i.details):i!=null&&i.error?String(i.error):`HTTP ${n.status}`;throw new Error(s)}}const XE=["zh-CN","en-US"],J0="codex.web.locale";function JE(e){return typeof e=="string"&&XE.includes(e)}function Sp(e){const t=String(e??"").trim();return t?t.toLowerCase()==="zh"||t.toLowerCase().startsWith("zh-")?"zh-CN":t.toLowerCase()==="en"||t.toLowerCase().startsWith("en-")?"en-US":JE(t)?t:null:null}function QE(){try{return Sp(window.localStorage.getItem(J0))}catch{return null}}function ZE(e){try{window.localStorage.setItem(J0,e)}catch{}}function eI(){if(typeof window>"u")return"zh-CN";const e=Array.isArray(window.navigator.languages)&&window.navigator.languages.length?window.navigator.languages:[window.navigator.language];for(const t of e){const r=Sp(t);if(r)return r}return"zh-CN"}function Q0(){return QE()??eI()}const tI={"common.unknown":"unknown","common.close":"关闭","common.expand":"展开","common.collapse":"收起","common.loading":"加载中…","common.default":"默认","common.on":"开","common.off":"关","common.copy":"复制","common.copied":"已复制","common.download":"下载","common.remove":"移除","common.cancel":"取消","common.submit":"提交","app.submitTimeoutReason":"发送超时:{seconds} 秒内未收到服务端确认","app.error.workspaceUnauthorized":"当前账号无权限使用该工作区:{workspace}","app.error.archiveFailed":"archive 失败:{error}","app.error.authExpired":"登录已失效,请重新登录。","app.auth.checkingStatus":"正在检查登录状态…","attachment.error.tooLarge":"附件过大:{sizeMb}MB(默认限制:100MB,可用 CODEX_WEB_MAX_UPLOAD_BYTES 调整)","attachment.error.uploadFailed":"上传附件失败:{error}","attachment.error.uploadResponseIncomplete":"上传响应不完整","language.current":"语言:{locale}","language.zh-CN":"中文","language.en-US":"English","language.switch":"切换语言","login.title":"登录","login.backend":"后端:{status}","login.backend.online":"在线","login.backend.offline":"离线","login.backend.checking":"检测中","login.toggleTheme":"切换主题","login.init.title":"首次初始化(推荐)","login.init.hint":"检测到管理员尚未完成初始化或仍存在默认口令账号,建议立即设置管理员账号和新密码(至少 8 位)。","login.init.username":"管理员账号","login.init.newPassword":"新密码","login.init.confirmPassword":"确认新密码","login.init.submit":"设置并登录","login.init.submitting":"设置中…","login.init.passwordMismatch":"两次输入的密码不一致。","login.init.loadingStatus":"正在读取管理员初始化状态…","login.username":"账号","login.password":"密码","login.submit":"登录","login.submitting":"登录中…","login.checking":"检查中…","login.error.invalidCredentials":"账号或密码错误。","login.error.loginFailed":"登录失败:{error}","login.error.adminInitStatusFailed":"无法读取管理员初始化状态:{error}","login.error.setupFailed":"设置失败:{error}","main.update.available":"检测到新版本,刷新后可使用最新界面。","main.update.reloadNow":"立即刷新","main.update.later":"稍后","main.sidebar.open":"打开侧栏","main.sidebar.close":"关闭侧栏","main.menu":"菜单","main.close":"关闭","main.thread.title":"Thread: {id}","main.thread.none":"未选择线程","main.chat.refresh.button":"刷新聊天","main.chat.refresh":"刷新当前线程聊天消息","main.changes.button":"文件变更","main.changes.noThread":"请先打开一个线程","main.changes.none":"暂无文件变更","main.changes.view":"查看本线程的文件变更列表","main.contextUsage.withValue":"上下文使用率:{value}","main.contextUsage.noData":"上下文使用率:暂无数据","main.placeholder.newThread":"输入 /new 新建线程…","main.placeholder.connecting":"连接中…","main.placeholder.busy":"Codex 正在运行,请等待…","main.placeholder.typeMessage":"输入消息…","main.overlay.chatRefreshing":"聊天刷新中…","main.overlay.threadSwitching":"切换会话中…","main.overlay.uploading":"上传中…","sidebar.aria.threads":"线程侧栏","sidebar.projectPath.none":"未选择项目路径","sidebar.collapse":"收起侧栏","sidebar.newThread":"新线程","sidebar.settings.toggle":"切换设置面板","sidebar.settings.show":"设置","sidebar.settings.hide":"隐藏设置","sidebar.refresh":"刷新","sidebar.logout":"退出登录","sidebar.logoutWithUser":"退出登录({user})","sidebar.users":"用户管理","sidebar.users.open":"打开用户管理","sidebar.theme":"主题:{theme}","sidebar.theme.toggle":"切换主题","sidebar.accent":"强调色","sidebar.accent.placeholder":"rgb(47,115,214) 或 #2f73d6","sidebar.accent.textInput":"强调色文本输入","sidebar.accent.picker":"强调色选择器","sidebar.accent.reset":"重置强调色","sidebar.background":"背景色","sidebar.background.placeholder":"rgb(255,255,255) 或 #ffffff","sidebar.background.textInput":"背景色文本输入","sidebar.background.picker":"背景色选择器","sidebar.background.reset":"重置背景色","sidebar.compact":"紧凑模式:{state}","sidebar.threads.loading":"加载会话中...","sidebar.thread.open":"打开线程 {preview}","sidebar.thread.pending":"需要输入/授权","sidebar.thread.running":"运行中{suffix}","sidebar.thread.archiveConfirm":"确认归档「{preview}」吗?","sidebar.thread.archive":"归档线程","sidebar.thread.archiving":"归档中","sidebar.thread.archiveAria":"归档 {preview}","sidebar.thread.archivingAria":"归档中 {preview}","workspace.add":"添加工作区","workspace.aria.nav":"工作区","workspace.aria.list":"工作区列表","composer.toolbar":"输入工具栏","composer.toolbarRight":"输入工具栏右侧","composer.quickTokens":"快速输入","composer.insertSlash":"插入 /","composer.insertSlashTitle":"斜杠命令(相当于在输入框输入 /)","composer.insertSkill":"插入 $","composer.insertSkillTitle":"技能(相当于在输入框输入 $)","composer.menu.slash":"斜杠命令","composer.menu.skills":"技能","composer.placeholder.openThread":"请先打开线程后再输入…","composer.placeholder.typeMessage":"输入消息…","composer.send":"发送","composer.stop":"停止","composer.plan.on":"Plan 已开启","composer.plan.off":"Plan 已关闭","composer.plan.title.on":"当前:Plan 协作模式(持续生效;用 /default 或再点一次 Plan 退出)","composer.plan.title.off":"当前:默认协作模式(点击启用 Plan;用 /default 退出)","composer.model.title.selected":"当前模型:{model}(点击切换;/model 可手动设置)","composer.model.title.unselected":"当前模型:未选择(点击切换;/model 可手动设置)","composer.model.aria":"模型:{model}","composer.reasoning.aria":"推理强度:{effort}","composer.reasoning.title.withModel":"当前推理强度:{effort}(模型:{model})","composer.reasoning.title.noModel":"当前推理强度:{effort}","composer.attachment.needThread":"请先打开线程(/new)","composer.attachment.uploading":"上传中…","composer.attachment.upload":"上传附件(可多选)","composer.attachment.uploadingAria":"附件上传中","composer.attachment.addAria":"添加附件","composer.attachment.download":"下载","composer.attachment.pathWarning":"注意:路径可读性不确定","composer.attachment.pathWarningTitle":"上传目录可能不在 CODEX_CWD 下,Codex 可能无法读取该路径。","composer.attachment.remove":"移除附件","composer.attachments.region":"附件","composer.attachments.pendingList":"待上传附件","composer.attachments.item":"已附加文件","chat.role.reasoning":"思考摘要","chat.delivery.pending":"发送中","chat.delivery.failed":"发送失败","chat.delivery.failedWithReason":"发送失败:{reason}","chat.delivery.sent":"已发送","chat.fold.expandTitle":"展开({lines}行 / {chars}字)","chat.fold.collapseTitle":"收起","chat.fold.expand":"展开","chat.fold.collapse":"收起","chat.copyMessage":"复制消息","chat.plan.skip":"暂不执行","chat.plan.skipTitle":"继续完善计划(仍保持 Plan 模式)","chat.plan.execute":"执行","chat.plan.executeTitle":"退出 Plan 并开始按计划执行","chat.plan.executeDisabledTitle":"当前不可执行(连接/线程状态不允许)","chat.systemToolCall.streaming":"进行中...","chat.attachments.summary.system":"System {count}","chat.attachments.summary.reasoning":"思考摘要 {count}","chat.attachments.summary.default":"System/思考摘要","chat.attachments.aria":"system 与思考摘要附件","todo.status.completed":"完成","todo.status.inProgress":"进行中","todo.status.pending":"待办","todo.summary.none":"暂无 TODO。","todo.summary.totalRemaining":"共 {total} 步 · 剩余 {remaining}{inProgressSuffix}","todo.summary.inProgressSuffix":" · 进行中 {inProgress}","todo.summary.inline.inProgress":"进行中","todo.summary.inline.noneInProgress":"暂无进行中任务","todo.title":"TODO 列表","todo.inline.expandOthers":"展开其他","todo.inline.collapse":"收起","todo.meta.thread":"Thread: {thread}","todo.meta.updated":"更新于 {updatedAt}","todo.meta.threadUpdated":"Thread: {thread} · 更新于 {updatedAt}","approval.role.needInput":"需要输入","approval.role.needApproval":"需要授权","approval.cancel":"关闭","approval.input.other":"输入其它…","approval.submitAnswers":"提交","approval.submitAnswersTitle":"提交所选答案","approval.options":"审批选项","approval.nextOption":"下一个选项({index}/{total})","approval.nextOptionTitle":"切换下一个选项","approval.details":"查看请求详情","approval.pendingFileChanges":"待审批的文件变更","approval.choice.approve":"允许","approval.choice.approveDesc":"允许本次操作。","approval.choice.approveSession":"本会话允许","approval.choice.approveSessionDesc":"在当前会话内允许同类操作。","approval.choice.deny":"拒绝","approval.choice.denyDesc":"拒绝本次操作。","approval.choice.abort":"中止","approval.choice.abortDesc":"取消并中止当前任务。","approval.choice.accept":"允许","approval.choice.acceptCommandDesc":"允许本次命令执行。","approval.choice.acceptSession":"本会话允许","approval.choice.acceptSessionCommandDesc":"本会话内自动允许同类命令。","approval.choice.acceptWithRule":"允许并保存规则","approval.choice.acceptWithRuleDesc":"允许并写入一条规则,减少后续打断。","approval.choice.decline":"拒绝","approval.choice.declineCommandDesc":"拒绝本次命令执行。","approval.choice.cancel":"取消并中断","approval.choice.cancelDesc":"取消并中断当前任务。","approval.choice.acceptFileDesc":"允许应用这些文件变更。","approval.choice.acceptSessionFileDesc":"本会话内自动允许同类文件变更。","approval.choice.declineFileDesc":"拒绝这些文件变更。","approval.choice.acceptContinueDesc":"允许继续。","approval.choice.declineContinueDesc":"拒绝继续。","pending.method.choice":"选择题","notice.choiceRequired":"需要选择题处理","notice.approvalRequired":"需要审批处理","notice.sessionCompleted":"会话执行已完成","notice.jump":"跳转","notice.jumpTitle":"跳转到待处理卡片","notice.openThread":"打开会话","notice.jumpBackReady":"已完成跳转,可快速回到刚才会话","notice.jumpBack":"回跳","notice.jumpBackTitle":"回到刚才会话","notice.dismiss":"忽略","slash.help.title":"斜杠命令(输入“/”可补全):","slash.help.escapeSlash":"提示:发送以“/”开头的普通文本请用“//”转义,例如:`//root/code` 会发送为 `/root/code`。","slash.help.escapeDollar":"提示:发送以“$”开头的普通文本请用“$$”转义,例如:`$$PATH` 会发送为 `$PATH`。","slash.command.help":"显示帮助与命令列表","slash.command.plan":"切换到 Plan 协作模式(持续生效,直到 /default)","slash.command.default":"切回默认协作模式(清除 Plan)","slash.command.workspace":"切换默认工作区(用于新建线程)","slash.command.model":"选择模型与推理强度","slash.command.permissions":"设置权限/沙箱(对齐 CLI 的 /permissions)","slash.command.experimental":"切换实验特性","slash.command.skills":"管理技能开关并插入 $skill","slash.command.review":"让 Codex review 当前变更","slash.command.rename":"重命名当前线程","slash.command.new":"新建线程","slash.command.resume":"打开一个已有线程","slash.command.compact":"压缩当前线程上下文(compact)","slash.command.fork":"Fork 当前线程到新线程","slash.command.archive":"归档当前线程","slash.command.unarchive":"取消归档当前线程","slash.command.rollback":"回滚线程历史(不回滚本地文件)","slash.error.needThread":"请先打开线程(可输入 /new 新建线程,或 /resume <threadId> 打开已有线程)","slash.plan.enableFailed":"启用 /plan 失败:collaborationMode 预设未提供 model,且当前未选择 model(请先 /model 选一个)。","slash.plan.enabled":"已切换到 Plan 协作模式(持续生效;用 /default 退出)。","slash.plan.default":"已切回默认协作模式。","slash.rename.usage":"用法:/rename <新名字>","slash.rename.cleared":"已清除当前线程的本地重命名。","slash.rename.failed":"设置线程名失败:{error}","slash.rename.succeeded":"已重命名当前线程为:{name}","slash.compact.requested":"已请求 compact:开始压缩线程上下文…","slash.compact.failed":"compact 启动失败:{error}","slash.fork.running":"正在 fork 当前线程…","slash.fork.successNoId":"fork 成功,但未返回 threadId;请刷新会话列表或稍后重试。","slash.fork.failed":"fork 失败:{error}","slash.archive.running":"正在归档当前线程…","slash.unarchive.running":"正在取消归档当前线程…","slash.archive.done":"已归档当前线程。","slash.unarchive.done":"已取消归档当前线程。","slash.command.failed":"{cmd} 失败:{error}","slash.rollback.usage":"用法:/rollback <numTurns?>(例如:/rollback 1)","slash.rollback.running":"正在回滚线程历史(numTurns={numTurns})…","slash.rollback.done":"回滚已完成:注意这不会自动回滚本地文件变更。","slash.rollback.failed":"rollback 失败:{error}","slash.review.successNoId":"review 已启动,但未返回 reviewThreadId;请刷新会话列表或稍后重试。","slash.review.failed":"启动 review 失败:{error}"},rI={"common.unknown":"unknown","common.close":"Close","common.expand":"Expand","common.collapse":"Collapse","common.loading":"Loading...","common.default":"Default","common.on":"On","common.off":"Off","common.copy":"Copy","common.copied":"Copied","common.download":"Download","common.remove":"Remove","common.cancel":"Cancel","common.submit":"Submit","app.submitTimeoutReason":"Send timeout: no server ack within {seconds} seconds","app.error.workspaceUnauthorized":"Current account has no permission for workspace: {workspace}","app.error.archiveFailed":"Archive failed: {error}","app.error.authExpired":"Login expired. Please sign in again.","app.auth.checkingStatus":"Checking login status...","attachment.error.tooLarge":"Attachment too large: {sizeMb}MB (default limit: 100MB, configurable via CODEX_WEB_MAX_UPLOAD_BYTES)","attachment.error.uploadFailed":"Attachment upload failed: {error}","attachment.error.uploadResponseIncomplete":"Upload response is incomplete","language.current":"Language: {locale}","language.zh-CN":"Chinese","language.en-US":"English","language.switch":"Switch language","login.title":"Sign in","login.backend":"Backend: {status}","login.backend.online":"Online","login.backend.offline":"Offline","login.backend.checking":"Checking","login.toggleTheme":"Toggle theme","login.init.title":"First-time setup (Recommended)","login.init.hint":"Admin initialization is incomplete or a default-password admin still exists. Set an admin username and a new password now (at least 8 characters).","login.init.username":"Admin username","login.init.newPassword":"New password","login.init.confirmPassword":"Confirm new password","login.init.submit":"Set and sign in","login.init.submitting":"Setting...","login.init.passwordMismatch":"Passwords do not match.","login.init.loadingStatus":"Loading admin initialization status...","login.username":"Username","login.password":"Password","login.submit":"Sign in","login.submitting":"Signing in...","login.checking":"Checking...","login.error.invalidCredentials":"Invalid username or password.","login.error.loginFailed":"Login failed: {error}","login.error.adminInitStatusFailed":"Failed to read admin initialization status: {error}","login.error.setupFailed":"Setup failed: {error}","main.update.available":"A new web UI version is available. Refresh to use the latest UI.","main.update.reloadNow":"Refresh now","main.update.later":"Later","main.sidebar.open":"Open sidebar","main.sidebar.close":"Close sidebar","main.menu":"Menu","main.close":"Close","main.thread.title":"Thread: {id}","main.thread.none":"No thread selected","main.chat.refresh.button":"Refresh chat","main.chat.refresh":"Refresh current thread chat messages","main.changes.button":"File changes","main.changes.noThread":"Open a thread first","main.changes.none":"No file changes","main.changes.view":"View file changes in this thread","main.contextUsage.withValue":"Context usage: {value}","main.contextUsage.noData":"Context usage: no data","main.placeholder.newThread":"Type /new to create a thread...","main.placeholder.connecting":"Connecting...","main.placeholder.busy":"Codex is running. Please wait...","main.placeholder.typeMessage":"Type a message...","main.overlay.chatRefreshing":"Refreshing chat...","main.overlay.threadSwitching":"Switching thread...","main.overlay.uploading":"Uploading...","sidebar.aria.threads":"Threads sidebar","sidebar.projectPath.none":"No workspace selected","sidebar.collapse":"Collapse sidebar","sidebar.newThread":"New thread","sidebar.settings.toggle":"Toggle settings","sidebar.settings.show":"Settings","sidebar.settings.hide":"Hide settings","sidebar.refresh":"Refresh","sidebar.logout":"Logout","sidebar.logoutWithUser":"Logout ({user})","sidebar.users":"Users","sidebar.users.open":"Open admin user manager","sidebar.theme":"Theme: {theme}","sidebar.theme.toggle":"Toggle theme","sidebar.accent":"Accent","sidebar.accent.placeholder":"rgb(47,115,214) or #2f73d6","sidebar.accent.textInput":"Accent color text input","sidebar.accent.picker":"Accent color picker","sidebar.accent.reset":"Reset accent color","sidebar.background":"Background","sidebar.background.placeholder":"rgb(255,255,255) or #ffffff","sidebar.background.textInput":"Background color text input","sidebar.background.picker":"Background color picker","sidebar.background.reset":"Reset background color","sidebar.compact":"Compact: {state}","sidebar.threads.loading":"Loading threads...","sidebar.thread.open":"Open thread {preview}","sidebar.thread.pending":"Input/approval required","sidebar.thread.running":"Running{suffix}","sidebar.thread.archiveConfirm":'Archive "{preview}"?',"sidebar.thread.archive":"Archive thread","sidebar.thread.archiving":"Archiving","sidebar.thread.archiveAria":"Archive {preview}","sidebar.thread.archivingAria":"Archiving {preview}","workspace.add":"Add workspace","workspace.aria.nav":"Workspaces","workspace.aria.list":"Workspaces list","composer.toolbar":"Composer toolbar","composer.toolbarRight":"Composer toolbar right","composer.quickTokens":"Composer quick tokens","composer.insertSlash":"Insert /","composer.insertSlashTitle":"Slash command (same as typing /)","composer.insertSkill":"Insert $","composer.insertSkillTitle":"Skill (same as typing $)","composer.menu.slash":"slash commands","composer.menu.skills":"skills","composer.placeholder.openThread":"Open a thread before typing...","composer.placeholder.typeMessage":"Type a message...","composer.send":"Send","composer.stop":"Stop","composer.plan.on":"Plan is on","composer.plan.off":"Plan is off","composer.plan.title.on":"Current: Plan collaboration mode (persists; use /default or click Plan again to exit)","composer.plan.title.off":"Current: Default collaboration mode (click to enable Plan; use /default to exit)","composer.model.title.selected":"Current model: {model} (click to switch; /model to set manually)","composer.model.title.unselected":"Current model: not selected (click to switch; /model to set manually)","composer.model.aria":"Model: {model}","composer.reasoning.aria":"Reasoning effort: {effort}","composer.reasoning.title.withModel":"Current reasoning effort: {effort} (model: {model})","composer.reasoning.title.noModel":"Current reasoning effort: {effort}","composer.attachment.needThread":"Open a thread first (/new)","composer.attachment.uploading":"Uploading...","composer.attachment.upload":"Upload attachments (multi-select)","composer.attachment.uploadingAria":"Uploading attachment","composer.attachment.addAria":"Add attachment","composer.attachment.download":"Download","composer.attachment.pathWarning":"Warning: path readability is uncertain","composer.attachment.pathWarningTitle":"Upload path may be outside CODEX_CWD; Codex may not be able to read it.","composer.attachment.remove":"Remove attachment","composer.attachments.region":"Attachments","composer.attachments.pendingList":"Pending attachments","composer.attachments.item":"Attached file","chat.role.reasoning":"Reasoning","chat.delivery.pending":"Sending","chat.delivery.failed":"Send failed","chat.delivery.failedWithReason":"Send failed: {reason}","chat.delivery.sent":"Sent","chat.fold.expandTitle":"Expand ({lines} lines / {chars} chars)","chat.fold.collapseTitle":"Collapse","chat.fold.expand":"Expand","chat.fold.collapse":"Collapse","chat.copyMessage":"Copy message","chat.plan.skip":"Not now","chat.plan.skipTitle":"Keep refining the plan (stay in Plan mode)","chat.plan.execute":"Execute","chat.plan.executeTitle":"Exit Plan mode and start execution","chat.plan.executeDisabledTitle":"Cannot execute right now (connection/thread state)","chat.systemToolCall.streaming":"In progress...","chat.attachments.summary.system":"System {count}","chat.attachments.summary.reasoning":"Reasoning {count}","chat.attachments.summary.default":"System/Reasoning","chat.attachments.aria":"system and reasoning attachments","todo.status.completed":"Completed","todo.status.inProgress":"In progress","todo.status.pending":"Pending","todo.summary.none":"No TODO items.","todo.summary.totalRemaining":"{total} steps total · {remaining} remaining{inProgressSuffix}","todo.summary.inProgressSuffix":" · {inProgress} in progress","todo.summary.inline.inProgress":"In progress","todo.summary.inline.noneInProgress":"No task in progress","todo.title":"TODO List","todo.inline.expandOthers":"Expand others","todo.inline.collapse":"Collapse","todo.meta.thread":"Thread: {thread}","todo.meta.updated":"Updated at {updatedAt}","todo.meta.threadUpdated":"Thread: {thread} · Updated at {updatedAt}","approval.role.needInput":"Input required","approval.role.needApproval":"Approval required","approval.cancel":"Close","approval.input.other":"Enter other...","approval.submitAnswers":"Submit","approval.submitAnswersTitle":"Submit selected answers","approval.options":"Approval options","approval.nextOption":"Next option ({index}/{total})","approval.nextOptionTitle":"Switch to next option","approval.details":"View request details","approval.pendingFileChanges":"Pending file changes","approval.choice.approve":"Allow","approval.choice.approveDesc":"Allow this action.","approval.choice.approveSession":"Allow for session","approval.choice.approveSessionDesc":"Allow similar actions in this session.","approval.choice.deny":"Deny","approval.choice.denyDesc":"Deny this action.","approval.choice.abort":"Abort","approval.choice.abortDesc":"Cancel and abort current task.","approval.choice.accept":"Allow","approval.choice.acceptCommandDesc":"Allow this command.","approval.choice.acceptSession":"Allow for session","approval.choice.acceptSessionCommandDesc":"Auto-allow similar commands in this session.","approval.choice.acceptWithRule":"Allow and save rule","approval.choice.acceptWithRuleDesc":"Allow and write a rule to reduce future interruptions.","approval.choice.decline":"Deny","approval.choice.declineCommandDesc":"Deny this command.","approval.choice.cancel":"Cancel and interrupt","approval.choice.cancelDesc":"Cancel and interrupt current task.","approval.choice.acceptFileDesc":"Allow applying these file changes.","approval.choice.acceptSessionFileDesc":"Auto-allow similar file changes in this session.","approval.choice.declineFileDesc":"Deny these file changes.","approval.choice.acceptContinueDesc":"Allow to continue.","approval.choice.declineContinueDesc":"Deny to continue.","pending.method.choice":"Question","notice.choiceRequired":"Input required","notice.approvalRequired":"Approval required","notice.sessionCompleted":"Session completed","notice.jump":"Jump","notice.jumpTitle":"Jump to pending request","notice.openThread":"Open thread","notice.jumpBackReady":"Jumped successfully, you can return to the previous thread","notice.jumpBack":"Go back","notice.jumpBackTitle":"Return to previous thread","notice.dismiss":"Dismiss","slash.help.title":'Slash commands (type "/" for completion):',"slash.help.escapeSlash":'Tip: to send plain text starting with "/", escape it with "//". Example: `//root/code` is sent as `/root/code`.',"slash.help.escapeDollar":'Tip: to send plain text starting with "$", escape it with "$$". Example: `$$PATH` is sent as `$PATH`.',"slash.command.help":"Show help and command list","slash.command.plan":"Switch to Plan collaboration mode (persists until /default)","slash.command.default":"Switch back to default collaboration mode (clear Plan)","slash.command.workspace":"Switch default workspace (for new threads)","slash.command.model":"Select model and reasoning effort","slash.command.permissions":"Set approval/sandbox (align with CLI /permissions)","slash.command.experimental":"Toggle experimental features","slash.command.skills":"Manage skills and insert $skill","slash.command.review":"Ask Codex to review current changes","slash.command.rename":"Rename current thread","slash.command.new":"Create a new thread","slash.command.resume":"Open an existing thread","slash.command.compact":"Compact current thread context","slash.command.fork":"Fork current thread to a new thread","slash.command.archive":"Archive current thread","slash.command.unarchive":"Unarchive current thread","slash.command.rollback":"Rollback thread history (does not rollback local files)","slash.error.needThread":"Open a thread first (use /new, or /resume <threadId> to open one)","slash.plan.enableFailed":"Failed to enable /plan: collaborationMode preset has no model and no model is currently selected (use /model first).","slash.plan.enabled":"Switched to Plan collaboration mode (persists; use /default to exit).","slash.plan.default":"Switched back to default collaboration mode.","slash.rename.usage":"Usage: /rename <new-name>","slash.rename.cleared":"Cleared local rename for current thread.","slash.rename.failed":"Failed to set thread name: {error}","slash.rename.succeeded":"Renamed current thread to: {name}","slash.compact.requested":"Compact requested: starting context compression...","slash.compact.failed":"Failed to start compact: {error}","slash.fork.running":"Forking current thread...","slash.fork.successNoId":"Fork succeeded, but no threadId returned; refresh the threads list or try again later.","slash.fork.failed":"Fork failed: {error}","slash.archive.running":"Archiving current thread...","slash.unarchive.running":"Unarchiving current thread...","slash.archive.done":"Current thread archived.","slash.unarchive.done":"Current thread unarchived.","slash.command.failed":"{cmd} failed: {error}","slash.rollback.usage":"Usage: /rollback <numTurns?> (example: /rollback 1)","slash.rollback.running":"Rolling back thread history (numTurns={numTurns})...","slash.rollback.done":"Rollback completed: this does not automatically rollback local file changes.","slash.rollback.failed":"Rollback failed: {error}","slash.review.successNoId":"Review started, but reviewThreadId was not returned; refresh the threads list or try again later.","slash.review.failed":"Failed to start review: {error}"},l_={"zh-CN":tI,"en-US":rI};let Z0=Q0();function nI(e,t){return t?e.replace(/\{([a-zA-Z0-9_]+)\}/g,(r,n)=>{const i=t[n];return i==null?"":String(i)}):e}function iI(e){Z0=e}function xe(e,t,r=Z0){const i=(l_[r]??l_["zh-CN"])[e]??e;return nI(i,t)}const eb=p.createContext(null);function sI(e){const[t,r]=p.useState(()=>Q0()),n=p.useCallback(a=>{r(a)},[]),i=p.useCallback(()=>{r(a=>a==="zh-CN"?"en-US":"zh-CN")},[]);p.useEffect(()=>{iI(t),ZE(t),typeof document<"u"&&(document.documentElement.lang=t)},[t]);const s=p.useCallback((a,l)=>xe(a,l,t),[t]),o=p.useMemo(()=>({locale:t,setLocale:n,toggleLocale:i,t:s}),[t,n,i,s]);return u.jsx(eb.Provider,{value:o,children:e.children})}function jt(){const e=p.useContext(eb);if(!e)throw new Error("useI18n must be used within I18nProvider");return e}const tb="theme",uf="accentColor",df="backgroundColor",oI=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,aI=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i;function vc(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):0}function Ws(e){return vc(e).toString(16).padStart(2,"0")}function lI(e){const t=wp(e);if(!t)return null;const r=Number.parseInt(t.slice(1,3),16),n=Number.parseInt(t.slice(3,5),16),i=Number.parseInt(t.slice(5,7),16);return[r,n,i].every(a=>Number.isFinite(a))?{r,g:n,b:i}:null}function _s(e){return`#${Ws(e.r)}${Ws(e.g)}${Ws(e.b)}`}function ys(e,t,r){const n=Math.min(1,Math.max(0,r)),i=1-n;return{r:vc(e.r*i+t.r*n),g:vc(e.g*i+t.g*n),b:vc(e.b*i+t.b*n)}}function cI(e){const t=s=>{const o=s/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4},r=t(e.r),n=t(e.g),i=t(e.b);return r*.2126+n*.7152+i*.0722}function uI(e){const t=aI.exec(e);if(!t)return null;const r=Number.parseInt(t[1]??"",10),n=Number.parseInt(t[2]??"",10),i=Number.parseInt(t[3]??"",10);return[r,n,i].every(a=>Number.isInteger(a)&&a>=0&&a<=255)?`#${Ws(r)}${Ws(n)}${Ws(i)}`:null}const _c=["light","dark"],c_={light:"#ffffff",dark:"#0d1422"};function dI(e){return typeof e=="string"&&_c.includes(e)}function hI(){const e=localStorage.getItem(tb);return dI(e)?e:"light"}function wp(e){if(typeof e!="string")return null;const t=e.trim();if(oI.test(t)){if(t.length===7)return t.toLowerCase();const r=t.slice(1).toLowerCase();return`#${r[0]}${r[0]}${r[1]}${r[1]}${r[2]}${r[2]}`}return uI(t)}function Za(e){return wp(e)}function Aa(e){return wp(e)}function fI(){const e=localStorage.getItem(uf);return Za(e)}function mI(){const e=localStorage.getItem(df);return Aa(e)}function pI(e){const t=_c.indexOf(e);if(t<0)return"light";const r=(t+1)%_c.length;return _c[r]??"light"}function rb(e){return e==="light"?"Light":"Dark"}function gI(e){return c_[e]??c_.light}function vI(e){const t=lI(e);if(!t)return{track:"#f1f2f4",thumb:"#c8cdd6",thumbHover:"#adb4c0"};const r={r:255,g:255,b:255},n={r:0,g:0,b:0};if(cI(t)>=.58){const c=ys(t,r,.2),d=ys(t,n,.18),h=ys(t,n,.3);return{track:_s(c),thumb:_s(d),thumbHover:_s(h)}}const o=ys(t,n,.18),a=ys(t,r,.28),l=ys(t,r,.4);return{track:_s(o),thumb:_s(a),thumbHover:_s(l)}}function _I(e){const{t}=jt(),[r,n]=p.useState(""),[i,s]=p.useState(""),[o,a]=p.useState(!1),[l,c]=p.useState(null),[d,h]=p.useState(null),[f,v]=p.useState(!1),[m,S]=p.useState(null),[y,g]=p.useState(""),[_,w]=p.useState(""),[b,C]=p.useState(""),[M,x]=p.useState(!1),[T,k]=p.useState(null),I=!!(r.trim()&&i.trim()&&!o&&!M&&e.mode!=="checking"),L=o||M||e.mode==="checking";p.useEffect(()=>{if(e.mode==="checking"||e.backendReachability!=="online")return;let E=!1;return v(!0),S(null),YE().then(F=>{E||h(F)}).catch(F=>{E||(h(null),S(t("login.error.adminInitStatusFailed",{error:String(F)})))}).finally(()=>{E||v(!1)}),()=>{E=!0}},[e.backendReachability,e.mode,t]);const R=async()=>{if(I){a(!0),c(null);try{if(!(await fetch("/api/auth/login",{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({username:r,password:i})})).ok){c(t("login.error.invalidCredentials"));return}e.onLoggedIn(r.trim())}catch(E){c(t("login.error.loginFailed",{error:String(E)}))}finally{a(!1)}}},A=!!(y.trim()&&_.trim()&&b.trim()&&_===b&&!M&&!o&&e.mode!=="checking"),O=async()=>{if(A){x(!0),k(null);try{await GE({username:y,password:_}),e.onLoggedIn(y.trim())}catch(E){k(t("login.error.setupFailed",{error:String(E)}))}finally{x(!1)}}},P=e.backendReachability==="online"?t("login.backend.online"):e.backendReachability==="offline"?t("login.backend.offline"):t("login.backend.checking");return u.jsx("div",{className:"loginLayout",children:u.jsxs("div",{className:"loginCard",role:"form","aria-label":"login",children:[u.jsxs("div",{className:"loginHeader",children:[u.jsxs("div",{className:"loginHeaderLeft",children:[u.jsx("div",{className:"loginTitle",children:t("login.title")}),u.jsx("div",{className:"loginSubtitle",children:t("login.backend",{status:P})})]}),u.jsx("button",{className:"toggleTheme",onClick:e.onToggleTheme,title:t("login.toggleTheme"),"aria-label":t("login.toggleTheme"),children:t("sidebar.theme",{theme:rb(e.theme)})})]}),u.jsxs("div",{className:"loginBody",children:[d!=null&&d.requiresSetup?u.jsxs("div",{className:"loginInitBox",children:[u.jsx("div",{className:"loginInitTitle",children:t("login.init.title")}),u.jsx("div",{className:"loginInitHint",children:t("login.init.hint")}),u.jsxs("label",{className:"loginField",children:[u.jsx("div",{className:"loginLabel",children:t("login.init.username")}),u.jsx("input",{className:"loginInput",value:y,onChange:E=>g(E.target.value),autoComplete:"username",disabled:L})]}),u.jsxs("label",{className:"loginField",children:[u.jsx("div",{className:"loginLabel",children:t("login.init.newPassword")}),u.jsx("input",{className:"loginInput",type:"password",value:_,onChange:E=>w(E.target.value),autoComplete:"new-password",disabled:L})]}),u.jsxs("label",{className:"loginField",children:[u.jsx("div",{className:"loginLabel",children:t("login.init.confirmPassword")}),u.jsx("input",{className:"loginInput",type:"password",value:b,onChange:E=>C(E.target.value),autoComplete:"new-password",disabled:L,onKeyDown:E=>{E.key==="Enter"&&O()}})]}),u.jsx("button",{className:"loginButton",disabled:!A,onClick:O,children:e.mode==="checking"?t("login.checking"):t(M?"login.init.submitting":"login.init.submit")}),T?u.jsx("div",{className:"loginError",children:T}):null,b&&_!==b?u.jsx("div",{className:"loginError",children:t("login.init.passwordMismatch")}):null]}):null,f?u.jsx("div",{className:"loginSubtitle",children:t("login.init.loadingStatus")}):null,m?u.jsx("div",{className:"loginError",children:m}):null,u.jsxs("label",{className:"loginField",children:[u.jsx("div",{className:"loginLabel",children:t("login.username")}),u.jsx("input",{className:"loginInput",value:r,onChange:E=>n(E.target.value),autoComplete:"username",disabled:L})]}),u.jsxs("label",{className:"loginField",children:[u.jsx("div",{className:"loginLabel",children:t("login.password")}),u.jsx("input",{className:"loginInput",type:"password",value:i,onChange:E=>s(E.target.value),autoComplete:"current-password",disabled:L,onKeyDown:E=>{E.key==="Enter"&&R()}})]}),u.jsx("button",{className:"loginButton",disabled:!I,onClick:R,children:e.mode==="checking"?t("login.checking"):t(o?"login.submitting":"login.submit")}),l?u.jsx("div",{className:"loginError",children:l}):null,e.error?u.jsx("div",{className:"loginError",children:e.error}):null]})]})})}const Ki=typeof document<"u"?ne.useLayoutEffect:()=>{},nb={prefix:String(Math.round(Math.random()*1e10)),current:0},ib=ne.createContext(nb),yI=ne.createContext(!1);let Fd=new WeakMap;function SI(e=!1){let t=p.useContext(ib),r=p.useRef(null);if(r.current===null&&!e){var n,i;let s=(i=ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||i===void 0||(n=i.ReactCurrentOwner)===null||n===void 0?void 0:n.current;if(s){let o=Fd.get(s);o==null?Fd.set(s,{id:t.current,state:s.memoizedState}):s.memoizedState!==o.state&&(t.current=o.id,Fd.delete(s))}r.current=++t.current}return r.current}function wI(e){let t=p.useContext(ib),r=SI(!!e),n=`react-aria${t.prefix}`;return e||`${n}-${r}`}function bI(e){let t=ne.useId(),[r]=p.useState(EI()),n=r?"react-aria":`react-aria${nb.prefix}`;return e||`${n}-${t}`}const CI=typeof ne.useId=="function"?bI:wI;function xI(){return!1}function kI(){return!0}function TI(e){return()=>{}}function EI(){return typeof ne.useSyncExternalStore=="function"?ne.useSyncExternalStore(TI,xI,kI):p.useContext(yI)}let II=!!(typeof window<"u"&&window.document&&window.document.createElement),Us=new Map,Xo;typeof FinalizationRegistry<"u"&&(Xo=new FinalizationRegistry(e=>{Us.delete(e)}));function u_(e){let[t,r]=p.useState(e),n=p.useRef(null),i=CI(t),s=p.useRef(null);if(Xo&&Xo.register(s,i),II){const o=Us.get(i);o&&!o.includes(n)?o.push(n):Us.set(i,[n])}return Ki(()=>{let o=i;return()=>{Xo&&Xo.unregister(s),Us.delete(o)}},[i]),p.useEffect(()=>{let o=n.current;return o&&r(o),()=>{o&&(n.current=null)}}),i}function RI(e,t){if(e===t)return e;let r=Us.get(e);if(r)return r.forEach(i=>i.current=t),t;let n=Us.get(t);return n?(n.forEach(i=>i.current=e),e):t}function sb(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const Rt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},qr=e=>e&&"window"in e&&e.window===e?e:Rt(e).defaultView||window;function MI(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function PI(e){return MI(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let LI=!1;function bp(){return LI}function Nt(e,t){if(!bp())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let r=t;for(;r!==null;){if(r===e)return!0;r.tagName==="SLOT"&&r.assignedSlot?r=r.assignedSlot.parentNode:PI(r)?r=r.host:r=r.parentNode}return!1}const Na=(e=document)=>{var t;if(!bp())return e.activeElement;let r=e.activeElement;for(;r&&"shadowRoot"in r&&(!((t=r.shadowRoot)===null||t===void 0)&&t.activeElement);)r=r.shadowRoot.activeElement;return r};function Xt(e){return bp()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Cp(...e){return e.length===1&&e[0]?e[0]:t=>{let r=!1;const n=e.map(i=>{const s=d_(i,t);return r||(r=typeof s=="function"),s});if(r)return()=>{n.forEach((i,s)=>{typeof i=="function"?i():d_(e[s],null)})}}}function d_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ob(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=ob(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function AI(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=ob(e))&&(n&&(n+=" "),n+=t);return n}function di(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let n=e[r];for(let i in n){let s=t[i],o=n[i];typeof s=="function"&&typeof o=="function"&&i[0]==="o"&&i[1]==="n"&&i.charCodeAt(2)>=65&&i.charCodeAt(2)<=90?t[i]=sb(s,o):(i==="className"||i==="UNSAFE_className")&&typeof s=="string"&&typeof o=="string"?t[i]=AI(s,o):i==="id"&&s&&o?t.id=RI(s,o):i==="ref"&&s&&o?t.ref=Cp(s,o):t[i]=o!==void 0?o:s}}return t}const NI=new Set(["id"]),DI=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),BI=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),OI=new Set(["dir","lang","hidden","inert","translate"]),h_=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),$I=/^(data-.*)$/;function ab(e,t={}){let{labelable:r,isLink:n,global:i,events:s=i,propNames:o}=t,a={};for(const l in e)Object.prototype.hasOwnProperty.call(e,l)&&(NI.has(l)||r&&DI.has(l)||n&&BI.has(l)||i&&OI.has(l)||s&&(h_.has(l)||l.endsWith("Capture")&&h_.has(l.slice(0,-7)))||o!=null&&o.has(l)||$I.test(l))&&(a[l]=e[l]);return a}function no(e){if(jI())e.focus({preventScroll:!0});else{let t=zI(e);e.focus(),FI(t)}}let Wl=null;function jI(){if(Wl==null){Wl=!1;try{document.createElement("div").focus({get preventScroll(){return Wl=!0,!0}})}catch{}}return Wl}function zI(e){let t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),r}function FI(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}function Nu(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let r=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(r)&&r.some(n=>e.test(n.brand))||e.test(window.navigator.userAgent)}function xp(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function gi(e){let t=null;return()=>(t==null&&(t=e()),t)}const Da=gi(function(){return xp(/^Mac/i)}),HI=gi(function(){return xp(/^iPhone/i)}),lb=gi(function(){return xp(/^iPad/i)||Da()&&navigator.maxTouchPoints>1}),cb=gi(function(){return HI()||lb()}),WI=gi(function(){return Nu(/AppleWebKit/i)&&!UI()}),UI=gi(function(){return Nu(/Chrome/i)}),ub=gi(function(){return Nu(/Android/i)}),KI=gi(function(){return Nu(/Firefox/i)});function Vi(e,t,r=!0){var n,i;let{metaKey:s,ctrlKey:o,altKey:a,shiftKey:l}=t;KI()&&(!((i=window.event)===null||i===void 0||(n=i.type)===null||n===void 0)&&n.startsWith("key"))&&e.target==="_blank"&&(Da()?s=!0:o=!0);let c=WI()&&Da()&&!lb()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:s,ctrlKey:o,altKey:a,shiftKey:l}):new MouseEvent("click",{metaKey:s,ctrlKey:o,altKey:a,shiftKey:l,detail:1,bubbles:!0,cancelable:!0});Vi.isOpening=r,no(e),e.dispatchEvent(c),Vi.isOpening=!1}Vi.isOpening=!1;let Yn=new Map,hf=new Set;function f_(){if(typeof window>"u")return;function e(n){return"propertyName"in n}let t=n=>{if(!e(n)||!n.target)return;let i=Yn.get(n.target);i||(i=new Set,Yn.set(n.target,i),n.target.addEventListener("transitioncancel",r,{once:!0})),i.add(n.propertyName)},r=n=>{if(!e(n)||!n.target)return;let i=Yn.get(n.target);if(i&&(i.delete(n.propertyName),i.size===0&&(n.target.removeEventListener("transitioncancel",r),Yn.delete(n.target)),Yn.size===0)){for(let s of hf)s();hf.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",r)}typeof document<"u"&&(document.readyState!=="loading"?f_():document.addEventListener("DOMContentLoaded",f_));function VI(){for(const[e]of Yn)"isConnected"in e&&!e.isConnected&&Yn.delete(e)}function db(e){requestAnimationFrame(()=>{VI(),Yn.size===0?e():hf.add(e)})}function kp(){let e=p.useRef(new Map),t=p.useCallback((i,s,o,a)=>{let l=a!=null&&a.once?(...c)=>{e.current.delete(o),o(...c)}:o;e.current.set(o,{type:s,eventTarget:i,fn:l,options:a}),i.addEventListener(s,l,a)},[]),r=p.useCallback((i,s,o,a)=>{var l;let c=((l=e.current.get(o))===null||l===void 0?void 0:l.fn)||o;i.removeEventListener(s,c,a),e.current.delete(o)},[]),n=p.useCallback(()=>{e.current.forEach((i,s)=>{r(i.eventTarget,i.type,s,i.options)})},[r]);return p.useEffect(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}function qI(e){const t=p.useRef(null),r=p.useRef(void 0),n=p.useCallback(i=>{if(typeof e=="function"){const s=e,o=s(i);return()=>{typeof o=="function"?o():s(null)}}else if(e)return e.current=i,()=>{e.current=null}},[e]);return p.useMemo(()=>({get current(){return t.current},set current(i){t.current=i,r.current&&(r.current(),r.current=void 0),i!=null&&(r.current=n(i))}}),[n])}var Hd;const YI=(Hd=ne.useInsertionEffect)!==null&&Hd!==void 0?Hd:Ki;function Ul(e){const t=p.useRef(null);return YI(()=>{t.current=e},[e]),p.useCallback((...r)=>{const n=t.current;return n==null?void 0:n(...r)},[])}function hb(e,t){Ki(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function fb(e){return e.pointerType===""&&e.isTrusted?!0:ub()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function GI(e){return!ub()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}const XI=typeof Element<"u"&&"checkVisibility"in Element.prototype;function JI(e){const t=qr(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:r,visibility:n}=e.style,i=r!=="none"&&n!=="hidden"&&n!=="collapse";if(i){const{getComputedStyle:s}=e.ownerDocument.defaultView;let{display:o,visibility:a}=s(e);i=o!=="none"&&a!=="hidden"&&a!=="collapse"}return i}function QI(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function mb(e,t){return XI?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&JI(e)&&QI(e,t)&&(!e.parentElement||mb(e.parentElement,e))}const pb=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],ZI=pb.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";pb.push('[tabindex]:not([tabindex="-1"]):not([disabled])');function e2(e){return e.matches(ZI)&&mb(e)&&!t2(e)}function t2(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}const r2=Symbol("default");function n2(e){let{className:t,style:r,children:n,defaultClassName:i,defaultChildren:s,defaultStyle:o,values:a,render:l}=e;return p.useMemo(()=>{let c,d,h;return typeof t=="function"?c=t({...a,defaultClassName:i}):c=t,typeof r=="function"?d=r({...a,defaultStyle:o||{}}):d=r,typeof n=="function"?h=n({...a,defaultChildren:s}):n==null?h=s:h=n,{className:c??i,style:d||o?{...o,...d}:void 0,children:h??s,"data-rac":"",render:l?f=>l(f,a):void 0}},[t,r,n,i,s,o,a,l])}function i2(e,t){let r=p.useContext(e);if(t===null)return null;if(r&&typeof r=="object"&&"slots"in r&&r.slots){let n=t||r2;if(!r.slots[n]){let i=new Intl.ListFormat().format(Object.keys(r.slots).map(o=>`"${o}"`)),s=t?`Invalid slot "${t}".`:"A slot prop is required.";throw new Error(`${s} Valid slot names are ${i}.`)}return r.slots[n]}return r}function s2(e,t,r){let n=i2(r,e.slot)||{},{ref:i,...s}=n,o=qI(p.useMemo(()=>Cp(t,i),[t,i])),a=di(s,e);return"style"in s&&s.style&&"style"in e&&e.style&&(typeof s.style=="function"||typeof e.style=="function"?a.style=l=>{let c=typeof s.style=="function"?s.style(l):s.style,d={...l.defaultStyle,...c},h=typeof e.style=="function"?e.style({...l,defaultStyle:d}):e.style;return{...d,...h}}:a.style={...s.style,...e.style}),[a,o]}function o2(e,t,r){let{render:n,...i}=t,s=p.useRef(null),o=p.useMemo(()=>Cp(r,s),[r,s]);Ki(()=>{},[e,n]);let a={...i,ref:o};return n?n(a,void 0):ne.createElement(e,a)}const m_={},a2=new Proxy({},{get(e,t){if(typeof t!="string")return;let r=m_[t];return r||(r=p.forwardRef(o2.bind(null,t)),m_[t]=r),r}}),gb=7e3;let rn=null;function p_(e,t="assertive",r=gb){rn?rn.announce(e,t,r):(rn=new l2,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?rn.announce(e,t,r):setTimeout(()=>{rn!=null&&rn.isAttached()&&(rn==null||rn.announce(e,t,r))},100))}class l2{isAttached(){var t;return(t=this.node)===null||t===void 0?void 0:t.isConnected}createLog(t){let r=document.createElement("div");return r.setAttribute("role","log"),r.setAttribute("aria-live",t),r.setAttribute("aria-relevant","additions"),r}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,r="assertive",n=gb){var i,s;if(!this.node)return;let o=document.createElement("div");typeof t=="object"?(o.setAttribute("role","img"),o.setAttribute("aria-labelledby",t["aria-labelledby"])):o.textContent=t,r==="assertive"?(i=this.assertiveLog)===null||i===void 0||i.appendChild(o):(s=this.politeLog)===null||s===void 0||s.appendChild(o),t!==""&&setTimeout(()=>{o.remove()},n)}clear(t){this.node&&((!t||t==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!t||t==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}function c2(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function u2(e,t,r){c2(e,t),t.set(e,r)}function Tp(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function vb(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function _b(e){let t=p.useRef({isFocused:!1,observer:null});return Ki(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]),p.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let n=r.target,i=s=>{if(t.current.isFocused=!1,n.disabled){let o=Tp(s);e==null||e(o)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};n.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&n.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let o=n===document.activeElement?null:document.activeElement;n.dispatchEvent(new FocusEvent("blur",{relatedTarget:o})),n.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:o}))}}),t.current.observer.observe(n,{attributes:!0,attributeFilter:["disabled"]})}},[e])}let iu=!1;function d2(e){for(;e&&!e2(e);)e=e.parentElement;let t=qr(e),r=t.document.activeElement;if(!r||r===e)return;iu=!0;let n=!1,i=d=>{(d.target===r||n)&&d.stopImmediatePropagation()},s=d=>{(d.target===r||n)&&(d.stopImmediatePropagation(),!e&&!n&&(n=!0,no(r),l()))},o=d=>{(d.target===e||n)&&d.stopImmediatePropagation()},a=d=>{(d.target===e||n)&&(d.stopImmediatePropagation(),n||(n=!0,no(r),l()))};t.addEventListener("blur",i,!0),t.addEventListener("focusout",s,!0),t.addEventListener("focusin",a,!0),t.addEventListener("focus",o,!0);let l=()=>{cancelAnimationFrame(c),t.removeEventListener("blur",i,!0),t.removeEventListener("focusout",s,!0),t.removeEventListener("focusin",a,!0),t.removeEventListener("focus",o,!0),iu=!1,n=!1},c=requestAnimationFrame(l);return l}let Ds="default",ff="",yc=new WeakMap;function h2(e){if(cb()){if(Ds==="default"){const t=Rt(e);ff=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}Ds="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";yc.set(e,e.style[t]),e.style[t]="none"}}function g_(e){if(cb()){if(Ds!=="disabled")return;Ds="restoring",setTimeout(()=>{db(()=>{if(Ds==="restoring"){const t=Rt(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=ff||""),ff="",Ds="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&yc.has(e)){let t=yc.get(e),r="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[r]==="none"&&(e.style[r]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),yc.delete(e)}}const yb=ne.createContext({register:()=>{}});yb.displayName="PressResponderContext";function f2(e,t){return t.get?t.get.call(e):t.value}function Sb(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function m2(e,t){var r=Sb(e,t,"get");return f2(e,r)}function p2(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}function v_(e,t,r){var n=Sb(e,t,"set");return p2(e,n,r),r}function g2(e){let t=p.useContext(yb);if(t){let{register:r,ref:n,...i}=t;e=di(i,e),r()}return hb(t,e.ref),e}var Kl=new WeakMap;class Vl{continuePropagation(){v_(this,Kl,!1)}get shouldStopPropagation(){return m2(this,Kl)}constructor(t,r,n,i){u2(this,Kl,{writable:!0,value:void 0}),v_(this,Kl,!0);var s;let o=(s=i==null?void 0:i.target)!==null&&s!==void 0?s:n.currentTarget;const a=o==null?void 0:o.getBoundingClientRect();let l,c=0,d,h=null;n.clientX!=null&&n.clientY!=null&&(d=n.clientX,h=n.clientY),a&&(d!=null&&h!=null?(l=d-a.left,c=h-a.top):(l=a.width/2,c=a.height/2)),this.type=t,this.pointerType=r,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=l,this.y=c,this.key=n.key}}const __=Symbol("linkClicked"),y_="react-aria-pressable-style",S_="data-react-aria-pressable";function v2(e){let{onPress:t,onPressChange:r,onPressStart:n,onPressEnd:i,onPressUp:s,onClick:o,isDisabled:a,isPressed:l,preventFocusOnPress:c,shouldCancelOnPointerExit:d,allowTextSelectionOnPress:h,ref:f,...v}=g2(e),[m,S]=p.useState(!1),y=p.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:g,removeAllGlobalListeners:_,removeGlobalListener:w}=kp(),b=p.useCallback((D,W)=>{let j=y.current;if(a||j.didFirePressStart)return!1;let ee=!0;if(j.isTriggeringEvent=!0,n){let te=new Vl("pressstart",W,D);n(te),ee=te.shouldStopPropagation}return r&&r(!0),j.isTriggeringEvent=!1,j.didFirePressStart=!0,S(!0),ee},[a,n,r]),C=p.useCallback((D,W,j=!0)=>{let ee=y.current;if(!ee.didFirePressStart)return!1;ee.didFirePressStart=!1,ee.isTriggeringEvent=!0;let te=!0;if(i){let ae=new Vl("pressend",W,D);i(ae),te=ae.shouldStopPropagation}if(r&&r(!1),S(!1),t&&j&&!a){let ae=new Vl("press",W,D);t(ae),te&&(te=ae.shouldStopPropagation)}return ee.isTriggeringEvent=!1,te},[a,i,r,t]),M=Ul(C),x=p.useCallback((D,W)=>{let j=y.current;if(a)return!1;if(s){j.isTriggeringEvent=!0;let ee=new Vl("pressup",W,D);return s(ee),j.isTriggeringEvent=!1,ee.shouldStopPropagation}return!0},[a,s]),T=Ul(x),k=p.useCallback(D=>{let W=y.current;if(W.isPressed&&W.target){W.didFirePressStart&&W.pointerType!=null&&C(xi(W.target,D),W.pointerType,!1),W.isPressed=!1,N(null),W.isOverTarget=!1,W.activePointerId=null,W.pointerType=null,_(),h||g_(W.target);for(let j of W.disposables)j();W.disposables=[]}},[h,_,C]),I=Ul(k),L=p.useCallback(D=>{d&&k(D)},[d,k]),R=p.useCallback(D=>{a||o==null||o(D)},[a,o]),A=p.useCallback((D,W)=>{if(!a&&o){let j=new MouseEvent("click",D);vb(j,W),o(Tp(j))}},[a,o]),O=Ul(A),[P,E]=p.useState(!1);Ki(()=>{let D=y.current;if(P){let W=ae=>{var H;if(D.isPressed&&D.target&&Wd(ae,D.target)){var se;w_(Xt(ae),ae.key)&&ae.preventDefault();let z=Xt(ae),Y=Nt(D.target,Xt(ae));M(xi(D.target,ae),"keyboard",Y),Y&&O(ae,D.target),_(),ae.key!=="Enter"&&Ep(D.target)&&Nt(D.target,z)&&!ae[__]&&(ae[__]=!0,Vi(D.target,ae,!1)),D.isPressed=!1,E(!1),(se=D.metaKeyEvents)===null||se===void 0||se.delete(ae.key)}else if(ae.key==="Meta"&&(!((H=D.metaKeyEvents)===null||H===void 0)&&H.size)){var B;let z=D.metaKeyEvents;D.metaKeyEvents=void 0;for(let Y of z.values())(B=D.target)===null||B===void 0||B.dispatchEvent(new KeyboardEvent("keyup",Y))}},j=D.target,te=sb(ae=>{j&&Wd(ae,j)&&!ae.repeat&&Nt(j,Xt(ae))&&D.target&&T(xi(D.target,ae),"keyboard")},W);return g(Rt(D.target),"keyup",te,!0),()=>{w(Rt(D.target),"keyup",te,!0)}}},[P,g,_,w]);let[F,N]=p.useState(null);Ki(()=>{let D=y.current;if(F==="pointer"){let W=ee=>{if(ee.pointerId===D.activePointerId&&D.isPressed&&ee.button===0&&D.target){if(Nt(D.target,Xt(ee))&&D.pointerType!=null){let te=!1,ae=setTimeout(()=>{D.isPressed&&D.target instanceof HTMLElement&&(te?I(ee):(no(D.target),D.target.click()))},80);g(ee.currentTarget,"click",()=>te=!0,!0),D.disposables.push(()=>clearTimeout(ae))}else I(ee);D.isOverTarget=!1}},j=ee=>{I(ee)};return g(Rt(D.target),"pointerup",W,!1),g(Rt(D.target),"pointercancel",j,!1),()=>{w(Rt(D.target),"pointerup",W,!1),w(Rt(D.target),"pointercancel",j,!1)}}},[F,g,w]);let V=p.useMemo(()=>{let D=y.current,W={onKeyDown(j){if(Wd(j.nativeEvent,j.currentTarget)&&Nt(j.currentTarget,Xt(j.nativeEvent))){var ee;w_(Xt(j.nativeEvent),j.key)&&j.preventDefault();let te=!0;!D.isPressed&&!j.repeat&&(D.target=j.currentTarget,D.isPressed=!0,E(!0),D.pointerType="keyboard",te=b(j,"keyboard")),te&&j.stopPropagation(),j.metaKey&&Da()&&((ee=D.metaKeyEvents)===null||ee===void 0||ee.set(j.key,j.nativeEvent))}else j.key==="Meta"&&(D.metaKeyEvents=new Map)},onClick(j){if(!(j&&!Nt(j.currentTarget,Xt(j.nativeEvent)))&&j&&j.button===0&&!D.isTriggeringEvent&&!Vi.isOpening){let ee=!0;if(a&&j.preventDefault(),!D.ignoreEmulatedMouseEvents&&!D.isPressed&&(D.pointerType==="virtual"||fb(j.nativeEvent))){let te=b(j,"virtual"),ae=x(j,"virtual"),H=C(j,"virtual");R(j),ee=te&&ae&&H}else if(D.isPressed&&D.pointerType!=="keyboard"){let te=D.pointerType||j.nativeEvent.pointerType||"virtual",ae=x(xi(j.currentTarget,j),te),H=C(xi(j.currentTarget,j),te,!0);ee=ae&&H,D.isOverTarget=!1,R(j),k(j)}D.ignoreEmulatedMouseEvents=!1,ee&&j.stopPropagation()}}};return typeof PointerEvent<"u"&&(W.onPointerDown=j=>{if(j.button!==0||!Nt(j.currentTarget,Xt(j.nativeEvent)))return;if(GI(j.nativeEvent)){D.pointerType="virtual";return}D.pointerType=j.pointerType;let ee=!0;if(!D.isPressed){D.isPressed=!0,N("pointer"),D.isOverTarget=!0,D.activePointerId=j.pointerId,D.target=j.currentTarget,h||h2(D.target),ee=b(j,D.pointerType);let te=Xt(j.nativeEvent);"releasePointerCapture"in te&&("hasPointerCapture"in te?te.hasPointerCapture(j.pointerId)&&te.releasePointerCapture(j.pointerId):te.releasePointerCapture(j.pointerId))}ee&&j.stopPropagation()},W.onMouseDown=j=>{if(Nt(j.currentTarget,Xt(j.nativeEvent))&&j.button===0){if(c){let ee=d2(j.target);ee&&D.disposables.push(ee)}j.stopPropagation()}},W.onPointerUp=j=>{!Nt(j.currentTarget,Xt(j.nativeEvent))||D.pointerType==="virtual"||j.button===0&&!D.isPressed&&x(j,D.pointerType||j.pointerType)},W.onPointerEnter=j=>{j.pointerId===D.activePointerId&&D.target&&!D.isOverTarget&&D.pointerType!=null&&(D.isOverTarget=!0,b(xi(D.target,j),D.pointerType))},W.onPointerLeave=j=>{j.pointerId===D.activePointerId&&D.target&&D.isOverTarget&&D.pointerType!=null&&(D.isOverTarget=!1,C(xi(D.target,j),D.pointerType,!1),L(j))},W.onDragStart=j=>{Nt(j.currentTarget,Xt(j.nativeEvent))&&k(j)}),W},[a,c,_,h,k,L,C,b,x,R,A]);return p.useEffect(()=>{if(!f)return;const D=Rt(f.current);if(!D||!D.head||D.getElementById(y_))return;const W=D.createElement("style");W.id=y_,W.textContent=`
|
|
41
|
-
@layer {
|
|
42
|
-
[${S_}] {
|
|
43
|
-
touch-action: pan-x pan-y pinch-zoom;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
`.trim(),D.head.prepend(W)},[f]),p.useEffect(()=>{let D=y.current;return()=>{var W;h||g_((W=D.target)!==null&&W!==void 0?W:void 0);for(let j of D.disposables)j();D.disposables=[]}},[h]),{isPressed:l||m,pressProps:di(v,V,{[S_]:!0})}}function Ep(e){return e.tagName==="A"&&e.hasAttribute("href")}function Wd(e,t){const{key:r,code:n}=e,i=t,s=i.getAttribute("role");return(r==="Enter"||r===" "||r==="Spacebar"||n==="Space")&&!(i instanceof qr(i).HTMLInputElement&&!wb(i,r)||i instanceof qr(i).HTMLTextAreaElement||i.isContentEditable)&&!((s==="link"||!s&&Ep(i))&&r!=="Enter")}function xi(e,t){let r=t.clientX,n=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:r,clientY:n,key:t.key}}function _2(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!Ep(e)}function w_(e,t){return e instanceof HTMLInputElement?!wb(e,t):_2(e)}const y2=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function wb(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":y2.has(e.type)}let uo=null;const mf=new Set;let ha=new Map,qi=!1,pf=!1;const S2={Tab:!0,Escape:!0};function Ip(e,t){for(let r of mf)r(e,t)}function w2(e){return!(e.metaKey||!Da()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function su(e){qi=!0,!Vi.isOpening&&w2(e)&&(uo="keyboard",Ip("keyboard",e))}function Ks(e){uo="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(qi=!0,Ip("pointer",e))}function bb(e){!Vi.isOpening&&fb(e)&&(qi=!0,uo="virtual")}function Cb(e){e.target===window||e.target===document||iu||!e.isTrusted||(!qi&&!pf&&(uo="virtual",Ip("virtual",e)),qi=!1,pf=!1)}function xb(){iu||(qi=!1,pf=!0)}function gf(e){if(typeof window>"u"||typeof document>"u"||ha.get(qr(e)))return;const t=qr(e),r=Rt(e);let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){qi=!0,n.apply(this,arguments)},r.addEventListener("keydown",su,!0),r.addEventListener("keyup",su,!0),r.addEventListener("click",bb,!0),t.addEventListener("focus",Cb,!0),t.addEventListener("blur",xb,!1),typeof PointerEvent<"u"&&(r.addEventListener("pointerdown",Ks,!0),r.addEventListener("pointermove",Ks,!0),r.addEventListener("pointerup",Ks,!0)),t.addEventListener("beforeunload",()=>{kb(e)},{once:!0}),ha.set(t,{focus:n})}const kb=(e,t)=>{const r=qr(e),n=Rt(e);t&&n.removeEventListener("DOMContentLoaded",t),ha.has(r)&&(r.HTMLElement.prototype.focus=ha.get(r).focus,n.removeEventListener("keydown",su,!0),n.removeEventListener("keyup",su,!0),n.removeEventListener("click",bb,!0),r.removeEventListener("focus",Cb,!0),r.removeEventListener("blur",xb,!1),typeof PointerEvent<"u"&&(n.removeEventListener("pointerdown",Ks,!0),n.removeEventListener("pointermove",Ks,!0),n.removeEventListener("pointerup",Ks,!0)),ha.delete(r))};function b2(e){const t=Rt(e);let r;return t.readyState!=="loading"?gf(e):(r=()=>{gf(e)},t.addEventListener("DOMContentLoaded",r)),()=>kb(e,r)}typeof document<"u"&&b2();function vf(){return uo!=="pointer"}function C2(){return uo}const x2=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function k2(e,t,r){let n=Rt(r==null?void 0:r.target);const i=typeof window<"u"?qr(r==null?void 0:r.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?qr(r==null?void 0:r.target).HTMLTextAreaElement:HTMLTextAreaElement,o=typeof window<"u"?qr(r==null?void 0:r.target).HTMLElement:HTMLElement,a=typeof window<"u"?qr(r==null?void 0:r.target).KeyboardEvent:KeyboardEvent;return e=e||n.activeElement instanceof i&&!x2.has(n.activeElement.type)||n.activeElement instanceof s||n.activeElement instanceof o&&n.activeElement.isContentEditable,!(e&&t==="keyboard"&&r instanceof a&&!S2[r.key])}function T2(e,t,r){gf(),p.useEffect(()=>{if((r==null?void 0:r.enabled)===!1)return;let n=(i,s)=>{k2(!!(r!=null&&r.isTextInput),i,s)&&e(vf())};return mf.add(n),()=>{mf.delete(n)}},t)}function E2(e){const t=Rt(e);if(C2()==="virtual"){let r=Na(t);db(()=>{const n=Na(t);(n===r||n===t.body)&&e.isConnected&&no(e)})}else no(e)}function Tb(e){let{isDisabled:t,onFocus:r,onBlur:n,onFocusChange:i}=e;const s=p.useCallback(l=>{if(l.target===l.currentTarget)return n&&n(l),i&&i(!1),!0},[n,i]),o=_b(s),a=p.useCallback(l=>{const c=Rt(l.target),d=c?Na(c):Na();l.target===l.currentTarget&&d===Xt(l.nativeEvent)&&(r&&r(l),i&&i(!0),o(l))},[i,r,o]);return{focusProps:{onFocus:!t&&(r||i||n)?a:void 0,onBlur:!t&&(n||i)?s:void 0}}}function b_(e){if(!e)return;let t=!0;return r=>{let n={...r,preventDefault(){r.preventDefault()},isDefaultPrevented(){return r.isDefaultPrevented()},stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(n),t&&r.stopPropagation()}}function I2(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:b_(e.onKeyDown),onKeyUp:b_(e.onKeyUp)}}}let R2=ne.createContext(null);function M2(e){let t=p.useContext(R2)||{};hb(t,e);let{ref:r,...n}=t;return n}function P2(e,t){let{focusProps:r}=Tb(e),{keyboardProps:n}=I2(e),i=di(r,n),s=M2(t),o=e.isDisabled?{}:s,a=p.useRef(e.autoFocus);p.useEffect(()=>{a.current&&t.current&&E2(t.current),a.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:di({...i,tabIndex:l},o)}}function L2(e){let{isDisabled:t,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:i}=e,s=p.useRef({isFocusWithin:!1}),{addGlobalListener:o,removeAllGlobalListeners:a}=kp(),l=p.useCallback(h=>{Nt(h.currentTarget,h.target)&&s.current.isFocusWithin&&!Nt(h.currentTarget,h.relatedTarget)&&(s.current.isFocusWithin=!1,a(),r&&r(h),i&&i(!1))},[r,i,s,a]),c=_b(l),d=p.useCallback(h=>{if(!Nt(h.currentTarget,h.target))return;const f=Rt(h.target),v=Na(f);if(!s.current.isFocusWithin&&v===Xt(h.nativeEvent)){n&&n(h),i&&i(!0),s.current.isFocusWithin=!0,c(h);let m=h.currentTarget;o(f,"focus",S=>{if(s.current.isFocusWithin&&!Nt(m,S.target)){let y=new f.defaultView.FocusEvent("blur",{relatedTarget:S.target});vb(y,m);let g=Tp(y);l(g)}},{capture:!0})}},[n,i,c,o,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:l}}}let _f=!1,ql=0;function A2(){_f=!0,setTimeout(()=>{_f=!1},50)}function C_(e){e.pointerType==="touch"&&A2()}function N2(){if(!(typeof document>"u"))return ql===0&&typeof PointerEvent<"u"&&document.addEventListener("pointerup",C_),ql++,()=>{ql--,!(ql>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",C_)}}function D2(e){let{onHoverStart:t,onHoverChange:r,onHoverEnd:n,isDisabled:i}=e,[s,o]=p.useState(!1),a=p.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;p.useEffect(N2,[]);let{addGlobalListener:l,removeAllGlobalListeners:c}=kp(),{hoverProps:d,triggerHoverEnd:h}=p.useMemo(()=>{let f=(S,y)=>{if(a.pointerType=y,i||y==="touch"||a.isHovered||!Nt(S.currentTarget,S.target))return;a.isHovered=!0;let g=S.currentTarget;a.target=g,l(Rt(S.target),"pointerover",_=>{a.isHovered&&a.target&&!Nt(a.target,_.target)&&v(_,_.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:g,pointerType:y}),r&&r(!0),o(!0)},v=(S,y)=>{let g=a.target;a.pointerType="",a.target=null,!(y==="touch"||!a.isHovered||!g)&&(a.isHovered=!1,c(),n&&n({type:"hoverend",target:g,pointerType:y}),r&&r(!1),o(!1))},m={};return typeof PointerEvent<"u"&&(m.onPointerEnter=S=>{_f&&S.pointerType==="mouse"||f(S,S.pointerType)},m.onPointerLeave=S=>{!i&&Nt(S.currentTarget,S.target)&&v(S,S.pointerType)}),{hoverProps:m,triggerHoverEnd:v}},[t,r,n,i,a,l,c]);return p.useEffect(()=>{i&&h({currentTarget:a.target},a.pointerType)},[i]),{hoverProps:d,isHovered:s}}function B2(e={}){let{autoFocus:t=!1,isTextInput:r,within:n}=e,i=p.useRef({isFocused:!1,isFocusVisible:t||vf()}),[s,o]=p.useState(!1),[a,l]=p.useState(()=>i.current.isFocused&&i.current.isFocusVisible),c=p.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),d=p.useCallback(v=>{i.current.isFocused=v,i.current.isFocusVisible=vf(),o(v),c()},[c]);T2(v=>{i.current.isFocusVisible=v,c()},[r,s],{enabled:s,isTextInput:r});let{focusProps:h}=Tb({isDisabled:n,onFocusChange:d}),{focusWithinProps:f}=L2({isDisabled:!n,onFocusWithinChange:d});return{isFocused:s,isFocusVisible:a,focusProps:n?f:h}}if(typeof HTMLTemplateElement<"u"){const e=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild").get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}const O2=p.createContext(!1);function $2(e){let t=(r,n)=>p.useContext(O2)?null:e(r,n);return t.displayName=e.displayName||e.name,p.forwardRef(t)}function j2(e,t){let{elementType:r="button",isDisabled:n,onPress:i,onPressStart:s,onPressEnd:o,onPressUp:a,onPressChange:l,preventFocusOnPress:c,allowFocusWhenDisabled:d,onClick:h,href:f,target:v,rel:m,type:S="button"}=e,y;r==="button"?y={type:S,disabled:n,form:e.form,formAction:e.formAction,formEncType:e.formEncType,formMethod:e.formMethod,formNoValidate:e.formNoValidate,formTarget:e.formTarget,name:e.name,value:e.value}:y={role:"button",href:r==="a"&&!n?f:void 0,target:r==="a"?v:void 0,type:r==="input"?S:void 0,disabled:r==="input"?n:void 0,"aria-disabled":!n||r==="input"?void 0:n,rel:r==="a"?m:void 0};let{pressProps:g,isPressed:_}=v2({onPressStart:s,onPressEnd:o,onPressChange:l,onPress:i,onPressUp:a,onClick:h,isDisabled:n,preventFocusOnPress:c,ref:t}),{focusableProps:w}=P2(e,t);d&&(w.tabIndex=n?-1:w.tabIndex);let b=di(w,g,ab(e,{labelable:!0}));return{isPressed:_,buttonProps:di(y,b,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"],"aria-disabled":e["aria-disabled"]})}}const z2=p.createContext(null),F2=p.createContext({}),H2=$2(function(t,r){[t,r]=s2(t,r,F2);let n=t,{isPending:i}=n,{buttonProps:s,isPressed:o}=j2(t,r);s=W2(s,i);let{focusProps:a,isFocused:l,isFocusVisible:c}=B2(t),{hoverProps:d,isHovered:h}=D2({...t,isDisabled:t.isDisabled||i}),f={isHovered:h,isPressed:(n.isPressed||o)&&!i,isFocused:l,isFocusVisible:c,isDisabled:t.isDisabled||!1,isPending:i??!1},v=n2({...t,values:f,defaultClassName:"react-aria-Button"}),m=u_(s.id),S=u_(),y=s["aria-labelledby"];i&&(y?y=`${y} ${S}`:s["aria-label"]&&(y=`${m} ${S}`));let g=p.useRef(i);p.useEffect(()=>{let w={"aria-labelledby":y||m};(!g.current&&l&&i||g.current&&l&&!i)&&p_(w,"assertive"),g.current=i},[i,l,y,m]);let _=ab(t,{global:!0});return delete _.onClick,ne.createElement(a2.button,{...di(_,v,s,a,d),type:s.type==="submit"&&i?"button":s.type,id:m,ref:r,"aria-labelledby":y,slot:t.slot||void 0,"aria-disabled":i?"true":s["aria-disabled"],"data-disabled":t.isDisabled||void 0,"data-pressed":f.isPressed||void 0,"data-hovered":h||void 0,"data-focused":l||void 0,"data-pending":i||void 0,"data-focus-visible":c||void 0},ne.createElement(z2.Provider,{value:{id:S}},v.children))});function W2(e,t){if(t){for(const r in e)r.startsWith("on")&&!(r.includes("Focus")||r.includes("Blur"))&&(e[r]=void 0);e.href=void 0,e.target=void 0}return e}/**
|
|
47
|
-
* @license lucide-react v0.575.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const Eb=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
|
|
52
|
-
* @license lucide-react v0.575.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const U2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
57
|
-
* @license lucide-react v0.575.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const K2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase());/**
|
|
62
|
-
* @license lucide-react v0.575.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const x_=e=>{const t=K2(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
67
|
-
* @license lucide-react v0.575.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/var V2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
72
|
-
* @license lucide-react v0.575.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const q2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
77
|
-
* @license lucide-react v0.575.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const Y2=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:s,iconNode:o,...a},l)=>p.createElement("svg",{ref:l,...V2,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Eb("lucide",i),...!s&&!q2(a)&&{"aria-hidden":"true"},...a},[...o.map(([c,d])=>p.createElement(c,d)),...Array.isArray(s)?s:[s]]));/**
|
|
82
|
-
* @license lucide-react v0.575.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const Rp=(e,t)=>{const r=p.forwardRef(({className:n,...i},s)=>p.createElement(Y2,{ref:s,iconNode:t,className:Eb(`lucide-${U2(x_(e))}`,`lucide-${e}`,n),...i}));return r.displayName=x_(e),r};/**
|
|
87
|
-
* @license lucide-react v0.575.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const G2=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],X2=Rp("send-horizontal",G2);/**
|
|
92
|
-
* @license lucide-react v0.575.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const J2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Q2=Rp("square",J2);/**
|
|
97
|
-
* @license lucide-react v0.575.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const Z2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],eR=Rp("x",Z2);function tR(e){var n;const t=Array.from(((n=e.clipboardData)==null?void 0:n.items)??[]),r=[];for(const i of t){if(i.kind!=="file"||!i.type.startsWith("image/"))continue;const s=i.getAsFile();s&&r.push(s)}return r}function rR(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M12 19V5",strokeLinecap:"round"}),u.jsx("path",{d:"M6 11l6-6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})]})}function nR(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M12 5v14",strokeLinecap:"round"}),u.jsx("path",{d:"M6 13l6 6 6-6",strokeLinecap:"round",strokeLinejoin:"round"})]})}function iR(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M6 12a6 6 0 0 1 12 0",strokeLinecap:"round"}),u.jsx("path",{d:"M9 12a3 3 0 0 1 6 0",strokeLinecap:"round"}),u.jsx("circle",{cx:"12",cy:"16",r:"1.5",fill:"currentColor",stroke:"none"})]})}function sR(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M4 7h16",strokeLinecap:"round"}),u.jsx("path",{d:"M4 12h16",strokeLinecap:"round"}),u.jsx("path",{d:"M4 17h16",strokeLinecap:"round"})]})}function k_(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M3 12a9 9 0 0 1 15.3-6.4",strokeLinecap:"round"}),u.jsx("path",{d:"M18.3 3.6V8h-4.4",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M21 12a9 9 0 0 1-15.3 6.4",strokeLinecap:"round"}),u.jsx("path",{d:"M5.7 20.4V16h4.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function oR(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("rect",{x:"9",y:"9",width:"10",height:"10",rx:"2"}),u.jsx("path",{d:"M7 15H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v1",strokeLinecap:"round"})]})}function aR(){return u.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:u.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})})}function lR(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M8 6h13",strokeLinecap:"round"}),u.jsx("path",{d:"M8 12h13",strokeLinecap:"round"}),u.jsx("path",{d:"M8 18h9",strokeLinecap:"round"}),u.jsx("path",{d:"M3.5 12l1.5 1.5L6.8 11",strokeLinecap:"round",strokeLinejoin:"round"})]})}function cR(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M12 2l8 4-8 4-8-4 8-4z",strokeLinejoin:"round"}),u.jsx("path",{d:"M4 6v8l8 4 8-4V6",strokeLinejoin:"round"}),u.jsx("path",{d:"M12 10v8",strokeLinejoin:"round"})]})}function uR(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M5 14a7 7 0 0 1 14 0",strokeLinecap:"round"}),u.jsx("path",{d:"M12 12l4-2",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M12 21a2 2 0 0 0 2-2H10a2 2 0 0 0 2 2z",strokeLinejoin:"round"})]})}function dR(e){return typeof e!="number"?null:Math.max(0,Math.min(100,e))}function hR(e){const t=dR(e.usagePercent),r=8,n=2*Math.PI*r,i=t===null?0:t/100,s=i>=1?.995:i,o=n*(1-s),a=t===null?0:.95;return u.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none","aria-hidden":"true",focusable:"false",children:u.jsx("circle",{cx:"12",cy:"12",r,fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",transform:"rotate(-90 12 12)",strokeDasharray:n,strokeDashoffset:o,opacity:a,style:{transition:"stroke-dashoffset 220ms ease, opacity 160ms ease"}})})}function Mp(){return u.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:u.jsx("path",{d:"M21 11.5l-8.5 8.5a6 6 0 0 1-8.5-8.5L12.5 3a4.5 4.5 0 1 1 6.4 6.4L10.6 17.7a3 3 0 0 1-4.2-4.2L15 5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ib(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M12 3v10",strokeLinecap:"round"}),u.jsx("path",{d:"M8 7l4-4 4 4",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M5 21h14a2 2 0 0 0 2-2v-3",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M3 16v3a2 2 0 0 0 2 2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function fR(){return u.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:u.jsx("path",{d:"M9 21 15 3",strokeLinecap:"round"})})}function mR(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M12 3v18",strokeLinecap:"round"}),u.jsx("path",{d:"M16 7c0-1.7-1.8-3-4-3s-4 1.3-4 3 1.8 3 4 3 4 1.3 4 3-1.8 3-4 3-4-1.3-4-3",strokeLinecap:"round",strokeLinejoin:"round"})]})}function pR(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M3 7h18",strokeLinecap:"round"}),u.jsx("rect",{x:"4",y:"7",width:"16",height:"13",rx:"2"}),u.jsx("path",{d:"M9 12h6",strokeLinecap:"round"}),u.jsx("path",{d:"M10 3h4",strokeLinecap:"round"})]})}function gR(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z",strokeLinejoin:"round"}),u.jsx("path",{d:"M3 9h18",strokeLinecap:"round"})]})}function Rb(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M12 5v14",strokeLinecap:"round"}),u.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})]})}function T_(e){return e.trim().toLowerCase()}function vR(e,t){const r=T_(e),n=T_(t);if(!r)return n.length*.01;if(!n)return null;if(n.startsWith(r))return(n.length-r.length)*.01;let i=0,s=-1,o=-1,a=0;for(let l=0;l<n.length&&i<r.length;l+=1)n[l]===r[i]&&(o<0&&(o=l),s>=0&&(a+=l-s-1),s=l,i+=1);return i!==r.length?null:1+o*.05+a*.1+(n.length-r.length)*.01}function E_(e,t,r){const n=[];for(const i of e){const s=r(i),o=vR(t,s);o!==null&&n.push({item:i,key:s,score:o})}return n.sort((i,s)=>i.score!==s.score?i.score-s.score:i.key.localeCompare(s.key)),n.map(i=>i.item)}function _R(e){const{t}=jt(),r=p.useRef(null),[n,i]=p.useState(!1),[s,o]=p.useState(0),[a,l]=p.useState(0),c=e.mode==="send"&&!e.buttonDisabled,d=p.useMemo(()=>{const y=!e.text.includes(`
|
|
102
|
-
`),g=e.text.replace(/^\s+/,"");if(!(y&&g.startsWith("/")&&!g.startsWith("//")))return{open:!1,query:"",items:[],tokenOnly:!1};const w=g.split(/\s+/,1)[0]??"/",b=w.trim(),C=b.startsWith("/")?b.slice(1):b,x=g.slice(w.length).trim().length===0,T=b==="/"?e.slashCommands:E_(e.slashCommands,C,k=>k.name.startsWith("/")?k.name.slice(1):k.name);return{open:x,query:b,items:T,tokenOnly:x}},[e.text,e.slashCommands]),h=p.useMemo(()=>{const y=!e.text.includes(`
|
|
103
|
-
`),g=e.text.replace(/^\s+/,"");if(!(y&&g.startsWith("$")&&!g.startsWith("$$")))return{open:!1,query:"",items:[],tokenOnly:!1};const w=g.split(/\s+/,1)[0]??"$",b=w.trim().slice(1),M=g.slice(w.length).trim().length===0,x=b?E_(e.skills,b,T=>T.name):e.skills;return{open:M,query:b,items:x,tokenOnly:M}},[e.text,e.skills]);p.useEffect(()=>{h.open&&(e.skills.length||e.onLoadSkills())},[h.open,e.skills.length,e.onLoadSkills]);const f=()=>{if(!c)return;const y=e.text.trim();y&&(e.onSubmit(y),e.onTextChange(""),o(0),l(0))};p.useLayoutEffect(()=>{const y=r.current;if(!y)return;const g=window.getComputedStyle(y),_=parseFloat(g.minHeight),w=parseFloat(g.maxHeight),b=parseFloat(g.borderTopWidth),C=parseFloat(g.borderBottomWidth),M=Number.isFinite(_)?_:0,x=Number.isFinite(w)?w:Number.POSITIVE_INFINITY,T=(Number.isFinite(b)?b:0)+(Number.isFinite(C)?C:0);y.style.height="auto";const k=y.scrollHeight>y.clientHeight+1,I=Math.min(Math.max(y.scrollHeight+T,M),x);y.style.height=`${I}px`,y.style.overflowY=y.scrollHeight+T>x?"auto":"hidden",i(L=>{const R=k;return L===R?L:R})},[e.text]),p.useEffect(()=>{d.open&&o(y=>{const g=Math.max(0,d.items.length-1);return Math.min(Math.max(0,y),g)})},[d.open,d.items.length]),p.useEffect(()=>{h.open&&l(y=>{const g=Math.max(0,h.items.length-1);return Math.min(Math.max(0,y),g)})},[h.open,h.items.length]);const v=y=>{const g=e.text,_=/^(\s*)(\/\S*)(.*)$/s.exec(g);if(!_)return;const w=_[1]??"",b=(_[3]??"").replace(/^\s+/,""),C=!!b||!!y.args;e.onTextChange(`${w}${y.name}${C?" ":""}${b}`),requestAnimationFrame(()=>{var M;return(M=r.current)==null?void 0:M.focus()})},m=y=>{const g=e.text,_=/^(\s*)(\$\S*)(.*)$/s.exec(g);if(!_)return;const w=_[1]??"",b=(_[3]??"").replace(/^\s+/,"");e.onTextChange(`${w}$${y.name} ${b}`),requestAnimationFrame(()=>{var C;return(C=r.current)==null?void 0:C.focus()})},S=y=>{e.text.trim()||e.onTextChange(y),requestAnimationFrame(()=>{var g;return(g=r.current)==null?void 0:g.focus()})};return u.jsxs("div",{className:"composer",children:[e.topPanel?u.jsx("div",{className:"composerTopPanel",children:e.topPanel}):null,u.jsxs("div",{className:"composerToolbar",children:[u.jsx("div",{className:"composerToolbarMain",children:e.toolbar}),u.jsx("div",{className:"composerToolbarRight",role:"toolbar","aria-label":t("composer.toolbarRight"),children:u.jsxs("div",{className:"composerQuickTokens",role:"toolbar","aria-label":t("composer.quickTokens"),children:[u.jsx("button",{type:"button",className:"mainActionBtn composerTokenBtn",disabled:e.textareaDisabled,onMouseDown:y=>y.preventDefault(),onClick:()=>S("/"),"aria-label":t("composer.insertSlash"),title:t("composer.insertSlashTitle"),children:u.jsx(fR,{})}),u.jsx("button",{type:"button",className:"mainActionBtn composerTokenBtn",disabled:e.textareaDisabled,onMouseDown:y=>y.preventDefault(),onClick:()=>S("$"),"aria-label":t("composer.insertSkill"),title:t("composer.insertSkillTitle"),children:u.jsx(mR,{})}),e.toolbarRight]})})]}),u.jsxs("div",{className:n?"composerBox composerBoxExpanded":"composerBox",children:[d.open&&d.items.length?u.jsx("div",{className:"slashMenu",role:"listbox","aria-label":t("composer.menu.slash"),children:d.items.map((y,g)=>{const _=g===s;return u.jsxs("button",{type:"button",className:_?"slashItem slashItemSelected":"slashItem",onMouseDown:w=>{w.preventDefault(),v(y)},"aria-selected":_,role:"option",title:y.description,children:[u.jsxs("span",{className:"slashName",children:[y.name,y.args?u.jsxs("span",{className:"slashArgs",children:[" ",y.args]}):null]}),u.jsx("span",{className:"slashDesc",children:y.description})]},y.name)})}):null,h.open&&h.items.length?u.jsx("div",{className:"slashMenu",role:"listbox","aria-label":t("composer.menu.skills"),children:h.items.map((y,g)=>{const _=g===a;return u.jsxs("button",{type:"button",className:_?"slashItem slashItemSelected":"slashItem",onMouseDown:w=>{w.preventDefault(),m(y)},"aria-selected":_,role:"option",title:y.description??y.path,children:[u.jsxs("span",{className:"slashName",children:["$",y.name]}),u.jsx("span",{className:"slashDesc",children:y.description??""})]},y.name)})}):null,u.jsxs("div",{className:"composerInputGroup",children:[u.jsx("textarea",{className:"composerInput",ref:y=>{r.current=y,e.textareaRef&&(e.textareaRef.current=y)},rows:1,placeholder:e.placeholder??(e.textareaDisabled?t("composer.placeholder.openThread"):t("composer.placeholder.typeMessage")),value:e.text,disabled:e.textareaDisabled,onChange:y=>e.onTextChange(y.target.value),onPaste:y=>{const g=tR(y);g.length&&e.onPasteImageFiles&&(y.preventDefault(),e.onPasteImageFiles(g))},onKeyDown:y=>{if(e.mode==="send"){if(d.open&&d.items.length){if(y.key==="ArrowDown"){y.preventDefault(),o(g=>Math.min(d.items.length-1,g+1));return}if(y.key==="ArrowUp"){y.preventDefault(),o(g=>Math.max(0,g-1));return}if(y.key==="Tab"){y.preventDefault();const g=d.items[s]??d.items[0];g&&v(g);return}if(y.key==="Enter"&&!y.shiftKey){if(y.preventDefault(),!c)return;const g=d.items[s]??d.items[0];if(!g)return;e.onTextChange(""),e.onSubmit(g.name),o(0),l(0);return}if(y.key==="Escape"){y.preventDefault(),e.onTextChange(e.text.replace(/^(\s*)\//,"$1"));return}}if(h.open&&h.items.length){if(y.key==="ArrowDown"){y.preventDefault(),l(g=>Math.min(h.items.length-1,g+1));return}if(y.key==="ArrowUp"){y.preventDefault(),l(g=>Math.max(0,g-1));return}if(y.key==="Tab"){y.preventDefault();const g=h.items[a]??h.items[0];g&&m(g);return}if(y.key==="Enter"&&!y.shiftKey){y.preventDefault();const g=h.items[a]??h.items[0];g&&m(g);return}if(y.key==="Escape"){y.preventDefault(),e.onTextChange(e.text.replace(/^(\s*)\$/,"$1"));return}}y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),f())}}}),u.jsx(H2,{className:e.mode==="stop"?"composerBtn composerBtnStop":"composerBtn composerBtnSend",isDisabled:e.buttonDisabled,onPress:()=>e.mode==="stop"?e.onStop():f(),"aria-label":e.mode==="stop"?t("composer.stop"):t("composer.send"),children:e.mode==="stop"?u.jsx(Q2,{className:"composerBtnIcon","aria-hidden":"true"}):u.jsx(X2,{className:"composerBtnIcon","aria-hidden":"true"})})]})]})]})}function yR(e){var f,v;const{t}=jt(),r=e.threadId?e.threadCollaboration:void 0,n=(r==null?void 0:r.mode)==="plan",i=r?String(r.settings.model??e.webDefaults.model??e.cliDefaults.model??"").trim():String(((f=e.threadModelOverride)==null?void 0:f.model)??e.webDefaults.model??e.cliDefaults.model??"").trim(),o=String(((v=e.threadModelOverride)==null?void 0:v.reasoningEffort)??e.webDefaults.reasoningEffort??e.cliDefaults.reasoningEffort??"").trim()||t("common.default"),a=p.useMemo(()=>!e.modelList||!i?null:e.modelList.find(m=>m.model===i||m.id===i)??null,[e.modelList,i]),l=(a==null?void 0:a.displayName)||i||t("common.default"),c=i?t("composer.model.title.selected",{model:(a==null?void 0:a.displayName)||i}):t("composer.model.title.unselected"),d=t(n?"composer.plan.title.on":"composer.plan.title.off"),h=i?t("composer.reasoning.title.withModel",{effort:o,model:i}):t("composer.reasoning.title.noModel",{effort:o});return u.jsxs("div",{className:"composerToolbarRow",role:"toolbar","aria-label":t("composer.toolbar"),children:[u.jsx("button",{type:"button",className:n?"mainActionBtn composerToolbarBtn composerToolbarBtnActive":"mainActionBtn composerToolbarBtn",onClick:()=>void e.onTogglePlan(),disabled:!e.connected,title:d,"aria-label":t(n?"composer.plan.on":"composer.plan.off"),children:u.jsx(lR,{})}),u.jsxs("button",{type:"button",className:"mainActionBtn composerToolbarBtn",onClick:()=>void e.onCycleModel(),disabled:!e.connected,title:c,"aria-label":t("composer.model.aria",{model:l}),children:[u.jsx(cR,{}),u.jsx("span",{className:"composerToolbarBtnValue",children:l})]}),u.jsxs("button",{type:"button",className:"mainActionBtn composerToolbarBtn",onClick:e.onCycleReasoningEffort,disabled:!e.connected,title:h,"aria-label":t("composer.reasoning.aria",{effort:o}),children:[u.jsx(uR,{}),u.jsx("span",{className:"composerToolbarBtnValue",children:o})]})]})}function SR(e){const{t}=jt(),r=!e.connected||e.busy||e.uploading||!e.threadId,n=e.threadId?e.uploading?t("composer.attachment.uploading"):t("composer.attachment.upload"):t("composer.attachment.needThread"),i=()=>{var s;r||(s=e.fileInputRef.current)==null||s.click()};return u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:e.fileInputRef,type:"file",multiple:!0,className:"composerHiddenFileInput",onChange:s=>{if(!e.threadId)return;const o=Array.from(s.currentTarget.files??[]);o.length&&e.onUpload(o)}}),u.jsx("button",{type:"button",className:"mainActionBtn composerTokenBtn",onMouseDown:s=>s.preventDefault(),onClick:i,disabled:r,title:n,"aria-label":e.uploading?t("composer.attachment.uploadingAria"):t("composer.attachment.addAria"),children:e.uploading?u.jsx(Ib,{}):u.jsx(Mp,{})})]})}function wR(e){const{t}=jt(),r=e.pendingAttachment.originalName||e.pendingAttachment.filename,n=t("composer.attachment.remove");return u.jsxs("div",{className:"composerAttachmentItem","aria-label":t("composer.attachments.item"),children:[u.jsxs("div",{className:"composerAttachmentNameRow",children:[u.jsx(Mp,{}),u.jsx("a",{className:"composerAttachmentDownloadName",href:e.pendingAttachment.apiUrl,target:"_blank",rel:"noreferrer",title:r,"aria-label":t("composer.attachment.download"),children:r})]}),u.jsx("button",{type:"button",className:"composerAttachmentRemoveBtn",onMouseDown:i=>i.preventDefault(),onClick:e.onClear,title:n,"aria-label":n,children:u.jsx(eR,{})})]})}function bR(e){const{t}=jt();return u.jsx("div",{className:"chatAttachments",role:"region","aria-label":t("composer.attachments.region"),children:u.jsx("div",{className:"chatAttachmentsList","aria-label":t("composer.attachments.pendingList"),children:e.pendingAttachments.map(r=>u.jsx(wR,{pendingAttachment:r,onClear:()=>e.onRemove(r.localPath)},r.localPath))})})}const Du=0,vi=1,ho=2,Mb=4;function I_(e){return()=>e}function CR(e){e()}function Pb(e,t){return r=>e(t(r))}function R_(e,t){return()=>e(t)}function xR(e,t){return r=>e(t,r)}function Pp(e){return e!==void 0}function kR(...e){return()=>{e.map(CR)}}function fo(){}function Bu(e,t){return t(e),e}function TR(e,t){return t(e)}function Ke(...e){return e}function Ae(e,t){return e(vi,t)}function Se(e,t){e(Du,t)}function Lp(e){e(ho)}function Ye(e){return e(Mb)}function de(e,t){return Ae(e,xR(t,Du))}function Xr(e,t){const r=e(vi,n=>{r(),t(n)});return r}function M_(e){let t,r;return n=>i=>{t=i,r&&clearTimeout(r),r=setTimeout(()=>{n(t)},e)}}function Lb(e,t){return e===t}function We(e=Lb){let t;return r=>n=>{e(t,n)||(t=n,r(n))}}function me(e){return t=>r=>{e(r)&&t(r)}}function oe(e){return t=>Pb(t,e)}function ln(e){return t=>()=>{t(e)}}function q(e,...t){const r=ER(...t);return(n,i)=>{switch(n){case ho:Lp(e);return;case vi:return Ae(e,r(i))}}}function un(e,t){return r=>n=>{r(t=e(t,n))}}function Yi(e){return t=>r=>{e>0?e--:t(r)}}function En(e){let t=null,r;return n=>i=>{t=i,!r&&(r=setTimeout(()=>{r=void 0,n(t)},e))}}function be(...e){const t=new Array(e.length);let r=0,n=null;const i=Math.pow(2,e.length)-1;return e.forEach((s,o)=>{const a=Math.pow(2,o);Ae(s,l=>{const c=r;r=r|a,t[o]=l,c!==i&&r===i&&n&&(n(),n=null)})}),s=>o=>{const a=()=>{s([o].concat(t))};r===i?a():n=a}}function ER(...e){return t=>e.reduceRight(TR,t)}function IR(e){let t,r;const n=()=>t==null?void 0:t();return function(i,s){switch(i){case vi:return s?r===s?void 0:(n(),r=s,t=Ae(e,s),t):(n(),fo);case ho:n(),r=null;return}}}function J(e){let t=e;const r=Ie();return(n,i)=>{switch(n){case Du:t=i;break;case vi:{i(t);break}case Mb:return t}return r(n,i)}}function Vt(e,t){return Bu(J(t),r=>de(e,r))}function Ie(){const e=[];return(t,r)=>{switch(t){case Du:e.slice().forEach(n=>{n(r)});return;case ho:e.splice(0,e.length);return;case vi:return e.push(r),()=>{const n=e.indexOf(r);n>-1&&e.splice(n,1)}}}}function br(e){return Bu(Ie(),t=>de(e,t))}function Le(e,t=[],{singleton:r}={singleton:!0}){return{constructor:e,dependencies:t,id:RR(),singleton:r}}const RR=()=>Symbol();function MR(e){const t=new Map,r=({constructor:n,dependencies:i,id:s,singleton:o})=>{if(o&&t.has(s))return t.get(s);const a=n(i.map(l=>r(l)));return o&&t.set(s,a),a};return r(e)}function ft(...e){const t=Ie(),r=new Array(e.length);let n=0;const i=Math.pow(2,e.length)-1;return e.forEach((s,o)=>{const a=Math.pow(2,o);Ae(s,l=>{r[o]=l,n=n|a,n===i&&Se(t,r)})}),function(s,o){switch(s){case ho:{Lp(t);return}case vi:return n===i&&o(r),Ae(t,o)}}}function fe(e,t=Lb){return q(e,We(t))}function yf(...e){return function(t,r){switch(t){case ho:return;case vi:return kR(...e.map(n=>Ae(n,r)))}}}var hr=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(hr||{});const PR={0:"debug",3:"error",1:"log",2:"warn"},LR=()=>typeof globalThis>"u"?window:globalThis,_i=Le(()=>{const e=J(3);return{log:J((t,r,n=1)=>{var i;const s=(i=LR().VIRTUOSO_LOG_LEVEL)!=null?i:Ye(e);n>=s&&console[PR[n]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,r)}),logLevel:e}},[],{singleton:!0});function es(e,t,r){return Ap(e,t,r).callbackRef}function Ap(e,t,r){const n=ne.useRef(null);let i=o=>{};const s=ne.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(o=>{const a=()=>{const l=o[0].target;l.offsetParent!==null&&e(l)};r?a():requestAnimationFrame(a)}):null,[e,r]);return i=o=>{o&&t?(s==null||s.observe(o),n.current=o):(n.current&&(s==null||s.unobserve(n.current)),n.current=null)},{callbackRef:i,ref:n}}function AR(e,t,r,n,i,s,o,a,l){const c=ne.useCallback(d=>{const h=NR(d.children,t,a?"offsetWidth":"offsetHeight",i);let f=d.parentElement;for(;!f.dataset.virtuosoScroller;)f=f.parentElement;const v=f.lastElementChild.dataset.viewportType==="window";let m;v&&(m=f.ownerDocument.defaultView);const S=o?a?o.scrollLeft:o.scrollTop:v?a?m.scrollX||m.document.documentElement.scrollLeft:m.scrollY||m.document.documentElement.scrollTop:a?f.scrollLeft:f.scrollTop,y=o?a?o.scrollWidth:o.scrollHeight:v?a?m.document.documentElement.scrollWidth:m.document.documentElement.scrollHeight:a?f.scrollWidth:f.scrollHeight,g=o?a?o.offsetWidth:o.offsetHeight:v?a?m.innerWidth:m.innerHeight:a?f.offsetWidth:f.offsetHeight;n({scrollHeight:y,scrollTop:Math.max(S,0),viewportHeight:g}),s==null||s(a?P_("column-gap",getComputedStyle(d).columnGap,i):P_("row-gap",getComputedStyle(d).rowGap,i)),h!==null&&e(h)},[e,t,i,s,o,n,a]);return Ap(c,r,l)}function NR(e,t,r,n){const i=e.length;if(i===0)return null;const s=[];for(let o=0;o<i;o++){const a=e.item(o);if(a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),d=t(a,r);if(d===0&&n("Zero-sized element, this should not happen",{child:a},hr.ERROR),d===c)continue;const h=s[s.length-1];s.length===0||h.size!==d||h.endIndex!==l-1?s.push({endIndex:l,size:d,startIndex:l}):s[s.length-1].endIndex++}return s}function P_(e,t,r){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&r(`${e} was not resolved to pixel value correctly`,t,hr.WARN),t==="normal"?0:parseInt(t??"0",10)}function Ab(e,t,r){const n=ne.useRef(null),i=ne.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const c=l.getBoundingClientRect(),d=c.width;let h,f;if(t){const v=t.getBoundingClientRect(),m=c.top-v.top;f=v.height-Math.max(0,m),h=m+t.scrollTop}else{const v=o.current.ownerDocument.defaultView;f=v.innerHeight-Math.max(0,c.top),h=c.top+v.scrollY}n.current={offsetTop:h,visibleHeight:f,visibleWidth:d},e(n.current)},[e,t]),{callbackRef:s,ref:o}=Ap(i,!0,r),a=ne.useCallback(()=>{i(o.current)},[i,o]);return ne.useEffect(()=>{var l;if(t){t.addEventListener("scroll",a);const c=new ResizeObserver(()=>{requestAnimationFrame(a)});return c.observe(t),()=>{t.removeEventListener("scroll",a),c.unobserve(t)}}else{const c=(l=o.current)==null?void 0:l.ownerDocument.defaultView;return c==null||c.addEventListener("scroll",a),c==null||c.addEventListener("resize",a),()=>{c==null||c.removeEventListener("scroll",a),c==null||c.removeEventListener("resize",a)}}},[a,t,o]),s}const tr=Le(()=>{const e=Ie(),t=Ie(),r=J(0),n=Ie(),i=J(0),s=Ie(),o=Ie(),a=J(0),l=J(0),c=J(0),d=J(0),h=Ie(),f=Ie(),v=J(!1),m=J(!1),S=J(!1);return de(q(e,oe(({scrollTop:y})=>y)),t),de(q(e,oe(({scrollHeight:y})=>y)),o),de(t,i),{deviation:r,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:d,headerHeight:a,horizontalDirection:m,scrollBy:f,scrollContainerState:e,scrollHeight:o,scrollingInProgress:v,scrollTo:h,scrollTop:t,skipAnimationFrameInResizeObserver:S,smoothScrollTargetReached:n,statefulScrollTop:i,viewportHeight:s}},[],{singleton:!0}),Ba={lvl:0};function Nb(e,t){const r=e.length;if(r===0)return[];let{index:n,value:i}=t(e[0]);const s=[];for(let o=1;o<r;o++){const{index:a,value:l}=t(e[o]);s.push({end:a-1,start:n,value:i}),n=a,i=l}return s.push({end:1/0,start:n,value:i}),s}function Be(e){return e===Ba}function Oa(e,t){if(!Be(e))return t===e.k?e.v:t<e.k?Oa(e.l,t):Oa(e.r,t)}function Qr(e,t,r="k"){if(Be(e))return[-1/0,void 0];if(Number(e[r])===t)return[e.k,e.v];if(Number(e[r])<t){const n=Qr(e.r,t,r);return n[0]===-1/0?[e.k,e.v]:n}return Qr(e.l,t,r)}function yr(e,t,r){return Be(e)?Ob(t,r,1):t===e.k?_t(e,{k:t,v:r}):t<e.k?L_(_t(e,{l:yr(e.l,t,r)})):L_(_t(e,{r:yr(e.r,t,r)}))}function Vs(){return Ba}function qs(e,t,r){if(Be(e))return[];const n=Qr(e,t)[0];return DR(wf(e,n,r))}function Sf(e,t){if(Be(e))return Ba;const{k:r,l:n,r:i}=e;if(t===r){if(Be(n))return i;if(Be(i))return n;{const[s,o]=Bb(n);return Sc(_t(e,{k:s,l:Db(n),v:o}))}}else return t<r?Sc(_t(e,{l:Sf(n,t)})):Sc(_t(e,{r:Sf(i,t)}))}function Di(e){return Be(e)?[]:[...Di(e.l),{k:e.k,v:e.v},...Di(e.r)]}function wf(e,t,r){if(Be(e))return[];const{k:n,l:i,r:s,v:o}=e;let a=[];return n>t&&(a=a.concat(wf(i,t,r))),n>=t&&n<=r&&a.push({k:n,v:o}),n<=r&&(a=a.concat(wf(s,t,r))),a}function Sc(e){const{l:t,lvl:r,r:n}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(Ud(t))return $b(_t(e,{lvl:r-1}));if(!Be(t)&&!Be(t.r))return _t(t.r,{l:_t(t,{r:t.r.l}),lvl:r,r:_t(e,{l:t.r.r,lvl:r-1})});throw new Error("Unexpected empty nodes")}else{if(Ud(e))return bf(_t(e,{lvl:r-1}));if(!Be(n)&&!Be(n.l)){const i=n.l,s=Ud(i)?n.lvl-1:n.lvl;return _t(i,{l:_t(e,{lvl:r-1,r:i.l}),lvl:i.lvl+1,r:bf(_t(n,{l:i.r,lvl:s}))})}else throw new Error("Unexpected empty nodes")}}function _t(e,t){return Ob(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function Db(e){return Be(e.r)?e.l:Sc(_t(e,{r:Db(e.r)}))}function Ud(e){return Be(e)||e.lvl>e.r.lvl}function Bb(e){return Be(e.r)?[e.k,e.v]:Bb(e.r)}function Ob(e,t,r,n=Ba,i=Ba){return{k:e,l:n,lvl:r,r:i,v:t}}function L_(e){return bf($b(e))}function $b(e){const{l:t}=e;return!Be(t)&&t.lvl===e.lvl?_t(t,{r:_t(e,{l:t.r})}):e}function bf(e){const{lvl:t,r}=e;return!Be(r)&&!Be(r.r)&&r.lvl===t&&r.r.lvl===t?_t(r,{l:_t(e,{r:r.l}),lvl:t+1}):e}function DR(e){return Nb(e,({k:t,v:r})=>({index:t,value:r}))}function jb(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function $a(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const Np=Le(()=>({recalcInProgress:J(!1)}),[],{singleton:!0});function zb(e,t,r){return e[ou(e,t,r)]}function ou(e,t,r,n=0){let i=e.length-1;for(;n<=i;){const s=Math.floor((n+i)/2),o=e[s],a=r(o,t);if(a===0)return s;if(a===-1){if(i-n<2)return s-1;i=s-1}else{if(i===n)return s;n=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function BR(e,t,r,n){const i=ou(e,t,n),s=ou(e,r,n,i);return e.slice(i,s+1)}function hi(e,t){return Math.round(e.getBoundingClientRect()[t])}function Ou(e){return!Be(e.groupOffsetTree)}function Dp({index:e},t){return t===e?0:t<e?-1:1}function OR(){return{groupIndices:[],groupOffsetTree:Vs(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Vs()}}function $R(e,t){let r=Be(e)?0:1/0;for(const n of t){const{endIndex:i,size:s,startIndex:o}=n;if(r=Math.min(r,o),Be(e)){e=yr(e,0,s);continue}const a=qs(e,o-1,i+1);if(a.some(KR(n)))continue;let l=!1,c=!1;for(const{end:d,start:h,value:f}of a)l?(i>=h||s===f)&&(e=Sf(e,h)):(c=f!==s,l=!0),d>i&&i>=h&&f!==s&&(e=yr(e,i+1,f));c&&(e=yr(e,o,s))}return[e,r]}function jR(e){return typeof e.groupIndex<"u"}function zR({offset:e},t){return t===e?0:t<e?-1:1}function ja(e,t,r){if(t.length===0)return 0;const{index:n,offset:i,size:s}=zb(t,e,Dp),o=e-n,a=s*o+(o-1)*r+i;return a>0?a+r:a}function Fb(e,t){if(!Ou(t))return e;let r=0;for(;t.groupIndices[r]<=e+r;)r++;return e+r}function Hb(e,t,r){if(jR(e))return t.groupIndices[e.groupIndex]+1;{const n=e.index==="LAST"?r:e.index;let i=Fb(n,t);return i=Math.max(0,i,Math.min(r,i)),i}}function FR(e,t,r,n=0){return n>0&&(t=Math.max(t,zb(e,n,Dp).offset)),Nb(BR(e,t,r,zR),UR)}function HR(e,[t,r,n,i]){t.length>0&&n("received item sizes",t,hr.DEBUG);const s=e.sizeTree;let o=s,a=0;if(r.length>0&&Be(s)&&t.length===2){const f=t[0].size,v=t[1].size;o=r.reduce((m,S)=>yr(yr(m,S,f),S+1,v),o)}else[o,a]=$R(o,t);if(o===s)return e;const{lastIndex:l,lastOffset:c,lastSize:d,offsetTree:h}=Cf(e.offsetTree,a,o,i);return{groupIndices:r,groupOffsetTree:r.reduce((f,v)=>yr(f,v,ja(v,h,i)),Vs()),lastIndex:l,lastOffset:c,lastSize:d,offsetTree:h,sizeTree:o}}function WR(e){return Di(e).map(({k:t,v:r},n,i)=>{const s=i[n+1];return{endIndex:s?s.k-1:1/0,size:r,startIndex:t}})}function A_(e,t){let r=0,n=0;for(;r<e;)r+=t[n+1]-t[n]-1,n++;return n-(r===e?0:1)}function Cf(e,t,r,n){let i=e,s=0,o=0,a=0,l=0;if(t!==0){l=ou(i,t-1,Dp),a=i[l].offset;const c=Qr(r,t-1);s=c[0],o=c[1],i.length&&i[l].size===Qr(r,t)[1]&&(l-=1),i=i.slice(0,l+1)}else i=[];for(const{start:c,value:d}of qs(r,t,1/0)){const h=c-s,f=h*o+a+h*n;i.push({index:c,offset:f,size:d}),s=c,a=f,o=d}return{lastIndex:s,lastOffset:a,lastSize:o,offsetTree:i}}function UR(e){return{index:e.index,value:e}}function KR(e){const{endIndex:t,size:r,startIndex:n}=e;return i=>i.start===n&&(i.end===t||i.end===1/0)&&i.value===r}const VR={offsetHeight:"height",offsetWidth:"width"},yn=Le(([{log:e},{recalcInProgress:t}])=>{const r=Ie(),n=Ie(),i=Vt(n,0),s=Ie(),o=Ie(),a=J(0),l=J([]),c=J(void 0),d=J(void 0),h=J(void 0),f=J(void 0),v=J((x,T)=>hi(x,VR[T])),m=J(void 0),S=J(0),y=OR(),g=Vt(q(r,be(l,e,S),un(HR,y),We()),y),_=Vt(q(l,We(),un((x,T)=>({current:T,prev:x.current}),{current:[],prev:[]}),oe(({prev:x})=>x)),[]);de(q(l,me(x=>x.length>0),be(g,S),oe(([x,T,k])=>{const I=x.reduce((L,R,A)=>yr(L,R,ja(R,T.offsetTree,k)||A),Vs());return{...T,groupIndices:x,groupOffsetTree:I}})),g),de(q(n,be(g),me(([x,{lastIndex:T}])=>x<T),oe(([x,{lastIndex:T,lastSize:k}])=>[{endIndex:T,size:k,startIndex:x}])),r),de(c,d);const w=Vt(q(c,oe(x=>x===void 0)),!0);de(q(d,me(x=>x!==void 0&&Be(Ye(g).sizeTree)),oe(x=>{const T=Ye(h),k=Ye(l).length>0;return T?k?[{endIndex:0,size:T,startIndex:0},{endIndex:1,size:x,startIndex:1}]:[]:[{endIndex:0,size:x,startIndex:0}]})),r),de(q(f,me(x=>x!==void 0&&x.length>0&&Be(Ye(g).sizeTree)),oe(x=>{const T=[];let k=x[0],I=0;for(let L=1;L<x.length;L++){const R=x[L];R!==k&&(T.push({endIndex:L-1,size:k,startIndex:I}),k=R,I=L)}return T.push({endIndex:x.length-1,size:k,startIndex:I}),T})),r),de(q(l,be(h,d),me(([,x,T])=>x!==void 0&&T!==void 0),oe(([x,T,k])=>{const I=[];for(let L=0;L<x.length;L++){const R=x[L],A=x[L+1];I.push({startIndex:R,endIndex:R,size:T}),A!==void 0&&I.push({startIndex:R+1,endIndex:A-1,size:k})}return I})),r);const b=br(q(r,be(g),un(({sizes:x},[T,k])=>({changed:k!==x,sizes:k}),{changed:!1,sizes:y}),oe(x=>x.changed)));Ae(q(a,un((x,T)=>({diff:x.prev-T,prev:T}),{diff:0,prev:0}),oe(x=>x.diff)),x=>{const{groupIndices:T}=Ye(g);if(x>0)Se(t,!0),Se(s,x+A_(x,T));else if(x<0){const k=Ye(_);k.length>0&&(x-=A_(-x,k)),Se(o,x)}}),Ae(q(a,be(e)),([x,T])=>{x<0&&T("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},hr.ERROR)});const C=br(s);de(q(s,be(g),oe(([x,T])=>{const k=T.groupIndices.length>0,I=[],L=T.lastSize;if(k){const R=Oa(T.sizeTree,0);let A=0,O=0;for(;A<x;){const E=T.groupIndices[O],F=T.groupIndices.length===O+1?1/0:T.groupIndices[O+1]-E-1;I.push({endIndex:E,size:R,startIndex:E}),I.push({endIndex:E+1+F-1,size:L,startIndex:E+1}),O++,A+=F+1}const P=Di(T.sizeTree);return A!==x&&P.shift(),P.reduce((E,{k:F,v:N})=>{let V=E.ranges;return E.prevSize!==0&&(V=[...E.ranges,{endIndex:F+x-1,size:E.prevSize,startIndex:E.prevIndex}]),{prevIndex:F+x,prevSize:N,ranges:V}},{prevIndex:x,prevSize:0,ranges:I}).ranges}return Di(T.sizeTree).reduce((R,{k:A,v:O})=>({prevIndex:A+x,prevSize:O,ranges:[...R.ranges,{endIndex:A+x-1,size:R.prevSize,startIndex:R.prevIndex}]}),{prevIndex:0,prevSize:L,ranges:[]}).ranges})),r);const M=br(q(o,be(g,S),oe(([x,{offsetTree:T},k])=>{const I=-x;return ja(I,T,k)})));return de(q(o,be(g,S),oe(([x,T,k])=>{if(T.groupIndices.length>0){if(Be(T.sizeTree))return T;let I=Vs();const L=Ye(_);let R=0,A=0,O=0;for(;R<-x;){O=L[A];const P=L[A+1]-O-1;A++,R+=P+1}if(I=Di(T.sizeTree).reduce((P,{k:E,v:F})=>yr(P,Math.max(0,E+x),F),I),R!==-x){const P=Oa(T.sizeTree,O);I=yr(I,0,P);const E=Qr(T.sizeTree,-x+1)[1];I=yr(I,1,E)}return{...T,sizeTree:I,...Cf(T.offsetTree,0,I,k)}}else{const I=Di(T.sizeTree).reduce((L,{k:R,v:A})=>yr(L,Math.max(0,R+x),A),Vs());return{...T,sizeTree:I,...Cf(T.offsetTree,0,I,k)}}})),g),{beforeUnshiftWith:C,data:m,defaultItemSize:d,firstItemIndex:a,fixedItemSize:c,fixedGroupSize:h,gap:S,groupIndices:l,heightEstimates:f,itemSize:v,listRefresh:b,shiftWith:o,shiftWithOffset:M,sizeRanges:r,sizes:g,statefulTotalCount:i,totalCount:n,trackItemSizes:w,unshiftWith:s}},Ke(_i,Np),{singleton:!0});function qR(e){return e.reduce((t,r)=>(t.groupIndices.push(t.totalCount),t.totalCount+=r+1,t),{groupIndices:[],totalCount:0})}const Wb=Le(([{groupIndices:e,sizes:t,totalCount:r},{headerHeight:n,scrollTop:i}])=>{const s=Ie(),o=Ie(),a=br(q(s,oe(qR)));return de(q(a,oe(l=>l.totalCount)),r),de(q(a,oe(l=>l.groupIndices)),e),de(q(ft(i,t,n),me(([l,c])=>Ou(c)),oe(([l,c,d])=>Qr(c.groupOffsetTree,Math.max(l-d,0),"v")[0]),We(),oe(l=>[l])),o),{groupCounts:s,topItemsIndexes:o}},Ke(yn,tr)),yi=Le(([{log:e}])=>{const t=J(!1),r=br(q(t,me(n=>n),We()));return Ae(t,n=>{n&&Ye(e)("props updated",{},hr.DEBUG)}),{didMount:r,propsReady:t}},Ke(_i),{singleton:!0}),YR=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Ub(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!YR)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const el=Le(([{gap:e,listRefresh:t,sizes:r,totalCount:n},{fixedFooterHeight:i,fixedHeaderHeight:s,footerHeight:o,headerHeight:a,scrollingInProgress:l,scrollTo:c,smoothScrollTargetReached:d,viewportHeight:h},{log:f}])=>{const v=Ie(),m=Ie(),S=J(0);let y=null,g=null,_=null;function w(){y&&(y(),y=null),_&&(_(),_=null),g&&(clearTimeout(g),g=null),Se(l,!1)}return de(q(v,be(r,h,n,S,a,o,f),be(e,s,i),oe(([[b,C,M,x,T,k,I,L],R,A,O])=>{const P=Ub(b),{align:E,behavior:F,offset:N}=P,V=x-1,D=Hb(P,C,V);let W=ja(D,C.offsetTree,R)+k;E==="end"?(W+=A+Qr(C.sizeTree,D)[1]-M+O,D===V&&(W+=I)):E==="center"?W+=(A+Qr(C.sizeTree,D)[1]-M+O)/2:W-=T,N&&(W+=N);const j=ee=>{w(),ee?(L("retrying to scroll to",{location:b},hr.DEBUG),Se(v,b)):(Se(m,!0),L("list did not change, scroll successful",{},hr.DEBUG))};if(w(),F==="smooth"){let ee=!1;_=Ae(t,te=>{ee=ee||te}),y=Xr(d,()=>{j(ee)})}else y=Xr(q(t,GR(150)),j);return g=setTimeout(()=>{w()},1200),Se(l,!0),L("scrolling from index to",{behavior:F,index:D,top:W},hr.DEBUG),{behavior:F,top:W}})),c),{scrollTargetReached:m,scrollToIndex:v,topListHeight:S}},Ke(yn,tr,_i),{singleton:!0});function GR(e){return t=>{const r=setTimeout(()=>{t(!1)},e);return n=>{n&&(t(!0),clearTimeout(r))}}}function Bp(e,t){e==0?t():requestAnimationFrame(()=>{Bp(e-1,t)})}function Op(e,t){const r=t-1;return typeof e=="number"?e:e.index==="LAST"?r:e.index}const tl=Le(([{defaultItemSize:e,listRefresh:t,sizes:r},{scrollTop:n},{scrollTargetReached:i,scrollToIndex:s},{didMount:o}])=>{const a=J(!0),l=J(0),c=J(!0);return de(q(o,be(l),me(([d,h])=>!!h),ln(!1)),a),de(q(o,be(l),me(([d,h])=>!!h),ln(!1)),c),Ae(q(ft(t,o),be(a,r,e,c),me(([[,d],h,{sizeTree:f},v,m])=>d&&(!Be(f)||Pp(v))&&!h&&!m),be(l)),([,d])=>{Xr(i,()=>{Se(c,!0)}),Bp(4,()=>{Xr(n,()=>{Se(a,!0)}),Se(s,d)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:a}},Ke(yn,tr,el,yi),{singleton:!0});function Kb(e,t){return Math.abs(e-t)<1.01}const za="up",fa="down",XR="none",JR={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},QR=0,rl=Le(([{footerHeight:e,headerHeight:t,scrollBy:r,scrollContainerState:n,scrollTop:i,viewportHeight:s}])=>{const o=J(!1),a=J(!0),l=Ie(),c=Ie(),d=J(4),h=J(QR),f=Vt(q(yf(q(fe(i),Yi(1),ln(!0)),q(fe(i),Yi(1),ln(!1),M_(100))),We()),!1),v=Vt(q(yf(q(r,ln(!0)),q(r,ln(!1),M_(200))),We()),!1);de(q(ft(fe(i),fe(h)),oe(([_,w])=>_<=w),We()),a),de(q(a,En(50)),c);const m=br(q(ft(n,fe(s),fe(t),fe(e),fe(d)),un((_,[{scrollHeight:w,scrollTop:b},C,M,x,T])=>{const k=b+C-w>-T,I={scrollHeight:w,scrollTop:b,viewportHeight:C};if(k){let R,A;return b>_.state.scrollTop?(R="SCROLLED_DOWN",A=_.state.scrollTop-b):(R="SIZE_DECREASED",A=_.state.scrollTop-b||_.scrollTopDelta),{atBottom:!0,atBottomBecause:R,scrollTopDelta:A,state:I}}let L;return I.scrollHeight>_.state.scrollHeight?L="SIZE_INCREASED":C<_.state.viewportHeight?L="VIEWPORT_HEIGHT_DECREASING":b<_.state.scrollTop?L="SCROLLING_UPWARDS":L="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:L,state:I}},JR),We((_,w)=>_&&_.atBottom===w.atBottom))),S=Vt(q(n,un((_,{scrollHeight:w,scrollTop:b,viewportHeight:C})=>{if(Kb(_.scrollHeight,w))return{changed:!1,jump:0,scrollHeight:w,scrollTop:b};{const M=w-(b+C)<1;return _.scrollTop!==b&&M?{changed:!0,jump:_.scrollTop-b,scrollHeight:w,scrollTop:b}:{changed:!0,jump:0,scrollHeight:w,scrollTop:b}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),me(_=>_.changed),oe(_=>_.jump)),0);de(q(m,oe(_=>_.atBottom)),o),de(q(o,En(50)),l);const y=J(fa);de(q(n,oe(({scrollTop:_})=>_),We(),un((_,w)=>Ye(v)?{direction:_.direction,prevScrollTop:w}:{direction:w<_.prevScrollTop?za:fa,prevScrollTop:w},{direction:fa,prevScrollTop:0}),oe(_=>_.direction)),y),de(q(n,En(50),ln(XR)),y);const g=J(0);return de(q(f,me(_=>!_),ln(0)),g),de(q(i,En(100),be(f),me(([_,w])=>w),un(([_,w],[b])=>[w,b],[0,0]),oe(([_,w])=>w-_)),g),{atBottomState:m,atBottomStateChange:l,atBottomThreshold:d,atTopStateChange:c,atTopThreshold:h,isAtBottom:o,isAtTop:a,isScrolling:f,lastJumpDueToItemResize:S,scrollDirection:y,scrollVelocity:g}},Ke(tr)),Fa="top",Ha="bottom",N_="none";function D_(e,t,r){return typeof e=="number"?r===za&&t===Fa||r===fa&&t===Ha?e:0:r===za?t===Fa?e.main:e.reverse:t===Ha?e.main:e.reverse}function B_(e,t){var r;return typeof e=="number"?e:(r=e[t])!=null?r:0}const $p=Le(([{deviation:e,fixedHeaderHeight:t,headerHeight:r,scrollTop:n,viewportHeight:i}])=>{const s=Ie(),o=J(0),a=J(0),l=J(0),c=Vt(q(ft(fe(n),fe(i),fe(r),fe(s,$a),fe(l),fe(o),fe(t),fe(e),fe(a)),oe(([d,h,f,[v,m],S,y,g,_,w])=>{const b=d-_,C=y+g,M=Math.max(f-b,0);let x=N_;const T=B_(w,Fa),k=B_(w,Ha);return v-=_,v+=f+g,m+=f+g,m-=_,v>d+C-T&&(x=za),m<d-M+h+k&&(x=fa),x!==N_?[Math.max(b-f-D_(S,Fa,x)-T,0),b-M-g+h+D_(S,Ha,x)+k]:null}),me(d=>d!=null),We($a)),[0,0]);return{increaseViewportBy:a,listBoundary:s,overscan:l,topListHeight:o,visibleRange:c}},Ke(tr),{singleton:!0});function ZR(e,t,r){if(Ou(t)){const n=Fb(e,t);return[{index:Qr(t.groupOffsetTree,n)[0],offset:0,size:0},{data:r==null?void 0:r[0],index:n,offset:0,size:0}]}return[{data:r==null?void 0:r[0],index:e,offset:0,size:0}]}const Kd={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function wc(e,t,r,n,i,s){const{lastIndex:o,lastOffset:a,lastSize:l}=i;let c=0,d=0;if(e.length>0){c=e[0].offset;const S=e[e.length-1];d=S.offset+S.size}const h=r-o,f=a+h*l+(h-1)*n,v=c,m=f-d;return{bottom:d,firstItemIndex:s,items:O_(e,i,s),offsetBottom:m,offsetTop:c,top:v,topItems:O_(t,i,s),topListHeight:t.reduce((S,y)=>y.size+S,0),totalCount:r}}function Vb(e,t,r,n,i,s){let o=0;if(r.groupIndices.length>0)for(const d of r.groupIndices){if(d-o>=e)break;o++}const a=e+o,l=Op(t,a),c=Array.from({length:a}).map((d,h)=>({data:s[h+l],index:h+l,offset:0,size:0}));return wc(c,[],a,i,r,n)}function O_(e,t,r){if(e.length===0)return[];if(!Ou(t))return e.map(c=>({...c,index:c.index+r,originalIndex:c.index}));const n=e[0].index,i=e[e.length-1].index,s=[],o=qs(t.groupOffsetTree,n,i);let a,l=0;for(const c of e){(!a||a.end<c.index)&&(a=o.shift(),l=t.groupIndices.indexOf(a.start));let d;c.index===a.start?d={index:l,type:"group"}:d={groupIndex:l,index:c.index-(l+1)+r},s.push({...d,data:c.data,offset:c.offset,originalIndex:c.index,size:c.size})}return s}function $_(e,t){var r;return e===void 0?0:typeof e=="number"?e:(r=e[t])!=null?r:0}const ts=Le(([{data:e,firstItemIndex:t,gap:r,sizes:n,totalCount:i},s,{listBoundary:o,topListHeight:a,visibleRange:l},{initialTopMostItemIndex:c,scrolledToInitialItem:d},{topListHeight:h},f,{didMount:v},{recalcInProgress:m}])=>{const S=J([]),y=J(0),g=Ie(),_=J(0);de(s.topItemsIndexes,S);const w=Vt(q(ft(v,m,fe(l,$a),fe(i),fe(n),fe(c),d,fe(S),fe(t),fe(r),fe(_),e),me(([x,T,,k,,,,,,,,I])=>{const L=I&&I.length!==k;return x&&!T&&!L}),oe(([,,[x,T],k,I,L,R,A,O,P,E,F])=>{var N,V,D,W;const j=I,{offsetTree:ee,sizeTree:te}=j,ae=Ye(y);if(k===0)return{...Kd,totalCount:k};if(x===0&&T===0)return ae===0?{...Kd,totalCount:k}:Vb(ae,L,I,O,P,F||[]);if(Be(te))return ae>0?null:wc(ZR(Op(L,k),j,F),[],k,P,j,O);const H=[];if(A.length>0){const re=A[0],ge=A[A.length-1];let Re=0;for(const Oe of qs(te,re,ge)){const we=Oe.value,Me=Math.max(Oe.start,re),wt=Math.min(Oe.end,ge);for(let ue=Me;ue<=wt;ue++)H.push({data:F==null?void 0:F[ue],index:ue,offset:Re,size:we}),Re+=we}}if(!R)return wc([],H,k,P,j,O);const se=A.length>0?A[A.length-1]+1:0,B=FR(ee,x,T,se);if(B.length===0)return null;const z=k-1,Y=Bu([],re=>{for(const ge of B){const Re=ge.value;let Oe=Re.offset,we=ge.start;const Me=Re.size;if(Re.offset<x){we+=Math.floor((x-Re.offset+P)/(Me+P));const ue=we-ge.start;Oe+=ue*Me+ue*P}we<se&&(Oe+=(se-we)*Me,we=se);const wt=Math.min(ge.end,z);for(let ue=we;ue<=wt&&!(Oe>=T);ue++)re.push({data:F==null?void 0:F[ue],index:ue,offset:Oe,size:Me}),Oe+=Me+P}}),Z=$_(E,Fa),ce=$_(E,Ha);if(Y.length>0&&(Z>0||ce>0)){const re=Y[0],ge=Y[Y.length-1];if(Z>0&&re.index>se){const Re=Math.min(Z,re.index-se),Oe=[];let we=re.offset;for(let Me=re.index-1;Me>=re.index-Re;Me--){const wt=(V=(N=qs(te,Me,Me)[0])==null?void 0:N.value)!=null?V:re.size;we-=wt+P,Oe.unshift({data:F==null?void 0:F[Me],index:Me,offset:we,size:wt})}Y.unshift(...Oe)}if(ce>0&&ge.index<z){const Re=Math.min(ce,z-ge.index);let Oe=ge.offset+ge.size+P;for(let we=ge.index+1;we<=ge.index+Re;we++){const Me=(W=(D=qs(te,we,we)[0])==null?void 0:D.value)!=null?W:ge.size;Y.push({data:F==null?void 0:F[we],index:we,offset:Oe,size:Me}),Oe+=Me+P}}}return wc(Y,H,k,P,j,O)}),me(x=>x!==null),We()),Kd);de(q(e,me(Pp),oe(x=>x==null?void 0:x.length)),i),de(q(w,oe(x=>x.topListHeight)),h),de(h,a),de(q(w,oe(x=>[x.top,x.bottom])),o),de(q(w,oe(x=>x.items)),g);const b=br(q(w,me(({items:x})=>x.length>0),be(i,e),me(([{items:x},T])=>x[x.length-1].originalIndex===T-1),oe(([,x,T])=>[x-1,T]),We($a),oe(([x])=>x))),C=br(q(w,En(200),me(({items:x,topItems:T})=>x.length>0&&x[0].originalIndex===T.length),oe(({items:x})=>x[0].index),We())),M=br(q(w,me(({items:x})=>x.length>0),oe(({items:x})=>{let T=0,k=x.length-1;for(;x[T].type==="group"&&T<k;)T++;for(;x[k].type==="group"&&k>T;)k--;return{endIndex:x[k].index,startIndex:x[T].index}}),We(jb)));return{endReached:b,initialItemCount:y,itemsRendered:g,listState:w,minOverscanItemCount:_,rangeChanged:M,startReached:C,topItemsIndexes:S,...f}},Ke(yn,Wb,$p,tl,el,rl,yi,Np),{singleton:!0}),qb=Le(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:r,headerHeight:n},{listState:i}])=>{const s=Ie(),o=Vt(q(ft(r,e,n,t,i),oe(([a,l,c,d,h])=>a+l+c+d+h.offsetBottom+h.bottom)),0);return de(fe(o),s),{totalListHeight:o,totalListHeightChanged:s}},Ke(tr,ts),{singleton:!0}),eM=Le(([{viewportHeight:e},{totalListHeight:t}])=>{const r=J(!1),n=Vt(q(ft(r,e,t),me(([i])=>i),oe(([,i,s])=>Math.max(0,i-s)),En(0),We()),0);return{alignToBottom:r,paddingTopAddition:n}},Ke(tr,qb),{singleton:!0}),Yb=Le(()=>({context:J(null)})),tM=({itemBottom:e,itemTop:t,locationParams:{align:r,behavior:n,...i},viewportBottom:s,viewportTop:o})=>t<o?{...i,align:r??"start",behavior:n}:e>s?{...i,align:r??"end",behavior:n}:null,Gb=Le(([{gap:e,sizes:t,totalCount:r},{fixedFooterHeight:n,fixedHeaderHeight:i,headerHeight:s,scrollingInProgress:o,scrollTop:a,viewportHeight:l},{scrollToIndex:c}])=>{const d=Ie();return de(q(d,be(t,l,r,s,i,n,a),be(e),oe(([[h,f,v,m,S,y,g,_],w])=>{const{align:b,behavior:C,calculateViewLocation:M=tM,done:x,...T}=h,k=Hb(h,f,m-1),I=ja(k,f.offsetTree,w)+S+y,L=I+Qr(f.sizeTree,k)[1],R=_+y,A=_+v-g,O=M({itemBottom:L,itemTop:I,locationParams:{align:b,behavior:C,...T},viewportBottom:A,viewportTop:R});return O?x&&Xr(q(o,me(P=>!P),Yi(Ye(o)?1:2)),x):x==null||x(),O}),me(h=>h!==null)),c),{scrollIntoView:d}},Ke(yn,tr,el,ts,_i),{singleton:!0});function j_(e){return e?e==="smooth"?"smooth":"auto":!1}const rM=(e,t)=>typeof e=="function"?j_(e(t)):t&&j_(e),nM=Le(([{listRefresh:e,totalCount:t,fixedItemSize:r,data:n},{atBottomState:i,isAtBottom:s},{scrollToIndex:o},{scrolledToInitialItem:a},{didMount:l,propsReady:c},{log:d},{scrollingInProgress:h},{context:f},{scrollIntoView:v}])=>{const m=J(!1),S=Ie();let y=null;function g(C){Se(o,{align:"end",behavior:C,index:"LAST"})}Ae(q(ft(q(fe(t),Yi(1)),l),be(fe(m),s,a,h),oe(([[C,M],x,T,k,I])=>{let L=M&&k,R="auto";return L&&(R=rM(x,T||I),L=L&&!!R),{followOutputBehavior:R,shouldFollow:L,totalCount:C}}),me(({shouldFollow:C})=>C)),({followOutputBehavior:C,totalCount:M})=>{y&&(y(),y=null),Ye(r)?requestAnimationFrame(()=>{Ye(d)("following output to ",{totalCount:M},hr.DEBUG),g(C)}):y=Xr(e,()=>{Ye(d)("following output to ",{totalCount:M},hr.DEBUG),g(C),y=null})});function _(C){const M=Xr(i,x=>{C&&!x.atBottom&&x.notAtBottomBecause==="SIZE_INCREASED"&&!y&&(Ye(d)("scrolling to bottom due to increased size",{},hr.DEBUG),g("auto"))});setTimeout(M,100)}Ae(q(ft(fe(m),t,c),me(([C,,M])=>C&&M),un(({value:C},[,M])=>({refreshed:C===M,value:M}),{refreshed:!1,value:0}),me(({refreshed:C})=>C),be(m,t)),([,C])=>{Ye(a)&&_(C!==!1)}),Ae(S,()=>{_(Ye(m)!==!1)}),Ae(ft(fe(m),i),([C,M])=>{C&&!M.atBottom&&M.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&g("auto")});const w=J(null),b=Ie();return de(yf(q(fe(n),oe(C=>{var M;return(M=C==null?void 0:C.length)!=null?M:0})),q(fe(t))),b),Ae(q(ft(q(b,Yi(1)),l),be(fe(w),a,h,f),oe(([[C,M],x,T,k,I])=>M&&T&&(x==null?void 0:x({context:I,totalCount:C,scrollingInProgress:k}))),me(C=>!!C),En(0)),C=>{y&&(y(),y=null),Ye(r)?requestAnimationFrame(()=>{Ye(d)("scrolling into view",{}),Se(v,C)}):y=Xr(e,()=>{Ye(d)("scrolling into view",{}),Se(v,C),y=null})}),{autoscrollToBottom:S,followOutput:m,scrollIntoViewOnChange:w}},Ke(yn,rl,el,tl,yi,_i,tr,Yb,Gb)),iM=Le(([{data:e,firstItemIndex:t,gap:r,sizes:n},{initialTopMostItemIndex:i},{initialItemCount:s,listState:o},{didMount:a}])=>(de(q(a,be(s),me(([,l])=>l!==0),be(i,n,t,r,e),oe(([[,l],c,d,h,f,v=[]])=>Vb(l,c,d,h,f,v))),o),{}),Ke(yn,tl,ts,yi),{singleton:!0}),sM=Le(([{didMount:e},{scrollTo:t},{listState:r}])=>{const n=J(0);return Ae(q(e,be(n),me(([,i])=>i!==0),oe(([,i])=>({top:i}))),i=>{Xr(q(r,Yi(1),me(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{Se(t,i)})})}),{initialScrollTop:n}},Ke(yi,tr,ts),{singleton:!0}),Xb=Le(([{scrollVelocity:e}])=>{const t=J(!1),r=Ie(),n=J(!1);return de(q(e,be(n,t,r),me(([i,s])=>!!s),oe(([i,s,o,a])=>{const{enter:l,exit:c}=s;if(o){if(c(i,a))return!1}else if(l(i,a))return!0;return o}),We()),t),Ae(q(ft(t,e,r),be(n)),([[i,s,o],a])=>{i&&a&&a.change&&a.change(s,o)}),{isSeeking:t,scrollSeekConfiguration:n,scrollSeekRangeChanged:r,scrollVelocity:e}},Ke(rl),{singleton:!0}),jp=Le(([{scrollContainerState:e,scrollTo:t}])=>{const r=Ie(),n=Ie(),i=Ie(),s=J(!1),o=J(void 0);return de(q(ft(r,n),oe(([{scrollHeight:a,scrollTop:l,viewportHeight:c},{offsetTop:d}])=>({scrollHeight:a,scrollTop:Math.max(0,l-d),viewportHeight:c}))),e),de(q(t,be(n),oe(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),i),{customScrollParent:o,useWindowScroll:s,windowScrollContainerState:r,windowScrollTo:i,windowViewportRect:n}},Ke(tr)),oM=Le(([{sizeRanges:e,sizes:t},{headerHeight:r,scrollTop:n},{initialTopMostItemIndex:i},{didMount:s},{useWindowScroll:o,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=Ie(),d=J(void 0),h=J(null),f=J(null);return de(a,h),de(l,f),Ae(q(c,be(t,n,o,h,f,r)),([v,m,S,y,g,_,w])=>{const b=WR(m.sizeTree);y&&g!==null&&_!==null&&(S=g.scrollTop-_.offsetTop),S-=w,v({ranges:b,scrollTop:S})}),de(q(d,me(Pp),oe(aM)),i),de(q(s,be(d),me(([,v])=>v!==void 0),We(),oe(([,v])=>v.ranges)),e),{getState:c,restoreStateFrom:d}},Ke(yn,tr,tl,yi,jp));function aM(e){return{align:"start",index:0,offset:e.scrollTop}}const lM=Le(([{topItemsIndexes:e}])=>{const t=J(0);return de(q(t,me(r=>r>=0),oe(r=>Array.from({length:r}).map((n,i)=>i))),e),{topItemCount:t}},Ke(ts));function Jb(e){let t=!1,r;return()=>(t||(t=!0,r=e()),r)}const cM=Jb(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),uM=Le(([{deviation:e,scrollBy:t,scrollingInProgress:r,scrollTop:n},{isAtBottom:i,isScrolling:s,lastJumpDueToItemResize:o,scrollDirection:a},{listState:l},{beforeUnshiftWith:c,gap:d,shiftWithOffset:h,sizes:f},{log:v},{recalcInProgress:m}])=>{const S=br(q(l,be(o),un(([,g,_,w],[{bottom:b,items:C,offsetBottom:M,totalCount:x},T])=>{const k=b+M;let I=0;return _===x&&g.length>0&&C.length>0&&(C[0].originalIndex===0&&g[0].originalIndex===0||(I=k-w,I!==0&&(I+=T))),[I,C,x,k]},[0,[],0,0]),me(([g])=>g!==0),be(n,a,r,i,v,m),me(([,g,_,w,,,b])=>!b&&!w&&g!==0&&_===za),oe(([[g],,,,,_])=>(_("Upward scrolling compensation",{amount:g},hr.DEBUG),g))));function y(g){g>0?(Se(t,{behavior:"auto",top:-g}),Se(e,0)):(Se(e,0),Se(t,{behavior:"auto",top:-g}))}return Ae(q(S,be(e,s)),([g,_,w])=>{w&&cM()?Se(e,_-g):y(-g)}),Ae(q(ft(Vt(s,!1),e,m),me(([g,_,w])=>!g&&!w&&_!==0),oe(([g,_])=>_),En(1)),y),de(q(h,oe(g=>({top:-g}))),t),Ae(q(c,be(f,d),oe(([g,{groupIndices:_,lastSize:w,sizeTree:b},C])=>{function M(x){return x*(w+C)}if(_.length===0)return M(g);{let x=0;const T=Oa(b,0);let k=0,I=0;for(;k<g;){k++,x+=T;let L=_.length===I+1?1/0:_[I+1]-_[I]-1;k+L>g&&(x-=T,L=g-k+1),k+=L,x+=M(L),I++}return x}})),g=>{Se(e,g),requestAnimationFrame(()=>{Se(t,{top:g}),requestAnimationFrame(()=>{Se(e,0),Se(m,!1)})})}),{deviation:e}},Ke(tr,rl,ts,yn,_i,Np)),dM=Le(([e,t,r,n,i,s,o,a,l,c,d])=>({...e,...t,...r,...n,...i,...s,...o,...a,...l,...c,...d}),Ke($p,iM,yi,Xb,qb,sM,eM,jp,Gb,_i,Yb)),Qb=Le(([{data:e,defaultItemSize:t,firstItemIndex:r,fixedItemSize:n,fixedGroupSize:i,gap:s,groupIndices:o,heightEstimates:a,itemSize:l,sizeRanges:c,sizes:d,statefulTotalCount:h,totalCount:f,trackItemSizes:v},{initialItemFinalLocationReached:m,initialTopMostItemIndex:S,scrolledToInitialItem:y},g,_,w,b,{scrollToIndex:C},M,{topItemCount:x},{groupCounts:T},k])=>{const{listState:I,minOverscanItemCount:L,topItemsIndexes:R,rangeChanged:A,...O}=b;return de(A,k.scrollSeekRangeChanged),de(q(k.windowViewportRect,oe(P=>P.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:r,fixedItemHeight:n,fixedGroupHeight:i,gap:s,groupCounts:T,heightEstimates:a,initialItemFinalLocationReached:m,initialTopMostItemIndex:S,scrolledToInitialItem:y,sizeRanges:c,topItemCount:x,topItemsIndexes:R,totalCount:f,...w,groupIndices:o,itemSize:l,listState:I,minOverscanItemCount:L,scrollToIndex:C,statefulTotalCount:h,trackItemSizes:v,rangeChanged:A,...O,...k,...g,sizes:d,..._}},Ke(yn,tl,tr,oM,nM,ts,el,uM,lM,Wb,dM));function hM(e,t){const r={},n={};let i=0;const s=e.length;for(;i<s;)n[e[i]]=1,i+=1;for(const o in t)Object.hasOwn(n,o)||(r[o]=t[o]);return r}const Yl=typeof document<"u"?ne.useLayoutEffect:ne.useEffect;function Zb(e,t,r){const n=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),a=ne.createContext({});function l(y,g){y.propsReady&&Se(y.propsReady,!1);for(const _ of n){const w=y[t.required[_]];Se(w,g[_])}for(const _ of i)if(_ in g){const w=y[t.optional[_]];Se(w,g[_])}y.propsReady&&Se(y.propsReady,!0)}function c(y){return s.reduce((g,_)=>(g[_]=w=>{const b=y[t.methods[_]];Se(b,w)},g),{})}function d(y){return o.reduce((g,_)=>(g[_]=IR(y[t.events[_]]),g),{})}const h=ne.forwardRef((y,g)=>{const{children:_,...w}=y,[b]=ne.useState(()=>Bu(MR(e),x=>{l(x,w)})),[C]=ne.useState(R_(d,b));Yl(()=>{for(const x of o)x in w&&Ae(C[x],w[x]);return()=>{Object.values(C).map(Lp)}},[w,C,b]),Yl(()=>{l(b,w)}),ne.useImperativeHandle(g,I_(c(b)));const M=r;return u.jsx(a.Provider,{value:b,children:r?u.jsx(M,{...hM([...n,...i,...o],w),children:_}):_})}),f=y=>{const g=ne.useContext(a);return ne.useCallback(_=>{Se(g[y],_)},[g,y])},v=y=>{const g=ne.useContext(a)[y],_=ne.useCallback(w=>Ae(g,w),[g]);return ne.useSyncExternalStore(_,()=>Ye(g),()=>Ye(g))},m=y=>{const g=ne.useContext(a)[y],[_,w]=ne.useState(R_(Ye,g));return Yl(()=>Ae(g,b=>{b!==_&&w(I_(b))}),[g,_]),_},S=ne.version.startsWith("18")?v:m;return{Component:h,useEmitter:(y,g)=>{const _=ne.useContext(a)[y];Yl(()=>Ae(_,g),[g,_])},useEmitterValue:S,usePublisher:f}}const eC=ne.createContext(void 0),tC=ne.createContext(void 0),rC=typeof document<"u"?ne.useLayoutEffect:ne.useEffect;function Vd(e){return"self"in e}function fM(e){return"body"in e}function nC(e,t,r,n=fo,i,s){const o=ne.useRef(null),a=ne.useRef(null),l=ne.useRef(null),c=ne.useCallback(f=>{let v,m,S;const y=f.target;if(fM(y)||Vd(y)){const _=Vd(y)?y:y.defaultView;S=s?_.scrollX:_.scrollY,v=s?_.document.documentElement.scrollWidth:_.document.documentElement.scrollHeight,m=s?_.innerWidth:_.innerHeight}else S=s?y.scrollLeft:y.scrollTop,v=s?y.scrollWidth:y.scrollHeight,m=s?y.offsetWidth:y.offsetHeight;const g=()=>{e({scrollHeight:v,scrollTop:Math.max(S,0),viewportHeight:m})};f.suppressFlushSync?g():qE.flushSync(g),a.current!==null&&(S===a.current||S<=0||S===v-m)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,s]);ne.useEffect(()=>{const f=i||o.current;return n(i||o.current),c({suppressFlushSync:!0,target:f}),f.addEventListener("scroll",c,{passive:!0}),()=>{n(null),f.removeEventListener("scroll",c)}},[o,c,r,n,i]);function d(f){const v=o.current;if(!v||(s?"offsetWidth"in v&&v.offsetWidth===0:"offsetHeight"in v&&v.offsetHeight===0))return;const m=f.behavior==="smooth";let S,y,g;Vd(v)?(y=Math.max(hi(v.document.documentElement,s?"width":"height"),s?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight),S=s?v.innerWidth:v.innerHeight,g=s?window.scrollX:window.scrollY):(y=v[s?"scrollWidth":"scrollHeight"],S=hi(v,s?"width":"height"),g=v[s?"scrollLeft":"scrollTop"]);const _=y-S;if(f.top=Math.ceil(Math.max(Math.min(_,f.top),0)),Kb(S,y)||f.top===g){e({scrollHeight:y,scrollTop:g,viewportHeight:S}),m&&t(!0);return}m?(a.current=f.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,t(!0)},1e3)):a.current=null,s&&(f={behavior:f.behavior,left:f.top}),v.scrollTo(f)}function h(f){s&&(f={behavior:f.behavior,left:f.top}),o.current.scrollBy(f)}return{scrollByCallback:h,scrollerRef:o,scrollToCallback:d}}const qd="-webkit-sticky",z_="sticky",zp=Jb(()=>{if(typeof document>"u")return z_;const e=document.createElement("div");return e.style.position=qd,e.style.position===qd?qd:z_});function Fp(e){return e}const mM=Le(()=>{const e=J(a=>`Item ${a}`),t=J(a=>`Group ${a}`),r=J({}),n=J(Fp),i=J("div"),s=J(fo),o=(a,l=null)=>Vt(q(r,oe(c=>c[a]),We()),l);return{components:r,computeItemKey:n,EmptyPlaceholder:o("EmptyPlaceholder"),FooterComponent:o("Footer"),GroupComponent:o("Group","div"),groupContent:t,HeaderComponent:o("Header"),HeaderFooterTag:i,ItemComponent:o("Item","div"),itemContent:e,ListComponent:o("List","div"),ScrollerComponent:o("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:o("ScrollSeekPlaceholder"),TopItemListComponent:o("TopItemList")}}),pM=Le(([e,t])=>({...e,...t}),Ke(Qb,mM)),gM=({height:e})=>u.jsx("div",{style:{height:e}}),vM={overflowAnchor:"none",position:zp(),zIndex:1},iC={overflowAnchor:"none"},_M={...iC,display:"inline-block",height:"100%"},F_=ne.memo(function({showTopList:e=!1}){const t=ve("listState"),r=Ar("sizeRanges"),n=ve("useWindowScroll"),i=ve("customScrollParent"),s=Ar("windowScrollContainerState"),o=Ar("scrollContainerState"),a=i||n?s:o,l=ve("itemContent"),c=ve("context"),d=ve("groupContent"),h=ve("trackItemSizes"),f=ve("itemSize"),v=ve("log"),m=Ar("gap"),S=ve("horizontalDirection"),{callbackRef:y}=AR(r,f,h,e?fo:a,v,m,i,S,ve("skipAnimationFrameInResizeObserver")),[g,_]=ne.useState(0);Hp("deviation",O=>{g!==O&&_(O)});const w=ve("EmptyPlaceholder"),b=ve("ScrollSeekPlaceholder")||gM,C=ve("ListComponent"),M=ve("ItemComponent"),x=ve("GroupComponent"),T=ve("computeItemKey"),k=ve("isSeeking"),I=ve("groupIndices").length>0,L=ve("alignToBottom"),R=ve("initialItemFinalLocationReached"),A=e?{}:{boxSizing:"border-box",...S?{display:"inline-block",height:"100%",marginLeft:g!==0?g:L?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:g!==0?g:L?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...R?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&w?u.jsx(w,{...Kt(w,c)}):u.jsx(C,{...Kt(C,c),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:y,style:A,children:(e?t.topItems:t.items).map(O=>{const P=O.originalIndex,E=T(P+t.firstItemIndex,O.data,c);return k?p.createElement(b,{...Kt(b,c),height:O.size,index:O.index,key:E,type:O.type||"item",...O.type==="group"?{}:{groupIndex:O.groupIndex}}):O.type==="group"?p.createElement(x,{...Kt(x,c),"data-index":P,"data-item-index":O.index,"data-known-size":O.size,key:E,style:vM},d(O.index,c)):p.createElement(M,{...Kt(M,c),...bM(M,O.data),"data-index":P,"data-item-group-index":O.groupIndex,"data-item-index":O.index,"data-known-size":O.size,key:E,style:S?_M:iC},I?l(O.index,O.groupIndex,O.data,c):l(O.index,O.data,c))})})}),yM={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},SM={outline:"none",overflowX:"auto",position:"relative"},$u=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),wM={position:zp(),top:0,width:"100%",zIndex:1};function Kt(e,t){if(typeof e!="string")return{context:t}}function bM(e,t){return{item:typeof e=="string"?void 0:t}}const CM=ne.memo(function(){const e=ve("HeaderComponent"),t=Ar("headerHeight"),r=ve("HeaderFooterTag"),n=es(ne.useMemo(()=>s=>{t(hi(s,"height"))},[t]),!0,ve("skipAnimationFrameInResizeObserver")),i=ve("context");return e?u.jsx(r,{ref:n,children:u.jsx(e,{...Kt(e,i)})}):null}),xM=ne.memo(function(){const e=ve("FooterComponent"),t=Ar("footerHeight"),r=ve("HeaderFooterTag"),n=es(ne.useMemo(()=>s=>{t(hi(s,"height"))},[t]),!0,ve("skipAnimationFrameInResizeObserver")),i=ve("context");return e?u.jsx(r,{ref:n,children:u.jsx(e,{...Kt(e,i)})}):null});function sC({useEmitter:e,useEmitterValue:t,usePublisher:r}){return ne.memo(function({children:n,style:i,context:s,...o}){const a=r("scrollContainerState"),l=t("ScrollerComponent"),c=r("smoothScrollTargetReached"),d=t("scrollerRef"),h=t("horizontalDirection")||!1,{scrollByCallback:f,scrollerRef:v,scrollToCallback:m}=nC(a,c,l,d,void 0,h);return e("scrollTo",m),e("scrollBy",f),u.jsx(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:v,style:{...h?SM:yM,...i},tabIndex:0,...o,...Kt(l,s),children:n})})}function oC({useEmitter:e,useEmitterValue:t,usePublisher:r}){return ne.memo(function({children:n,style:i,context:s,...o}){const a=r("windowScrollContainerState"),l=t("ScrollerComponent"),c=r("smoothScrollTargetReached"),d=t("totalListHeight"),h=t("deviation"),f=t("customScrollParent"),v=ne.useRef(null),m=t("scrollerRef"),{scrollByCallback:S,scrollerRef:y,scrollToCallback:g}=nC(a,c,l,m,f);return rC(()=>{var _;return y.current=f||((_=v.current)==null?void 0:_.ownerDocument.defaultView),()=>{y.current=null}},[y,f]),e("windowScrollTo",g),e("scrollBy",S),u.jsx(l,{ref:v,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...d!==0?{height:d+h}:{}},...o,...Kt(l,s),children:n})})}const kM=({children:e})=>{const t=ne.useContext(eC),r=Ar("viewportHeight"),n=Ar("fixedItemHeight"),i=ve("alignToBottom"),s=ve("horizontalDirection"),o=ne.useMemo(()=>Pb(r,l=>hi(l,s?"width":"height")),[r,s]),a=es(o,!0,ve("skipAnimationFrameInResizeObserver"));return ne.useEffect(()=>{t&&(r(t.viewportHeight),n(t.itemHeight))},[t,r,n]),u.jsx("div",{"data-viewport-type":"element",ref:a,style:$u(i),children:e})},TM=({children:e})=>{const t=ne.useContext(eC),r=Ar("windowViewportRect"),n=Ar("fixedItemHeight"),i=ve("customScrollParent"),s=Ab(r,i,ve("skipAnimationFrameInResizeObserver")),o=ve("alignToBottom");return ne.useEffect(()=>{t&&(n(t.itemHeight),r({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,r,n]),u.jsx("div",{"data-viewport-type":"window",ref:s,style:$u(o),children:e})},EM=({children:e})=>{const t=ve("TopItemListComponent")||"div",r=ve("headerHeight"),n={...wM,marginTop:`${r}px`},i=ve("context");return u.jsx(t,{style:n,...Kt(t,i),children:e})},IM=ne.memo(function(e){const t=ve("useWindowScroll"),r=ve("topItemsIndexes").length>0,n=ve("customScrollParent"),i=ve("context");return u.jsxs(n||t?PM:MM,{...e,context:i,children:[r&&u.jsx(EM,{children:u.jsx(F_,{showTopList:!0})}),u.jsxs(n||t?TM:kM,{children:[u.jsx(CM,{}),u.jsx(F_,{}),u.jsx(xM,{})]})]})}),{Component:RM,useEmitter:Hp,useEmitterValue:ve,usePublisher:Ar}=Zb(pM,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},IM),MM=sC({useEmitter:Hp,useEmitterValue:ve,usePublisher:Ar}),PM=oC({useEmitter:Hp,useEmitterValue:ve,usePublisher:Ar}),LM=RM,AM=Le(()=>{const e=J(c=>u.jsxs("td",{children:["Item $",c]})),t=J(null),r=J(c=>u.jsxs("td",{colSpan:1e3,children:["Group ",c]})),n=J(null),i=J(null),s=J({}),o=J(Fp),a=J(fo),l=(c,d=null)=>Vt(q(s,oe(h=>h[c]),We()),d);return{components:s,computeItemKey:o,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:i,fixedHeaderContent:n,itemContent:e,groupContent:r,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}});Ke(Qb,AM);zp();const H_={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},NM={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:W_,floor:au,max:ma,min:Yd,round:U_}=Math;function K_(e,t,r){return Array.from({length:t-e+1}).map((n,i)=>({data:r===null?null:r[i+e],index:i+e}))}function DM(e){return{...NM,items:e}}function Gl(e,t){return e&&e.width===t.width&&e.height===t.height}function BM(e,t){return e&&e.column===t.column&&e.row===t.row}const OM=Le(([{increaseViewportBy:e,listBoundary:t,overscan:r,visibleRange:n},{footerHeight:i,headerHeight:s,scrollBy:o,scrollContainerState:a,scrollTo:l,scrollTop:c,smoothScrollTargetReached:d,viewportHeight:h},f,v,{didMount:m,propsReady:S},{customScrollParent:y,useWindowScroll:g,windowScrollContainerState:_,windowScrollTo:w,windowViewportRect:b},C])=>{const M=J(0),x=J(0),T=J(H_),k=J({height:0,width:0}),I=J({height:0,width:0}),L=Ie(),R=Ie(),A=J(0),O=J(null),P=J({column:0,row:0}),E=Ie(),F=Ie(),N=J(!1),V=J(0),D=J(!0),W=J(!1),j=J(!1);Ae(q(m,be(V),me(([B,z])=>!!z)),()=>{Se(D,!1)}),Ae(q(ft(m,D,I,k,V,W),me(([B,z,Y,Z,,ce])=>B&&!z&&Y.height!==0&&Z.height!==0&&!ce)),([,,,,B])=>{Se(W,!0),Bp(1,()=>{Se(L,B)}),Xr(q(c),()=>{Se(t,[0,0]),Se(D,!0)})}),de(q(F,me(B=>B!=null&&B.scrollTop>0),ln(0)),x),Ae(q(m,be(F),me(([,B])=>B!=null)),([,B])=>{B&&(Se(k,B.viewport),Se(I,B.item),Se(P,B.gap),B.scrollTop>0&&(Se(N,!0),Xr(q(c,Yi(1)),z=>{Se(N,!1)}),Se(l,{top:B.scrollTop})))}),de(q(k,oe(({height:B})=>B)),h),de(q(ft(fe(k,Gl),fe(I,Gl),fe(P,(B,z)=>B&&B.column===z.column&&B.row===z.row),fe(c)),oe(([B,z,Y,Z])=>({gap:Y,item:z,scrollTop:Z,viewport:B}))),E),de(q(ft(fe(M),n,fe(P,BM),fe(I,Gl),fe(k,Gl),fe(O),fe(x),fe(N),fe(D),fe(V)),me(([,,,,,,,B])=>!B),oe(([B,[z,Y],Z,ce,re,ge,Re,,Oe,we])=>{const{column:Me,row:wt}=Z,{height:ue,width:ze}=ce,{width:st}=re;if(Re===0&&(B===0||st===0))return H_;if(ze===0){const Zr=Op(we,B),cl=Zr+Math.max(Re-1,0);return DM(K_(Zr,cl,ge))}const bt=aC(st,ze,Me);let Lt,Yt;Oe?z===0&&Y===0&&Re>0?(Lt=0,Yt=Re-1):(Lt=bt*au((z+wt)/(ue+wt)),Yt=bt*W_((Y+wt)/(ue+wt))-1,Yt=Yd(B-1,ma(Yt,bt-1)),Lt=Yd(Yt,ma(0,Lt))):(Lt=0,Yt=-1);const _o=K_(Lt,Yt,ge),{bottom:On,top:yo}=V_(re,Z,ce,_o),Sn=W_(B/bt),So=Sn*ue+(Sn-1)*wt-On;return{bottom:On,itemHeight:ue,items:_o,itemWidth:ze,offsetBottom:So,offsetTop:yo,top:yo}})),T),de(q(O,me(B=>B!==null),oe(B=>B.length)),M),de(q(ft(k,I,T,P),me(([B,z,{items:Y}])=>Y.length>0&&z.height!==0&&B.height!==0),oe(([B,z,{items:Y},Z])=>{const{bottom:ce,top:re}=V_(B,Z,z,Y);return[re,ce]}),We($a)),t);const ee=J(!1);de(q(c,be(ee),oe(([B,z])=>z||B!==0)),ee);const te=br(q(ft(T,M),me(([{items:B}])=>B.length>0),be(ee),me(([[B,z],Y])=>{const Z=B.items[B.items.length-1].index===z-1;return(Y||B.bottom>0&&B.itemHeight>0&&B.offsetBottom===0&&B.items.length===z)&&Z}),oe(([[,B]])=>B-1),We())),ae=br(q(fe(T),me(({items:B})=>B.length>0&&B[0].index===0),ln(0),We())),H=br(q(fe(T),be(N),me(([{items:B},z])=>B.length>0&&!z),oe(([{items:B}])=>({endIndex:B[B.length-1].index,startIndex:B[0].index})),We(jb),En(0)));de(H,v.scrollSeekRangeChanged),de(q(L,be(k,I,M,P),oe(([B,z,Y,Z,ce])=>{const re=Ub(B),{align:ge,behavior:Re,offset:Oe}=re;let we=re.index;we==="LAST"&&(we=Z-1),we=ma(0,we,Yd(Z-1,we));let Me=xf(z,ce,Y,we);return ge==="end"?Me=U_(Me-z.height+Y.height):ge==="center"&&(Me=U_(Me-z.height/2+Y.height/2)),Oe&&(Me+=Oe),{behavior:Re,top:Me}})),l);const se=Vt(q(T,oe(B=>B.offsetBottom+B.bottom)),0);return de(q(b,oe(B=>({height:B.visibleHeight,width:B.visibleWidth}))),k),{customScrollParent:y,data:O,deviation:A,footerHeight:i,gap:P,headerHeight:s,increaseViewportBy:e,initialItemCount:x,itemDimensions:I,overscan:r,restoreStateFrom:F,scrollBy:o,scrollContainerState:a,scrollHeight:R,scrollTo:l,scrollToIndex:L,scrollTop:c,smoothScrollTargetReached:d,totalCount:M,useWindowScroll:g,viewportDimensions:k,windowScrollContainerState:_,windowScrollTo:w,windowViewportRect:b,...v,gridState:T,horizontalDirection:j,initialTopMostItemIndex:V,totalListHeight:se,...f,endReached:te,propsReady:S,rangeChanged:H,startReached:ae,stateChanged:E,stateRestoreInProgress:N,...C}},Ke($p,tr,rl,Xb,yi,jp,_i));function aC(e,t,r){return ma(1,au((e+r)/(au(t)+r)))}function V_(e,t,r,n){const{height:i}=r;if(i===void 0||n.length===0)return{bottom:0,top:0};const s=xf(e,t,r,n[0].index);return{bottom:xf(e,t,r,n[n.length-1].index)+i,top:s}}function xf(e,t,r,n){const i=aC(e.width,r.width,t.column),s=au(n/i),o=s*r.height+ma(0,s-1)*t.row;return o>0?o+t.row:o}const $M=Le(()=>{const e=J(h=>`Item ${h}`),t=J({}),r=J(null),n=J("virtuoso-grid-item"),i=J("virtuoso-grid-list"),s=J(Fp),o=J("div"),a=J(fo),l=(h,f=null)=>Vt(q(t,oe(v=>v[h]),We()),f),c=J(!1),d=J(!1);return de(fe(d),c),{components:t,computeItemKey:s,context:r,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:o,itemClassName:n,ItemComponent:l("Item","div"),itemContent:e,listClassName:i,ListComponent:l("List","div"),readyStateChanged:c,reportReadyState:d,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),jM=Le(([e,t])=>({...e,...t}),Ke(OM,$M)),zM=ne.memo(function(){const e=qe("gridState"),t=qe("listClassName"),r=qe("itemClassName"),n=qe("itemContent"),i=qe("computeItemKey"),s=qe("isSeeking"),o=Nr("scrollHeight"),a=qe("ItemComponent"),l=qe("ListComponent"),c=qe("ScrollSeekPlaceholder"),d=qe("context"),h=Nr("itemDimensions"),f=Nr("gap"),v=qe("log"),m=qe("stateRestoreInProgress"),S=Nr("reportReadyState"),y=es(ne.useMemo(()=>g=>{const _=g.parentElement.parentElement.scrollHeight;o(_);const w=g.firstChild;if(w){const{height:b,width:C}=w.getBoundingClientRect();h({height:b,width:C})}f({column:q_("column-gap",getComputedStyle(g).columnGap,v),row:q_("row-gap",getComputedStyle(g).rowGap,v)})},[o,h,f,v]),!0,!1);return rC(()=>{e.itemHeight>0&&e.itemWidth>0&&S(!0)},[e]),m?null:u.jsx(l,{className:t,ref:y,...Kt(l,d),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(g=>{const _=i(g.index,g.data,d);return s?u.jsx(c,{...Kt(c,d),height:e.itemHeight,index:g.index,width:e.itemWidth},_):p.createElement(a,{...Kt(a,d),className:r,"data-index":g.index,key:_},n(g.index,g.data,d))})})}),FM=ne.memo(function(){const e=qe("HeaderComponent"),t=Nr("headerHeight"),r=qe("headerFooterTag"),n=es(ne.useMemo(()=>s=>{t(hi(s,"height"))},[t]),!0,!1),i=qe("context");return e?u.jsx(r,{ref:n,children:u.jsx(e,{...Kt(e,i)})}):null}),HM=ne.memo(function(){const e=qe("FooterComponent"),t=Nr("footerHeight"),r=qe("headerFooterTag"),n=es(ne.useMemo(()=>s=>{t(hi(s,"height"))},[t]),!0,!1),i=qe("context");return e?u.jsx(r,{ref:n,children:u.jsx(e,{...Kt(e,i)})}):null}),WM=({children:e})=>{const t=ne.useContext(tC),r=Nr("itemDimensions"),n=Nr("viewportDimensions"),i=es(ne.useMemo(()=>s=>{n(s.getBoundingClientRect())},[n]),!0,!1);return ne.useEffect(()=>{t&&(n({height:t.viewportHeight,width:t.viewportWidth}),r({height:t.itemHeight,width:t.itemWidth}))},[t,n,r]),u.jsx("div",{ref:i,style:$u(!1),children:e})},UM=({children:e})=>{const t=ne.useContext(tC),r=Nr("windowViewportRect"),n=Nr("itemDimensions"),i=qe("customScrollParent"),s=Ab(r,i,!1);return ne.useEffect(()=>{t&&(n({height:t.itemHeight,width:t.itemWidth}),r({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,r,n]),u.jsx("div",{ref:s,style:$u(!1),children:e})},KM=ne.memo(function({...e}){const t=qe("useWindowScroll"),r=qe("customScrollParent"),n=r||t?qM:VM,i=r||t?UM:WM,s=qe("context");return u.jsx(n,{...e,...Kt(n,s),children:u.jsxs(i,{children:[u.jsx(FM,{}),u.jsx(zM,{}),u.jsx(HM,{})]})})}),{useEmitter:lC,useEmitterValue:qe,usePublisher:Nr}=Zb(jM,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},KM),VM=sC({useEmitter:lC,useEmitterValue:qe,usePublisher:Nr}),qM=oC({useEmitter:lC,useEmitterValue:qe,usePublisher:Nr});function q_(e,t,r){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&r(`${e} was not resolved to pixel value correctly`,t,hr.WARN),t==="normal"?0:parseInt(t??"0",10)}function YM(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function GM(e){const t=p.useRef(new Map),r=p.useRef(new Set),[n,i]=p.useState(0),[s,o]=p.useState(null);p.useEffect(()=>{var y;const c=new Map,d=t.current,h=new Set(r.current),f=[];for(const g of e.items){const _=!!g.streaming,w=d.get(g.id);c.set(g.id,_),w===!0&&!_&&(h.add(g.id),f.push(g))}const v=new Set(e.items.map(g=>g.id));for(const g of Array.from(h))v.has(g)||h.delete(g);const m=!YM(h,r.current),S=f.length>0;if(t.current=c,!(!m&&!S)){if(r.current=h,f.length){for(const _ of f)(y=e.onItemCompleted)==null||y.call(e,_);const g=f[f.length-1]??null;o(g?g.id:null)}else o(g=>g&&h.has(g)?g:null);i(g=>g+1)}},[e.items,e.onItemCompleted]);const a=p.useMemo(()=>new Set(r.current),[n]);return{completedMessageIds:a,lastCompletedMessageId:s,isMessageCompleted:c=>a.has(c)}}function XM(e){return e==="user"||e==="assistant"}function cC(e){return e.nextLastMessageId?e.previousLastMessageId!==e.nextLastMessageId:!1}function JM(e){return cC(e)?e.nextLastMessageRole==="user":!1}function QM(e){return!cC(e)||!e.nextLastMessageRole||e.nextLastMessageRole==="user"?!1:!e.nextLastMessageStreaming}function ZM(e){return e.hasStreamingMessage?!!e.streamingTailKey.trim():!1}function Y_(e){return e.nextFoldState==="collapsed"}function eP(e){return!!e.lastCompletedMessageId}const tP=new Set(["um","am","plan","rs","cmd","fc"]);function rP(e){const t="v2:turn-diff:";return e.startsWith(t)&&e.slice(t.length).trim()||null}function nP(e){const t=/^v2:([^-:]+)-([^:]+):/.exec(e),r=String((t==null?void 0:t[1])??"").trim();return tP.has(r)&&String((t==null?void 0:t[2])??"").trim()||null}function iP(e){if(e.startsWith("v2:"))return null;const t=e.indexOf(":");return t<=0?null:e.slice(0,t).trim()||null}function G_(e){const t=String(e??"").trim();return t?rP(t)??nP(t)??iP(t):null}/**
|
|
104
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
105
|
-
* @license MIT
|
|
106
|
-
*
|
|
107
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
108
|
-
* @license MIT
|
|
109
|
-
*
|
|
110
|
-
* Originally forked from (with the author's permission):
|
|
111
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
112
|
-
* http://bellard.org/jslinux/
|
|
113
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
114
|
-
*/var sP=2,oP=1,aP=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var h;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((h=this._terminal.options.overviewRuler)==null?void 0:h.width)||14,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),i=Math.max(0,parseInt(r.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),o={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},a=o.top+o.bottom,l=o.right+o.left,c=n-a,d=i-l-t;return{cols:Math.max(sP,Math.floor(d/e.css.cell.width)),rows:Math.max(oP,Math.floor(c/e.css.cell.height))}}};/**
|
|
115
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
116
|
-
* @license MIT
|
|
117
|
-
*
|
|
118
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
119
|
-
* @license MIT
|
|
120
|
-
*
|
|
121
|
-
* Originally forked from (with the author's permission):
|
|
122
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
123
|
-
* http://bellard.org/jslinux/
|
|
124
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
125
|
-
*/var uC=Object.defineProperty,lP=Object.getOwnPropertyDescriptor,cP=(e,t)=>{for(var r in t)uC(e,r,{get:t[r],enumerable:!0})},it=(e,t,r,n)=>{for(var i=n>1?void 0:n?lP(t,r):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=(n?o(t,r,i):o(i))||i);return n&&i&&uC(t,r,i),i},ie=(e,t)=>(r,n)=>t(r,n,e),X_="Terminal input",kf={get:()=>X_,set:e=>X_=e},J_="Too much output to announce, navigate to rows manually to read",Tf={get:()=>J_,set:e=>J_=e};function uP(e){return e.replace(/\r?\n/g,"\r")}function dP(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function hP(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function fP(e,t,r,n){if(e.stopPropagation(),e.clipboardData){let i=e.clipboardData.getData("text/plain");dC(i,t,r,n)}}function dC(e,t,r,n){e=uP(e),e=dP(e,r.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(e,!0),t.value=""}function hC(e,t,r){let n=r.getBoundingClientRect(),i=e.clientX-n.left-10,s=e.clientY-n.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${i}px`,t.style.top=`${s}px`,t.style.zIndex="1000",t.focus()}function Q_(e,t,r,n,i){hC(e,t,r),i&&n.rightClickSelect(e),t.value=n.selectionText,t.select()}function Kn(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function ju(e,t=0,r=e.length){let n="";for(let i=t;i<r;++i){let s=e[i];s>65535?(s-=65536,n+=String.fromCharCode((s>>10)+55296)+String.fromCharCode(s%1024+56320)):n+=String.fromCharCode(s)}return n}var mP=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let r=e.length;if(!r)return 0;let n=0,i=0;if(this._interim){let s=e.charCodeAt(i++);56320<=s&&s<=57343?t[n++]=(this._interim-55296)*1024+s-56320+65536:(t[n++]=this._interim,t[n++]=s),this._interim=0}for(let s=i;s<r;++s){let o=e.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=r)return this._interim=o,n;let a=e.charCodeAt(s);56320<=a&&a<=57343?t[n++]=(o-55296)*1024+a-56320+65536:(t[n++]=o,t[n++]=a);continue}o!==65279&&(t[n++]=o)}return n}},pP=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let r=e.length;if(!r)return 0;let n=0,i,s,o,a,l=0,c=0;if(this.interim[0]){let f=!1,v=this.interim[0];v&=(v&224)===192?31:(v&240)===224?15:7;let m=0,S;for(;(S=this.interim[++m]&63)&&m<4;)v<<=6,v|=S;let y=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,g=y-m;for(;c<g;){if(c>=r)return 0;if(S=e[c++],(S&192)!==128){c--,f=!0;break}else this.interim[m++]=S,v<<=6,v|=S&63}f||(y===2?v<128?c--:t[n++]=v:y===3?v<2048||v>=55296&&v<=57343||v===65279||(t[n++]=v):v<65536||v>1114111||(t[n++]=v)),this.interim.fill(0)}let d=r-4,h=c;for(;h<r;){for(;h<d&&!((i=e[h])&128)&&!((s=e[h+1])&128)&&!((o=e[h+2])&128)&&!((a=e[h+3])&128);)t[n++]=i,t[n++]=s,t[n++]=o,t[n++]=a,h+=4;if(i=e[h++],i<128)t[n++]=i;else if((i&224)===192){if(h>=r)return this.interim[0]=i,n;if(s=e[h++],(s&192)!==128){h--;continue}if(l=(i&31)<<6|s&63,l<128){h--;continue}t[n++]=l}else if((i&240)===224){if(h>=r)return this.interim[0]=i,n;if(s=e[h++],(s&192)!==128){h--;continue}if(h>=r)return this.interim[0]=i,this.interim[1]=s,n;if(o=e[h++],(o&192)!==128){h--;continue}if(l=(i&15)<<12|(s&63)<<6|o&63,l<2048||l>=55296&&l<=57343||l===65279)continue;t[n++]=l}else if((i&248)===240){if(h>=r)return this.interim[0]=i,n;if(s=e[h++],(s&192)!==128){h--;continue}if(h>=r)return this.interim[0]=i,this.interim[1]=s,n;if(o=e[h++],(o&192)!==128){h--;continue}if(h>=r)return this.interim[0]=i,this.interim[1]=s,this.interim[2]=o,n;if(a=e[h++],(a&192)!==128){h--;continue}if(l=(i&7)<<18|(s&63)<<12|(o&63)<<6|a&63,l<65536||l>1114111)continue;t[n++]=l}}return n}},fC="",Qn=" ",nl=class mC{constructor(){this.fg=0,this.bg=0,this.extended=new lu}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new mC;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},lu=class pC{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new pC(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Br=class gC extends nl{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new lu,this.combinedData=""}static fromCharData(t){let r=new gC;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Kn(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let n=t[1].charCodeAt(0);if(55296<=n&&n<=56319){let i=t[1].charCodeAt(1);56320<=i&&i<=57343?this.content=(n-55296)*1024+i-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Z_="di$target",Ef="di$dependencies",Gd=new Map;function gP(e){return e[Ef]||[]}function Pt(e){if(Gd.has(e))return Gd.get(e);let t=function(r,n,i){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");vP(t,r,i)};return t._id=e,Gd.set(e,t),t}function vP(e,t,r){t[Z_]===t?t[Ef].push({id:e,index:r}):(t[Ef]=[{id:e,index:r}],t[Z_]=t)}var rr=Pt("BufferService"),vC=Pt("CoreMouseService"),rs=Pt("CoreService"),_P=Pt("CharsetService"),Wp=Pt("InstantiationService"),_C=Pt("LogService"),nr=Pt("OptionsService"),yC=Pt("OscLinkService"),yP=Pt("UnicodeService"),il=Pt("DecorationService"),If=class{constructor(e,t,r){this._bufferService=e,this._optionsService=t,this._oscLinkService=r}provideLinks(e,t){var d;let r=this._bufferService.buffer.lines.get(e-1);if(!r){t(void 0);return}let n=[],i=this._optionsService.rawOptions.linkHandler,s=new Br,o=r.getTrimmedLength(),a=-1,l=-1,c=!1;for(let h=0;h<o;h++)if(!(l===-1&&!r.hasContent(h))){if(r.loadCell(h,s),s.hasExtendedAttrs()&&s.extended.urlId)if(l===-1){l=h,a=s.extended.urlId;continue}else c=s.extended.urlId!==a;else l!==-1&&(c=!0);if(c||l!==-1&&h===o-1){let f=(d=this._oscLinkService.getLinkData(a))==null?void 0:d.uri;if(f){let v={start:{x:l+1,y:e},end:{x:h+(!c&&h===o-1?1:0),y:e}},m=!1;if(!(i!=null&&i.allowNonHttpProtocols))try{let S=new URL(f);["http:","https:"].includes(S.protocol)||(m=!0)}catch{m=!0}m||n.push({text:f,range:v,activate:(S,y)=>i?i.activate(S,y,v):SP(S,y),hover:(S,y)=>{var g;return(g=i==null?void 0:i.hover)==null?void 0:g.call(i,S,y,v)},leave:(S,y)=>{var g;return(g=i==null?void 0:i.leave)==null?void 0:g.call(i,S,y,v)}})}c=!1,s.hasExtendedAttrs()&&s.extended.urlId?(l=h,a=s.extended.urlId):(l=-1,a=-1)}}t(n)}};If=it([ie(0,rr),ie(1,nr),ie(2,yC)],If);function SP(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
126
|
-
|
|
127
|
-
WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var zu=Pt("CharSizeService"),Dn=Pt("CoreBrowserService"),Up=Pt("MouseService"),Bn=Pt("RenderService"),wP=Pt("SelectionService"),SC=Pt("CharacterJoinerService"),mo=Pt("ThemeService"),wC=Pt("LinkProviderService"),bP=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ey.isErrorNoTelemetry(e)?new ey(e.message+`
|
|
128
|
-
|
|
129
|
-
`+e.stack):new Error(e.message+`
|
|
130
|
-
|
|
131
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},CP=new bP;function bc(e){xP(e)||CP.onUnexpectedError(e)}var Rf="Canceled";function xP(e){return e instanceof kP?!0:e instanceof Error&&e.name===Rf&&e.message===Rf}var kP=class extends Error{constructor(){super(Rf),this.name=this.message}};function TP(e){return new Error(`Illegal argument: ${e}`)}var ey=class Mf extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Mf)return t;let r=new Mf;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Pf=class bC extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,bC.prototype)}};function pr(e,t=0){return e[e.length-(1+t)]}var EP;(e=>{function t(s){return s<0}e.isLessThan=t;function r(s){return s<=0}e.isLessThanOrEqual=r;function n(s){return s>0}e.isGreaterThan=n;function i(s){return s===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(EP||(EP={}));function IP(e,t){let r=this,n=!1,i;return function(){return n||(n=!0,t||(i=e.apply(r,arguments))),i}}var CC;(e=>{function t(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function n(){return r}e.empty=n;function*i(b){yield b}e.single=i;function s(b){return t(b)?b:i(b)}e.wrap=s;function o(b){return b||r}e.from=o;function*a(b){for(let C=b.length-1;C>=0;C--)yield b[C]}e.reverse=a;function l(b){return!b||b[Symbol.iterator]().next().done===!0}e.isEmpty=l;function c(b){return b[Symbol.iterator]().next().value}e.first=c;function d(b,C){let M=0;for(let x of b)if(C(x,M++))return!0;return!1}e.some=d;function h(b,C){for(let M of b)if(C(M))return M}e.find=h;function*f(b,C){for(let M of b)C(M)&&(yield M)}e.filter=f;function*v(b,C){let M=0;for(let x of b)yield C(x,M++)}e.map=v;function*m(b,C){let M=0;for(let x of b)yield*C(x,M++)}e.flatMap=m;function*S(...b){for(let C of b)yield*C}e.concat=S;function y(b,C,M){let x=M;for(let T of b)x=C(x,T);return x}e.reduce=y;function*g(b,C,M=b.length){for(C<0&&(C+=b.length),M<0?M+=b.length:M>b.length&&(M=b.length);C<M;C++)yield b[C]}e.slice=g;function _(b,C=Number.POSITIVE_INFINITY){let M=[];if(C===0)return[M,b];let x=b[Symbol.iterator]();for(let T=0;T<C;T++){let k=x.next();if(k.done)return[M,e.empty()];M.push(k.value)}return[M,{[Symbol.iterator](){return x}}]}e.consume=_;async function w(b){let C=[];for await(let M of b)C.push(M);return Promise.resolve(C)}e.asyncToArray=w})(CC||(CC={}));function Gi(e){if(CC.is(e)){let t=[];for(let r of e)if(r)try{r.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function RP(...e){return Xe(()=>Gi(e))}function Xe(e){return{dispose:IP(()=>{e()})}}var xC=class kC{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Gi(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?kC.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};xC.DISABLE_DISPOSED_WARNING=!1;var ai=xC,ke=class{constructor(){this._store=new ai,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};ke.None=Object.freeze({dispose(){}});var io=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},In=typeof window=="object"?window:globalThis,Lf=class Af{constructor(t){this.element=t,this.next=Af.Undefined,this.prev=Af.Undefined}};Lf.Undefined=new Lf(void 0);var Je=Lf,ty=class{constructor(){this._first=Je.Undefined,this._last=Je.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Je.Undefined}clear(){let e=this._first;for(;e!==Je.Undefined;){let t=e.next;e.prev=Je.Undefined,e.next=Je.Undefined,e=t}this._first=Je.Undefined,this._last=Je.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new Je(e);if(this._first===Je.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==Je.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Je.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Je.Undefined&&e.next!==Je.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Je.Undefined&&e.next===Je.Undefined?(this._first=Je.Undefined,this._last=Je.Undefined):e.next===Je.Undefined?(this._last=this._last.prev,this._last.next=Je.Undefined):e.prev===Je.Undefined&&(this._first=this._first.next,this._first.prev=Je.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Je.Undefined;)yield e.element,e=e.next}},MP=globalThis.performance&&typeof globalThis.performance.now=="function",PP=class TC{static create(t){return new TC(t)}constructor(t){this._now=MP&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Bt;(e=>{e.None=()=>ke.None;function t(R,A){return h(R,()=>{},0,void 0,!0,void 0,A)}e.defer=t;function r(R){return(A,O=null,P)=>{let E=!1,F;return F=R(N=>{if(!E)return F?F.dispose():E=!0,A.call(O,N)},null,P),E&&F.dispose(),F}}e.once=r;function n(R,A,O){return c((P,E=null,F)=>R(N=>P.call(E,A(N)),null,F),O)}e.map=n;function i(R,A,O){return c((P,E=null,F)=>R(N=>{A(N),P.call(E,N)},null,F),O)}e.forEach=i;function s(R,A,O){return c((P,E=null,F)=>R(N=>A(N)&&P.call(E,N),null,F),O)}e.filter=s;function o(R){return R}e.signal=o;function a(...R){return(A,O=null,P)=>{let E=RP(...R.map(F=>F(N=>A.call(O,N))));return d(E,P)}}e.any=a;function l(R,A,O,P){let E=O;return n(R,F=>(E=A(E,F),E),P)}e.reduce=l;function c(R,A){let O,P={onWillAddFirstListener(){O=R(E.fire,E)},onDidRemoveLastListener(){O==null||O.dispose()}},E=new Q(P);return A==null||A.add(E),E.event}function d(R,A){return A instanceof Array?A.push(R):A&&A.add(R),R}function h(R,A,O=100,P=!1,E=!1,F,N){let V,D,W,j=0,ee,te={leakWarningThreshold:F,onWillAddFirstListener(){V=R(H=>{j++,D=A(D,H),P&&!W&&(ae.fire(D),D=void 0),ee=()=>{let se=D;D=void 0,W=void 0,(!P||j>1)&&ae.fire(se),j=0},typeof O=="number"?(clearTimeout(W),W=setTimeout(ee,O)):W===void 0&&(W=0,queueMicrotask(ee))})},onWillRemoveListener(){E&&j>0&&(ee==null||ee())},onDidRemoveLastListener(){ee=void 0,V.dispose()}},ae=new Q(te);return N==null||N.add(ae),ae.event}e.debounce=h;function f(R,A=0,O){return e.debounce(R,(P,E)=>P?(P.push(E),P):[E],A,void 0,!0,void 0,O)}e.accumulate=f;function v(R,A=(P,E)=>P===E,O){let P=!0,E;return s(R,F=>{let N=P||!A(F,E);return P=!1,E=F,N},O)}e.latch=v;function m(R,A,O){return[e.filter(R,A,O),e.filter(R,P=>!A(P),O)]}e.split=m;function S(R,A=!1,O=[],P){let E=O.slice(),F=R(D=>{E?E.push(D):V.fire(D)});P&&P.add(F);let N=()=>{E==null||E.forEach(D=>V.fire(D)),E=null},V=new Q({onWillAddFirstListener(){F||(F=R(D=>V.fire(D)),P&&P.add(F))},onDidAddFirstListener(){E&&(A?setTimeout(N):N())},onDidRemoveLastListener(){F&&F.dispose(),F=null}});return P&&P.add(V),V.event}e.buffer=S;function y(R,A){return(O,P,E)=>{let F=A(new _);return R(function(N){let V=F.evaluate(N);V!==g&&O.call(P,V)},void 0,E)}}e.chain=y;let g=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(A){return this.steps.push(A),this}forEach(A){return this.steps.push(O=>(A(O),O)),this}filter(A){return this.steps.push(O=>A(O)?O:g),this}reduce(A,O){let P=O;return this.steps.push(E=>(P=A(P,E),P)),this}latch(A=(O,P)=>O===P){let O=!0,P;return this.steps.push(E=>{let F=O||!A(E,P);return O=!1,P=E,F?E:g}),this}evaluate(A){for(let O of this.steps)if(A=O(A),A===g)break;return A}}function w(R,A,O=P=>P){let P=(...V)=>N.fire(O(...V)),E=()=>R.on(A,P),F=()=>R.removeListener(A,P),N=new Q({onWillAddFirstListener:E,onDidRemoveLastListener:F});return N.event}e.fromNodeEventEmitter=w;function b(R,A,O=P=>P){let P=(...V)=>N.fire(O(...V)),E=()=>R.addEventListener(A,P),F=()=>R.removeEventListener(A,P),N=new Q({onWillAddFirstListener:E,onDidRemoveLastListener:F});return N.event}e.fromDOMEventEmitter=b;function C(R){return new Promise(A=>r(R)(A))}e.toPromise=C;function M(R){let A=new Q;return R.then(O=>{A.fire(O)},()=>{A.fire(void 0)}).finally(()=>{A.dispose()}),A.event}e.fromPromise=M;function x(R,A){return R(O=>A.fire(O))}e.forward=x;function T(R,A,O){return A(O),R(P=>A(P))}e.runAndSubscribe=T;class k{constructor(A,O){this._observable=A,this._counter=0,this._hasChanged=!1;let P={onWillAddFirstListener:()=>{A.addObserver(this)},onDidRemoveLastListener:()=>{A.removeObserver(this)}};this.emitter=new Q(P),O&&O.add(this.emitter)}beginUpdate(A){this._counter++}handlePossibleChange(A){}handleChange(A,O){this._hasChanged=!0}endUpdate(A){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function I(R,A){return new k(R,A).emitter.event}e.fromObservable=I;function L(R){return(A,O,P)=>{let E=0,F=!1,N={beginUpdate(){E++},endUpdate(){E--,E===0&&(R.reportChanges(),F&&(F=!1,A.call(O)))},handlePossibleChange(){},handleChange(){F=!0}};R.addObserver(N),R.reportChanges();let V={dispose(){R.removeObserver(N)}};return P instanceof ai?P.add(V):Array.isArray(P)&&P.push(V),V}}e.fromObservableLight=L})(Bt||(Bt={}));var Nf=class Df{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Df._idPool++}`,Df.all.add(this)}start(t){this._stopWatch=new PP,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Nf.all=new Set,Nf._idPool=0;var LP=Nf,AP=-1,EC=class IC{constructor(t,r,n=(IC._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,r){let n=this.threshold;if(n<=0||r<n)return;this._stacks||(this._stacks=new Map);let i=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[s,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(s);let l=new BP(a,s);this._errorHandler(l)}return()=>{let s=this._stacks.get(t.value)||0;this._stacks.set(t.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[n,i]of this._stacks)(!t||r<i)&&(t=[n,i],r=i);return t}};EC._idPool=1;var NP=EC,DP=class RC{constructor(t){this.value=t}static create(){let t=new Error;return new RC(t.stack??"")}print(){console.warn(this.value.split(`
|
|
132
|
-
`).slice(2).join(`
|
|
133
|
-
`))}},BP=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},OP=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},$P=0,Xd=class{constructor(e){this.value=e,this.id=$P++}},jP=2,zP,Q=class{constructor(e){var t,r,n,i;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new NP((e==null?void 0:e.onListenerError)??bc,((r=this._options)==null?void 0:r.leakWarningThreshold)??AP):void 0,this._perfMon=(n=this._options)!=null&&n._profName?new LP(this._options._profName):void 0,this._deliveryQueue=(i=this._options)==null?void 0:i.deliveryQueue}dispose(){var e,t,r,n;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(r=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t),(n=this._leakageMon)==null||n.dispose())}get event(){return this._event??(this._event=(e,t,r)=>{var o,a,l,c,d;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let h=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(h);let f=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],v=new OP(`${h}. HINT: Stack shows most frequent listener (${f[1]}-times)`,f[0]);return(((o=this._options)==null?void 0:o.onListenerError)||bc)(v),ke.None}if(this._disposed)return ke.None;t&&(e=e.bind(t));let n=new Xd(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=DP.create(),i=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof Xd?(this._deliveryQueue??(this._deliveryQueue=new FP),this._listeners=[this._listeners,n]):this._listeners.push(n):((l=(a=this._options)==null?void 0:a.onWillAddFirstListener)==null||l.call(a,this),this._listeners=n,(d=(c=this._options)==null?void 0:c.onDidAddFirstListener)==null||d.call(c,this)),this._size++;let s=Xe(()=>{i==null||i(),this._removeListener(n)});return r instanceof ai?r.add(s):Array.isArray(r)&&r.push(s),s}),this._event}_removeListener(e){var i,s,o,a;if((s=(i=this._options)==null?void 0:i.onWillRemoveListener)==null||s.call(i,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(a=(o=this._options)==null?void 0:o.onDidRemoveLastListener)==null||a.call(o,this),this._size=0;return}let t=this._listeners,r=t.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[r]=void 0;let n=this._deliveryQueue.current===this;if(this._size*jP<=t.length){let l=0;for(let c=0;c<t.length;c++)t[c]?t[l++]=t[c]:n&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=l}}_deliver(e,t){var n;if(!e)return;let r=((n=this._options)==null?void 0:n.onListenerError)||bc;if(!r){e.value(t);return}try{e.value(t)}catch(i){r(i)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,r,n,i;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(r=this._perfMon)==null||r.stop()),(n=this._perfMon)==null||n.start(this._size),this._listeners)if(this._listeners instanceof Xd)this._deliver(this._listeners,e);else{let s=this._deliveryQueue;s.enqueue(this,e,this._listeners.length),this._deliverQueue(s)}(i=this._perfMon)==null||i.stop()}hasListeners(){return this._size>0}},FP=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Bf=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Q,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Q,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,r){if(this.getZoomLevel(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(n,t),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),t)}setFullscreen(t,r){if(this.isFullscreen(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToFullScreen.set(n,t),this._onDidChangeFullscreen.fire(n)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Bf.INSTANCE=new Bf;var Kp=Bf;function HP(e,t,r){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",r)}Kp.INSTANCE.onDidChangeZoomLevel;function WP(e){return Kp.INSTANCE.getZoomFactor(e)}Kp.INSTANCE.onDidChangeFullscreen;var po=typeof navigator=="object"?navigator.userAgent:"",Of=po.indexOf("Firefox")>=0,UP=po.indexOf("AppleWebKit")>=0,Vp=po.indexOf("Chrome")>=0,KP=!Vp&&po.indexOf("Safari")>=0;po.indexOf("Electron/")>=0;po.indexOf("Android")>=0;var Jd=!1;if(typeof In.matchMedia=="function"){let e=In.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=In.matchMedia("(display-mode: fullscreen)");Jd=e.matches,HP(In,e,({matches:r})=>{Jd&&t.matches||(Jd=r)})}var Bs="en",$f=!1,jf=!1,Cc=!1,MC=!1,Xl,xc=Bs,ry=Bs,VP,Hr,ji=globalThis,Dt,NS;typeof ji.vscode<"u"&&typeof ji.vscode.process<"u"?Dt=ji.vscode.process:typeof process<"u"&&typeof((NS=process==null?void 0:process.versions)==null?void 0:NS.node)=="string"&&(Dt=process);var DS,qP=typeof((DS=Dt==null?void 0:Dt.versions)==null?void 0:DS.electron)=="string",YP=qP&&(Dt==null?void 0:Dt.type)==="renderer",BS;if(typeof Dt=="object"){$f=Dt.platform==="win32",jf=Dt.platform==="darwin",Cc=Dt.platform==="linux",Cc&&Dt.env.SNAP&&Dt.env.SNAP_REVISION,Dt.env.CI||Dt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Xl=Bs,xc=Bs;let e=Dt.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Xl=t.userLocale,ry=t.osLocale,xc=t.resolvedLanguage||Bs,VP=(BS=t.languagePack)==null?void 0:BS.translationsConfigFile}catch{}MC=!0}else typeof navigator=="object"&&!YP?(Hr=navigator.userAgent,$f=Hr.indexOf("Windows")>=0,jf=Hr.indexOf("Macintosh")>=0,(Hr.indexOf("Macintosh")>=0||Hr.indexOf("iPad")>=0||Hr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Cc=Hr.indexOf("Linux")>=0,(Hr==null?void 0:Hr.indexOf("Mobi"))>=0,xc=globalThis._VSCODE_NLS_LANGUAGE||Bs,Xl=navigator.language.toLowerCase(),ry=Xl):console.error("Unable to resolve platform.");var PC=$f,mn=jf,GP=Cc,ny=MC,vn=Hr,zn=xc,XP;(e=>{function t(){return zn}e.value=t;function r(){return zn.length===2?zn==="en":zn.length>=3?zn[0]==="e"&&zn[1]==="n"&&zn[2]==="-":!1}e.isDefaultVariant=r;function n(){return zn==="en"}e.isDefault=n})(XP||(XP={}));var JP=typeof ji.postMessage=="function"&&!ji.importScripts;(()=>{if(JP){let e=[];ji.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,i=e.length;n<i;n++){let s=e[n];if(s.id===r.data.vscodeScheduleAsyncWork){e.splice(n,1),s.callback();return}}});let t=0;return r=>{let n=++t;e.push({id:n,callback:r}),ji.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})();var QP=!!(vn&&vn.indexOf("Chrome")>=0);vn&&vn.indexOf("Firefox")>=0;!QP&&vn&&vn.indexOf("Safari")>=0;vn&&vn.indexOf("Edg/")>=0;vn&&vn.indexOf("Android")>=0;var Ss=typeof navigator=="object"?navigator:{};ny||document.queryCommandSupported&&document.queryCommandSupported("copy")||Ss&&Ss.clipboard&&Ss.clipboard.writeText,ny||Ss&&Ss.clipboard&&Ss.clipboard.readText;var qp=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Qd=new qp,iy=new qp,sy=new qp,ZP=new Array(230),LC;(e=>{function t(a){return Qd.keyCodeToStr(a)}e.toString=t;function r(a){return Qd.strToKeyCode(a)}e.fromString=r;function n(a){return iy.keyCodeToStr(a)}e.toUserSettingsUS=n;function i(a){return sy.keyCodeToStr(a)}e.toUserSettingsGeneral=i;function s(a){return iy.strToKeyCode(a)||sy.strToKeyCode(a)}e.fromUserSettings=s;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Qd.keyCodeToStr(a)}e.toElectronAccelerator=o})(LC||(LC={}));var eL=class AC{constructor(t,r,n,i,s){this.ctrlKey=t,this.shiftKey=r,this.altKey=n,this.metaKey=i,this.keyCode=s}equals(t){return t instanceof AC&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",n=this.altKey?"1":"0",i=this.metaKey?"1":"0";return`K${t}${r}${n}${i}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new tL([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},tL=class{constructor(e){if(e.length===0)throw TP("chords");this.chords=e}getHashCode(){let e="";for(let t=0,r=this.chords.length;t<r;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function rL(e){if(e.charCode){let r=String.fromCharCode(e.charCode).toUpperCase();return LC.fromString(r)}let t=e.keyCode;if(t===3)return 7;if(Of)switch(t){case 59:return 85;case 60:if(GP)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(mn)return 57;break}else if(UP&&(mn&&t===93||!mn&&t===92))return 57;return ZP[t]||0}var nL=mn?256:2048,iL=512,sL=1024,oL=mn?2048:256,oy=class{constructor(e){var r;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(r=t.getModifierState)==null?void 0:r.call(t,"AltGraph"),this.keyCode=rL(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=nL),this.altKey&&(t|=iL),this.shiftKey&&(t|=sL),this.metaKey&&(t|=oL),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new eL(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},ay=new WeakMap;function aL(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,r=e.parent.location;if(t.origin!=="null"&&r.origin!=="null"&&t.origin!==r.origin)return null}catch{return null}return e.parent}var lL=class{static getSameOriginWindowChain(e){let t=ay.get(e);if(!t){t=[],ay.set(e,t);let r=e,n;do n=aL(r),n?t.push({window:new WeakRef(r),iframeElement:r.frameElement||null}):t.push({window:new WeakRef(r),iframeElement:null}),r=n;while(r)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let r=0,n=0,i=this.getSameOriginWindowChain(e);for(let s of i){let o=s.window.deref();if(r+=(o==null?void 0:o.scrollY)??0,n+=(o==null?void 0:o.scrollX)??0,o===t||!s.iframeElement)break;let a=s.iframeElement.getBoundingClientRect();r+=a.top,n+=a.left}return{top:r,left:n}}},Jl=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let r=lL.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=r.left,this.posy-=r.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},ly=class{constructor(e,t=0,r=0){var i;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=r,this.deltaX=t;let n=!1;if(Vp){let s=navigator.userAgent.match(/Chrome\/(\d+)/);n=(s?parseInt(s[1]):123)<=122}if(e){let s=e,o=e,a=((i=e.view)==null?void 0:i.devicePixelRatio)||1;if(typeof s.wheelDeltaY<"u")n?this.deltaY=s.wheelDeltaY/(120*a):this.deltaY=s.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){let l=e;l.deltaMode===l.DOM_DELTA_LINE?Of&&!mn?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")KP&&PC?this.deltaX=-(s.wheelDeltaX/120):n?this.deltaX=s.wheelDeltaX/(120*a):this.deltaX=s.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let l=e;l.deltaMode===l.DOM_DELTA_LINE?Of&&!mn?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*a):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},NC=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),cL;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof uL?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Bt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:NC})})(cL||(cL={}));var uL=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?NC:(this._emitter||(this._emitter=new Q),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Yp=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Pf("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Pf("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},dL=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,r=globalThis){if(this.isDisposed)throw new Pf("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=r.setInterval(()=>{e()},t);this.disposable=Xe(()=>{r.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},hL;(e=>{async function t(n){let i,s=await Promise.all(n.map(o=>o.then(a=>a,a=>{i||(i=a)})));if(typeof i<"u")throw i;return s}e.settled=t;function r(n){return new Promise(async(i,s)=>{try{await n(i,s)}catch(o){s(o)}})}e.withAsyncBody=r})(hL||(hL={}));var cy=class Er{static fromArray(t){return new Er(r=>{r.emitMany(t)})}static fromPromise(t){return new Er(async r=>{r.emitMany(await t)})}static fromPromises(t){return new Er(async r=>{await Promise.all(t.map(async n=>r.emitOne(await n)))})}static merge(t){return new Er(async r=>{await Promise.all(t.map(async n=>{for await(let i of n)r.emitOne(i)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Q,queueMicrotask(async()=>{let n={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{await Promise.resolve(t(n)),this.resolve()}catch(i){this.reject(i)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Bt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var r;return(r=this._onReturn)==null||r.call(this),{done:!0,value:void 0}}}}static map(t,r){return new Er(async n=>{for await(let i of t)n.emitOne(r(i))})}map(t){return Er.map(this,t)}static filter(t,r){return new Er(async n=>{for await(let i of t)r(i)&&n.emitOne(i)})}filter(t){return Er.filter(this,t)}static coalesce(t){return Er.filter(t,r=>!!r)}coalesce(){return Er.coalesce(this)}static async toPromise(t){let r=[];for await(let n of t)r.push(n);return r}toPromise(){return Er.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};cy.EMPTY=cy.fromArray([]);var{getWindow:dn,getWindowId:fL,onDidRegisterWindow:mL}=function(){let e=new Map,t={window:In,disposables:new ai};e.set(In.vscodeWindowId,t);let r=new Q,n=new Q,i=new Q;function s(o,a){return(typeof o=="number"?e.get(o):void 0)??(a?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:n.event,registerWindow(o){if(e.has(o.vscodeWindowId))return ke.None;let a=new ai,l={window:o,disposables:a.add(new ai)};return e.set(o.vscodeWindowId,l),a.add(Xe(()=>{e.delete(o.vscodeWindowId),n.fire(o)})),a.add(pe(o,xt.BEFORE_UNLOAD,()=>{i.fire(o)})),r.fire(l),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:s,getWindow(o){var c;let a=o;if((c=a==null?void 0:a.ownerDocument)!=null&&c.defaultView)return a.ownerDocument.defaultView.window;let l=o;return l!=null&&l.view?l.view.window:In},getDocument(o){return dn(o).document}}}(),pL=class{constructor(e,t,r,n){this._node=e,this._type=t,this._handler=r,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function pe(e,t,r,n){return new pL(e,t,r,n)}var uy=function(e,t,r,n){return pe(e,t,r,n)},Gp,gL=class extends dL{constructor(e){super(),this.defaultTarget=e&&dn(e)}cancelAndSet(e,t,r){return super.cancelAndSet(e,t,r??this.defaultTarget)}},dy=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){bc(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,r=new Map,n=new Map,i=s=>{r.set(s,!1);let o=e.get(s)??[];for(t.set(s,o),e.set(s,[]),n.set(s,!0);o.length>0;)o.sort(dy.sort),o.shift().execute();n.set(s,!1)};Gp=(s,o,a=0)=>{let l=fL(s),c=new dy(o,a),d=e.get(l);return d||(d=[],e.set(l,d)),d.push(c),r.get(l)||(r.set(l,!0),s.requestAnimationFrame(()=>i(l))),c}})();function vL(e){let t=e.getBoundingClientRect(),r=dn(e);return{left:t.left+r.scrollX,top:t.top+r.scrollY,width:t.width,height:t.height}}var xt={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},_L=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=sr(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=sr(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=sr(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=sr(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=sr(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=sr(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=sr(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=sr(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=sr(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=sr(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=sr(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=sr(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=sr(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=sr(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function sr(e){return typeof e=="number"?`${e}px`:e}function pa(e){return new _L(e)}var DC=class{constructor(){this._hooks=new ai,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let r=this._onStopCallback;this._onStopCallback=null,e&&r&&r(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,r,n,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=i;let s=e;try{e.setPointerCapture(t),this._hooks.add(Xe(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=dn(e)}this._hooks.add(pe(s,xt.POINTER_MOVE,o=>{if(o.buttons!==r){this.stopMonitoring(!0);return}o.preventDefault(),this._pointerMoveCallback(o)})),this._hooks.add(pe(s,xt.POINTER_UP,o=>this.stopMonitoring(!0)))}};function yL(e,t,r){let n=null,i=null;if(typeof r.value=="function"?(n="value",i=r.value,i.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(n="get",i=r.get),!i)throw new Error("not supported");let s=`$memoize$${t}`;r[n]=function(...o){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,o)}),this[s]}}var on;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(on||(on={}));var Jo=class Ht extends ke{constructor(){super(),this.dispatched=!1,this.targets=new ty,this.ignoreTargets=new ty,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Bt.runAndSubscribe(mL,({window:t,disposables:r})=>{r.add(pe(t.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),r.add(pe(t.document,"touchend",n=>this.onTouchEnd(t,n))),r.add(pe(t.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:In,disposables:this._store}))}static addTarget(t){if(!Ht.isTouchDevice())return ke.None;Ht.INSTANCE||(Ht.INSTANCE=new Ht);let r=Ht.INSTANCE.targets.push(t);return Xe(r)}static ignoreTarget(t){if(!Ht.isTouchDevice())return ke.None;Ht.INSTANCE||(Ht.INSTANCE=new Ht);let r=Ht.INSTANCE.ignoreTargets.push(t);return Xe(r)}static isTouchDevice(){return"ontouchstart"in In||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,i=t.targetTouches.length;n<i;n++){let s=t.targetTouches.item(n);this.activeTouches[s.identifier]={id:s.identifier,initialTarget:s.target,initialTimeStamp:r,initialPageX:s.pageX,initialPageY:s.pageY,rollingTimestamps:[r],rollingPageX:[s.pageX],rollingPageY:[s.pageY]};let o=this.newGestureEvent(on.Start,s.target);o.pageX=s.pageX,o.pageY=s.pageY,this.dispatchEvent(o)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,r){let n=Date.now(),i=Object.keys(this.activeTouches).length;for(let s=0,o=r.changedTouches.length;s<o;s++){let a=r.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("move of an UNKNOWN touch",a);continue}let l=this.activeTouches[a.identifier],c=Date.now()-l.initialTimeStamp;if(c<Ht.HOLD_DELAY&&Math.abs(l.initialPageX-pr(l.rollingPageX))<30&&Math.abs(l.initialPageY-pr(l.rollingPageY))<30){let d=this.newGestureEvent(on.Tap,l.initialTarget);d.pageX=pr(l.rollingPageX),d.pageY=pr(l.rollingPageY),this.dispatchEvent(d)}else if(c>=Ht.HOLD_DELAY&&Math.abs(l.initialPageX-pr(l.rollingPageX))<30&&Math.abs(l.initialPageY-pr(l.rollingPageY))<30){let d=this.newGestureEvent(on.Contextmenu,l.initialTarget);d.pageX=pr(l.rollingPageX),d.pageY=pr(l.rollingPageY),this.dispatchEvent(d)}else if(i===1){let d=pr(l.rollingPageX),h=pr(l.rollingPageY),f=pr(l.rollingTimestamps)-l.rollingTimestamps[0],v=d-l.rollingPageX[0],m=h-l.rollingPageY[0],S=[...this.targets].filter(y=>l.initialTarget instanceof Node&&y.contains(l.initialTarget));this.inertia(t,S,n,Math.abs(v)/f,v>0?1:-1,d,Math.abs(m)/f,m>0?1:-1,h)}this.dispatchEvent(this.newGestureEvent(on.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,r){let n=document.createEvent("CustomEvent");return n.initEvent(t,!1,!0),n.initialTarget=r,n.tapCount=0,n}dispatchEvent(t){if(t.type===on.Tap){let r=new Date().getTime(),n=0;r-this._lastSetTapCountTime>Ht.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=r,t.tapCount=n}else(t.type===on.Change||t.type===on.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(t.initialTarget))return;let r=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let i=0,s=t.initialTarget;for(;s&&s!==n;)i++,s=s.parentElement;r.push([i,n])}r.sort((n,i)=>n[0]-i[0]);for(let[n,i]of r)i.dispatchEvent(t),this.dispatched=!0}}inertia(t,r,n,i,s,o,a,l,c){this.handle=Gp(t,()=>{let d=Date.now(),h=d-n,f=0,v=0,m=!0;i+=Ht.SCROLL_FRICTION*h,a+=Ht.SCROLL_FRICTION*h,i>0&&(m=!1,f=s*i*h),a>0&&(m=!1,v=l*a*h);let S=this.newGestureEvent(on.Change);S.translationX=f,S.translationY=v,r.forEach(y=>y.dispatchEvent(S)),m||this.inertia(t,r,d,i,s,o+f,a,l,c+v)})}onTouchMove(t){let r=Date.now();for(let n=0,i=t.changedTouches.length;n<i;n++){let s=t.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("end of an UNKNOWN touch",s);continue}let o=this.activeTouches[s.identifier],a=this.newGestureEvent(on.Change,o.initialTarget);a.translationX=s.pageX-pr(o.rollingPageX),a.translationY=s.pageY-pr(o.rollingPageY),a.pageX=s.pageX,a.pageY=s.pageY,this.dispatchEvent(a),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(s.pageX),o.rollingPageY.push(s.pageY),o.rollingTimestamps.push(r)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Jo.SCROLL_FRICTION=-.005,Jo.HOLD_DELAY=700,Jo.CLEAR_TAP_COUNT_TIME=400,it([yL],Jo,"isTouchDevice",1);var SL=Jo,Xp=class extends ke{onclick(e,t){this._register(pe(e,xt.CLICK,r=>t(new Jl(dn(e),r))))}onmousedown(e,t){this._register(pe(e,xt.MOUSE_DOWN,r=>t(new Jl(dn(e),r))))}onmouseover(e,t){this._register(pe(e,xt.MOUSE_OVER,r=>t(new Jl(dn(e),r))))}onmouseleave(e,t){this._register(pe(e,xt.MOUSE_LEAVE,r=>t(new Jl(dn(e),r))))}onkeydown(e,t){this._register(pe(e,xt.KEY_DOWN,r=>t(new oy(r))))}onkeyup(e,t){this._register(pe(e,xt.KEY_UP,r=>t(new oy(r))))}oninput(e,t){this._register(pe(e,xt.INPUT,t))}onblur(e,t){this._register(pe(e,xt.BLUR,t))}onfocus(e,t){this._register(pe(e,xt.FOCUS,t))}onchange(e,t){this._register(pe(e,xt.CHANGE,t))}ignoreGesture(e){return SL.ignoreTarget(e)}},hy=11,wL=class extends Xp{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=hy+"px",this.domNode.style.height=hy+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new DC),this._register(uy(this.bgDomNode,xt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(uy(this.domNode,xt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new gL),this._pointerdownScheduleRepeatTimer=this._register(new Yp)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,dn(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},bL=class zf{constructor(t,r,n,i,s,o,a){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,n=n|0,i=i|0,s=s|0,o=o|0,a=a|0),this.rawScrollLeft=i,this.rawScrollTop=a,r<0&&(r=0),i+r>n&&(i=n-r),i<0&&(i=0),s<0&&(s=0),a+s>o&&(a=o-s),a<0&&(a=0),this.width=r,this.scrollWidth=n,this.scrollLeft=i,this.height=s,this.scrollHeight=o,this.scrollTop=a}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,r){return new zf(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new zf(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,r){let n=this.width!==t.width,i=this.scrollWidth!==t.scrollWidth,s=this.scrollLeft!==t.scrollLeft,o=this.height!==t.height,a=this.scrollHeight!==t.scrollHeight,l=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:r,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:i,scrollLeftChanged:s,heightChanged:o,scrollHeightChanged:a,scrollTopChanged:l}}},CL=class extends ke{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new bL(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var n;let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(n=this._smoothScrolling)==null||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let n;t?n=new my(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=my.start(this._state,r,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,t)))}},fy=class{constructor(e,t,r){this.scrollLeft=e,this.scrollTop=t,this.isDone=r}};function Zd(e,t){let r=t-e;return function(n){return e+r*TL(n)}}function xL(e,t,r){return function(n){return n<r?e(n/r):t((n-r)/(1-r))}}var my=class Ff{constructor(t,r,n,i){this.from=t,this.to=r,this.duration=i,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,r,n){if(Math.abs(t-r)>2.5*n){let i,s;return t<r?(i=t+.75*n,s=r-.75*n):(i=t-.75*n,s=r+.75*n),xL(Zd(t,i),Zd(s,r),.33)}return Zd(t,r)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let r=(t-this.startTime)/this.duration;if(r<1){let n=this.scrollLeft(r),i=this.scrollTop(r);return new fy(n,i,!1)}return new fy(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,r,n){return Ff.start(t,r,n)}static start(t,r,n){n=n+10;let i=Date.now()-10;return new Ff(t,r,i,n)}};function kL(e){return Math.pow(e,3)}function TL(e){return 1-kL(1-e)}var EL=class extends ke{constructor(e,t,r){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=r,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Yp)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},IL=140,BC=class extends Xp{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new EL(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new DC),this._shouldRender=!0,this.domNode=pa(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(pe(this.domNode.domNode,xt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new wL(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,r,n){this.slider=pa(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof r=="number"&&this.slider.setWidth(r),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(pe(this.slider.domNode,xt.POINTER_DOWN,i=>{i.button===0&&(i.preventDefault(),this._sliderPointerDown(i))})),this.onclick(this.slider.domNode,i=>{i.leftButton&&i.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,r=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);r<=i&&i<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,r;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,r=e.offsetY;else{let i=vL(this.domNode.domNode);t=e.pageX-i.left,r=e.pageY-i.top}let n=this._pointerDownRelativePosition(t,r);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),r=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{let s=this._sliderOrthogonalPointerPosition(i),o=Math.abs(s-r);if(PC&&o>IL){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let a=this._sliderPointerPosition(i)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(a))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},OC=class Hf{constructor(t,r,n,i,s,o){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(t),this._visibleSize=i,this._scrollSize=s,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Hf(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let r=Math.round(t);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(t){let r=Math.round(t);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let r=Math.round(t);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,r,n,i,s){let o=Math.max(0,n-t),a=Math.max(0,o-2*r),l=i>0&&i>n;if(!l)return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*a/i))),d=(a-c)/(i-n),h=s*d;return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:d,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){let t=Hf._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize,n=this._scrollPosition;return r<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let r=this._computedSliderPosition+t;return Math.round(r/this._computedSliderRatio)}},RL=class extends BC{constructor(e,t,r){let n=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new OC(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},ML=class extends BC{constructor(e,t,r){let n=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new OC(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},PL=500,py=50,LL=class{constructor(e,t,r){this.timestamp=e,this.deltaX=t,this.deltaY=r,this.score=0}},Wf=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,r=0,n=1,i=this._rear;do{let s=i===this._front?t:Math.pow(2,-n);if(t-=s,r+=this._memory[i].score*s,i===this._front)break;i=(this._capacity+i-1)%this._capacity,n++}while(!0);return r<=.5}acceptStandardWheelEvent(t){if(Vp){let r=dn(t.browserEvent),n=WP(r);this.accept(Date.now(),t.deltaX*n,t.deltaY*n)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,r,n){let i=null,s=new LL(t,r,n);this._front===-1&&this._rear===-1?(this._memory[0]=s,this._front=0,this._rear=0):(i=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=s),s.score=this._computeScore(s,i)}_computeScore(t,r){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(n+=.25),r){let i=Math.abs(t.deltaX),s=Math.abs(t.deltaY),o=Math.abs(r.deltaX),a=Math.abs(r.deltaY),l=Math.max(Math.min(i,o),1),c=Math.max(Math.min(s,a),1),d=Math.max(i,o),h=Math.max(s,a);d%l===0&&h%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Wf.INSTANCE=new Wf;var AL=Wf,NL=class extends Xp{constructor(e,t,r){super(),this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Q),this.onWillScroll=this._onWillScroll.event,this._options=BL(t),this._scrollable=r,this._register(this._scrollable.onScroll(i=>{this._onWillScroll.fire(i),this._onDidScroll(i),this._onScroll.fire(i)}));let n={onMouseWheel:i=>this._onMouseWheel(i),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new ML(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new RL(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=pa(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=pa(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=pa(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,i=>this._onMouseOver(i)),this.onmouseleave(this._listenOnDomNode,i=>this._onMouseLeave(i)),this._hideTimeout=this._register(new Yp),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Gi(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,mn&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new ly(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Gi(this._mouseWheelToDispose),e)){let t=r=>{this._onMouseWheel(new ly(r))};this._mouseWheelToDispose.push(pe(this._listenOnDomNode,xt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var i;if((i=e.browserEvent)!=null&&i.defaultPrevented)return;let t=AL.INSTANCE;t.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+s===0?o=s=0:Math.abs(s)>=Math.abs(o)?o=0:s=0),this._options.flipAxes&&([s,o]=[o,s]);let a=!mn&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!o&&(o=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);let l=this._scrollable.getFutureScrollPosition(),c={};if(s){let d=py*s,h=l.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(c,h)}if(o){let d=py*o,h=l.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(c,h)}c=this._scrollable.validateScrollPosition(c),(l.scrollLeft!==c.scrollLeft||l.scrollTop!==c.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(c):this._scrollable.setScrollPositionNow(c),r=!0)}let n=r;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,r=e.scrollLeft>0,n=r?" left":"",i=t?" top":"",s=r||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${i}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),PL)}},DL=class extends NL{constructor(e,t,r){super(e,t,r)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function BL(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,mn&&(t.className+=" mac"),t}var Uf=class extends ke{constructor(e,t,r,n,i,s,o,a){super(),this._bufferService=r,this._optionsService=o,this._renderService=a,this._onRequestScrollLines=this._register(new Q),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let l=this._register(new CL({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:c=>Gp(n.window,c)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{l.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new DL(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},l)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(c=>{this._scrollableElement.updateOptions({handleMouseWheel:!(c&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Bt.runAndSubscribe(s.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=s.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Xe(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Xe(()=>this._styleElement.remove())),this._register(Bt.runAndSubscribe(s.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${s.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${s.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${s.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
134
|
-
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(c=>this._handleScroll(c)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),r=t-this._bufferService.buffer.ydisp;r!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(r)),this._isHandlingScroll=!1}};Uf=it([ie(2,rr),ie(3,Dn),ie(4,vC),ie(5,mo),ie(6,nr),ie(7,Bn)],Uf);var Kf=class extends ke{constructor(e,t,r,n,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=r,this._decorationService=n,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(s=>this._removeDecoration(s))),this._register(Xe(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var n;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((n=e==null?void 0:e.options)==null?void 0:n.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let r=e.options.x??0;return r&&r>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let r=this._decorationElements.get(e);r||(r=this._createElement(e),e.element=r,this._decorationElements.set(e,r),this._container.appendChild(r),e.onDispose(()=>{this._decorationElements.delete(e),r.remove()})),r.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r)}}_refreshXPosition(e,t=e.element){if(!t)return;let r=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=r?`${r*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=r?`${r*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};Kf=it([ie(1,rr),ie(2,Dn),ie(3,il),ie(4,Bn)],Kf);var OL=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,r){return t>=e.startBufferLine-this._linePadding[r||"full"]&&t<=e.endBufferLine+this._linePadding[r||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},nn={full:0,left:0,center:0,right:0},Fn={full:0,left:0,center:0,right:0},Oo={full:0,left:0,center:0,right:0},cu=class extends ke{constructor(e,t,r,n,i,s,o,a){var c;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=r,this._decorationService=n,this._renderService=i,this._optionsService=s,this._themeService=o,this._coreBrowserService=a,this._colorZoneStore=new OL,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(c=this._viewportElement.parentElement)==null||c.insertBefore(this._canvas,this._viewportElement),this._register(Xe(()=>{var d;return(d=this._canvas)==null?void 0:d.remove()}));let l=this._canvas.getContext("2d");if(l)this._ctx=l;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Fn.full=this._canvas.width,Fn.left=e,Fn.center=t,Fn.right=e,this._refreshDrawHeightConstants(),Oo.full=1,Oo.left=1,Oo.center=1+Fn.left,Oo.right=1+Fn.left+Fn.center}_refreshDrawHeightConstants(){nn.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);nn.left=t,nn.center=t,nn.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*nn.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*nn.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*nn.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*nn.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Oo[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-nn[e.position||"full"]/2),Fn[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+nn[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};cu=it([ie(2,rr),ie(3,il),ie(4,Bn),ie(5,nr),ie(6,mo),ie(7,Dn)],cu);var K;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
135
|
-
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(K||(K={}));var kc;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(kc||(kc={}));var $C;(e=>e.ST=`${K.ESC}\\`)($C||($C={}));var Vf=class{constructor(e,t,r,n,i,s){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=n,this._coreService=i,this._renderService=s,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let r;t.start+=this._dataAlreadySent.length,this._isComposing?r=this._textarea.value.substring(t.start,this._compositionPosition.start):r=this._textarea.value.substring(t.start),r.length>0&&this._coreService.triggerDataEvent(r,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,r=t.replace(e,"");this._dataAlreadySent=r,t.length>e.length?this._coreService.triggerDataEvent(r,!0):t.length<e.length?this._coreService.triggerDataEvent(`${K.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,i=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let s=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(s.width,1)+"px",this._textarea.style.height=Math.max(s.height,1)+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Vf=it([ie(2,rr),ie(3,nr),ie(4,rs),ie(5,Bn)],Vf);var Tt=0,Et=0,It=0,rt=0,gy={css:"#00000000",rgba:0},dt;(e=>{function t(i,s,o,a){return a!==void 0?`#${ki(i)}${ki(s)}${ki(o)}${ki(a)}`:`#${ki(i)}${ki(s)}${ki(o)}`}e.toCss=t;function r(i,s,o,a=255){return(i<<24|s<<16|o<<8|a)>>>0}e.toRgba=r;function n(i,s,o,a){return{css:e.toCss(i,s,o,a),rgba:e.toRgba(i,s,o,a)}}e.toColor=n})(dt||(dt={}));var He;(e=>{function t(l,c){if(rt=(c.rgba&255)/255,rt===1)return{css:c.css,rgba:c.rgba};let d=c.rgba>>24&255,h=c.rgba>>16&255,f=c.rgba>>8&255,v=l.rgba>>24&255,m=l.rgba>>16&255,S=l.rgba>>8&255;Tt=v+Math.round((d-v)*rt),Et=m+Math.round((h-m)*rt),It=S+Math.round((f-S)*rt);let y=dt.toCss(Tt,Et,It),g=dt.toRgba(Tt,Et,It);return{css:y,rgba:g}}e.blend=t;function r(l){return(l.rgba&255)===255}e.isOpaque=r;function n(l,c,d){let h=Tc.ensureContrastRatio(l.rgba,c.rgba,d);if(h)return dt.toColor(h>>24&255,h>>16&255,h>>8&255)}e.ensureContrastRatio=n;function i(l){let c=(l.rgba|255)>>>0;return[Tt,Et,It]=Tc.toChannels(c),{css:dt.toCss(Tt,Et,It),rgba:c}}e.opaque=i;function s(l,c){return rt=Math.round(c*255),[Tt,Et,It]=Tc.toChannels(l.rgba),{css:dt.toCss(Tt,Et,It,rt),rgba:dt.toRgba(Tt,Et,It,rt)}}e.opacity=s;function o(l,c){return rt=l.rgba&255,s(l,rt*c/255)}e.multiplyOpacity=o;function a(l){return[l.rgba>>24&255,l.rgba>>16&255,l.rgba>>8&255]}e.toColorRGB=a})(He||(He={}));var Qe;(e=>{let t,r;try{let i=document.createElement("canvas");i.width=1,i.height=1;let s=i.getContext("2d",{willReadFrequently:!0});s&&(t=s,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function n(i){if(i.match(/#[\da-f]{3,8}/i))switch(i.length){case 4:return Tt=parseInt(i.slice(1,2).repeat(2),16),Et=parseInt(i.slice(2,3).repeat(2),16),It=parseInt(i.slice(3,4).repeat(2),16),dt.toColor(Tt,Et,It);case 5:return Tt=parseInt(i.slice(1,2).repeat(2),16),Et=parseInt(i.slice(2,3).repeat(2),16),It=parseInt(i.slice(3,4).repeat(2),16),rt=parseInt(i.slice(4,5).repeat(2),16),dt.toColor(Tt,Et,It,rt);case 7:return{css:i,rgba:(parseInt(i.slice(1),16)<<8|255)>>>0};case 9:return{css:i,rgba:parseInt(i.slice(1),16)>>>0}}let s=i.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return Tt=parseInt(s[1]),Et=parseInt(s[2]),It=parseInt(s[3]),rt=Math.round((s[5]===void 0?1:parseFloat(s[5]))*255),dt.toColor(Tt,Et,It,rt);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=i,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Tt,Et,It,rt]=t.getImageData(0,0,1,1).data,rt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:dt.toRgba(Tt,Et,It,rt),css:i}}e.toColor=n})(Qe||(Qe={}));var Gt;(e=>{function t(n){return r(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function r(n,i,s){let o=n/255,a=i/255,l=s/255,c=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4);return c*.2126+d*.7152+h*.0722}e.relativeLuminance2=r})(Gt||(Gt={}));var Tc;(e=>{function t(o,a){if(rt=(a&255)/255,rt===1)return a;let l=a>>24&255,c=a>>16&255,d=a>>8&255,h=o>>24&255,f=o>>16&255,v=o>>8&255;return Tt=h+Math.round((l-h)*rt),Et=f+Math.round((c-f)*rt),It=v+Math.round((d-v)*rt),dt.toRgba(Tt,Et,It)}e.blend=t;function r(o,a,l){let c=Gt.relativeLuminance(o>>8),d=Gt.relativeLuminance(a>>8);if(bn(c,d)<l){if(d<c){let v=n(o,a,l),m=bn(c,Gt.relativeLuminance(v>>8));if(m<l){let S=i(o,a,l),y=bn(c,Gt.relativeLuminance(S>>8));return m>y?v:S}return v}let h=i(o,a,l),f=bn(c,Gt.relativeLuminance(h>>8));if(f<l){let v=n(o,a,l),m=bn(c,Gt.relativeLuminance(v>>8));return f>m?h:v}return h}}e.ensureContrastRatio=r;function n(o,a,l){let c=o>>24&255,d=o>>16&255,h=o>>8&255,f=a>>24&255,v=a>>16&255,m=a>>8&255,S=bn(Gt.relativeLuminance2(f,v,m),Gt.relativeLuminance2(c,d,h));for(;S<l&&(f>0||v>0||m>0);)f-=Math.max(0,Math.ceil(f*.1)),v-=Math.max(0,Math.ceil(v*.1)),m-=Math.max(0,Math.ceil(m*.1)),S=bn(Gt.relativeLuminance2(f,v,m),Gt.relativeLuminance2(c,d,h));return(f<<24|v<<16|m<<8|255)>>>0}e.reduceLuminance=n;function i(o,a,l){let c=o>>24&255,d=o>>16&255,h=o>>8&255,f=a>>24&255,v=a>>16&255,m=a>>8&255,S=bn(Gt.relativeLuminance2(f,v,m),Gt.relativeLuminance2(c,d,h));for(;S<l&&(f<255||v<255||m<255);)f=Math.min(255,f+Math.ceil((255-f)*.1)),v=Math.min(255,v+Math.ceil((255-v)*.1)),m=Math.min(255,m+Math.ceil((255-m)*.1)),S=bn(Gt.relativeLuminance2(f,v,m),Gt.relativeLuminance2(c,d,h));return(f<<24|v<<16|m<<8|255)>>>0}e.increaseLuminance=i;function s(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}e.toChannels=s})(Tc||(Tc={}));function ki(e){let t=e.toString(16);return t.length<2?"0"+t:t}function bn(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var $L=class extends nl{constructor(e,t,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},uu=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Br}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let r=[],n=t.translateToString(!0),i=0,s=0,o=0,a=t.getFg(0),l=t.getBg(0);for(let c=0;c<t.getTrimmedLength();c++)if(t.loadCell(c,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==a||this._workCell.bg!==l){if(c-i>1){let d=this._getJoinedRanges(n,o,s,t,i);for(let h=0;h<d.length;h++)r.push(d[h])}i=c,o=s,a=this._workCell.fg,l=this._workCell.bg}s+=this._workCell.getChars().length||Qn.length}if(this._bufferService.cols-i>1){let c=this._getJoinedRanges(n,o,s,t,i);for(let d=0;d<c.length;d++)r.push(c[d])}return r}_getJoinedRanges(e,t,r,n,i){let s=e.substring(t,r),o=[];try{o=this._characterJoiners[0].handler(s)}catch(a){console.error(a)}for(let a=1;a<this._characterJoiners.length;a++)try{let l=this._characterJoiners[a].handler(s);for(let c=0;c<l.length;c++)uu._mergeRanges(o,l[c])}catch(l){console.error(l)}return this._stringRangesToCellRanges(o,n,i),o}_stringRangesToCellRanges(e,t,r){let n=0,i=!1,s=0,o=e[n];if(o){for(let a=r;a<this._bufferService.cols;a++){let l=t.getWidth(a),c=t.getString(a).length||Qn.length;if(l!==0){if(!i&&o[0]<=s&&(o[0]=a,i=!0),o[1]<=s){if(o[1]=a,o=e[++n],!o)break;o[0]<=s?(o[0]=a,i=!0):i=!1}s+=c}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let r=!1;for(let n=0;n<e.length;n++){let i=e[n];if(r){if(t[1]<=i[0])return e[n-1][1]=t[1],e;if(t[1]<=i[1])return e[n-1][1]=Math.max(t[1],i[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(t[1]<=i[0])return e.splice(n,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),r=!0);continue}}return r?e[e.length-1][1]=t[1]:e.push(t),e}};uu=it([ie(0,rr)],uu);function jL(e){return 57508<=e&&e<=57558}function zL(e){return 9472<=e&&e<=9631}function FL(e){return jL(e)||zL(e)}function HL(){return{css:{canvas:Ql(),cell:Ql()},device:{canvas:Ql(),cell:Ql(),char:{width:0,height:0,left:0,top:0}}}}function Ql(){return{width:0,height:0}}var qf=class{constructor(e,t,r,n,i,s,o){this._document=e,this._characterJoinerService=t,this._optionsService=r,this._coreBrowserService=n,this._coreService=i,this._decorationService=s,this._themeService=o,this._workCell=new Br,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,r){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=r}createRow(e,t,r,n,i,s,o,a,l,c,d){let h=[],f=this._characterJoinerService.getJoinedCharacters(t),v=this._themeService.colors,m=e.getNoBgTrimmedLength();r&&m<s+1&&(m=s+1);let S,y=0,g="",_=0,w=0,b=0,C=0,M=!1,x=0,T=!1,k=0,I=0,L=[],R=c!==-1&&d!==-1;for(let A=0;A<m;A++){e.loadCell(A,this._workCell);let O=this._workCell.getWidth();if(O===0)continue;let P=!1,E=A>=I,F=A,N=this._workCell;if(f.length>0&&A===f[0][0]&&E){let re=f.shift(),ge=this._isCellInSelection(re[0],t);for(_=re[0]+1;_<re[1];_++)E&&(E=ge===this._isCellInSelection(_,t));E&&(E=!r||s<re[0]||s>=re[1]),E?(P=!0,N=new $L(this._workCell,e.translateToString(!0,re[0],re[1]),re[1]-re[0]),F=re[1]-1,O=N.getWidth()):I=re[1]}let V=this._isCellInSelection(A,t),D=r&&A===s,W=R&&A>=c&&A<=d,j=!1;this._decorationService.forEachDecorationAtCell(A,t,void 0,re=>{j=!0});let ee=N.getChars()||Qn;if(ee===" "&&(N.isUnderline()||N.isOverline())&&(ee=" "),k=O*a-l.get(ee,N.isBold(),N.isItalic()),!S)S=this._document.createElement("span");else if(y&&(V&&T||!V&&!T&&N.bg===w)&&(V&&T&&v.selectionForeground||N.fg===b)&&N.extended.ext===C&&W===M&&k===x&&!D&&!P&&!j&&E){N.isInvisible()?g+=Qn:g+=ee,y++;continue}else y&&(S.textContent=g),S=this._document.createElement("span"),y=0,g="";if(w=N.bg,b=N.fg,C=N.extended.ext,M=W,x=k,T=V,P&&s>=A&&s<=F&&(s=A),!this._coreService.isCursorHidden&&D&&this._coreService.isCursorInitialized){if(L.push("xterm-cursor"),this._coreBrowserService.isFocused)o&&L.push("xterm-cursor-blink"),L.push(n==="bar"?"xterm-cursor-bar":n==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(i)switch(i){case"outline":L.push("xterm-cursor-outline");break;case"block":L.push("xterm-cursor-block");break;case"bar":L.push("xterm-cursor-bar");break;case"underline":L.push("xterm-cursor-underline");break}}if(N.isBold()&&L.push("xterm-bold"),N.isItalic()&&L.push("xterm-italic"),N.isDim()&&L.push("xterm-dim"),N.isInvisible()?g=Qn:g=N.getChars()||Qn,N.isUnderline()&&(L.push(`xterm-underline-${N.extended.underlineStyle}`),g===" "&&(g=" "),!N.isUnderlineColorDefault()))if(N.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${nl.toColorRGB(N.getUnderlineColor()).join(",")})`;else{let re=N.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&N.isBold()&&re<8&&(re+=8),S.style.textDecorationColor=v.ansi[re].css}N.isOverline()&&(L.push("xterm-overline"),g===" "&&(g=" ")),N.isStrikethrough()&&L.push("xterm-strikethrough"),W&&(S.style.textDecoration="underline");let te=N.getFgColor(),ae=N.getFgColorMode(),H=N.getBgColor(),se=N.getBgColorMode(),B=!!N.isInverse();if(B){let re=te;te=H,H=re;let ge=ae;ae=se,se=ge}let z,Y,Z=!1;this._decorationService.forEachDecorationAtCell(A,t,void 0,re=>{re.options.layer!=="top"&&Z||(re.backgroundColorRGB&&(se=50331648,H=re.backgroundColorRGB.rgba>>8&16777215,z=re.backgroundColorRGB),re.foregroundColorRGB&&(ae=50331648,te=re.foregroundColorRGB.rgba>>8&16777215,Y=re.foregroundColorRGB),Z=re.options.layer==="top")}),!Z&&V&&(z=this._coreBrowserService.isFocused?v.selectionBackgroundOpaque:v.selectionInactiveBackgroundOpaque,H=z.rgba>>8&16777215,se=50331648,Z=!0,v.selectionForeground&&(ae=50331648,te=v.selectionForeground.rgba>>8&16777215,Y=v.selectionForeground)),Z&&L.push("xterm-decoration-top");let ce;switch(se){case 16777216:case 33554432:ce=v.ansi[H],L.push(`xterm-bg-${H}`);break;case 50331648:ce=dt.toColor(H>>16,H>>8&255,H&255),this._addStyle(S,`background-color:#${vy((H>>>0).toString(16),"0",6)}`);break;case 0:default:B?(ce=v.foreground,L.push("xterm-bg-257")):ce=v.background}switch(z||N.isDim()&&(z=He.multiplyOpacity(ce,.5)),ae){case 16777216:case 33554432:N.isBold()&&te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(te+=8),this._applyMinimumContrast(S,ce,v.ansi[te],N,z,void 0)||L.push(`xterm-fg-${te}`);break;case 50331648:let re=dt.toColor(te>>16&255,te>>8&255,te&255);this._applyMinimumContrast(S,ce,re,N,z,Y)||this._addStyle(S,`color:#${vy(te.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(S,ce,v.foreground,N,z,Y)||B&&L.push("xterm-fg-257")}L.length&&(S.className=L.join(" "),L.length=0),!D&&!P&&!j&&E?y++:S.textContent=g,k!==this.defaultSpacing&&(S.style.letterSpacing=`${k}px`),h.push(S),A=F}return S&&y&&(S.textContent=g),h}_applyMinimumContrast(e,t,r,n,i,s){if(this._optionsService.rawOptions.minimumContrastRatio===1||FL(n.getCode()))return!1;let o=this._getContrastCache(n),a;if(!i&&!s&&(a=o.getColor(t.rgba,r.rgba)),a===void 0){let l=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);a=He.ensureContrastRatio(i||t,s||r,l),o.setColor((i||t).rgba,(s||r).rgba,a??null)}return a?(this._addStyle(e,`color:${a.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let r=this._selectionStart,n=this._selectionEnd;return!r||!n?!1:this._columnSelectMode?r[0]<=n[0]?e>=r[0]&&t>=r[1]&&e<n[0]&&t<=n[1]:e<r[0]&&t>=r[1]&&e>=n[0]&&t<=n[1]:t>r[1]&&t<n[1]||r[1]===n[1]&&t===r[1]&&e>=r[0]&&e<n[0]||r[1]<n[1]&&t===n[1]&&e<n[0]||r[1]<n[1]&&t===r[1]&&e>=r[0]}};qf=it([ie(1,SC),ie(2,nr),ie(3,Dn),ie(4,rs),ie(5,il),ie(6,mo)],qf);function vy(e,t,r){for(;e.length<r;)e=t+e;return e}var WL=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let r=e.createElement("span");r.classList.add("xterm-char-measure-element");let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";let i=e.createElement("span");i.classList.add("xterm-char-measure-element"),i.style.fontStyle="italic";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold",s.style.fontStyle="italic",this._measureElements=[r,n,i,s],this._container.appendChild(r),this._container.appendChild(n),this._container.appendChild(i),this._container.appendChild(s),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,r,n){e===this._font&&t===this._fontSize&&r===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=t,this._weight=r,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${r}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${r}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,t,r){let n=0;if(!t&&!r&&e.length===1&&(n=e.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];let o=this._measure(e,0);return o>0&&(this._flat[n]=o),o}let i=e;t&&(i+="B"),r&&(i+="I");let s=this._holey.get(i);if(s===void 0){let o=0;t&&(o|=1),r&&(o|=2),s=this._measure(e,o),s>0&&this._holey.set(i,s)}return s}_measure(e,t){let r=this._measureElements[t];return r.textContent=e.repeat(32),r.offsetWidth/32}},UL=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,r,n=!1){if(this.selectionStart=t,this.selectionEnd=r,!t||!r||t[0]===r[0]&&t[1]===r[1]){this.clear();return}let i=e.buffers.active.ydisp,s=t[1]-i,o=r[1]-i,a=Math.max(s,0),l=Math.min(o,e.rows-1);if(a>=e.rows||l<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=s,this.viewportEndRow=o,this.viewportCappedStartRow=a,this.viewportCappedEndRow=l,this.startCol=t[0],this.endCol=r[0]}isCellSelected(e,t,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&r>=this.viewportCappedStartRow&&t<this.endCol&&r<=this.viewportCappedEndRow:t<this.startCol&&r>=this.viewportCappedStartRow&&t>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol):!1}};function KL(){return new UL}var eh="xterm-dom-renderer-owner-",Tr="xterm-rows",Zl="xterm-fg-",_y="xterm-bg-",$o="xterm-focus",ec="xterm-selection",VL=1,Yf=class extends ke{constructor(e,t,r,n,i,s,o,a,l,c,d,h,f,v){super(),this._terminal=e,this._document=t,this._element=r,this._screenElement=n,this._viewportElement=i,this._helperContainer=s,this._linkifier2=o,this._charSizeService=l,this._optionsService=c,this._bufferService=d,this._coreService=h,this._coreBrowserService=f,this._themeService=v,this._terminalClass=VL++,this._rowElements=[],this._selectionRenderModel=KL(),this.onRequestRedraw=this._register(new Q).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Tr),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(ec),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=HL(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(m=>this._injectCss(m))),this._injectCss(this._themeService.colors),this._rowFactory=a.createInstance(qf,document),this._element.classList.add(eh+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(m=>this._handleLinkHover(m))),this._register(this._linkifier2.onHideLinkUnderline(m=>this._handleLinkLeave(m))),this._register(Xe(()=>{this._element.classList.remove(eh+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new WL(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let r of this._rowElements)r.style.width=`${this.dimensions.css.canvas.width}px`,r.style.height=`${this.dimensions.css.cell.height}px`,r.style.lineHeight=`${this.dimensions.css.cell.height}px`,r.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Tr} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Tr} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Tr} .xterm-dim { color: ${He.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let r=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${r} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${n} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Tr}.${$o} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Tr}.${$o} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Tr}.${$o} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Tr} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Tr} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Tr} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Tr} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Tr} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${ec} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${ec} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${ec} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[s,o]of e.ansi.entries())t+=`${this._terminalSelector} .${Zl}${s} { color: ${o.css}; }${this._terminalSelector} .${Zl}${s}.xterm-dim { color: ${He.multiplyOpacity(o,.5).css}; }${this._terminalSelector} .${_y}${s} { background-color: ${o.css}; }`;t+=`${this._terminalSelector} .${Zl}257 { color: ${He.opaque(e.background).css}; }${this._terminalSelector} .${Zl}257.xterm-dim { color: ${He.multiplyOpacity(He.opaque(e.background),.5).css}; }${this._terminalSelector} .${_y}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let r=this._rowElements.length;r<=t;r++){let n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove($o),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add($o),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,r){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,r),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,r),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,s=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,a=this._document.createDocumentFragment();if(r){let l=e[0]>t[0];a.appendChild(this._createSelectionElement(s,l?t[0]:e[0],l?e[0]:t[0],o-s+1))}else{let l=n===s?e[0]:0,c=s===i?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(s,l,c));let d=o-s-1;if(a.appendChild(this._createSelectionElement(s+1,0,this._bufferService.cols,d)),s!==o){let h=i===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,h))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,r,n=1){let i=this._document.createElement("div"),s=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(r-t);return s+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-s),i.style.height=`${n*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${s}px`,i.style.width=`${o}px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let r=this._bufferService.buffer,n=r.ybase+r.y,i=Math.min(r.x,this._bufferService.cols-1),s=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,a=this._optionsService.rawOptions.cursorInactiveStyle;for(let l=e;l<=t;l++){let c=l+r.ydisp,d=this._rowElements[l],h=r.lines.get(c);if(!d||!h)break;d.replaceChildren(...this._rowFactory.createRow(h,c,c===n,o,a,i,s,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${eh}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,r,n,i,s){r<0&&(e=0),n<0&&(t=0);let o=this._bufferService.rows-1;r=Math.max(Math.min(r,o),0),n=Math.max(Math.min(n,o),0),i=Math.min(i,this._bufferService.cols);let a=this._bufferService.buffer,l=a.ybase+a.y,c=Math.min(a.x,i-1),d=this._optionsService.rawOptions.cursorBlink,h=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let v=r;v<=n;++v){let m=v+a.ydisp,S=this._rowElements[v],y=a.lines.get(m);if(!S||!y)break;S.replaceChildren(...this._rowFactory.createRow(y,m,m===l,h,f,c,d,this.dimensions.css.cell.width,this._widthCache,s?v===r?e:0:-1,s?(v===n?t:i)-1:-1))}}};Yf=it([ie(7,Wp),ie(8,zu),ie(9,nr),ie(10,rr),ie(11,rs),ie(12,Dn),ie(13,mo)],Yf);var Gf=class extends ke{constructor(e,t,r){super(),this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Q),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new YL(this._optionsService))}catch{this._measureStrategy=this._register(new qL(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Gf=it([ie(2,nr)],Gf);var jC=class extends ke{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},qL=class extends jC{constructor(e,t,r){super(),this._document=e,this._parentElement=t,this._optionsService=r,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},YL=class extends jC{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},GL=class extends ke{constructor(e,t,r){super(),this._textarea=e,this._window=t,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new XL(this._window)),this._onDprChange=this._register(new Q),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Q),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register(Bt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(pe(this._textarea,"focus",()=>this._isFocused=!0)),this._register(pe(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},XL=class extends ke{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new io),this._onDprChange=this._register(new Q),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Xe(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=pe(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},JL=class extends ke{constructor(){super(),this.linkProviders=[],this._register(Xe(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Jp(e,t,r){let n=r.getBoundingClientRect(),i=e.getComputedStyle(r),s=parseInt(i.getPropertyValue("padding-left")),o=parseInt(i.getPropertyValue("padding-top"));return[t.clientX-n.left-s,t.clientY-n.top-o]}function QL(e,t,r,n,i,s,o,a,l){if(!s)return;let c=Jp(e,t,r);if(c)return c[0]=Math.ceil((c[0]+(l?o/2:0))/o),c[1]=Math.ceil(c[1]/a),c[0]=Math.min(Math.max(c[0],1),n+(l?1:0)),c[1]=Math.min(Math.max(c[1],1),i),c}var Xf=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,r,n,i){return QL(window,e,t,r,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let r=Jp(window,e,t);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};Xf=it([ie(0,Bn),ie(1,zu)],Xf);var ZL=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},zC={};cP(zC,{getSafariVersion:()=>tA,isChromeOS:()=>UC,isFirefox:()=>FC,isIpad:()=>rA,isIphone:()=>nA,isLegacyEdge:()=>eA,isLinux:()=>Qp,isMac:()=>du,isNode:()=>Fu,isSafari:()=>HC,isWindows:()=>WC});var Fu=typeof process<"u"&&"title"in process,sl=Fu?"node":navigator.userAgent,ol=Fu?"node":navigator.platform,FC=sl.includes("Firefox"),eA=sl.includes("Edge"),HC=/^((?!chrome|android).)*safari/i.test(sl);function tA(){if(!HC)return 0;let e=sl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var du=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(ol),rA=ol==="iPad",nA=ol==="iPhone",WC=["Windows","Win16","Win32","WinCE"].includes(ol),Qp=ol.indexOf("Linux")>=0,UC=/\bCrOS\b/.test(sl),KC=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,r=0,n=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),r=Math.max(t,r),i=e.timeRemaining(),r*1.5>i){n-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=i}this.clear()}},iA=class extends KC{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},sA=class extends KC{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},hu=!Fu&&"requestIdleCallback"in window?sA:iA,oA=class{constructor(){this._queue=new hu}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Jf=class extends ke{constructor(e,t,r,n,i,s,o,a,l){super(),this._rowCount=e,this._optionsService=r,this._charSizeService=n,this._coreService=i,this._coreBrowserService=a,this._renderer=this._register(new io),this._pausedResizeTask=new oA,this._observerDisposable=this._register(new io),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new Q),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Q),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Q),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Q),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new ZL((c,d)=>this._renderRows(c,d),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new aA(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Xe(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>{var c;return(c=this._renderer.value)==null?void 0:c.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(s.onDecorationRegistered(()=>this._fullRefresh())),this._register(s.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(l.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(c=>this._registerIntersectionObserver(c,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let r=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});r.observe(t),this._observerDisposable.value=Xe(()=>r.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),t=Math.max(t,n.end)),r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var r;return(r=this._renderer.value)==null?void 0:r.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,r){var n;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,(n=this._renderer.value)==null||n.handleSelectionChanged(e,t,r)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Jf=it([ie(2,nr),ie(3,zu),ie(4,rs),ie(5,il),ie(6,rr),ie(7,Dn),ie(8,mo)],Jf);var aA=class{constructor(e,t,r){this._coreBrowserService=e,this._coreService=t,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function lA(e,t,r,n){let i=r.buffer.x,s=r.buffer.y;if(!r.buffer.hasScrollback)return dA(i,s,e,t,r,n)+Hu(s,t,r,n)+hA(i,s,e,t,r,n);let o;if(s===t)return o=i>e?"D":"C",Ua(Math.abs(i-e),Wa(o,n));o=s>t?"D":"C";let a=Math.abs(s-t),l=uA(s>t?e:i,r)+(a-1)*r.cols+1+cA(s>t?i:e);return Ua(l,Wa(o,n))}function cA(e,t){return e-1}function uA(e,t){return t.cols-e}function dA(e,t,r,n,i,s){return Hu(t,n,i,s).length===0?"":Ua(qC(e,t,e,t-Xi(t,i),!1,i).length,Wa("D",s))}function Hu(e,t,r,n){let i=e-Xi(e,r),s=t-Xi(t,r),o=Math.abs(i-s)-fA(e,t,r);return Ua(o,Wa(VC(e,t),n))}function hA(e,t,r,n,i,s){let o;Hu(t,n,i,s).length>0?o=n-Xi(n,i):o=t;let a=n,l=mA(e,t,r,n,i,s);return Ua(qC(e,o,r,a,l==="C",i).length,Wa(l,s))}function fA(e,t,r){var o;let n=0,i=e-Xi(e,r),s=t-Xi(t,r);for(let a=0;a<Math.abs(i-s);a++){let l=VC(e,t)==="A"?-1:1;(o=r.buffer.lines.get(i+l*a))!=null&&o.isWrapped&&n++}return n}function Xi(e,t){let r=0,n=t.buffer.lines.get(e),i=n==null?void 0:n.isWrapped;for(;i&&e>=0&&e<t.rows;)r++,n=t.buffer.lines.get(--e),i=n==null?void 0:n.isWrapped;return r}function mA(e,t,r,n,i,s){let o;return Hu(r,n,i,s).length>0?o=n-Xi(n,i):o=t,e<r&&o<=n||e>=r&&o<n?"C":"D"}function VC(e,t){return e>t?"A":"B"}function qC(e,t,r,n,i,s){let o=e,a=t,l="";for(;(o!==r||a!==n)&&a>=0&&a<s.buffer.lines.length;)o+=i?1:-1,i&&o>s.cols-1?(l+=s.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!i&&o<0&&(l+=s.buffer.translateBufferLineToString(a,!1,0,e+1),o=s.cols-1,e=o,a--);return l+s.buffer.translateBufferLineToString(a,!1,e,o)}function Wa(e,t){let r=t?"O":"[";return K.ESC+r+e}function Ua(e,t){e=Math.floor(e);let r="";for(let n=0;n<e;n++)r+=t;return r}var pA=class{constructor(t){this._bufferService=t,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?t%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let t=this.selectionStart,r=this.selectionEnd;return!t||!r?!1:t[1]>r[1]||t[1]===r[1]&&t[0]>r[0]}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function yy(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var th=50,gA=15,vA=50,_A=500,yA=" ",SA=new RegExp(yA,"g"),Qf=class extends ke{constructor(e,t,r,n,i,s,o,a,l){super(),this._element=e,this._screenElement=t,this._linkifier=r,this._bufferService=n,this._coreService=i,this._mouseService=s,this._optionsService=o,this._renderService=a,this._coreBrowserService=l,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Br,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Q),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Q),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Q),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Q),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=c=>this._handleMouseMove(c),this._mouseUpListener=c=>this._handleMouseUp(c),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(c=>this._handleTrim(c)),this._register(this._bufferService.buffers.onBufferActivate(c=>this._handleBufferActivate(c))),this.enable(),this._model=new pA(this._bufferService),this._activeSelectionMode=0,this._register(Xe(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(c=>{c.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let r=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let i=e[0]<t[0]?e[0]:t[0],s=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let a=r.translateBufferLineToString(o,!0,i,s);n.push(a)}}else{let i=e[1]===t[1]?t[0]:void 0;n.push(r.translateBufferLineToString(e[1],!0,e[0],i));for(let s=e[1]+1;s<=t[1]-1;s++){let o=r.lines.get(s),a=r.translateBufferLineToString(s,!0);o!=null&&o.isWrapped?n[n.length-1]+=a:n.push(a)}if(e[1]!==t[1]){let s=r.lines.get(t[1]),o=r.translateBufferLineToString(t[1],!0,0,t[0]);s&&s.isWrapped?n[n.length-1]+=o:n.push(o)}}return n.map(i=>i.replace(SA," ")).join(WC?`\r
|
|
136
|
-
`:`
|
|
137
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Qp&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n||!t?!1:this._areCoordsInSelection(t,r,n)}isCellInSelection(e,t){let r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n?!1:this._areCoordsInSelection([e,t],r,n)}_areCoordsInSelection(e,t,r){return e[1]>t[1]&&e[1]<r[1]||t[1]===r[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<r[0]||t[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||t[1]<r[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var i,s;let r=(s=(i=this._linkifier.currentLink)==null?void 0:i.link)==null?void 0:s.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=yy(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Jp(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-th),th),t/=th,t/Math.abs(t)+Math.round(t*(gA-1)))}shouldForceSelection(e){return du?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),vA)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(du&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){let n=r.lines.get(this._model.selectionEnd[1]);n&&n.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<_A&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let r=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(r&&r[0]!==void 0&&r[1]!==void 0){let n=lA(r[0]-1,r[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(n,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,r=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!r){this._oldHasSelection&&this._fireOnSelectionChange(e,t,r);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,r)}_fireOnSelectionChange(e,t,r){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=r,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let r=t;for(let n=0;t>=n;n++){let i=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?r--:i>1&&t!==n&&(r+=i-1)}return r}setSelection(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,r=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,s=i.lines.get(e[1]);if(!s)return;let o=i.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(s,e[0]),l=a,c=e[0]-a,d=0,h=0,f=0,v=0;if(o.charAt(a)===" "){for(;a>0&&o.charAt(a-1)===" ";)a--;for(;l<o.length&&o.charAt(l+1)===" ";)l++}else{let y=e[0],g=e[0];s.getWidth(y)===0&&(d++,y--),s.getWidth(g)===2&&(h++,g++);let _=s.getString(g).length;for(_>1&&(v+=_-1,l+=_-1);y>0&&a>0&&!this._isCharWordSeparator(s.loadCell(y-1,this._workCell));){s.loadCell(y-1,this._workCell);let w=this._workCell.getChars().length;this._workCell.getWidth()===0?(d++,y--):w>1&&(f+=w-1,a-=w-1),a--,y--}for(;g<s.length&&l+1<o.length&&!this._isCharWordSeparator(s.loadCell(g+1,this._workCell));){s.loadCell(g+1,this._workCell);let w=this._workCell.getChars().length;this._workCell.getWidth()===2?(h++,g++):w>1&&(v+=w-1,l+=w-1),l++,g++}}l++;let m=a+c-d+f,S=Math.min(this._bufferService.cols,l-a+d+h-f-v);if(!(!t&&o.slice(a,l).trim()==="")){if(r&&m===0&&s.getCodePoint(0)!==32){let y=i.lines.get(e[1]-1);if(y&&s.isWrapped&&y.getCodePoint(this._bufferService.cols-1)!==32){let g=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(g){let _=this._bufferService.cols-g.start;m-=_,S+=_}}}if(n&&m+S===this._bufferService.cols&&s.getCodePoint(this._bufferService.cols-1)!==32){let y=i.lines.get(e[1]+1);if(y!=null&&y.isWrapped&&y.getCodePoint(0)!==32){let g=this._getWordAt([0,e[1]+1],!1,!1,!0);g&&(S+=g.length)}}return{start:m,length:S}}}_selectWordAt(e,t){let r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let r=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=yy(r,this._bufferService.cols)}};Qf=it([ie(3,rr),ie(4,rs),ie(5,Up),ie(6,nr),ie(7,Bn),ie(8,Dn)],Qf);var Sy=class{constructor(){this._data={}}set(e,t,r){this._data[e]||(this._data[e]={}),this._data[e][t]=r}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},wy=class{constructor(){this._color=new Sy,this._css=new Sy}setCss(e,t,r){this._css.set(e,t,r)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,r){this._color.set(e,t,r)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},pt=Object.freeze((()=>{let e=[Qe.toColor("#2e3436"),Qe.toColor("#cc0000"),Qe.toColor("#4e9a06"),Qe.toColor("#c4a000"),Qe.toColor("#3465a4"),Qe.toColor("#75507b"),Qe.toColor("#06989a"),Qe.toColor("#d3d7cf"),Qe.toColor("#555753"),Qe.toColor("#ef2929"),Qe.toColor("#8ae234"),Qe.toColor("#fce94f"),Qe.toColor("#729fcf"),Qe.toColor("#ad7fa8"),Qe.toColor("#34e2e2"),Qe.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let n=t[r/36%6|0],i=t[r/6%6|0],s=t[r%6];e.push({css:dt.toCss(n,i,s),rgba:dt.toRgba(n,i,s)})}for(let r=0;r<24;r++){let n=8+r*10;e.push({css:dt.toCss(n,n,n),rgba:dt.toRgba(n,n,n)})}return e})()),Ii=Qe.toColor("#ffffff"),Qo=Qe.toColor("#000000"),by=Qe.toColor("#ffffff"),Cy=Qo,jo={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},wA=Ii,Zf=class extends ke{constructor(e){super(),this._optionsService=e,this._contrastCache=new wy,this._halfContrastCache=new wy,this._onChangeColors=this._register(new Q),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Ii,background:Qo,cursor:by,cursorAccent:Cy,selectionForeground:void 0,selectionBackgroundTransparent:jo,selectionBackgroundOpaque:He.blend(Qo,jo),selectionInactiveBackgroundTransparent:jo,selectionInactiveBackgroundOpaque:He.blend(Qo,jo),scrollbarSliderBackground:He.opacity(Ii,.2),scrollbarSliderHoverBackground:He.opacity(Ii,.4),scrollbarSliderActiveBackground:He.opacity(Ii,.5),overviewRulerBorder:Ii,ansi:pt.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=De(e.foreground,Ii),t.background=De(e.background,Qo),t.cursor=He.blend(t.background,De(e.cursor,by)),t.cursorAccent=He.blend(t.background,De(e.cursorAccent,Cy)),t.selectionBackgroundTransparent=De(e.selectionBackground,jo),t.selectionBackgroundOpaque=He.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=De(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=He.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?De(e.selectionForeground,gy):void 0,t.selectionForeground===gy&&(t.selectionForeground=void 0),He.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=He.opacity(t.selectionBackgroundTransparent,.3)),He.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=He.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=De(e.scrollbarSliderBackground,He.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=De(e.scrollbarSliderHoverBackground,He.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=De(e.scrollbarSliderActiveBackground,He.opacity(t.foreground,.5)),t.overviewRulerBorder=De(e.overviewRulerBorder,wA),t.ansi=pt.slice(),t.ansi[0]=De(e.black,pt[0]),t.ansi[1]=De(e.red,pt[1]),t.ansi[2]=De(e.green,pt[2]),t.ansi[3]=De(e.yellow,pt[3]),t.ansi[4]=De(e.blue,pt[4]),t.ansi[5]=De(e.magenta,pt[5]),t.ansi[6]=De(e.cyan,pt[6]),t.ansi[7]=De(e.white,pt[7]),t.ansi[8]=De(e.brightBlack,pt[8]),t.ansi[9]=De(e.brightRed,pt[9]),t.ansi[10]=De(e.brightGreen,pt[10]),t.ansi[11]=De(e.brightYellow,pt[11]),t.ansi[12]=De(e.brightBlue,pt[12]),t.ansi[13]=De(e.brightMagenta,pt[13]),t.ansi[14]=De(e.brightCyan,pt[14]),t.ansi[15]=De(e.brightWhite,pt[15]),e.extendedAnsi){let r=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<r;n++)t.ansi[n+16]=De(e.extendedAnsi[n],pt[n+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};Zf=it([ie(0,nr)],Zf);function De(e,t){if(e!==void 0)try{return Qe.toColor(e)}catch{}return t}var bA=class{constructor(...e){this._entries=new Map;for(let[t,r]of e)this.set(t,r)}set(e,t){let r=this._entries.get(e);return this._entries.set(e,t),r}forEach(e){for(let[t,r]of this._entries.entries())e(t,r)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},CA=class{constructor(){this._services=new bA,this._services.set(Wp,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let r=gP(e).sort((s,o)=>s.index-o.index),n=[];for(let s of r){let o=this._services.get(s.id);if(!o)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${s.id._id}.`);n.push(o)}let i=r.length>0?r[0].index:t.length;if(t.length!==i)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...n)}},xA={trace:0,debug:1,info:2,warn:3,error:4,off:5},kA="xterm.js: ",em=class extends ke{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=xA[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":kA)+t,...r)}trace(e,...t){var r;this._logLevel<=0&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var r;this._logLevel<=1&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var r;this._logLevel<=2&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var r;this._logLevel<=3&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var r;this._logLevel<=4&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.error.bind(this._optionsService.options.logger))??console.error,e,t)}};em=it([ie(0,nr)],em);var xy=class extends ke{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new Q),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new Q),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new Q),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let r=0;r<Math.min(e,this.length);r++)t[r]=this._array[this._getCyclicIndex(r)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...r){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+r.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<r.length;n++)this._array[this._getCyclicIndex(e+n)]=r[n];if(r.length&&this.onInsertEmitter.fire({index:e,amount:r.length}),this._length+r.length>this._maxLength){let n=this._length+r.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let i=t-1;i>=0;i--)this.set(e+i+r,this.get(e+i));let n=e+t+r-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<t;n++)this.set(e+n+r,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ce=3,ut=Object.freeze(new nl),tc=0,rh=2,Zo=class YC{constructor(t,r,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ce);let i=r||Br.fromCharData([0,fC,1,0]);for(let s=0;s<t;++s)this.setCell(s,i);this.length=t}get(t){let r=this._data[t*Ce+0],n=r&2097151;return[this._data[t*Ce+1],r&2097152?this._combined[t]:n?Kn(n):"",r>>22,r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n]}set(t,r){this._data[t*Ce+1]=r[0],r[1].length>1?(this._combined[t]=r[1],this._data[t*Ce+0]=t|2097152|r[2]<<22):this._data[t*Ce+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(t){return this._data[t*Ce+0]>>22}hasWidth(t){return this._data[t*Ce+0]&12582912}getFg(t){return this._data[t*Ce+1]}getBg(t){return this._data[t*Ce+2]}hasContent(t){return this._data[t*Ce+0]&4194303}getCodePoint(t){let r=this._data[t*Ce+0];return r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r&2097151}isCombined(t){return this._data[t*Ce+0]&2097152}getString(t){let r=this._data[t*Ce+0];return r&2097152?this._combined[t]:r&2097151?Kn(r&2097151):""}isProtected(t){return this._data[t*Ce+2]&536870912}loadCell(t,r){return tc=t*Ce,r.content=this._data[tc+0],r.fg=this._data[tc+1],r.bg=this._data[tc+2],r.content&2097152&&(r.combinedData=this._combined[t]),r.bg&268435456&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){r.content&2097152&&(this._combined[t]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Ce+0]=r.content,this._data[t*Ce+1]=r.fg,this._data[t*Ce+2]=r.bg}setCellFromCodepoint(t,r,n,i){i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*Ce+0]=r|n<<22,this._data[t*Ce+1]=i.fg,this._data[t*Ce+2]=i.bg}addCodepointToCell(t,r,n){let i=this._data[t*Ce+0];i&2097152?this._combined[t]+=Kn(r):i&2097151?(this._combined[t]=Kn(i&2097151)+Kn(r),i&=-2097152,i|=2097152):i=r|1<<22,n&&(i&=-12582913,i|=n<<22),this._data[t*Ce+0]=i}insertCells(t,r,n){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length-t){let i=new Br;for(let s=this.length-t-r-1;s>=0;--s)this.setCell(t+r+s,this.loadCell(t+s,i));for(let s=0;s<r;++s)this.setCell(t+s,n)}else for(let i=t;i<this.length;++i)this.setCell(i,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(t,r,n){if(t%=this.length,r<this.length-t){let i=new Br;for(let s=0;s<this.length-t-r;++s)this.setCell(t+s,this.loadCell(t+r+s,i));for(let s=this.length-r;s<this.length;++s)this.setCell(s,n)}else for(let i=t;i<this.length;++i)this.setCell(i,n);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,n)}replaceCells(t,r,n,i=!1){if(i){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.isProtected(t)||this.setCell(t,n),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.setCell(t++,n)}resize(t,r){if(t===this.length)return this._data.length*4*rh<this._data.buffer.byteLength;let n=t*Ce;if(t>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let i=new Uint32Array(n);i.set(this._data),this._data=i}for(let i=this.length;i<t;++i)this.setCell(i,r)}else{this._data=this._data.subarray(0,n);let i=Object.keys(this._combined);for(let o=0;o<i.length;o++){let a=parseInt(i[o],10);a>=t&&delete this._combined[a]}let s=Object.keys(this._extendedAttrs);for(let o=0;o<s.length;o++){let a=parseInt(s[o],10);a>=t&&delete this._extendedAttrs[a]}}return this.length=t,n*4*rh<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*rh<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,r=!1){if(r){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,t);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let r in t._combined)this._combined[r]=t._combined[r];this._extendedAttrs={};for(let r in t._extendedAttrs)this._extendedAttrs[r]=t._extendedAttrs[r];this.isWrapped=t.isWrapped}clone(){let t=new YC(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let r in this._combined)t._combined[r]=this._combined[r];for(let r in this._extendedAttrs)t._extendedAttrs[r]=this._extendedAttrs[r];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ce+0]&4194303)return t+(this._data[t*Ce+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ce+0]&4194303||this._data[t*Ce+2]&50331648)return t+(this._data[t*Ce+0]>>22);return 0}copyCellsFrom(t,r,n,i,s){let o=t._data;if(s)for(let l=i-1;l>=0;l--){for(let c=0;c<Ce;c++)this._data[(n+l)*Ce+c]=o[(r+l)*Ce+c];o[(r+l)*Ce+2]&268435456&&(this._extendedAttrs[n+l]=t._extendedAttrs[r+l])}else for(let l=0;l<i;l++){for(let c=0;c<Ce;c++)this._data[(n+l)*Ce+c]=o[(r+l)*Ce+c];o[(r+l)*Ce+2]&268435456&&(this._extendedAttrs[n+l]=t._extendedAttrs[r+l])}let a=Object.keys(t._combined);for(let l=0;l<a.length;l++){let c=parseInt(a[l],10);c>=r&&(this._combined[c-r+n]=t._combined[c])}}translateToString(t,r,n,i){r=r??0,n=n??this.length,t&&(n=Math.min(n,this.getTrimmedLength())),i&&(i.length=0);let s="";for(;r<n;){let o=this._data[r*Ce+0],a=o&2097151,l=o&2097152?this._combined[r]:a?Kn(a):Qn;if(s+=l,i)for(let c=0;c<l.length;++c)i.push(r);r+=o>>22||1}return i&&i.push(r),s}};function TA(e,t,r,n,i,s){let o=[];for(let a=0;a<e.length-1;a++){let l=a,c=e.get(++l);if(!c.isWrapped)continue;let d=[e.get(a)];for(;l<e.length&&c.isWrapped;)d.push(c),c=e.get(++l);if(!s&&n>=a&&n<l){a+=d.length-1;continue}let h=0,f=Ka(d,h,t),v=1,m=0;for(;v<d.length;){let y=Ka(d,v,t),g=y-m,_=r-f,w=Math.min(g,_);d[h].copyCellsFrom(d[v],m,f,w,!1),f+=w,f===r&&(h++,f=0),m+=w,m===y&&(v++,m=0),f===0&&h!==0&&d[h-1].getWidth(r-1)===2&&(d[h].copyCellsFrom(d[h-1],r-1,f++,1,!1),d[h-1].setCell(r-1,i))}d[h].replaceCells(f,r,i);let S=0;for(let y=d.length-1;y>0&&(y>h||d[y].getTrimmedLength()===0);y--)S++;S>0&&(o.push(a+d.length-S),o.push(S)),a+=d.length-1}return o}function EA(e,t){let r=[],n=0,i=t[n],s=0;for(let o=0;o<e.length;o++)if(i===o){let a=t[++n];e.onDeleteEmitter.fire({index:o-s,amount:a}),o+=a-1,s+=a,i=t[++n]}else r.push(o);return{layout:r,countRemoved:s}}function IA(e,t){let r=[];for(let n=0;n<t.length;n++)r.push(e.get(t[n]));for(let n=0;n<r.length;n++)e.set(n,r[n]);e.length=t.length}function RA(e,t,r){let n=[],i=e.map((l,c)=>Ka(e,c,t)).reduce((l,c)=>l+c),s=0,o=0,a=0;for(;a<i;){if(i-a<r){n.push(i-a);break}s+=r;let l=Ka(e,o,t);s>l&&(s-=l,o++);let c=e[o].getWidth(s-1)===2;c&&s--;let d=c?r-1:r;n.push(d),a+=d}return n}function Ka(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();let n=!e[t].hasContent(r-1)&&e[t].getWidth(r-1)===1,i=e[t+1].getWidth(0)===2;return n&&i?r-1:r}var GC=class XC{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=XC._nextId++,this._onDispose=this.register(new Q),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Gi(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};GC._nextId=1;var MA=GC,St={},Ri=St.B;St[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};St.A={"#":"£"};St.B=void 0;St[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};St.C=St[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};St.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};St.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};St.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};St.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};St.E=St[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};St.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};St.H=St[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};St["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var ky=4294967295,Ty=class{constructor(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=ut.clone(),this.savedCharset=Ri,this.markers=[],this._nullCell=Br.fromCharData([0,fC,1,0]),this._whitespaceCell=Br.fromCharData([0,Qn,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new hu,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new xy(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new lu),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new lu),this._whitespaceCell}getBlankLine(e,t){return new Zo(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>ky?ky:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=ut);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new xy(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let r=this.getNullCell(ut),n=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let o=0;o<this.lines.length;o++)n+=+this.lines.get(o).resize(e,r);let s=0;if(this._rows<t)for(let o=this._rows;o<t;o++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Zo(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new Zo(e,r)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let o=this.lines.length-i;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),s&&(this.y+=s),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let s=0;s<this.lines.length;s++)n+=+this.lines.get(s).resize(e,r);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,n=TA(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(ut),r);if(n.length>0){let i=EA(this.lines,n);IA(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved)}}_reflowLargerAdjustViewport(e,t,r){let n=this.getNullCell(ut),i=r;for(;i-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Zo(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)}_reflowSmaller(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(ut),i=[],s=0;for(let o=this.lines.length-1;o>=0;o--){let a=this.lines.get(o);if(!a||!a.isWrapped&&a.getTrimmedLength()<=e)continue;let l=[a];for(;a.isWrapped&&o>0;)a=this.lines.get(--o),l.unshift(a);if(!r){let w=this.ybase+this.y;if(w>=o&&w<o+l.length)continue}let c=l[l.length-1].getTrimmedLength(),d=RA(l,this._cols,e),h=d.length-l.length,f;this.ybase===0&&this.y!==this.lines.length-1?f=Math.max(0,this.y-this.lines.maxLength+h):f=Math.max(0,this.lines.length-this.lines.maxLength+h);let v=[];for(let w=0;w<h;w++){let b=this.getBlankLine(ut,!0);v.push(b)}v.length>0&&(i.push({start:o+l.length+s,newLines:v}),s+=v.length),l.push(...v);let m=d.length-1,S=d[m];S===0&&(m--,S=d[m]);let y=l.length-h-1,g=c;for(;y>=0;){let w=Math.min(g,S);if(l[m]===void 0)break;if(l[m].copyCellsFrom(l[y],g-w,S-w,w,!0),S-=w,S===0&&(m--,S=d[m]),g-=w,g===0){y--;let b=Math.max(y,0);g=Ka(l,b,this._cols)}}for(let w=0;w<l.length;w++)d[w]<e&&l[w].setCell(d[w],n);let _=h-f;for(;_-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+s)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+h,this.ybase+t-1)}if(i.length>0){let o=[],a=[];for(let S=0;S<this.lines.length;S++)a.push(this.lines.get(S));let l=this.lines.length,c=l-1,d=0,h=i[d];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);let f=0;for(let S=Math.min(this.lines.maxLength-1,l+s-1);S>=0;S--)if(h&&h.start>c+f){for(let y=h.newLines.length-1;y>=0;y--)this.lines.set(S--,h.newLines[y]);S++,o.push({index:c+1,amount:h.newLines.length}),f+=h.newLines.length,h=i[++d]}else this.lines.set(S,a[c--]);let v=0;for(let S=o.length-1;S>=0;S--)o[S].index+=v,this.lines.onInsertEmitter.fire(o[S]),v+=o[S].amount;let m=Math.max(0,l+s-this.lines.maxLength);m>0&&this.lines.onTrimEmitter.fire(m)}}translateBufferLineToString(e,t,r=0,n){let i=this.lines.get(e);return i?i.translateToString(t,r,n):""}getWrappedRangeForLine(e){let t=e,r=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:t,last:r}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new MA(e);return this.markers.push(t),t.register(this.lines.onTrim(r=>{t.line-=r,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(r=>{t.line>=r.index&&(t.line+=r.amount)})),t.register(this.lines.onDelete(r=>{t.line>=r.index&&t.line<r.index+r.amount&&t.dispose(),t.line>r.index&&(t.line-=r.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},PA=class extends ke{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new Q),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new Ty(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Ty(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},JC=2,QC=1,tm=class extends ke{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new Q),this.onResize=this._onResize.event,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,JC),this.rows=Math.max(e.rawOptions.rows||0,QC),this.buffers=this._register(new PA(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let r=this.cols!==e,n=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:r,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let r=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=r.getBlankLine(e,t),this._cachedBlankLine=n),n.isWrapped=t;let i=r.ybase+r.scrollTop,s=r.ybase+r.scrollBottom;if(r.scrollTop===0){let o=r.lines.isFull;s===r.lines.length-1?o?r.lines.recycle().copyFrom(n):r.lines.push(n.clone()):r.lines.splice(s+1,0,n.clone()),o?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let o=s-i+1;r.lines.shiftElements(i+1,o-1,-1),r.lines.set(s,n.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,t){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let n=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),n!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};tm=it([ie(0,nr)],tm);var ws={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:du,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},LA=["normal","bold","100","200","300","400","500","600","700","800","900"],AA=class extends ke{constructor(e){super(),this._onOptionChange=this._register(new Q),this.onOptionChange=this._onOptionChange.event;let t={...ws};for(let r in e)if(r in t)try{let n=e[r];t[r]=this._sanitizeAndValidateOption(r,n)}catch(n){console.error(n)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(Xe(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(r=>{r===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(r=>{e.indexOf(r)!==-1&&t()})}_setupOptions(){let e=r=>{if(!(r in ws))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},t=(r,n)=>{if(!(r in ws))throw new Error(`No option with key "${r}"`);n=this._sanitizeAndValidateOption(r,n),this.rawOptions[r]!==n&&(this.rawOptions[r]=n,this._onOptionChange.fire(r))};for(let r in this.rawOptions){let n={get:e.bind(this,r),set:t.bind(this,r)};Object.defineProperty(this.options,r,n)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=ws[e]),!NA(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=ws[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=LA.includes(t)?t:ws[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function NA(e){return e==="block"||e==="underline"||e==="bar"}function ea(e,t=5){if(typeof e!="object")return e;let r=Array.isArray(e)?[]:{};for(let n in e)r[n]=t<=1?e[n]:e[n]&&ea(e[n],t-1);return r}var Ey=Object.freeze({insertMode:!1}),Iy=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),rm=class extends ke{constructor(e,t,r){super(),this._bufferService=e,this._logService=t,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new Q),this.onData=this._onData.event,this._onUserInput=this._register(new Q),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Q),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Q),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=ea(Ey),this.decPrivateModes=ea(Iy)}reset(){this.modes=ea(Ey),this.decPrivateModes=ea(Iy)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(n=>n.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};rm=it([ie(0,rr),ie(1,_C),ie(2,nr)],rm);var Ry={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function nh(e,t){let r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(r|=64,r|=e.action):(r|=e.button&3,e.button&4&&(r|=64),e.button&8&&(r|=128),e.action===32?r|=32:e.action===0&&!t&&(r|=3)),r}var ih=String.fromCharCode,My={DEFAULT:e=>{let t=[nh(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${ih(t[0])}${ih(t[1])}${ih(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${nh(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${nh(e,!0)};${e.x};${e.y}${t}`}},nm=class extends ke{constructor(e,t,r){super(),this._bufferService=e,this._coreService=t,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new Q),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(Ry))this.addProtocol(n,Ry[n]);for(let n of Object.keys(My))this.addEncoding(n,My[n]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,r){if(e.deltaY===0||e.shiftKey||t===void 0||r===void 0)return 0;let n=t/r,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=n+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,r){if(r){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};nm=it([ie(0,rr),ie(1,rs),ie(2,nr)],nm);var sh=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],DA=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],gt;function BA(e,t){let r=0,n=t.length-1,i;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=r;)if(i=r+n>>1,e>t[i][1])r=i+1;else if(e<t[i][0])n=i-1;else return!0;return!1}var OA=class{constructor(){if(this.version="6",!gt){gt=new Uint8Array(65536),gt.fill(1),gt[0]=0,gt.fill(0,1,32),gt.fill(0,127,160),gt.fill(2,4352,4448),gt[9001]=2,gt[9002]=2,gt.fill(2,11904,42192),gt[12351]=1,gt.fill(2,44032,55204),gt.fill(2,63744,64256),gt.fill(2,65040,65050),gt.fill(2,65072,65136),gt.fill(2,65280,65377),gt.fill(2,65504,65511);for(let e=0;e<sh.length;++e)gt.fill(0,sh[e][0],sh[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?gt[e]:BA(e,DA)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let r=this.wcwidth(e),n=r===0&&t!==0;if(n){let i=Bi.extractWidth(t);i===0?n=!1:i>r&&(r=i)}return Bi.createPropertyValue(0,r,n)}},Bi=class Ec{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Q,this.onChange=this._onChange.event;let t=new OA;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,n=!1){return(t&16777215)<<3|(r&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,n=0,i=t.length;for(let s=0;s<i;++s){let o=t.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=i)return r+this.wcwidth(o);let c=t.charCodeAt(s);56320<=c&&c<=57343?o=(o-55296)*1024+c-56320+65536:r+=this.wcwidth(c)}let a=this.charProperties(o,n),l=Ec.extractWidth(a);Ec.extractShouldJoin(a)&&(l-=Ec.extractWidth(n)),r+=l,n=a}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},$A=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function Py(e){var n;let t=(n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:n.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&t&&(r.isWrapped=t[3]!==0&&t[3]!==32)}var zo=2147483647,jA=256,ZC=class im{constructor(t=32,r=32){if(this.maxLength=t,this.maxSubParamsLength=r,r>jA)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let r=new im;if(!t.length)return r;for(let n=Array.isArray(t[0])?1:0;n<t.length;++n){let i=t[n];if(Array.isArray(i))for(let s=0;s<i.length;++s)r.addSubParam(i[s]);else r.addParam(i)}return r}clone(){let t=new im(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let r=0;r<this.length;++r){t.push(this.params[r]);let n=this._subParamsIdx[r]>>8,i=this._subParamsIdx[r]&255;i-n>0&&t.push(Array.prototype.slice.call(this._subParams,n,i))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>zo?zo:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>zo?zo:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let r=this._subParamsIdx[t]>>8,n=this._subParamsIdx[t]&255;return n-r>0?this._subParams.subarray(r,n):null}getSubParamsAll(){let t={};for(let r=0;r<this.length;++r){let n=this._subParamsIdx[r]>>8,i=this._subParamsIdx[r]&255;i-n>0&&(t[r]=this._subParams.slice(n,i))}return t}addDigit(t){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,i=n[r-1];n[r-1]=~i?Math.min(i*10+t,zo):t}},Fo=[],zA=class{constructor(){this._state=0,this._active=Fo,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Fo}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Fo,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Fo,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,r){if(!this._active.length)this._handlerFb(this._id,"PUT",ju(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}start(){this.reset(),this._state=1}put(e,t,r){if(this._state!==3){if(this._state===1)for(;t<r;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&r-t>0&&this._put(e,t,r)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let r=!1,n=this._active.length-1,i=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&r===!1){for(;n>=0&&(r=this._active[n].end(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].end(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=Fo,this._id=-1,this._state=0}}},gr=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=ju(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(r=>(this._data="",this._hitLimit=!1,r));return this._data="",this._hitLimit=!1,t}},Ho=[],FA=class{constructor(){this._handlers=Object.create(null),this._active=Ho,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Ho}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Ho,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Ho,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(t)}put(e,t,r){if(!this._active.length)this._handlerFb(this._ident,"PUT",ju(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let r=!1,n=this._active.length-1,i=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&r===!1){for(;n>=0&&(r=this._active[n].unhook(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=Ho,this._ident=0}},ta=new ZC;ta.addParam(0);var Ly=class{constructor(e){this._handler=e,this._data="",this._params=ta,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ta,this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=ju(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(r=>(this._params=ta,this._data="",this._hitLimit=!1,r));return this._params=ta,this._data="",this._hitLimit=!1,t}},HA=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,r,n){this.table[t<<8|e]=r<<4|n}addMany(e,t,r,n){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=r<<4|n}},Ir=160,WA=function(){let e=new HA(4095),t=Array.apply(null,Array(256)).map((a,l)=>l),r=(a,l)=>t.slice(a,l),n=r(32,127),i=r(0,24);i.push(25),i.push.apply(i,r(28,32));let s=r(0,14),o;e.setDefault(1,0),e.addMany(n,0,2,0);for(o in s)e.addMany([24,26,153,154],o,3,0),e.addMany(r(128,144),o,3,0),e.addMany(r(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Ir,0,2,0),e.add(Ir,8,5,8),e.add(Ir,6,0,6),e.add(Ir,11,0,11),e.add(Ir,13,13,13),e}(),UA=class extends ke{constructor(e=WA){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new ZC,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,r,n)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,r)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Xe(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new zA),this._dcsParser=this._register(new FA),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=e.prefix.charCodeAt(0),r&&60>r||r>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let i=0;i<e.intermediates.length;++i){let s=e.intermediates.charCodeAt(i);if(32>s||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=s}}if(e.final.length!==1)throw new Error("final must be a single byte");let n=e.final.charCodeAt(0);if(t[0]>n||n>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return r<<=8,r|=n,r}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let r=this._identifier(e,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);let n=this._escHandlers[r];return n.push(t),{dispose:()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let r=this._identifier(e);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);let n=this._csiHandlers[r];return n.push(t),{dispose:()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,r,n,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=r,this._parseStack.transition=n,this._parseStack.chunkPos=i}parse(e,t,r){let n=0,i=0,s=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,s=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let a=this._parseStack.handlers,l=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&l>-1){for(;l>=0&&(o=a[l](this._params),o!==!0);l--)if(o instanceof Promise)return this._parseStack.handlerPos=l,o}this._parseStack.handlers=[];break;case 4:if(r===!1&&l>-1){for(;l>=0&&(o=a[l](),o!==!0);l--)if(o instanceof Promise)return this._parseStack.handlerPos=l,o}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(n!==24&&n!==26,r),o)return o;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],o=this._oscParser.end(n!==24&&n!==26,r),o)return o;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,s=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let a=s;a<t;++a){switch(n=e[a],i=this._transitions.table[this.currentState<<8|(n<160?n:Ir)],i>>4){case 2:for(let f=a+1;;++f){if(f>=t||(n=e[f])<32||n>126&&n<Ir){this._printHandler(e,a,f),a=f-1;break}if(++f>=t||(n=e[f])<32||n>126&&n<Ir){this._printHandler(e,a,f),a=f-1;break}if(++f>=t||(n=e[f])<32||n>126&&n<Ir){this._printHandler(e,a,f),a=f-1;break}if(++f>=t||(n=e[f])<32||n>126&&n<Ir){this._printHandler(e,a,f),a=f-1;break}}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:a,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let l=this._csiHandlers[this._collect<<8|n],c=l?l.length-1:-1;for(;c>=0&&(o=l[c](this._params),o!==!0);c--)if(o instanceof Promise)return this._preserveStack(3,l,c,i,a),o;c<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++a<t&&(n=e[a])>47&&n<60);a--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let d=this._escHandlers[this._collect<<8|n],h=d?d.length-1:-1;for(;h>=0&&(o=d[h](),o!==!0);h--)if(o instanceof Promise)return this._preserveStack(4,d,h,i,a),o;h<0&&this._escHandlerFb(this._collect<<8|n),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|n,this._params);break;case 13:for(let f=a+1;;++f)if(f>=t||(n=e[f])===24||n===26||n===27||n>127&&n<Ir){this._dcsParser.put(e,a,f),a=f-1;break}break;case 14:if(o=this._dcsParser.unhook(n!==24&&n!==26),o)return this._preserveStack(6,[],0,i,a),o;n===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let f=a+1;;f++)if(f>=t||(n=e[f])<32||n>127&&n<Ir){this._oscParser.put(e,a,f),a=f-1;break}break;case 6:if(o=this._oscParser.end(n!==24&&n!==26),o)return this._preserveStack(5,[],0,i,a),o;n===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=i&15}}},KA=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,VA=/^[\da-f]+$/;function Ay(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let r=KA.exec(t);if(r){let n=r[1]?15:r[4]?255:r[7]?4095:65535;return[Math.round(parseInt(r[1]||r[4]||r[7]||r[10],16)/n*255),Math.round(parseInt(r[2]||r[5]||r[8]||r[11],16)/n*255),Math.round(parseInt(r[3]||r[6]||r[9]||r[12],16)/n*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),VA.exec(t)&&[3,6,9,12].includes(t.length))){let r=t.length/3,n=[0,0,0];for(let i=0;i<3;++i){let s=parseInt(t.slice(r*i,r*i+r),16);n[i]=r===1?s<<4:r===2?s:r===3?s>>4:s>>8}return n}}function oh(e,t){let r=e.toString(16),n=r.length<2?"0"+r:r;switch(t){case 4:return r[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function qA(e,t=16){let[r,n,i]=e;return`rgb:${oh(r,t)}/${oh(n,t)}/${oh(i,t)}`}var YA={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Hn=131072,Ny=10;function Dy(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var By=5e3,Oy=0,GA=class extends ke{constructor(e,t,r,n,i,s,o,a,l=new UA){super(),this._bufferService=e,this._charsetService=t,this._coreService=r,this._logService=n,this._optionsService=i,this._oscLinkService=s,this._coreMouseService=o,this._unicodeService=a,this._parser=l,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new mP,this._utf8Decoder=new pP,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=ut.clone(),this._eraseAttrDataInternal=ut.clone(),this._onRequestBell=this._register(new Q),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Q),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Q),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Q),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Q),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Q),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Q),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Q),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Q),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Q),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Q),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Q),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new sm(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(c=>this._activeBuffer=c.activeBuffer)),this._parser.setCsiHandlerFallback((c,d)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(c),params:d.toArray()})}),this._parser.setEscHandlerFallback(c=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(c)})}),this._parser.setExecuteHandlerFallback(c=>{this._logService.debug("Unknown EXECUTE code: ",{code:c})}),this._parser.setOscHandlerFallback((c,d,h)=>{this._logService.debug("Unknown OSC code: ",{identifier:c,action:d,data:h})}),this._parser.setDcsHandlerFallback((c,d,h)=>{d==="HOOK"&&(h=h.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(c),action:d,payload:h})}),this._parser.setPrintHandler((c,d,h)=>this.print(c,d,h)),this._parser.registerCsiHandler({final:"@"},c=>this.insertChars(c)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},c=>this.scrollLeft(c)),this._parser.registerCsiHandler({final:"A"},c=>this.cursorUp(c)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},c=>this.scrollRight(c)),this._parser.registerCsiHandler({final:"B"},c=>this.cursorDown(c)),this._parser.registerCsiHandler({final:"C"},c=>this.cursorForward(c)),this._parser.registerCsiHandler({final:"D"},c=>this.cursorBackward(c)),this._parser.registerCsiHandler({final:"E"},c=>this.cursorNextLine(c)),this._parser.registerCsiHandler({final:"F"},c=>this.cursorPrecedingLine(c)),this._parser.registerCsiHandler({final:"G"},c=>this.cursorCharAbsolute(c)),this._parser.registerCsiHandler({final:"H"},c=>this.cursorPosition(c)),this._parser.registerCsiHandler({final:"I"},c=>this.cursorForwardTab(c)),this._parser.registerCsiHandler({final:"J"},c=>this.eraseInDisplay(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},c=>this.eraseInDisplay(c,!0)),this._parser.registerCsiHandler({final:"K"},c=>this.eraseInLine(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},c=>this.eraseInLine(c,!0)),this._parser.registerCsiHandler({final:"L"},c=>this.insertLines(c)),this._parser.registerCsiHandler({final:"M"},c=>this.deleteLines(c)),this._parser.registerCsiHandler({final:"P"},c=>this.deleteChars(c)),this._parser.registerCsiHandler({final:"S"},c=>this.scrollUp(c)),this._parser.registerCsiHandler({final:"T"},c=>this.scrollDown(c)),this._parser.registerCsiHandler({final:"X"},c=>this.eraseChars(c)),this._parser.registerCsiHandler({final:"Z"},c=>this.cursorBackwardTab(c)),this._parser.registerCsiHandler({final:"`"},c=>this.charPosAbsolute(c)),this._parser.registerCsiHandler({final:"a"},c=>this.hPositionRelative(c)),this._parser.registerCsiHandler({final:"b"},c=>this.repeatPrecedingCharacter(c)),this._parser.registerCsiHandler({final:"c"},c=>this.sendDeviceAttributesPrimary(c)),this._parser.registerCsiHandler({prefix:">",final:"c"},c=>this.sendDeviceAttributesSecondary(c)),this._parser.registerCsiHandler({final:"d"},c=>this.linePosAbsolute(c)),this._parser.registerCsiHandler({final:"e"},c=>this.vPositionRelative(c)),this._parser.registerCsiHandler({final:"f"},c=>this.hVPosition(c)),this._parser.registerCsiHandler({final:"g"},c=>this.tabClear(c)),this._parser.registerCsiHandler({final:"h"},c=>this.setMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"h"},c=>this.setModePrivate(c)),this._parser.registerCsiHandler({final:"l"},c=>this.resetMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"l"},c=>this.resetModePrivate(c)),this._parser.registerCsiHandler({final:"m"},c=>this.charAttributes(c)),this._parser.registerCsiHandler({final:"n"},c=>this.deviceStatus(c)),this._parser.registerCsiHandler({prefix:"?",final:"n"},c=>this.deviceStatusPrivate(c)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},c=>this.softReset(c)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},c=>this.setCursorStyle(c)),this._parser.registerCsiHandler({final:"r"},c=>this.setScrollRegion(c)),this._parser.registerCsiHandler({final:"s"},c=>this.saveCursor(c)),this._parser.registerCsiHandler({final:"t"},c=>this.windowOptions(c)),this._parser.registerCsiHandler({final:"u"},c=>this.restoreCursor(c)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},c=>this.insertColumns(c)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},c=>this.deleteColumns(c)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},c=>this.selectProtected(c)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},c=>this.requestMode(c,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},c=>this.requestMode(c,!1)),this._parser.setExecuteHandler(K.BEL,()=>this.bell()),this._parser.setExecuteHandler(K.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(K.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(K.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(K.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(K.BS,()=>this.backspace()),this._parser.setExecuteHandler(K.HT,()=>this.tab()),this._parser.setExecuteHandler(K.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(K.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(kc.IND,()=>this.index()),this._parser.setExecuteHandler(kc.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(kc.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new gr(c=>(this.setTitle(c),this.setIconName(c),!0))),this._parser.registerOscHandler(1,new gr(c=>this.setIconName(c))),this._parser.registerOscHandler(2,new gr(c=>this.setTitle(c))),this._parser.registerOscHandler(4,new gr(c=>this.setOrReportIndexedColor(c))),this._parser.registerOscHandler(8,new gr(c=>this.setHyperlink(c))),this._parser.registerOscHandler(10,new gr(c=>this.setOrReportFgColor(c))),this._parser.registerOscHandler(11,new gr(c=>this.setOrReportBgColor(c))),this._parser.registerOscHandler(12,new gr(c=>this.setOrReportCursorColor(c))),this._parser.registerOscHandler(104,new gr(c=>this.restoreIndexedColor(c))),this._parser.registerOscHandler(110,new gr(c=>this.restoreFgColor(c))),this._parser.registerOscHandler(111,new gr(c=>this.restoreBgColor(c))),this._parser.registerOscHandler(112,new gr(c=>this.restoreCursorColor(c))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let c in St)this._parser.registerEscHandler({intermediates:"(",final:c},()=>this.selectCharset("("+c)),this._parser.registerEscHandler({intermediates:")",final:c},()=>this.selectCharset(")"+c)),this._parser.registerEscHandler({intermediates:"*",final:c},()=>this.selectCharset("*"+c)),this._parser.registerEscHandler({intermediates:"+",final:c},()=>this.selectCharset("+"+c)),this._parser.registerEscHandler({intermediates:"-",final:c},()=>this.selectCharset("-"+c)),this._parser.registerEscHandler({intermediates:".",final:c},()=>this.selectCharset("."+c)),this._parser.registerEscHandler({intermediates:"/",final:c},()=>this.selectCharset("/"+c));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(c=>(this._logService.error("Parsing error: ",c),c)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Ly((c,d)=>this.requestStatusString(c,d)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,r,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),By))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${By} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let r,n=this._activeBuffer.x,i=this._activeBuffer.y,s=0,o=this._parseStack.paused;if(o){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;n=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Hn&&(s=this._parseStack.position+Hn)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,c=>String.fromCharCode(c)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(c=>c.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Hn&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Hn))),o||this._dirtyRowTracker.clearRange(),e.length>Hn)for(let c=s;c<e.length;c+=Hn){let d=c+Hn<e.length?c+Hn:e.length,h=typeof e=="string"?this._stringDecoder.decode(e.substring(c,d),this._parseBuffer):this._utf8Decoder.decode(e.subarray(c,d),this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,h))return this._preserveStack(n,i,h,c),this._logSlowResolvingAsync(r),r}else if(!o){let c=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,c))return this._preserveStack(n,i,c,0),this._logSlowResolvingAsync(r),r}(this._activeBuffer.x!==n||this._activeBuffer.y!==i)&&this._onCursorMove.fire();let a=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),l=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);l<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(l,this._bufferService.rows-1),end:Math.min(a,this._bufferService.rows-1)})}print(e,t,r){let n,i,s=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,a=this._bufferService.cols,l=this._coreService.decPrivateModes.wraparound,c=this._coreService.modes.insertMode,d=this._curAttrData,h=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&r-t>0&&h.getWidth(this._activeBuffer.x-1)===2&&h.setCellFromCodepoint(this._activeBuffer.x-1,0,1,d);let f=this._parser.precedingJoinState;for(let v=t;v<r;++v){if(n=e[v],n<127&&s){let g=s[String.fromCharCode(n)];g&&(n=g.charCodeAt(0))}let m=this._unicodeService.charProperties(n,f);i=Bi.extractWidth(m);let S=Bi.extractShouldJoin(m),y=S?Bi.extractWidth(f):0;if(f=m,o&&this._onA11yChar.fire(Kn(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-y>a){if(l){let g=h,_=this._activeBuffer.x-y;for(this._activeBuffer.x=y,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),h=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),y>0&&h instanceof Zo&&h.copyCellsFrom(g,_,0,y,!1);_<a;)g.setCellFromCodepoint(_++,0,1,d)}else if(this._activeBuffer.x=a-1,i===2)continue}if(S&&this._activeBuffer.x){let g=h.getWidth(this._activeBuffer.x-1)?1:2;h.addCodepointToCell(this._activeBuffer.x-g,n,i);for(let _=i-y;--_>=0;)h.setCellFromCodepoint(this._activeBuffer.x++,0,0,d);continue}if(c&&(h.insertCells(this._activeBuffer.x,i-y,this._activeBuffer.getNullCell(d)),h.getWidth(a-1)===2&&h.setCellFromCodepoint(a-1,0,1,d)),h.setCellFromCodepoint(this._activeBuffer.x++,n,i,d),i>0)for(;--i;)h.setCellFromCodepoint(this._activeBuffer.x++,0,0,d)}this._parser.precedingJoinState=f,this._activeBuffer.x<a&&r-t>0&&h.getWidth(this._activeBuffer.x)===0&&!h.hasContent(this._activeBuffer.x)&&h.setCellFromCodepoint(this._activeBuffer.x,0,1,d),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>Dy(r.params[0],this._optionsService.rawOptions.windowOptions)?t(r):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Ly(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new gr(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,r,n=!1,i=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);s.replaceCells(t,r,this._activeBuffer.getNullCell(this._eraseAttrData()),i),n&&(s.isWrapped=!1)}_resetBufferLine(e,t=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,t=!1){var n;this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);r<this._bufferService.rows;r++)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(r);break;case 1:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!((n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r))!=null&&n.getTrimmedLength()););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let i=this._activeBuffer.lines.length-this._bufferService.rows;i>0&&(this._activeBuffer.lines.trimStart(i),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-i,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-i,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;t--;)this._activeBuffer.lines.splice(r,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(ut));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let r=e.params[0]||1,n=Bi.extractWidth(t),i=this._activeBuffer.x-n,s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(s.length*r),a=0;for(let c=0;c<s.length;){let d=s.codePointAt(c)||0;o[a++]=d,c+=d>65535?2:1}let l=a;for(let c=1;c<r;++c)o.copyWithin(l,0,a),l+=a;return this.print(o,0,l),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(K.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(K.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(K.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(K.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(K.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Ri),this._charsetService.setgCharset(1,Ri),this._charsetService.setgCharset(2,Ri),this._charsetService.setgCharset(3,Ri);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(S=>(S[S.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",S[S.SET=1]="SET",S[S.RESET=2]="RESET",S[S.PERMANENTLY_SET=3]="PERMANENTLY_SET",S[S.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(r={}));let n=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:s}=this._coreMouseService,o=this._coreService,{buffers:a,cols:l}=this._bufferService,{active:c,alt:d}=a,h=this._optionsService.rawOptions,f=(S,y)=>(o.triggerDataEvent(`${K.ESC}[${t?"":"?"}${S};${y}$y`),!0),v=S=>S?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,v(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,v(h.convertEol)):f(m,0):m===1?f(m,v(n.applicationCursorKeys)):m===3?f(m,h.windowOptions.setWinLines?l===80?2:l===132?1:0:0):m===6?f(m,v(n.origin)):m===7?f(m,v(n.wraparound)):m===8?f(m,3):m===9?f(m,v(i==="X10")):m===12?f(m,v(h.cursorBlink)):m===25?f(m,v(!o.isCursorHidden)):m===45?f(m,v(n.reverseWraparound)):m===66?f(m,v(n.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,v(i==="VT200")):m===1002?f(m,v(i==="DRAG")):m===1003?f(m,v(i==="ANY")):m===1004?f(m,v(n.sendFocus)):m===1005?f(m,4):m===1006?f(m,v(s==="SGR")):m===1015?f(m,4):m===1016?f(m,v(s==="SGR_PIXELS")):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,v(c===d)):m===2004?f(m,v(n.bracketedPasteMode)):m===2026?f(m,v(n.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,r,n,i){return t===2?(e|=50331648,e&=-16777216,e|=nl.fromColorRGB([r,n,i])):t===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,t,r){let n=[0,0,-1,0,0,0],i=0,s=0;do{if(n[s+i]=e.params[t+s],e.hasSubParams(t+s)){let o=e.getSubParams(t+s),a=0;do n[1]===5&&(i=1),n[s+a+1+i]=o[a];while(++a<o.length&&a+s+1+i<n.length);break}if(n[1]===5&&s+i>=2||n[1]===2&&s+i>=5)break;n[1]&&(i=1)}while(++s+t<e.length&&s+i<n.length);for(let o=2;o<n.length;++o)n[o]===-1&&(n[o]=0);switch(n[0]){case 38:r.fg=this._updateAttrColor(r.fg,n[1],n[3],n[4],n[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,n[1],n[3],n[4],n[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,n[1],n[3],n[4],n[5])}return s}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=ut.fg,e.bg=ut.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,r,n=this._curAttrData;for(let i=0;i<t;i++)r=e.params[i],r>=30&&r<=37?(n.fg&=-50331904,n.fg|=16777216|r-30):r>=40&&r<=47?(n.bg&=-50331904,n.bg|=16777216|r-40):r>=90&&r<=97?(n.fg&=-50331904,n.fg|=16777216|r-90|8):r>=100&&r<=107?(n.bg&=-50331904,n.bg|=16777216|r-100|8):r===0?this._processSGR0(n):r===1?n.fg|=134217728:r===3?n.bg|=67108864:r===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,n)):r===5?n.fg|=536870912:r===7?n.fg|=67108864:r===8?n.fg|=1073741824:r===9?n.fg|=2147483648:r===2?n.bg|=134217728:r===21?this._processUnderline(2,n):r===22?(n.fg&=-134217729,n.bg&=-134217729):r===23?n.bg&=-67108865:r===24?(n.fg&=-268435457,this._processUnderline(0,n)):r===25?n.fg&=-536870913:r===27?n.fg&=-67108865:r===28?n.fg&=-1073741825:r===29?n.fg&=2147483647:r===39?(n.fg&=-67108864,n.fg|=ut.fg&16777215):r===49?(n.bg&=-67108864,n.bg|=ut.bg&16777215):r===38||r===48||r===58?i+=this._extractColor(e,i,n):r===53?n.bg|=1073741824:r===55?n.bg&=-1073741825:r===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):r===100?(n.fg&=-67108864,n.fg|=ut.fg&16777215,n.bg&=-67108864,n.bg|=ut.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${K.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${K.ESC}[${t};${r}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${K.ESC}[?${t};${r}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=ut.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let r=t%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let t=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Dy(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${K.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Ny&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Ny&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],r=e.split(";");for(;r.length>1;){let n=r.shift(),i=r.shift();if(/^\d+$/.exec(n)){let s=parseInt(n);if($y(s))if(i==="?")t.push({type:0,index:s});else{let o=Ay(i);o&&t.push({type:1,index:s,color:o})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let r=e.slice(0,t).trim(),n=e.slice(t+1);return n?this._createHyperlink(r,n):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),n,i=r.findIndex(s=>s.startsWith("id="));return i!==-1&&(n=r[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let r=e.split(";");for(let n=0;n<r.length&&!(t>=this._specialColors.length);++n,++t)if(r[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let i=Ay(r[n]);i&&this._onColor.fire([{type:1,index:this._specialColors[t],color:i}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],r=e.split(";");for(let n=0;n<r.length;++n)if(/^\d+$/.exec(r[n])){let i=parseInt(r[n]);$y(i)&&t.push({type:2,index:i})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,Ri),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(YA[e[0]],St[e[1]]||Ri),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=ut.clone(),this._eraseAttrDataInternal=ut.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Br;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let r=this._activeBuffer.ybase+this._activeBuffer.y+t,n=this._activeBuffer.lines.get(r);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let r=o=>(this._coreService.triggerDataEvent(`${K.ESC}${o}${K.ESC}\\`),!0),n=this._bufferService.buffer,i=this._optionsService.rawOptions;return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-(i.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},sm=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(Oy=e,e=t,t=Oy),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};sm=it([ie(0,rr)],sm);function $y(e){return 0<=e&&e<256}var XA=5e7,jy=12,JA=50,QA=class extends ke{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new Q),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let r;for(;r=this._writeBuffer.shift();){this._action(r);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>XA)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],i=this._action(n,t);if(i){let o=a=>performance.now()-r>=jy?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(r,a);i.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(o);return}let s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-r>=jy)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>JA&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},om=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let a=t.addMarker(t.ybase+t.y),l={data:e,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(l,a)),this._dataByLinkId.set(l.id,l),l.id}let r=e,n=this._getEntryIdKey(r),i=this._entriesWithId.get(n);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let s=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(o,s)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(n=>n.line!==t)){let n=this._bufferService.buffer.addMarker(t);r.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(r,n))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let r=e.lines.indexOf(t);r!==-1&&(e.lines.splice(r,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};om=it([ie(0,rr)],om);var zy=!1,ZA=class extends ke{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new io),this._onBinary=this._register(new Q),this.onBinary=this._onBinary.event,this._onData=this._register(new Q),this.onData=this._onData.event,this._onLineFeed=this._register(new Q),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Q),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Q),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Q),this._instantiationService=new CA,this.optionsService=this._register(new AA(e)),this._instantiationService.setService(nr,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(tm)),this._instantiationService.setService(rr,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(em)),this._instantiationService.setService(_C,this._logService),this.coreService=this._register(this._instantiationService.createInstance(rm)),this._instantiationService.setService(rs,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(nm)),this._instantiationService.setService(vC,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Bi)),this._instantiationService.setService(yP,this.unicodeService),this._charsetService=this._instantiationService.createInstance($A),this._instantiationService.setService(_P,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(om),this._instantiationService.setService(yC,this._oscLinkService),this._inputHandler=this._register(new GA(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Bt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Bt.forward(this._bufferService.onResize,this._onResize)),this._register(Bt.forward(this.coreService.onData,this._onData)),this._register(Bt.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new QA((t,r)=>this._inputHandler.parse(t,r))),this._register(Bt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Q),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!zy&&(this._logService.warn("writeSync is unreliable and will be removed soon."),zy=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,JC),t=Math.max(t,QC),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(Py.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Py(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Xe(()=>{for(let t of e)t.dispose()})}}},eN={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function tN(e,t,r,n){var o;let i={type:0,cancel:!1,key:void 0},s=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?i.key=K.ESC+"OA":i.key=K.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?i.key=K.ESC+"OD":i.key=K.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?i.key=K.ESC+"OC":i.key=K.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?i.key=K.ESC+"OB":i.key=K.ESC+"[B");break;case 8:i.key=e.ctrlKey?"\b":K.DEL,e.altKey&&(i.key=K.ESC+i.key);break;case 9:if(e.shiftKey){i.key=K.ESC+"[Z";break}i.key=K.HT,i.cancel=!0;break;case 13:i.key=e.altKey?K.ESC+K.CR:K.CR,i.cancel=!0;break;case 27:i.key=K.ESC,e.altKey&&(i.key=K.ESC+K.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;s?i.key=K.ESC+"[1;"+(s+1)+"D":t?i.key=K.ESC+"OD":i.key=K.ESC+"[D";break;case 39:if(e.metaKey)break;s?i.key=K.ESC+"[1;"+(s+1)+"C":t?i.key=K.ESC+"OC":i.key=K.ESC+"[C";break;case 38:if(e.metaKey)break;s?i.key=K.ESC+"[1;"+(s+1)+"A":t?i.key=K.ESC+"OA":i.key=K.ESC+"[A";break;case 40:if(e.metaKey)break;s?i.key=K.ESC+"[1;"+(s+1)+"B":t?i.key=K.ESC+"OB":i.key=K.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=K.ESC+"[2~");break;case 46:s?i.key=K.ESC+"[3;"+(s+1)+"~":i.key=K.ESC+"[3~";break;case 36:s?i.key=K.ESC+"[1;"+(s+1)+"H":t?i.key=K.ESC+"OH":i.key=K.ESC+"[H";break;case 35:s?i.key=K.ESC+"[1;"+(s+1)+"F":t?i.key=K.ESC+"OF":i.key=K.ESC+"[F";break;case 33:e.shiftKey?i.type=2:e.ctrlKey?i.key=K.ESC+"[5;"+(s+1)+"~":i.key=K.ESC+"[5~";break;case 34:e.shiftKey?i.type=3:e.ctrlKey?i.key=K.ESC+"[6;"+(s+1)+"~":i.key=K.ESC+"[6~";break;case 112:s?i.key=K.ESC+"[1;"+(s+1)+"P":i.key=K.ESC+"OP";break;case 113:s?i.key=K.ESC+"[1;"+(s+1)+"Q":i.key=K.ESC+"OQ";break;case 114:s?i.key=K.ESC+"[1;"+(s+1)+"R":i.key=K.ESC+"OR";break;case 115:s?i.key=K.ESC+"[1;"+(s+1)+"S":i.key=K.ESC+"OS";break;case 116:s?i.key=K.ESC+"[15;"+(s+1)+"~":i.key=K.ESC+"[15~";break;case 117:s?i.key=K.ESC+"[17;"+(s+1)+"~":i.key=K.ESC+"[17~";break;case 118:s?i.key=K.ESC+"[18;"+(s+1)+"~":i.key=K.ESC+"[18~";break;case 119:s?i.key=K.ESC+"[19;"+(s+1)+"~":i.key=K.ESC+"[19~";break;case 120:s?i.key=K.ESC+"[20;"+(s+1)+"~":i.key=K.ESC+"[20~";break;case 121:s?i.key=K.ESC+"[21;"+(s+1)+"~":i.key=K.ESC+"[21~";break;case 122:s?i.key=K.ESC+"[23;"+(s+1)+"~":i.key=K.ESC+"[23~";break;case 123:s?i.key=K.ESC+"[24;"+(s+1)+"~":i.key=K.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=K.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=K.DEL:e.keyCode===219?i.key=K.ESC:e.keyCode===220?i.key=K.FS:e.keyCode===221&&(i.key=K.GS);else if((!r||n)&&e.altKey&&!e.metaKey){let a=(o=eN[e.keyCode])==null?void 0:o[e.shiftKey?1:0];if(a)i.key=K.ESC+a;else if(e.keyCode>=65&&e.keyCode<=90){let l=e.ctrlKey?e.keyCode-64:e.keyCode+32,c=String.fromCharCode(l);e.shiftKey&&(c=c.toUpperCase()),i.key=K.ESC+c}else if(e.keyCode===32)i.key=K.ESC+(e.ctrlKey?K.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let l=e.code.slice(3,4);e.shiftKey||(l=l.toLowerCase()),i.key=K.ESC+l,i.cancel=!0}}else r&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(i.key=K.US),e.key==="@"&&(i.key=K.NUL));break}return i}var ot=0,rN=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new hu,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new hu,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((i,s)=>this._getKey(i)-this._getKey(s)),t=0,r=0,n=new Array(this._array.length+this._insertedValues.length);for(let i=0;i<n.length;i++)r>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[r])?(n[i]=e[t],t++):n[i]=this._array[r++];this._array=n,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(ot=this._search(t),ot===-1)||this._getKey(this._array[ot])!==t)return!1;do if(this._array[ot]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(ot),!0;while(++ot<this._array.length&&this._getKey(this._array[ot])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((i,s)=>i-s),t=0,r=new Array(this._array.length-e.length),n=0;for(let i=0;i<this._array.length;i++)e[t]===i?t++:r[n++]=this._array[i];this._array=r,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ot=this._search(e),!(ot<0||ot>=this._array.length)&&this._getKey(this._array[ot])===e))do yield this._array[ot];while(++ot<this._array.length&&this._getKey(this._array[ot])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ot=this._search(e),!(ot<0||ot>=this._array.length)&&this._getKey(this._array[ot])===e))do t(this._array[ot]);while(++ot<this._array.length&&this._getKey(this._array[ot])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,r=this._array.length-1;for(;r>=t;){let n=t+r>>1,i=this._getKey(this._array[n]);if(i>e)r=n-1;else if(i<e)t=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return t}},ah=0,Fy=0,nN=class extends ke{constructor(){super(),this._decorations=new rN(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new Q),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Q),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Xe(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new iN(e);if(t){let r=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),r.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,r){let n=0,i=0;for(let s of this._decorations.getKeyIterator(t))n=s.options.x??0,i=n+(s.options.width??1),e>=n&&e<i&&(!r||(s.options.layer??"bottom")===r)&&(yield s)}forEachDecorationAtCell(e,t,r,n){this._decorations.forEachByKey(t,i=>{ah=i.options.x??0,Fy=ah+(i.options.width??1),e>=ah&&e<Fy&&(!r||(i.options.layer??"bottom")===r)&&n(i)})}},iN=class extends ai{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new Q),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new Q),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Qe.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Qe.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},sN=1e3,oN=class{constructor(e,t=sN){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let i=n-this._lastRefreshMs,s=this._debounceThresholdMS-i;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},s)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Hy=20,fu=class extends ke{constructor(e,t,r,n){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=i.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let s=0;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);if(this._topBoundaryFocusListener=s=>this._handleBoundaryFocus(s,0),this._bottomBoundaryFocusListener=s=>this._handleBoundaryFocus(s,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=i.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new oN(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(s=>this._handleResize(s.rows))),this._register(this._terminal.onRender(s=>this._refreshRows(s.start,s.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(s=>this._handleChar(s))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
138
|
-
`))),this._register(this._terminal.onA11yTab(s=>this._handleTab(s))),this._register(this._terminal.onKey(s=>this._handleKey(s.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(pe(i,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Xe(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Hy+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
139
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Hy+1&&(this._liveRegion.textContent+=Tf.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let r=this._terminal.buffer,n=r.lines.length.toString();for(let i=e;i<=t;i++){let s=r.lines.get(r.ydisp+i),o=[],a=(s==null?void 0:s.translateToString(!0,void 0,void 0,o))||"",l=(r.ydisp+i+1).toString(),c=this._rowElements[i];c&&(a.length===0?(c.textContent=" ",this._rowColumns.set(c,[0,1])):(c.textContent=a,this._rowColumns.set(c,o)),c.setAttribute("aria-posinset",l),c.setAttribute("aria-setsize",n),this._alignRowWidth(c))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let r=e.target,n=this._rowElements[t===0?1:this._rowElements.length-2],i=r.getAttribute("aria-posinset"),s=t===0?"1":`${this._terminal.buffer.lines.length}`;if(i===s||e.relatedTarget!==n)return;let o,a;if(t===0?(o=r,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(o=this._rowElements.shift(),a=r,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),a.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{let l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var a;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===r.node&&t.offset>r.offset)&&([t,r]=[r,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let n=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:n,offset:((a=n.textContent)==null?void 0:a.length)??0}),!this._rowContainer.contains(r.node))return;let i=({node:l,offset:c})=>{let d=l instanceof Text?l.parentNode:l,h=parseInt(d==null?void 0:d.getAttribute("aria-posinset"),10)-1;if(isNaN(h))return console.warn("row is invalid. Race condition?"),null;let f=this._rowColumns.get(d);if(!f)return console.warn("columns is null. Race condition?"),null;let v=c<f.length?f[c]:f.slice(-1)[0]+1;return v>=this._terminal.cols&&(++h,v=0),{row:h,column:v}},s=i(t),o=i(r);if(!(!s||!o)){if(s.row>o.row||s.row===o.row&&s.column>=o.column)throw new Error("invalid range");this._terminal.select(s.column,s.row,(o.row-s.row)*this._terminal.cols-s.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var i,s;e.style.transform="";let t=e.getBoundingClientRect().width,r=(s=(i=this._rowColumns.get(e))==null?void 0:i.slice(-1))==null?void 0:s[0];if(!r)return;let n=r*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/t})`}};fu=it([ie(1,Wp),ie(2,Dn),ie(3,Bn)],fu);var am=class extends ke{constructor(e,t,r,n,i){super(),this._element=e,this._mouseService=t,this._renderService=r,this._bufferService=n,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new Q),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new Q),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Xe(()=>{var s;Gi(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(s=this._activeProviderReplies)==null||s.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(pe(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(pe(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(pe(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(pe(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let r=e.composedPath();for(let n=0;n<r.length;n++){let i=r[n];if(i.classList.contains("xterm"))break;if(i.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var n,i;(!this._activeProviderReplies||!t)&&((n=this._activeProviderReplies)==null||n.forEach(s=>{s==null||s.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[s,o]of this._linkProviderService.linkProviders.entries())t?(i=this._activeProviderReplies)!=null&&i.get(s)&&(r=this._checkLinkProviderResult(s,e,r)):o.provideLinks(e.y,a=>{var c,d;if(this._isMouseOut)return;let l=a==null?void 0:a.map(h=>({link:h}));(c=this._activeProviderReplies)==null||c.set(s,l),r=this._checkLinkProviderResult(s,e,r),((d=this._activeProviderReplies)==null?void 0:d.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let r=new Set;for(let n=0;n<t.size;n++){let i=t.get(n);if(i)for(let s=0;s<i.length;s++){let o=i[s],a=o.link.range.start.y<e?0:o.link.range.start.x,l=o.link.range.end.y>e?this._bufferService.cols:o.link.range.end.x;for(let c=a;c<=l;c++){if(r.has(c)){i.splice(s--,1);break}r.add(c)}}}}_checkLinkProviderResult(e,t,r){var s;if(!this._activeProviderReplies)return r;let n=this._activeProviderReplies.get(e),i=!1;for(let o=0;o<e;o++)(!this._activeProviderReplies.has(o)||this._activeProviderReplies.get(o))&&(i=!0);if(!i&&n){let o=n.find(a=>this._linkAtPosition(a.link,t));o&&(r=!0,this._handleNewLink(o))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let o=0;o<this._activeProviderReplies.size;o++){let a=(s=this._activeProviderReplies.get(o))==null?void 0:s.find(l=>this._linkAtPosition(l.link,t));if(a){r=!0,this._handleNewLink(a);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&aN(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Gi(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var r,n;return(n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.decorations.pointerCursor},set:r=>{var n;(n=this._currentLink)!=null&&n.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>{var r,n;return(n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.decorations.underline},set:r=>{var n,i,s;(n=this._currentLink)!=null&&n.state&&((s=(i=this._currentLink)==null?void 0:i.state)==null?void 0:s.decorations.underline)!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let n=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,i=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=i&&(this._clearCurrentLink(n,i),this._lastMouseEvent)){let s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._askForLink(s,!1)}})))}_linkHover(e,t,r){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)}_fireUnderlineEvent(e,t){let r=e.range,n=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-n-1,r.end.x,r.end.y-n-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,r){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)}_linkAtPosition(e,t){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return r<=i&&i<=n}_positionFromMouseEvent(e,t,r){let n=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,r,n,i){return{x1:e,y1:t,x2:r,y2:n,cols:this._bufferService.cols,fg:i}}};am=it([ie(1,Up),ie(2,Bn),ie(3,rr),ie(4,wC)],am);function aN(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var lN=class extends ZA{constructor(e={}){super(e),this._linkifier=this._register(new io),this.browser=zC,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new io),this._onCursorMove=this._register(new Q),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Q),this.onKey=this._onKey.event,this._onRender=this._register(new Q),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Q),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Q),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Q),this.onBell=this._onBell.event,this._onFocus=this._register(new Q),this._onBlur=this._register(new Q),this._onA11yCharEmitter=this._register(new Q),this._onA11yTabEmitter=this._register(new Q),this._onWillOpen=this._register(new Q),this._setup(),this._decorationService=this._instantiationService.createInstance(nN),this._instantiationService.setService(il,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(JL),this._instantiationService.setService(wC,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(If)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(Bt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Bt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Bt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Bt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Xe(()=>{var t,r;this._customKeyEventHandler=void 0,(r=(t=this.element)==null?void 0:t.parentNode)==null||r.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let r,n="";switch(t.index){case 256:r="foreground",n="10";break;case 257:r="background",n="11";break;case 258:r="cursor",n="12";break;default:r="ansi",n="4;"+t.index}switch(t.type){case 0:let i=He.toColorRGB(r==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[r]);this.coreService.triggerDataEvent(`${K.ESC}]${n};${qA(i)}${$C.ST}`);break;case 1:if(r==="ansi")this._themeService.modifyColors(s=>s.ansi[t.index]=dt.toColor(...t.color));else{let s=r;this._themeService.modifyColors(o=>o[s]=dt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(fu,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let r=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,i=t.getWidth(r),s=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,a=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=s+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(pe(this.element,"copy",t=>{this.hasSelection()&&hP(t,this._selectionService)}));let e=t=>fP(t,this.textarea,this.coreService,this.optionsService);this._register(pe(this.textarea,"paste",e)),this._register(pe(this.element,"paste",e)),FC?this._register(pe(this.element,"mousedown",t=>{t.button===2&&Q_(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(pe(this.element,"contextmenu",t=>{Q_(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Qp&&this._register(pe(this.element,"auxclick",t=>{t.button===1&&hC(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(pe(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(pe(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(pe(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(pe(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(pe(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(pe(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(pe(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var i;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((i=this.element)==null?void 0:i.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(pe(this.screenElement,"mousemove",s=>this.updateCursorStyle(s))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",kf.get()),UC||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(GL,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Dn,this._coreBrowserService),this._register(pe(this.textarea,"focus",s=>this._handleTextAreaFocus(s))),this._register(pe(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Gf,this._document,this._helperContainer),this._instantiationService.setService(zu,this._charSizeService),this._themeService=this._instantiationService.createInstance(Zf),this._instantiationService.setService(mo,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(uu),this._instantiationService.setService(SC,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Jf,this.rows,this.screenElement)),this._instantiationService.setService(Bn,this._renderService),this._register(this._renderService.onRenderedViewportChange(s=>this._onRender.fire(s))),this.onResize(s=>this._renderService.resize(s.cols,s.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Vf,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Xf),this._instantiationService.setService(Up,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(am,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(Uf,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(s=>{super.scrollLines(s,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Qf,this.element,this.screenElement,n)),this._instantiationService.setService(wP,this._selectionService),this._register(this._selectionService.onRequestScrollLines(s=>this.scrollLines(s.amount,s.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(s=>this._renderService.handleSelectionChanged(s.start,s.end,s.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(s=>{this.textarea.value=s,this.textarea.focus(),this.textarea.select()})),this._register(Bt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var s;this._selectionService.refresh(),(s=this._viewport)==null||s.queueSync()})),this._register(this._instantiationService.createInstance(Kf,this.screenElement)),this._register(pe(this.element,"mousedown",s=>this._selectionService.handleMouseDown(s))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(fu,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",s=>this._handleScreenReaderModeOptionChange(s))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(cu,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",s=>{!this._overviewRulerRenderer&&s&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(cu,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Yf,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function r(s){var c,d,h,f,v;let o=e._mouseService.getMouseReportCoords(s,e.screenElement);if(!o)return!1;let a,l;switch(s.overrideType||s.type){case"mousemove":l=32,s.buttons===void 0?(a=3,s.button!==void 0&&(a=s.button<3?s.button:3)):a=s.buttons&1?0:s.buttons&4?1:s.buttons&2?2:3;break;case"mouseup":l=0,a=s.button<3?s.button:3;break;case"mousedown":l=1,a=s.button<3?s.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(s)===!1)return!1;let m=s.deltaY;if(m===0||e.coreMouseService.consumeWheelEvent(s,(f=(h=(d=(c=e._renderService)==null?void 0:c.dimensions)==null?void 0:d.device)==null?void 0:h.cell)==null?void 0:f.height,(v=e._coreBrowserService)==null?void 0:v.dpr)===0)return!1;l=m<0?0:1,a=4;break;default:return!1}return l===void 0||a===void 0||a>4?!1:e.coreMouseService.triggerMouseEvent({col:o.col,row:o.row,x:o.x,y:o.y,button:a,action:l,ctrl:s.ctrlKey,alt:s.altKey,shift:s.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:s=>(r(s),s.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(s)),wheel:s=>(r(s),this.cancel(s,!0)),mousedrag:s=>{s.buttons&&r(s)},mousemove:s=>{s.buttons||r(s)}};this._register(this.coreMouseService.onProtocolChange(s=>{s?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(s)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),s&8?n.mousemove||(t.addEventListener("mousemove",i.mousemove),n.mousemove=i.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),s&16?n.wheel||(t.addEventListener("wheel",i.wheel,{passive:!1}),n.wheel=i.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),s&2?n.mouseup||(n.mouseup=i.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),s&4?n.mousedrag||(n.mousedrag=i.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(pe(t,"mousedown",s=>{if(s.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(s)))return r(s),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(s)})),this._register(pe(t,"wheel",s=>{var o,a,l,c,d;if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(s)===!1)return!1;if(!this.buffer.hasScrollback){if(s.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(s,(c=(l=(a=(o=e._renderService)==null?void 0:o.dimensions)==null?void 0:a.device)==null?void 0:l.cell)==null?void 0:c.height,(d=e._coreBrowserService)==null?void 0:d.dpr)===0)return this.cancel(s,!0);let h=K.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(s.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(h,!0),this.cancel(s,!0)}}},{passive:!1}))}refresh(e,t){var r;(r=this._renderService)==null||r.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){dC(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,r){this._selectionService.setSelection(e,t,r)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var r;(r=this._selectionService)==null||r.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let r=tN(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),r.type===3||r.type===2){let n=this.rows-1;return this.scrollLines(r.type===2?-n:n),this.cancel(e,!0)}if(r.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((r.key===K.ETX||r.key===K.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?r:r&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(cN(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var r;(r=this._charSizeService)==null||r.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(ut));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(K.ESC+"[I"):this.coreService.triggerDataEvent(K.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),r=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.ESC}[4;${r};${t}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),i=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.ESC}[6;${i};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function cN(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var uN=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=()=>this._wrappedAddonDispose(r),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let r=0;r<this._addons.length;r++)if(this._addons[r]===e){t=r;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},dN=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Br)}translateToString(e,t,r){return this._line.translateToString(e,t,r)}},Wy=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new dN(t)}getNullCell(){return new Br}},hN=class extends ke{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Q),this.onBufferChange=this._onBufferChange.event,this._normal=new Wy(this._core.buffers.normal,"normal"),this._alternate=new Wy(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},fN=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,r=>t(r.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(r,n)=>t(r,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},mN=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},pN=["cols","rows"],sn=0,gN=class extends ke{constructor(e){super(),this._core=this._register(new lN(e)),this._addonManager=this._register(new uN),this._publicOptions={...this._core.options};let t=n=>this._core.options[n],r=(n,i)=>{this._checkReadonlyOptions(n),this._core.options[n]=i};for(let n in this._core.options){let i={get:t.bind(this,n),set:r.bind(this,n)};Object.defineProperty(this._publicOptions,n,i)}}_checkReadonlyOptions(e){if(pN.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new fN(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new mN(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new hN(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
140
|
-
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return kf.get()},set promptLabel(e){kf.set(e)},get tooMuchOutput(){return Tf.get()},set tooMuchOutput(e){Tf.set(e)}}}_verifyIntegers(...e){for(sn of e)if(sn===1/0||isNaN(sn)||sn%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(sn of e)if(sn&&(sn===1/0||isNaN(sn)||sn%1!==0||sn<0))throw new Error("This API only accepts positive integers")}};function vN(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const _N=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yN=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SN={};function Uy(e,t){return(SN.jsx?yN:_N).test(e)}const wN=/[ \t\n\f\r]/g;function bN(e){return typeof e=="object"?e.type==="text"?Ky(e.value):!1:Ky(e)}function Ky(e){return e.replace(wN,"")===""}class al{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}al.prototype.normal={};al.prototype.property={};al.prototype.space=void 0;function e1(e,t){const r={},n={};for(const i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new al(r,n,t)}function lm(e){return e.toLowerCase()}class fr{constructor(t,r){this.attribute=r,this.property=t}}fr.prototype.attribute="";fr.prototype.booleanish=!1;fr.prototype.boolean=!1;fr.prototype.commaOrSpaceSeparated=!1;fr.prototype.commaSeparated=!1;fr.prototype.defined=!1;fr.prototype.mustUseProperty=!1;fr.prototype.number=!1;fr.prototype.overloadedBoolean=!1;fr.prototype.property="";fr.prototype.spaceSeparated=!1;fr.prototype.space=void 0;let CN=0;const ye=ns(),ct=ns(),cm=ns(),X=ns(),$e=ns(),Ys=ns(),vr=ns();function ns(){return 2**++CN}const um=Object.freeze(Object.defineProperty({__proto__:null,boolean:ye,booleanish:ct,commaOrSpaceSeparated:vr,commaSeparated:Ys,number:X,overloadedBoolean:cm,spaceSeparated:$e},Symbol.toStringTag,{value:"Module"})),lh=Object.keys(um);class Zp extends fr{constructor(t,r,n,i){let s=-1;if(super(t,r),Vy(this,"space",i),typeof n=="number")for(;++s<lh.length;){const o=lh[s];Vy(this,lh[s],(n&um[o])===um[o])}}}Zp.prototype.defined=!0;function Vy(e,t,r){r&&(e[t]=r)}function go(e){const t={},r={};for(const[n,i]of Object.entries(e.properties)){const s=new Zp(n,e.transform(e.attributes||{},n),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(s.mustUseProperty=!0),t[n]=s,r[lm(n)]=n,r[lm(s.attribute)]=n}return new al(t,r,e.space)}const t1=go({properties:{ariaActiveDescendant:null,ariaAtomic:ct,ariaAutoComplete:null,ariaBusy:ct,ariaChecked:ct,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:$e,ariaCurrent:null,ariaDescribedBy:$e,ariaDetails:null,ariaDisabled:ct,ariaDropEffect:$e,ariaErrorMessage:null,ariaExpanded:ct,ariaFlowTo:$e,ariaGrabbed:ct,ariaHasPopup:null,ariaHidden:ct,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$e,ariaLevel:X,ariaLive:null,ariaModal:ct,ariaMultiLine:ct,ariaMultiSelectable:ct,ariaOrientation:null,ariaOwns:$e,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:ct,ariaReadOnly:ct,ariaRelevant:null,ariaRequired:ct,ariaRoleDescription:$e,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:ct,ariaSetSize:X,ariaSort:null,ariaValueMax:X,ariaValueMin:X,ariaValueNow:X,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function r1(e,t){return t in e?e[t]:t}function n1(e,t){return r1(e,t.toLowerCase())}const xN=go({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ys,acceptCharset:$e,accessKey:$e,action:null,allow:null,allowFullScreen:ye,allowPaymentRequest:ye,allowUserMedia:ye,alt:null,as:null,async:ye,autoCapitalize:null,autoComplete:$e,autoFocus:ye,autoPlay:ye,blocking:$e,capture:null,charSet:null,checked:ye,cite:null,className:$e,cols:X,colSpan:null,content:null,contentEditable:ct,controls:ye,controlsList:$e,coords:X|Ys,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ye,defer:ye,dir:null,dirName:null,disabled:ye,download:cm,draggable:ct,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ye,formTarget:null,headers:$e,height:X,hidden:cm,high:X,href:null,hrefLang:null,htmlFor:$e,httpEquiv:$e,id:null,imageSizes:null,imageSrcSet:null,inert:ye,inputMode:null,integrity:null,is:null,isMap:ye,itemId:null,itemProp:$e,itemRef:$e,itemScope:ye,itemType:$e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ye,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:ye,muted:ye,name:null,nonce:null,noModule:ye,noValidate:ye,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ye,optimum:X,pattern:null,ping:$e,placeholder:null,playsInline:ye,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ye,referrerPolicy:null,rel:$e,required:ye,reversed:ye,rows:X,rowSpan:X,sandbox:$e,scope:null,scoped:ye,seamless:ye,selected:ye,shadowRootClonable:ye,shadowRootDelegatesFocus:ye,shadowRootMode:null,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:ct,src:null,srcDoc:null,srcLang:null,srcSet:null,start:X,step:null,style:null,tabIndex:X,target:null,title:null,translate:null,type:null,typeMustMatch:ye,useMap:null,value:ct,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$e,axis:null,background:null,bgColor:null,border:X,borderColor:null,bottomMargin:X,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ye,declare:ye,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:ye,noHref:ye,noShade:ye,noWrap:ye,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:ct,standby:null,summary:null,text:null,topMargin:X,valueType:null,version:null,vAlign:null,vLink:null,vSpace:X,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ye,disableRemotePlayback:ye,prefix:null,property:null,results:X,security:null,unselectable:null},space:"html",transform:n1}),kN=go({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:vr,accentHeight:X,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:X,amplitude:X,arabicForm:null,ascent:X,attributeName:null,attributeType:null,azimuth:X,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:X,by:null,calcMode:null,capHeight:X,className:$e,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:X,diffuseConstant:X,direction:null,display:null,dur:null,divisor:X,dominantBaseline:null,download:ye,dx:null,dy:null,edgeMode:null,editable:null,elevation:X,enableBackground:null,end:null,event:null,exponent:X,externalResourcesRequired:null,fill:null,fillOpacity:X,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ys,g2:Ys,glyphName:Ys,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:X,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:X,horizOriginX:X,horizOriginY:X,id:null,ideographic:X,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:X,k:X,k1:X,k2:X,k3:X,k4:X,kernelMatrix:vr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:X,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:X,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:X,overlineThickness:X,paintOrder:null,panose1:null,path:null,pathLength:X,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vr,rev:vr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vr,requiredFeatures:vr,requiredFonts:vr,requiredFormats:vr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:X,specularExponent:X,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:X,strikethroughThickness:X,string:null,stroke:null,strokeDashArray:vr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:X,strokeOpacity:X,strokeWidth:null,style:null,surfaceScale:X,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vr,tabIndex:X,tableValues:null,target:null,targetX:X,targetY:X,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:X,underlineThickness:X,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:X,values:null,vAlphabetic:X,vMathematical:X,vectorEffect:null,vHanging:X,vIdeographic:X,version:null,vertAdvY:X,vertOriginX:X,vertOriginY:X,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:X,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:r1}),i1=go({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),s1=go({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:n1}),o1=go({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),TN={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},EN=/[A-Z]/g,qy=/-[a-z]/g,IN=/^data[-\w.:]+$/i;function RN(e,t){const r=lm(t);let n=t,i=fr;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&IN.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(qy,PN);n="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!qy.test(s)){let o=s.replace(EN,MN);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Zp}return new i(n,t)}function MN(e){return"-"+e.toLowerCase()}function PN(e){return e.charAt(1).toUpperCase()}const LN=e1([t1,xN,i1,s1,o1],"html"),eg=e1([t1,kN,i1,s1,o1],"svg");function AN(e){return e.join(" ").trim()}var tg={},Yy=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NN=/\n/g,DN=/^\s*/,BN=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ON=/^:\s*/,$N=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,jN=/^[;\s]*/,zN=/^\s+|\s+$/g,FN=`
|
|
141
|
-
`,Gy="/",Xy="*",Mi="",HN="comment",WN="declaration";function UN(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,n=1;function i(m){var S=m.match(NN);S&&(r+=S.length);var y=m.lastIndexOf(FN);n=~y?m.length-y:n+m.length}function s(){var m={line:r,column:n};return function(S){return S.position=new o(m),c(),S}}function o(m){this.start=m,this.end={line:r,column:n},this.source=t.source}o.prototype.content=e;function a(m){var S=new Error(t.source+":"+r+":"+n+": "+m);if(S.reason=m,S.filename=t.source,S.line=r,S.column=n,S.source=e,!t.silent)throw S}function l(m){var S=m.exec(e);if(S){var y=S[0];return i(y),e=e.slice(y.length),S}}function c(){l(DN)}function d(m){var S;for(m=m||[];S=h();)S!==!1&&m.push(S);return m}function h(){var m=s();if(!(Gy!=e.charAt(0)||Xy!=e.charAt(1))){for(var S=2;Mi!=e.charAt(S)&&(Xy!=e.charAt(S)||Gy!=e.charAt(S+1));)++S;if(S+=2,Mi===e.charAt(S-1))return a("End of comment missing");var y=e.slice(2,S-2);return n+=2,i(y),e=e.slice(S),n+=2,m({type:HN,comment:y})}}function f(){var m=s(),S=l(BN);if(S){if(h(),!l(ON))return a("property missing ':'");var y=l($N),g=m({type:WN,property:Jy(S[0].replace(Yy,Mi)),value:y?Jy(y[0].replace(Yy,Mi)):Mi});return l(jN),g}}function v(){var m=[];d(m);for(var S;S=f();)S!==!1&&(m.push(S),d(m));return m}return c(),v()}function Jy(e){return e?e.replace(zN,Mi):Mi}var KN=UN,VN=Ac&&Ac.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tg,"__esModule",{value:!0});tg.default=YN;const qN=VN(KN);function YN(e,t){let r=null;if(!e||typeof e!="string")return r;const n=(0,qN.default)(e),i=typeof t=="function";return n.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?t(o,a,s):a&&(r=r||{},r[o]=a)}),r}var Wu={};Object.defineProperty(Wu,"__esModule",{value:!0});Wu.camelCase=void 0;var GN=/^--[a-zA-Z0-9_-]+$/,XN=/-([a-z])/g,JN=/^[^-]+$/,QN=/^-(webkit|moz|ms|o|khtml)-/,ZN=/^-(ms)-/,eD=function(e){return!e||JN.test(e)||GN.test(e)},tD=function(e,t){return t.toUpperCase()},Qy=function(e,t){return"".concat(t,"-")},rD=function(e,t){return t===void 0&&(t={}),eD(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(ZN,Qy):e=e.replace(QN,Qy),e.replace(XN,tD))};Wu.camelCase=rD;var nD=Ac&&Ac.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},iD=nD(tg),sD=Wu;function dm(e,t){var r={};return!e||typeof e!="string"||(0,iD.default)(e,function(n,i){n&&i&&(r[(0,sD.camelCase)(n,t)]=i)}),r}dm.default=dm;var oD=dm;const aD=km(oD),lD=cD("start");function cD(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function uD(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Zy(e.position):"start"in e||"end"in e?Zy(e):"line"in e||"column"in e?hm(e):""}function hm(e){return eS(e&&e.line)+":"+eS(e&&e.column)}function Zy(e){return hm(e&&e.start)+"-"+hm(e&&e.end)}function eS(e){return e&&typeof e=="number"?e:1}class ir extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",s={},o=!1;if(r&&("line"in r&&"column"in r?s={place:r}:"start"in r&&"end"in r?s={place:r}:"type"in r?s={ancestors:[r],place:r.position}:s={...r}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?s.ruleId=n:(s.source=n.slice(0,l),s.ruleId=n.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=uD(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ir.prototype.file="";ir.prototype.name="";ir.prototype.reason="";ir.prototype.message="";ir.prototype.stack="";ir.prototype.column=void 0;ir.prototype.line=void 0;ir.prototype.ancestors=void 0;ir.prototype.cause=void 0;ir.prototype.fatal=void 0;ir.prototype.place=void 0;ir.prototype.ruleId=void 0;ir.prototype.source=void 0;const rg={}.hasOwnProperty,dD=new Map,hD=/[A-Z]/g,fD=new Set(["table","tbody","thead","tfoot","tr"]),mD=new Set(["td","th"]),a1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=CD(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=bD(r,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?eg:LN,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=l1(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function l1(e,t,r){if(t.type==="element")return gD(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return vD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return yD(e,t,r);if(t.type==="mdxjsEsm")return _D(e,t);if(t.type==="root")return SD(e,t,r);if(t.type==="text")return wD(e,t)}function gD(e,t,r){const n=e.schema;let i=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=eg,e.schema=i),e.ancestors.push(t);const s=u1(e,t.tagName,!1),o=xD(e,t);let a=ig(e,t);return fD.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!bN(l):!0})),c1(e,o,s,t),ng(o,a),e.ancestors.pop(),e.schema=n,e.create(t,s,o,r)}function vD(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Va(e,t.position)}function _D(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Va(e,t.position)}function yD(e,t,r){const n=e.schema;let i=n;t.name==="svg"&&n.space==="html"&&(i=eg,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:u1(e,t.name,!0),o=kD(e,t),a=ig(e,t);return c1(e,o,s,t),ng(o,a),e.ancestors.pop(),e.schema=n,e.create(t,s,o,r)}function SD(e,t,r){const n={};return ng(n,ig(e,t)),e.create(t,e.Fragment,n,r)}function wD(e,t){return t.value}function c1(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function ng(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function bD(e,t,r){return n;function n(i,s,o,a){const c=Array.isArray(o.children)?r:t;return a?c(s,o,a):c(s,o)}}function CD(e,t){return r;function r(n,i,s,o){const a=Array.isArray(s.children),l=lD(n);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function xD(e,t){const r={};let n,i;for(i in t.properties)if(i!=="children"&&rg.call(t.properties,i)){const s=TD(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&mD.has(t.tagName)?n=a:r[o]=a}}if(n){const s=r.style||(r.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function kD(e,t){const r={};for(const n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){const s=n.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(r,e.evaluater.evaluateExpression(a.argument))}else Va(e,t.position);else{const i=n.name;let s;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){const a=n.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else Va(e,t.position);else s=n.value===null?!0:n.value;r[i]=s}return r}function ig(e,t){const r=[];let n=-1;const i=e.passKeys?new Map:dD;for(;++n<t.children.length;){const s=t.children[n];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=l1(e,s,o);a!==void 0&&r.push(a)}return r}function TD(e,t,r){const n=RN(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?vN(r):AN(r)),n.property==="style"){let i=typeof r=="object"?r:ED(e,String(r));return e.stylePropertyNameCase==="css"&&(i=ID(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&n.space?TN[n.property]||n.property:n.attribute,r]}}function ED(e,t){try{return aD(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const n=r,i=new ir("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=a1+"#cannot-parse-style-attribute",i}}function u1(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=Uy(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}n=o}else n=Uy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){const i=n.value;return rg.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(n);Va(e)}function Va(e,t){const r=new ir("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=a1+"#cannot-handle-mdx-estrees-without-createevaluater",r}function ID(e){const t={};let r;for(r in e)rg.call(e,r)&&(t[RD(r)]=e[r]);return t}function RD(e){let t=e.replace(hD,MD);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function MD(e){return"-"+e.toLowerCase()}const PD=800,LD=5,AD=2400,ND=24;function DD(e,t,r){if(!e)return"";let n=e;const i=n.split(/\r?\n/);return i.length>t&&(n=i.slice(0,t).join(`
|
|
142
|
-
`)),n.length>r&&(n=n.slice(0,r)),n.length<e.length&&(n=`${n.replace(/\s+$/,"")}
|
|
143
|
-
…`),n}function BD(e,t,r){if(!e)return"";const n=e.replace(/\r\n/g,`
|
|
144
|
-
`),i=n.split(`
|
|
145
|
-
`),s=i.length>t;let a=(s?i.slice(Math.max(0,i.length-t)):i).join(`
|
|
146
|
-
`);const l=a.length>r;return l&&(a=a.slice(Math.max(0,a.length-r))),(s||l||a.length<n.length)&&(a=`…
|
|
147
|
-
${a.replace(/^\s+/,"")}`),a}function OD(e){const t=e.split(/\r?\n/);for(let r=0;r<t.length;r+=1){const n=t[r]??"";if(n.trim())return{idx:r,line:n}}return null}function tS(e){const t=OD(e);if(!t)return!1;const r=e.split(/\r?\n/);for(let n=t.idx+1;n<r.length;n+=1)if((r[n]??"").trim())return!0;return!1}function $D(e){if(!e)return"思考摘要";let t=e.replace(/\r\n/g,`
|
|
148
|
-
`);return t=t.replace(/```+/g,"`"),t=t.replace(/\n+/g," ").replace(/\s+/g," ").trim(),t=t.replace(/^#{1,6}\s+/,""),t=t.replace(/^>\s+/,""),t=t.replace(/^[-*+]\s+/,""),t=t.replace(/^\d+\.\s+/,""),t.trim()||"思考摘要"}function jD(e,t,r){return Math.max(t,Math.min(r,e))}function rS(e){return jD(44+e*16,84,420)}function zD(e){var r;if(!e)return"";const t=[];t.push(e.title);for(const n of e.changes)t.push(`
|
|
149
|
-
--- ${n.path} (${n.kind||"change"})
|
|
150
|
-
`),n.diff&&t.push(`${n.diff.trimEnd()}
|
|
151
|
-
`);return(r=e.output)!=null&&r.trim()&&(t.push(`
|
|
152
|
-
# tool output
|
|
153
|
-
`),t.push(e.output.trimEnd()),t.push(`
|
|
154
|
-
`)),t.join("").trimEnd()}function d1(e){var i,s,o,a,l,c;const t=((s=(i=e.diff)==null?void 0:i.output)==null?void 0:s.length)??0,r=((a=(o=e.diff)==null?void 0:o.changes)==null?void 0:a.length)??0,n=((c=(l=e.diff)==null?void 0:l.title)==null?void 0:c.length)??0;return[e.text.length,e.streaming?1:0,e.render??"",n,r,t].join(":")}function FD(e){const t=e.trim();if(!t||t.toLowerCase()==="[object object]")return"变更";const r=t.toLowerCase();return r==="create"||r==="add"||r==="added"?"新增":r==="delete"||r==="remove"||r==="removed"?"删除":r==="rename"?"重命名":r==="update"||r==="edit"||r==="modified"?"修改":t}function HD(e){const t=e.diff.replace(/\r\n/g,`
|
|
155
|
-
`).split(`
|
|
156
|
-
`);return u.jsx("pre",{className:"diffCode",children:u.jsx("code",{children:t.map((r,n)=>{const i=r.startsWith("+")?"diffLine diffLineAdd":r.startsWith("-")?"diffLine diffLineDel":"diffLine";return u.jsxs("span",{className:i,children:[r,`
|
|
157
|
-
`]},n)})})})}function WD(e){return e.loadingDetails?"(正在加载 diff 内容…)":e.detailsError?"(加载失败,再次展开可重试)":e.needsDetails?"(点击展开时按需加载)":"(无 diff 内容)"}function sg(e){var h;const[t,r]=p.useState({}),n=e.diff.changes.map((f,v)=>`${f.kind}:${f.path}:${v}`),i=n.reduce((f,v)=>f+(t[v]?1:0),0),s=!!e.needsDetails,o=!!e.loadingDetails,a=String(e.detailsError??"").trim(),l=WD({needsDetails:s,loadingDetails:o,detailsError:a}),c=()=>{var f;s&&((f=e.onRequireDetails)==null||f.call(e))},d=f=>{f&&c();const v={};for(const m of n)v[m]=f;r(v)};return u.jsxs("div",{className:"diffBlock",children:[u.jsxs("div",{className:"diffHeader",children:[u.jsxs("div",{className:"diffTitle",children:[e.diff.title,e.streaming?u.jsx("span",{className:"diffStreaming",children:"(进行中)"}):null]}),u.jsxs("div",{className:"diffHeaderRight",children:[u.jsxs("span",{className:"diffMeta",children:[e.diff.changes.length," 个文件",i?` · 已展开 ${i}`:""]}),e.diff.changes.length>1?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"diffBtn",onClick:()=>d(!0),title:"展开全部",children:"展开全部"}),u.jsx("button",{type:"button",className:"diffBtn",onClick:()=>d(!1),title:"收起全部",children:"收起全部"})]}):null]})]}),u.jsx("div",{className:"diffFiles",children:e.diff.changes.map((f,v)=>{const m=`${f.kind}:${f.path}:${v}`,S=!!t[m],y=FD(f.kind),g=f.kind.trim().toLowerCase()||"change";return u.jsxs("details",{className:"diffFile",open:S,onToggle:_=>{const w=_.currentTarget;w.open&&c(),r(b=>({...b,[m]:w.open}))},children:[u.jsxs("summary",{className:"diffSummary",children:[u.jsx("span",{className:`diffKind diffKind-${g}`,children:y}),u.jsx("span",{className:"diffPath",children:f.path})]}),u.jsx("div",{className:"diffBody",children:f.diff?u.jsx(HD,{diff:f.diff}):u.jsx("pre",{className:"diffEmpty",children:l})})]},m)})}),(h=e.diff.output)!=null&&h.trim()?u.jsxs("details",{className:"diffOutput",children:[u.jsx("summary",{className:"diffSummary",children:"工具输出"}),u.jsx("pre",{className:"diffOutputText",children:e.diff.output.trimEnd()})]}):null]})}const UD="审核结论",KD="decision";function nS(e){return e.split("/").map(t=>t.trim()).filter(Boolean).map(t=>t.replace(/[✓✔]$/u,"").trim()).filter(Boolean).map(t=>({label:t,selected:!0}))}function VD(e){const t=String(e??"").trim();return t?t===UD?!0:t.toLowerCase()===KD:!1}function qD(e){const t=String(e??"").split(/\r?\n/).map(s=>s.trimEnd()).filter(s=>s.trim().length>0);if(!t.length)return{heading:"记录",lines:[]};const r=t[0].trim(),n=[];for(let s=1;s<t.length;s+=1){const o=t[s],a=/^选项:\s*(.+)$/u.exec(o.trim());if(a&&n.length){const f=n[n.length-1],v=a[1].split("/").map(m=>m.trim()).filter(Boolean).map(m=>{const S=/[✓✔]$/.test(m);return{label:m.replace(/[✓✔]$/u,"").trim(),selected:S}}).filter(m=>m.label.length>0);f.options=v;continue}const l=o.replace(/^[-•]\s*/,"").trim();if(!l)continue;const c=l.indexOf(":");if(c<=0){n.push({title:l,detail:"",options:[]});continue}const d=l.slice(0,c).trim(),h=l.slice(c+1).trim();n.push({title:d,detail:h,options:[]})}const i=r.trim();for(const s of n)if(!(s.options.length||!s.detail)){if(i==="选择题结果"){s.options=nS(s.detail),s.options.length&&(s.detail="");continue}i==="审核结果"&&VD(s.title)&&(s.options=nS(s.detail),s.options.length&&(s.detail=""))}return{heading:r,lines:n}}function iS(e){const t=qD(e.text);return t.lines.length?u.jsxs("div",{className:"approvalInline approvalInlineRecord","data-pending":"false",children:[u.jsx("div",{className:"approvalQuestions",children:t.lines.map((r,n)=>{const i=`${n}:${r.title}`;return u.jsxs("div",{className:"approvalQuestion",children:[u.jsx("div",{className:"approvalQuestionHeader",children:r.title}),r.detail?u.jsx("div",{className:"approvalQuestionText",children:r.detail}):null,r.options.length?u.jsx("div",{className:"approvalOptionList",role:"listbox","aria-label":r.title,children:r.options.map(s=>u.jsx("span",{className:s.selected?"approvalOption approvalOptionSelected":"approvalOption",children:u.jsx("span",{className:"approvalOptionLabel",children:s.selected?`${s.label} ✓`:s.label})},`${i}:${s.label}`))}):null]},i)})}),u.jsx("div",{className:"approvalDesc",children:t.heading})]}):u.jsx("pre",{className:"approvalPre",children:e.text})}function YD(e){const{t}=jt(),r=e.summary.stages,n=e.summary.statusLines;return u.jsxs("div",{className:"systemToolCallSummary","aria-label":"system tool call summary",children:[r.map((i,s)=>u.jsxs("section",{className:"systemToolCallStage",children:[u.jsxs("div",{className:"systemToolCallStageTitle",children:[u.jsx("span",{className:"systemToolCallStageDot","aria-hidden":"true",children:"•"}),u.jsx("span",{className:"systemToolCallStageText",children:i.title})]}),i.steps.length?u.jsx("ul",{className:"systemToolCallStepList",children:i.steps.map((o,a)=>u.jsxs("li",{className:"systemToolCallStepItem",children:[u.jsx("span",{className:"systemToolCallStepArrow","aria-hidden":"true",children:"↳"}),u.jsx("span",{className:"systemToolCallStepText",children:o})]},`stage-${s}-step-${a}-${o}`))}):null]},`stage-${s}-${i.title}`)),n.length?u.jsx("div",{className:"systemToolCallStatusList",children:n.map((i,s)=>u.jsx("div",{className:"systemToolCallStatusItem",children:i},`status-${s}-${i}`))}):null,e.streaming?u.jsx("div",{className:"systemToolCallStreaming",children:t("chat.systemToolCall.streaming")}):null]})}const GD=/^(\s*\[attachment\]\s+)(.+)$/i;function h1(e){const t=e.trim().replace(/[\\/]+$/g,"");if(!t)return"";const r=t.split(/[\\/]/).filter(Boolean);return r.length?r[r.length-1]??"":""}function XD(e){const t=h1(e);return t||"attachment"}function f1(e){const t=e.match(GD);if(!t)return null;const r=t[1]??"[attachment] ",n=String(t[2]??"").trim();if(!n)return null;const i=h1(n);if(!i)return null;const s=XD(n),o=`/api/uploads/${encodeURIComponent(i)}`;return{prefix:r,rawPath:n,filename:i,displayName:s,downloadUrl:o}}function og(e){return e.trim()?e.split(`
|
|
158
|
-
`).map(t=>{const r=f1(t);return r?`${r.prefix}${r.displayName}`:t}).join(`
|
|
159
|
-
`):e}const fm="codex:auth-expired";function JD(e={}){window.dispatchEvent(new CustomEvent(fm,{detail:e}))}function QD(e){const t=r=>{e(r.detail??{})};return window.addEventListener(fm,t),()=>window.removeEventListener(fm,t)}const ZD="http://localhost/";function eB(e){if(typeof e=="string")return e;if(e instanceof URL)return e.toString();const t=e==null?void 0:e.url;return typeof t=="string"?t:""}function tB(){var e;return typeof window<"u"&&typeof((e=window.location)==null?void 0:e.href)=="string"&&window.location.href.trim()?window.location.href:ZD}function rB(e){const t=String(e??"").trim();if(!t)return!1;try{return new URL(t,tB()).pathname.startsWith("/api/auth/")}catch{return t.startsWith("/api/auth/")}}function nB(e){return e===401||e===304}function iB(e){return nB(e.status)?!rB(e.rawUrl):!1}async function Ut(e,t){const r=await fetch(e,{credentials:"same-origin",...t??{}}),n=eB(e);return iB({status:r.status,rawUrl:n})&&JD({url:n}),r}function sB(e){const t=e??{},r=String(t.path??"").trim();if(!r)return null;const n=String(t.kind??"change").trim()||"change",i=typeof t.diff=="string"?t.diff:typeof t.patch=="string"?t.patch:typeof t.unifiedDiff=="string"?t.unifiedDiff:"";return{path:r,kind:n,diff:i}}function oB(e){if(!e||typeof e!="object")return null;const t=e,r=Array.isArray(t.changes)?t.changes:[],n=[];for(const a of r){const l=sB(a);l&&n.push(l)}const i=typeof t.output=="string"?t.output:void 0,s=!!(i!=null&&i.trim());return!n.length&&!s?null:{title:String(t.title??"").trim()||"文件变更",changes:n,output:s?i:void 0}}async function m1(e){const t=String(e.threadId??"").trim(),r=String(e.messageId??"").trim();if(!t||!r)throw new Error("invalid_request");const n=await Ut(`/api/history/threads/${encodeURIComponent(t)}/messages/${encodeURIComponent(r)}/diff`,{cache:"no-store"}),i=await n.json().catch(()=>({}));if(!n.ok||(i==null?void 0:i.ok)!==!0)throw new Error(String((i==null?void 0:i.details)??(i==null?void 0:i.error)??`HTTP ${n.status}`));const s=oB(i.diff);if(!s)throw new Error("diff_not_found");return s}function sS(e){const t=getComputedStyle(document.documentElement),r=e==="dark",n=t.getPropertyValue("--fg").trim()||(r?"#e8e8ea":"#0f1115"),i=t.getPropertyValue("--panel-2").trim()||(r?"#101019":"#f2f3f8");return{foreground:n,background:i,cursor:"transparent"}}function oS(e){const t=p.useRef(null),r=p.useRef(null),n=p.useRef(null),i=p.useRef("");return p.useEffect(()=>{const s=t.current;if(!s)return;const o=new aP,a=new gN({convertEol:!0,disableStdin:!0,cursorBlink:!1,cursorStyle:"block",scrollback:4e3,fontSize:12,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',theme:sS(e.theme)});a.loadAddon(o),a.open(s),r.current=a,n.current=o,requestAnimationFrame(()=>{try{o.fit()}catch{}});const l=new ResizeObserver(()=>{try{o.fit()}catch{}});return l.observe(s),i.current="",a.write(e.text),i.current=e.text,()=>{l.disconnect();try{a.dispose()}catch{}r.current=null,n.current=null,i.current=""}},[]),p.useEffect(()=>{const s=r.current,o=n.current;if(!s)return;const a=i.current;if(e.text.startsWith(a)){const l=e.text.slice(a.length);l&&s.write(l)}else s.reset(),s.write(e.text);i.current=e.text,o&&requestAnimationFrame(()=>{try{o.fit()}catch{}})},[e.text]),p.useEffect(()=>{const s=r.current;s&&(s.options.theme=sS(e.theme))},[e.theme]),u.jsx("div",{className:"terminalWrap",style:{height:`${e.height}px`},children:u.jsx("div",{className:"terminalHost",ref:t})})}function aS(e){const t=p.useMemo(()=>{try{return pD(e.ast,{Fragment:u.Fragment,jsx:u.jsx,jsxs:u.jsxs})}catch{return null}},[e.ast]);return u.jsx("div",{className:`md ${e.className??""}`.trim(),children:t})}function bs(e){const t=p.useMemo(()=>e.text.split(`
|
|
160
|
-
`),[e.text]),r=p.useMemo(()=>t.map(i=>{const s=f1(i);return{lineText:i,parsedAttachmentLine:s}}),[t]);return r.some(i=>!!i.parsedAttachmentLine)?u.jsx("div",{className:`msgText msgTextMixed ${e.className??""}`.trim(),children:r.map((i,s)=>{const o=`${s}:${i.lineText}`;if(!i.parsedAttachmentLine){const l=i.lineText.length===0;return u.jsx("span",{className:`msgTextMixedLine${l?" msgTextMixedLineEmpty":""}`,children:l?" ":i.lineText},o)}const a=i.parsedAttachmentLine;return u.jsxs("a",{className:"msgAttachmentChip",href:a.downloadUrl,target:"_blank",rel:"noreferrer",title:a.displayName,"aria-label":e.t("composer.attachment.download"),children:[u.jsx(Mp,{}),u.jsx("span",{className:"msgAttachmentChipName",children:a.displayName})]},o)})}):u.jsx("pre",{className:`msgText ${e.className??""}`.trim(),children:e.text})}function aB(e){const t=p.useRef(null),r=p.useRef(null),n=p.useRef(e.stateKey),i=p.useRef(null),s=p.useRef(null);return p.useLayoutEffect(()=>{var v,m;const o=t.current,a=r.current;if(!o||!a)return;const l=!!((m=(v=window.matchMedia)==null?void 0:v.call(window,"(prefers-reduced-motion: reduce)"))!=null&&m.matches),c=Math.max(0,Math.ceil(a.getBoundingClientRect().height)),d=i.current,h=n.current;if(n.current=e.stateKey,l||d===null||h===e.stateKey){o.style.height="auto",i.current=c;return}if(d===c){o.style.height="auto",i.current=c;return}s.current&&o.removeEventListener("transitionend",s.current),o.style.height=`${d}px`,o.getBoundingClientRect(),requestAnimationFrame(()=>{o.style.height=`${c}px`});const f=S=>{S.target===o&&S.propertyName==="height"&&(o.style.height="auto",o.removeEventListener("transitionend",f),s.current===f&&(s.current=null))};return s.current=f,o.addEventListener("transitionend",f),i.current=c,()=>{o.removeEventListener("transitionend",f),s.current===f&&(s.current=null)}},[e.stateKey]),p.useLayoutEffect(()=>{const o=r.current;o&&(i.current=Math.max(0,Math.ceil(o.getBoundingClientRect().height)))}),u.jsx("div",{ref:t,className:e.className,children:u.jsx("div",{ref:r,children:e.children})})}function lB(e,t){return e==="reasoning"?t("chat.role.reasoning"):e}function cB(e){var o,a,l;const t=((a=(o=e.stages[0])==null?void 0:o.title)==null?void 0:a.trim())||"工具调用",r=e.stages.reduce((c,d)=>c+d.steps.length,0),n=e.stages.length,i=r>0?`${r} 条操作`:`${n} 个阶段`,s=(l=e.statusLines[0])==null?void 0:l.trim();return s?`${t} · ${i} · ${s}`:`${t} · ${i}`}function uB(e){const t=e.changes.some(n=>!!String(n.diff??"").trim()),r=!!String(e.output??"").trim();return t||r}async function dB(e){try{return await navigator.clipboard.writeText(e),!0}catch{try{const r=document.createElement("textarea");r.value=e,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select();const n=document.execCommand("copy");return document.body.removeChild(r),n}catch{return!1}}}const p1=p.memo(function(t){const{t:r}=jt(),n=t.item,i=t.compact?" msg-compact":"",s=n.render==="terminal",o=n.render==="diff",a=n.render==="approval",[l,c]=p.useState(null),[d,h]=p.useState(!1),[f,v]=p.useState(""),m=p.useRef(0),S=p.useMemo(()=>typeof t.threadId=="string"?t.threadId.trim():"",[t.threadId]),y=l??n.diff,g=!!(o&&y&&!uB(y)),_=n.plainText??n.text,w=p.useMemo(()=>o?zD(y):_,[o,y,_]),b=n.metrics??(o?{lines:0,chars:0}:{lines:0,chars:_.length}),C=n.role==="reasoning",M=n.role==="assistant",x=n.role==="system",T=!!(x&&s),k=!!(x&&!s&&!o),I=k?n.systemToolCallSummary??null:null,L=!!I,R=n.role==="user"?n.deliveryStatus??"sent":null,A=R==="failed"?String(n.deliveryError??"").trim():"",O=R==="pending"?r("chat.delivery.pending"):R==="failed"?A?r("chat.delivery.failedWithReason",{reason:A}):r("chat.delivery.failed"):R==="sent"?r("chat.delivery.sent"):"",P=R==="pending"?"msgDelivery msgDeliveryPending":R==="failed"?"msgDelivery msgDeliveryFailed":R==="sent"?"msgDelivery msgDeliverySent":"";C&&tS(n.text);const E=k?tS(n.text):!1,F=!!(C&&_.trim()),N=C?AD:PD,V=C?ND:LD,D=b.chars>N||b.lines>V,W=t.fold,j=o||a?!1:C?F:T?!!_.trim():k?!!(E||D):!!D,ee=!!((C||x)&&!o&&n.streaming&&W!=="collapsed"),te=o||a?!1:M?!!(j&&W==="collapsed"):!!(j&&W!=="expanded"&&!ee),ae=o||a?!1:C?F:T?!!_.trim():k?!!(E||D):!!D,H=!te&&!s&&!o&&!a&&!L&&!!n.markdownAst,se=te?L&&I?cB(I):C||k?$D(_):s?BD(_,V,N):DD(_,V,N):_,B=p.useCallback(()=>{t.onSetFold(n.id,te?"expanded":"collapsed")},[t.onSetFold,n.id,te]),z=p.useCallback(()=>{(async()=>await dB(w)&&t.onCopied(n.id))()},[w,t.onCopied,n.id]),Y=te?r("chat.fold.expandTitle",{lines:b.lines,chars:b.chars}):r("chat.fold.collapseTitle"),Z=n.streaming?"streaming":t.lifecycleCompleted?"completed":"idle";p.useEffect(()=>{m.current+=1,c(null),h(!1),v("")},[n.id]);const ce=p.useCallback(()=>{if(!g||!S||!n.id||d)return;const ge=m.current+1;m.current=ge,h(!0),v(""),m1({threadId:S,messageId:n.id}).then(Re=>{m.current===ge&&c(Re)}).catch(Re=>{if(m.current!==ge)return;const Oe=String((Re==null?void 0:Re.message)??Re??"").trim()||"load_failed";v(Oe)}).finally(()=>{m.current===ge&&h(!1)})},[d,n.id,S,g]),re=o&&y?u.jsx(sg,{diff:y,streaming:n.streaming,needsDetails:g,loadingDetails:d,detailsError:f,onRequireDetails:ce}):null;return u.jsxs("div",{className:`msg msg-${n.role}${i}`,"data-lifecycle":Z,children:[u.jsxs("div",{className:"msgMeta",children:[u.jsx("span",{className:"msgRole",children:lB(n.role,r)}),u.jsxs("div",{className:"msgMetaRight",children:[u.jsx("span",{className:"msgTime",children:new Date(n.ts).toLocaleTimeString()}),ae?u.jsx("button",{type:"button",className:"foldBtn foldBtnInline",onClick:B,"aria-expanded":!te,"aria-label":r(te?"chat.fold.expand":"chat.fold.collapse"),title:Y,children:r(te?"chat.fold.expand":"chat.fold.collapse")}):null,u.jsx("button",{type:"button",className:"msgCopyBtn",onClick:z,"aria-label":t.copied?r("common.copied"):r("chat.copyMessage"),title:t.copied?r("common.copied"):r("common.copy"),children:t.copied?u.jsx(aR,{}):u.jsx(oR,{})})]})]}),u.jsxs("div",{className:R?"msgBody msgBodyWithDelivery":"msgBody",children:[C||x&&!o?u.jsx(aB,{stateKey:te?"collapsed":"expanded",className:"reasoningCollapseAnim",children:te?u.jsx(bs,{text:se,t:r,className:L||C||k?"msgTextOneLine":void 0}):s?u.jsx(oS,{text:n.text,theme:t.theme,height:rS(b.lines)}):re||(a?u.jsx(iS,{text:n.text}):L&&I?u.jsx(YD,{summary:I,streaming:!!n.streaming}):H?n.markdownAst?u.jsx(aS,{ast:n.markdownAst}):u.jsx(bs,{text:se,t:r}):u.jsx(bs,{text:se,t:r}))}):te?u.jsx(bs,{text:se,t:r}):s?u.jsx(oS,{text:n.text,theme:t.theme,height:rS(b.lines)}):re||(a?u.jsx(iS,{text:n.text}):H?n.markdownAst?u.jsx(aS,{ast:n.markdownAst}):u.jsx(bs,{text:se,t:r}):u.jsx(bs,{text:se,t:r})),t.proposedPlanAction?u.jsxs("div",{className:"msgPlanConfirm",role:"group","aria-label":"proposed plan actions",children:[u.jsx("button",{type:"button",className:"mainActionBtn",onClick:t.proposedPlanAction.onDismiss,title:r("chat.plan.skipTitle"),children:r("chat.plan.skip")}),u.jsx("button",{type:"button",className:"mainActionBtn msgPlanConfirmPrimary",onClick:t.proposedPlanAction.onExecute,disabled:t.proposedPlanAction.executeDisabled,title:t.proposedPlanAction.executeDisabled?r("chat.plan.executeDisabledTitle"):r("chat.plan.executeTitle"),children:r("chat.plan.execute")})]}):null,R?u.jsx("span",{className:P,children:O}):null]})]})}),ag="item/tool/requestUserInput",hB="item/commandExecution/requestApproval",fB="item/fileChange/requestApproval",mB="applyPatchApproval",pB="execCommandApproval",gB=new Set([ag,hB,fB,mB,pB]);function Uu(e){return String(e??"").trim()}function g1(e){const t=Uu(e.method),r=String(e.threadId??"").trim()||"__global__";return t===ag?`user_input:${r}`:`${String(e.requestId)}:${t}`}function v1(e){return Uu(e)===ag}function vB(e){return!gB.has(Uu(e))}function _B(e){return v1(e)?xe("pending.method.choice"):Uu(e)||xe("common.unknown")}function so(e){return String(e??"").replace(/\s+/g," ").trim()}function oo(e){let t=so(e);return t=t.replace(/\s*\((?:recommended|推荐)\)\s*$/i,"").trim(),t=t.replace(/\s*((?:recommended|推荐))\s*$/i,"").trim(),t}function lg(e){const t=e,r=so((t==null?void 0:t.header)??""),n=so((t==null?void 0:t.question)??""),i=!!(t!=null&&t.isOther),s=!!(t!=null&&t.isSecret),a=(Array.isArray(t==null?void 0:t.options)?t.options:[]).map(l=>oo((l==null?void 0:l.label)??"")).filter(Boolean).sort().join(",");return`${r}|${n}|${i?1:0}|${s?1:0}|${a}`}function _1(e){const t=e,r=so((t==null?void 0:t.header)??""),n=!!(t!=null&&t.isOther),i=!!(t!=null&&t.isSecret),o=(Array.isArray(t==null?void 0:t.options)?t.options:[]).map(a=>oo((a==null?void 0:a.label)??"")).filter(Boolean).sort().join(",");return`${r}|${n?1:0}|${i?1:0}|${o}`}function yB(e){return(Array.isArray(e)?e:[]).map(r=>lg(r)).sort().join(`
|
|
161
|
-
`)}function lS(e,t){const r=oo(t);if(!r)return null;const n=Array.isArray(e)?e:[];for(const i of n){const s=String((i==null?void 0:i.label)??"");if(s&&oo(s)===r)return s}return null}function cS(e,t,r){const n=Array.isArray(t)?t:[],i={};for(const a of n){const l=a,c=String((l==null?void 0:l.id)??"").trim();if(!c||l!=null&&l.isSecret)continue;const d=lg(l),h=_1(l),f=r[`s:${d}`]??r[`l:${h}`],v=Array.isArray(l==null?void 0:l.options)?l.options:[],m=!!(l!=null&&l.isOther)||!v.length,S=v.length?lS(v,e[c]):null;if(S){i[c]=S;continue}const y=v.length?lS(v,f):null;if(y){i[c]=y;continue}if(!m)continue;const g=so(e[c])?String(e[c]):so(f)?String(f):"";g&&(i[c]=g)}const s=Object.keys(e),o=Object.keys(i);if(s.length!==o.length)return i;for(const a of o)if(e[a]!==i[a])return i;return e}function SB(e){var A,O;const{t}=jt(),{pending:r}=e,n=r.method==="item/tool/requestUserInput",i=r.method==="applyPatchApproval"||r.method==="execCommandApproval",s=r.method==="item/commandExecution/requestApproval",o=r.method==="item/fileChange/requestApproval",a=((A=r.params)==null?void 0:A.questions)??[],l=e.draftStoreRef.current[e.draftKey],[c,d]=p.useState(()=>(l==null?void 0:l.answers)??{}),[h,f]=p.useState(0),v=p.useRef((l==null?void 0:l.remembered)??{}),m=p.useMemo(()=>yB(a),[a]),S=n?`user_input:${m}`:`${r.requestId}:${r.method}`;p.useEffect(()=>{d(P=>n?cS(P,a,v.current):{}),f(0)},[S]),p.useEffect(()=>{n&&(e.draftStoreRef.current[e.draftKey]={answers:c,remembered:{...v.current}})},[c,n,e.draftKey,e.draftStoreRef]);const y=p.useMemo(()=>n?cS(c,a,v.current):c,[c,n,a]),g=P=>{var F;const E={};for(const N of a){const V=(F=P[N.id])==null?void 0:F.trim();V&&(E[N.id]=[V])}return E},_=P=>{e.onSubmit({answers:g(P)})},w=()=>_(y),b=P=>{e.onSubmit({decision:P})},C=P=>{e.onSubmit({decision:P})},M=()=>{var F;const P=((F=r.params)==null?void 0:F.proposedExecpolicyAmendment)??null,E=Array.isArray(P)?P.map(String):null;if(!(E!=null&&E.length)){e.onSubmit({decision:"accept"});return}e.onSubmit({decision:{acceptWithExecpolicyAmendment:{execpolicy_amendment:E}}})},x=p.useMemo(()=>{try{return JSON.stringify(r.params,null,2)}catch{return String(r.params??"")}},[r.params]),T=[];if(!n)if(i)T.push({key:"approved",label:t("approval.choice.approve"),description:t("approval.choice.approveDesc"),onPick:()=>b("approved")},{key:"approved_for_session",label:t("approval.choice.approveSession"),description:t("approval.choice.approveSessionDesc"),onPick:()=>b("approved_for_session")},{key:"denied",label:t("approval.choice.deny"),description:t("approval.choice.denyDesc"),danger:!0,onPick:()=>b("denied")},{key:"abort",label:t("approval.choice.abort"),description:t("approval.choice.abortDesc"),danger:!0,onPick:()=>b("abort")});else if(s){const P=Array.isArray((O=r.params)==null?void 0:O.proposedExecpolicyAmendment)&&r.params.proposedExecpolicyAmendment.length>0;T.push({key:"accept",label:t("approval.choice.accept"),description:t("approval.choice.acceptCommandDesc"),onPick:()=>C("accept")},{key:"acceptForSession",label:t("approval.choice.acceptSession"),description:t("approval.choice.acceptSessionCommandDesc"),onPick:()=>C("acceptForSession")}),P&&T.push({key:"acceptWithRule",label:t("approval.choice.acceptWithRule"),description:t("approval.choice.acceptWithRuleDesc"),onPick:M}),T.push({key:"decline",label:t("approval.choice.decline"),description:t("approval.choice.declineCommandDesc"),danger:!0,onPick:()=>C("decline")},{key:"cancel",label:t("approval.choice.cancel"),description:t("approval.choice.cancelDesc"),danger:!0,onPick:()=>C("cancel")})}else o?T.push({key:"accept",label:t("approval.choice.accept"),description:t("approval.choice.acceptFileDesc"),onPick:()=>C("accept")},{key:"acceptForSession",label:t("approval.choice.acceptSession"),description:t("approval.choice.acceptSessionFileDesc"),onPick:()=>C("acceptForSession")},{key:"decline",label:t("approval.choice.decline"),description:t("approval.choice.declineFileDesc"),danger:!0,onPick:()=>C("decline")},{key:"cancel",label:t("approval.choice.cancel"),description:t("approval.choice.cancelDesc"),danger:!0,onPick:()=>C("cancel")}):T.push({key:"accept",label:t("approval.choice.accept"),description:t("approval.choice.acceptContinueDesc"),onPick:()=>C("accept")},{key:"decline",label:t("approval.choice.decline"),description:t("approval.choice.declineContinueDesc"),danger:!0,onPick:()=>C("decline")});const k=T.length?T[Math.max(0,Math.min(h,T.length-1))]:null,I=()=>f(P=>T.length?(P+1)%T.length:0),L=s,R=_B(r.method);return u.jsxs("div",{className:"msg msg-system approvalInline","data-pending":"true",children:[u.jsxs("div",{className:"msgMeta",children:[u.jsx("span",{className:"msgRole",children:t(n?"approval.role.needInput":"approval.role.needApproval")}),u.jsxs("div",{className:"msgMetaRight",children:[u.jsx("span",{className:"approvalMethod",title:r.method,children:R}),u.jsx("button",{type:"button",className:"approvalCancel",onClick:e.onCancel,title:t("approval.cancel"),children:t("approval.cancel")})]})]}),u.jsx("div",{className:"msgBody",children:n?u.jsxs("div",{className:"approvalQuestions",children:[a.map(P=>{const E=lg(P),F=_1(P),N=P.options??[],V=y[P.id]??"";return u.jsxs("div",{className:"approvalQuestion",children:[u.jsx("div",{className:"approvalQuestionHeader",children:P.header}),u.jsx("div",{className:"approvalQuestionText",children:P.question}),N.length?u.jsx("div",{className:"approvalOptionList",role:"listbox","aria-label":P.header||P.id,children:N.map(D=>{const W=oo(V)===oo(D.label);return u.jsxs("button",{type:"button",className:W?"approvalOption approvalOptionSelected":"approvalOption",onClick:()=>{P.isSecret||(v.current[`s:${E}`]=D.label,v.current[`l:${F}`]=D.label),d(j=>({...j,[P.id]:D.label}))},"aria-selected":W,title:D.description||D.label,children:[u.jsx("span",{className:"approvalOptionLabel",children:D.label}),D.description?u.jsx("span",{className:"approvalOptionDesc",children:D.description}):null]},D.label)})}):null,P.isOther||!N.length?u.jsx("input",{className:"otherInput",type:P.isSecret?"password":"text",placeholder:t("approval.input.other"),value:y[P.id]??"",onChange:D=>{const W=D.target.value;P.isSecret||(v.current[`s:${E}`]=W,v.current[`l:${F}`]=W),d(j=>({...j,[P.id]:W}))}}):null]},P.id)}),u.jsx("div",{className:"approvalActions",children:u.jsx("button",{type:"button",className:"approvalPrimary",onClick:w,disabled:a.every(P=>!(y[P.id]??"").trim()),title:t("approval.submitAnswersTitle"),children:t("approval.submitAnswers")})})]}):k?u.jsxs("div",{className:"approvalDecision",children:[L?u.jsx("div",{className:"approvalDecisionList",role:"group","aria-label":t("approval.options"),children:T.map(P=>u.jsxs("button",{type:"button",className:P.danger?"approvalDecisionOption approvalPrimaryDanger":"approvalDecisionOption",onClick:P.onPick,title:P.description||P.label,children:[u.jsx("span",{className:"approvalOptionLabel",children:P.label}),P.description?u.jsx("span",{className:"approvalOptionDesc",children:P.description}):null]},P.key))}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"approvalChoiceRow",children:[u.jsx("button",{type:"button",className:k.danger?"approvalPrimary approvalPrimaryDanger":"approvalPrimary",onClick:k.onPick,title:k.label,children:k.label}),T.length>1?u.jsx("button",{type:"button",className:"approvalNext",onClick:I,title:t("approval.nextOptionTitle"),children:t("approval.nextOption",{index:Math.min(h+1,T.length),total:T.length})}):null]}),k.description?u.jsx("div",{className:"approvalDesc",children:k.description}):null]}),u.jsxs("details",{className:"approvalDetails",children:[u.jsx("summary",{children:t("approval.details")}),o?(()=>{const P=r.params,E=Array.isArray(r.fileChanges)?r.fileChanges:[];if(E.length){const F=t("approval.pendingFileChanges");return u.jsx(sg,{diff:{title:F,changes:E,output:typeof(P==null?void 0:P.details)=="string"?P.details:void 0}})}return u.jsx("pre",{className:"approvalPre",children:x})})():u.jsx("pre",{className:"approvalPre",children:x})]})]}):u.jsx("pre",{className:"approvalPre",children:x})})]})}function wB(e){return u.jsx(SB,{pending:e.pending,draftKey:e.draftKey,draftStoreRef:e.draftStoreRef,onCancel:e.onCancel,onSubmit:e.onSubmit})}function bB(e){const t=p.useRef(null),r=p.useRef(!0),n=p.useRef(!0),i=p.useCallback(()=>{const o=t.current;o&&(o.scrollTop=o.scrollHeight)},[]),s=p.useCallback(()=>{const o=t.current;if(!o)return;const a=o.scrollHeight-o.scrollTop-o.clientHeight;r.current=a<=24},[]);return p.useLayoutEffect(()=>{if(e.collapsed){n.current=!0;return}if(n.current){n.current=!1,r.current=!0,i();return}r.current&&i()},[e.collapsed,e.contentKey,i]),{bodyRef:t,onBodyScroll:s}}const CB=p.memo(function(t){const{t:r}=jt(),n=t.row;if(!n.items.length)return null;const i=n.items.some(v=>v.render==="approval"),s=t.turnFold?t.turnFold==="collapsed":i?!1:n.autoCollapsed,o=()=>t.onSetTurnFold(n.key,s?"expanded":"collapsed"),a=n.items.length?n.items[n.items.length-1]:null,l=a?`${a.id}:${d1(a)}`:"",{bodyRef:c,onBodyScroll:d}=bB({collapsed:s,contentKey:l}),h=[];n.systemCount&&h.push(r("chat.attachments.summary.system",{count:n.systemCount})),n.reasoningCount&&h.push(r("chat.attachments.summary.reasoning",{count:n.reasoningCount}));const f=h.join(" · ")||r("chat.attachments.summary.default");return u.jsxs("div",{className:"turnAttachments","aria-label":r("chat.attachments.aria"),children:[u.jsxs("div",{className:"turnAttachmentsHeader",children:[u.jsx("span",{className:"turnAttachmentsSummary",children:f}),u.jsx("button",{type:"button",className:"foldBtn foldBtnInline",onClick:o,"aria-expanded":!s,"aria-label":r(s?"common.expand":"common.collapse"),title:r(s?"common.expand":"common.collapse"),children:r(s?"common.expand":"common.collapse")})]}),s?null:u.jsx("div",{ref:c,className:"turnAttachmentsBody",onScroll:d,children:n.items.map(v=>u.jsx(p1,{item:v,threadId:t.threadId,theme:t.theme,fold:t.foldById[v.id],onSetFold:t.onSetFold,copied:t.copiedId===v.id,onCopied:t.onCopied,lifecycleCompleted:t.completedMessageIds.has(v.id),proposedPlanAction:null,compact:v.role==="reasoning"},v.id))})]})}),Wo=1e6,xB=14;function ch(e){return e.kind==="msg"?e.msg.id:e.kind==="pending"?`pending:${e.key}`:`att:${e.key}:${e.userMsgId}`}function kB(e,t){for(let r=0;r<e.length;r+=1){const n=e[r];if(n.kind==="pending"&&n.key===t)return r}return-1}function TB(e){return e.role==="user"||e.role==="assistant"||e.render==="approval"}const EB=p.forwardRef(function(t,r){const{style:n,...i}=t,s=t.className;return u.jsx("div",{...i,ref:r,style:{...n,overflowX:"hidden"},className:`${s??""} chat`.trim()})}),IB=p.forwardRef(function(t,r){const{style:n,children:i,...s}=t,o=t.className;return u.jsx("div",{...s,ref:r,style:n,className:`${o??""} chatList`.trim(),children:i})}),RB=p.forwardRef(function(t,r){const{children:n,style:i,item:s,...o}=t,a=s.kind==="attachments"&&s.items.length===0?0:xB;return u.jsx("div",{...o,ref:r,style:{...i,paddingBottom:a},children:n})});function MB(e){const r=p.useRef(null),[n,i]=p.useState(!1),s=p.useRef(null),[o,a]=p.useState(null),[l,c]=p.useState({}),[d,h]=p.useState({}),[f,v]=p.useState(null),m=p.useRef(null),[S,y]=p.useState(!0),[g,_]=p.useState(!0),[w,b]=p.useState(0),C=p.useRef(null),M=p.useRef(null),x=p.useRef(null),T=p.useRef(0),[k,I]=p.useState(null),L=p.useRef(null),[R,A]=p.useState(Wo),O=!!(e.pendingRequest&&e.pendingDraftStoreRef&&e.onCancelPendingRequest&&e.onSubmitPendingRequest),P=GM({items:e.items,onItemCompleted:e.onMessageLifecycleComplete}),E=p.useCallback(B=>{var z;x.current!==null&&(window.cancelAnimationFrame(x.current),x.current=null),(z=s.current)==null||z.scrollToIndex({index:"LAST",align:"end",behavior:B}),x.current=window.requestAnimationFrame(()=>{var Y;(Y=s.current)==null||Y.scrollToIndex({index:"LAST",align:"end",behavior:"auto"}),x.current=null}),b(0),I(null)},[]);p.useLayoutEffect(()=>{const B=r.current;if(!B)return;const z=()=>{const Z=B.getBoundingClientRect();Z.width>0&&Z.height>0&&i(!0)};z();const Y=new ResizeObserver(z);return Y.observe(B),()=>Y.disconnect()},[]);const F=p.useCallback(B=>{const z=B&&B!==window&&B instanceof HTMLElement?B:null;a(Y=>Y===z?Y:z)},[]);p.useEffect(()=>{if(!o)return;T.current=o.scrollTop;const B=()=>{const z=o.scrollTop,Y=z-T.current;if(T.current=z,o.scrollHeight-z-o.clientHeight<=80){I(null);return}Y<0?I("top"):Y>0&&I("bottom")};return o.addEventListener("scroll",B,{passive:!0}),()=>o.removeEventListener("scroll",B)},[80,o]);const N=p.useMemo(()=>{var Me,wt;const B=[];if(!e.compactView){const ue=e.items.map(ze=>({kind:"msg",msg:ze}));if(O&&e.pendingRequest){const ze=((Me=e.pendingRequestKey)==null?void 0:Me.trim())||`${e.pendingRequest.requestId}:${e.pendingRequest.method}`;ue.push({kind:"pending",key:ze,pending:e.pendingRequest})}return ue}const z={},Y={},Z=new Map,ce=new Map;let re=null;const ge=(ue,ze)=>{(z[ue]||(z[ue]=[])).push(ze)},Re=ue=>{re&&(Y[re]=!0);const ze=`msg:${ue.id}`;re=ze,Y[ze]=!1;const st=G_(ue.id);if(st){Z.set(st,ze);const bt=ce.get(st);if(bt!=null&&bt.length){for(const Lt of bt)ge(ze,Lt);ce.delete(st)}}B.push({kind:"msg",msg:ue}),B.push({kind:"attachments",key:ze,userMsgId:ue.id,items:[],systemCount:0,reasoningCount:0,hasStreaming:!1,autoCollapsed:Y[ze]??!1})};for(const ue of e.items){if(TB(ue)){Re(ue);continue}if(ue.role==="system"||ue.role==="reasoning"){const st=G_(ue.id);if(st){const bt=Z.get(st);if(bt){ge(bt,ue);continue}const Lt=ce.get(st);Lt?Lt.push(ue):ce.set(st,[ue]);continue}if(re){ge(re,ue);continue}B.push({kind:"msg",msg:ue});continue}B.push({kind:"msg",msg:ue})}for(const ue of ce.values())for(const ze of ue)B.push({kind:"msg",msg:ze});const we=B.map(ue=>{if(ue.kind!=="attachments")return ue;const ze=z[ue.key]??[];let st=0,bt=0,Lt=!1;for(const Yt of ze)Yt.role==="system"?st+=1:Yt.role==="reasoning"&&(bt+=1),Yt.streaming&&(Lt=!0);return{...ue,items:ze,systemCount:st,reasoningCount:bt,hasStreaming:Lt,autoCollapsed:Y[ue.key]??!1}}).filter(ue=>ue.kind!=="attachments"||ue.items.length>0);if(O&&e.pendingRequest){const ue=((wt=e.pendingRequestKey)==null?void 0:wt.trim())||`${e.pendingRequest.requestId}:${e.pendingRequest.method}`;we.push({kind:"pending",key:ue,pending:e.pendingRequest})}return we},[O,e.compactView,e.items,e.pendingRequest,e.pendingRequestKey]);p.useLayoutEffect(()=>{const B=L.current,z=N[0]?ch(N[0]):null;if(!z){L.current=null;return}if(!B){L.current=z,A(Z=>Z===Wo?Z:Wo);return}if(B===z)return;const Y=N.findIndex(Z=>ch(Z)===B);if(L.current=z,Y>0){A(Z=>Math.max(0,Z-Y));return}A(Z=>Z===Wo?Z:Wo)},[N]),p.useEffect(()=>()=>{m.current!==null&&window.clearTimeout(m.current),x.current!==null&&window.cancelAnimationFrame(x.current)},[]),p.useEffect(()=>{S&&b(0)},[S]),p.useEffect(()=>{const B=e.items.length?e.items[e.items.length-1]:null;B&&C.current!==B.id&&(C.current=B.id,!S&&XM(B.role)&&b(z=>z+1))},[S,e.items]),p.useEffect(()=>{b(0),C.current=null,M.current=null,I(null)},[e.threadId]);const V=p.useMemo(()=>String(e.jumpToPendingKey??"").trim(),[e.jumpToPendingKey]),D=p.useRef(null);p.useEffect(()=>{var Y;if(!V){D.current=null;return}if(!n||D.current===V)return;const B=kB(N,V);if(B<0)return;const z=s.current;z&&(D.current=V,z.scrollToIndex({index:B,align:"center",behavior:"smooth"}),(Y=e.onJumpedToPending)==null||Y.call(e))},[n,V,e.onJumpedToPending,N]),p.useEffect(()=>{const B=e.items.length?e.items[e.items.length-1]:null,z=M.current,Y=B?{id:B.id,role:B.role,streaming:!!B.streaming}:null;Y&&(JM({previousLastMessageId:(z==null?void 0:z.id)??null,nextLastMessageId:Y.id,nextLastMessageRole:Y.role})?E("smooth"):QM({previousLastMessageId:(z==null?void 0:z.id)??null,nextLastMessageId:Y.id,nextLastMessageRole:Y.role,nextLastMessageStreaming:Y.streaming})&&E("auto")),M.current=Y},[e.items,E]);const W=p.useMemo(()=>{for(let B=e.items.length-1;B>=0;B-=1){const z=e.items[B];if(z!=null&&z.streaming)return`${z.id}:${d1(z)}`}return""},[e.items]),j=p.useMemo(()=>e.items.some(B=>!!B.streaming),[e.items]);p.useEffect(()=>{ZM({hasStreamingMessage:j,streamingTailKey:W})&&E("auto")},[j,E,W]),p.useEffect(()=>{eP({lastCompletedMessageId:P.lastCompletedMessageId})&&E("auto")},[P.lastCompletedMessageId,E]),p.useEffect(()=>{e.pendingRequest&&E("auto")},[e.pendingRequest,e.pendingRequestKey,E]);const ee=p.useCallback(()=>{var B;I("bottom"),(B=s.current)==null||B.scrollToIndex({index:0,align:"start",behavior:"smooth"})},[]),te=p.useCallback(()=>{var B;b(0),I(null),(B=s.current)==null||B.scrollToIndex({index:"LAST",align:"end",behavior:"smooth"})},[]);p.useEffect(()=>{c(B=>{const z=new Set(e.items.map(ce=>ce.id));let Y=!1;const Z={};for(const[ce,re]of Object.entries(B))z.has(ce)?Z[ce]=re:Y=!0;return Y?Z:B})},[e.items]),p.useEffect(()=>{h(B=>{const z=new Set(N.filter(ce=>ce.kind==="attachments").map(ce=>ce.key));let Y=!1;const Z={};for(const[ce,re]of Object.entries(B))z.has(ce)?Z[ce]=re:Y=!0;return Y?Z:B})},[N]);const ae=p.useCallback((B,z)=>{c(Y=>({...Y,[B]:z})),Y_({nextFoldState:z})&&E("smooth")},[E]),H=p.useCallback((B,z)=>{h(Y=>({...Y,[B]:z})),Y_({nextFoldState:z})&&E("smooth")},[E]),se=p.useCallback(B=>{v(B),m.current!==null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>v(z=>z===B?null:z),900)},[]);return u.jsxs("div",{className:"chatFrame",ref:r,children:[n?u.jsx(LM,{ref:s,scrollerRef:F,style:{flex:"1 1 auto",minHeight:0},data:N,firstItemIndex:R,atBottomThreshold:80,atBottomStateChange:y,atTopStateChange:_,computeItemKey:(B,z)=>ch(z),components:{Scroller:EB,List:IB,Item:RB,Header:()=>e.canLoadEarlier?u.jsx("div",{className:"chatLoadRow",children:u.jsx("button",{type:"button",className:"foldBtn",onClick:e.onLoadEarlier,disabled:!e.onLoadEarlier||e.loadingEarlier,title:e.loadingEarlier?"加载中…":"加载更早消息",children:e.loadingEarlier?"加载中…":"加载更早消息"})}):null},itemContent:(B,z)=>z.kind==="msg"?u.jsx(p1,{item:z.msg,threadId:e.threadId,theme:e.theme,fold:l[z.msg.id],onSetFold:ae,copied:f===z.msg.id,onCopied:se,lifecycleCompleted:P.isMessageCompleted(z.msg.id),proposedPlanAction:e.proposedPlanAction&&e.proposedPlanAction.messageId===z.msg.id?{executeDisabled:e.proposedPlanAction.executeDisabled,onExecute:e.proposedPlanAction.onExecute,onDismiss:e.proposedPlanAction.onDismiss}:null}):z.kind==="attachments"?u.jsx(CB,{row:z,threadId:e.threadId,theme:e.theme,foldById:l,onSetFold:ae,turnFold:d[z.key],onSetTurnFold:H,copiedId:f,onCopied:se,completedMessageIds:P.completedMessageIds}):O&&e.pendingDraftStoreRef&&e.onCancelPendingRequest&&e.onSubmitPendingRequest?u.jsx(wB,{pending:z.pending,draftKey:z.pending.threadId?z.pending.threadId:"__global__",draftStoreRef:e.pendingDraftStoreRef,onCancel:e.onCancelPendingRequest,onSubmit:e.onSubmitPendingRequest}):null}):u.jsx("div",{style:{flex:"1 1 auto",minHeight:1}}),S?null:u.jsx("div",{className:"chatJump","aria-label":"jump controls",children:k==="top"&&!g?u.jsx("button",{type:"button",className:"chatJumpBtn",onClick:ee,"aria-label":"回到顶部",title:"回到顶部",children:u.jsx(rR,{})}):u.jsx("button",{type:"button",className:"chatJumpBtn",onClick:te,"aria-label":"回到底部",title:"回到底部",children:u.jsx(nR,{})})})]})}function PB(e){var a;const{t}=jt(),r=p.useMemo(()=>e.notice.type==="session_completed"?t("notice.sessionCompleted"):e.notice.kind==="choice"?t("notice.choiceRequired"):t("notice.approvalRequired"),[e.notice,t]),n=e.notice.type==="session_completed"?t("notice.openThread"):t("notice.jump"),i=e.notice.type==="session_completed"?t("notice.openThread"):t("notice.jumpTitle"),s=(a=e.threadTitle)!=null&&a.trim()?String(e.threadTitle).trim():null,o=e.showThreadTitle&&!!s;return u.jsxs("div",{className:"noticeBanner",role:"status","aria-live":"polite",title:e.notice.threadId,children:[u.jsxs("span",{className:"noticeBannerText",children:[r,o?u.jsxs("span",{className:"noticeBannerThread",children:[" · ",s]}):null]}),u.jsxs("div",{className:"noticeBannerActions",children:[u.jsx("button",{type:"button",className:"noticeBannerBtn",onClick:e.onJump,title:i,"aria-label":i,children:n}),u.jsx("button",{type:"button",className:"noticeBannerBtn noticeBannerBtnSecondary",onClick:e.onDismiss,title:t("notice.dismiss"),"aria-label":t("notice.dismiss"),children:t("notice.dismiss")})]})]})}function LB(e){var n;const{t}=jt(),r=(n=e.threadTitle)!=null&&n.trim()?String(e.threadTitle).trim():null;return u.jsxs("div",{className:"noticeBanner",role:"status","aria-live":"polite",children:[u.jsxs("span",{className:"noticeBannerText",children:[t("notice.jumpBackReady"),r?u.jsxs("span",{className:"noticeBannerThread",children:[" · ",r]}):null]}),u.jsxs("div",{className:"noticeBannerActions",children:[u.jsx("button",{type:"button",className:"noticeBannerBtn",onClick:e.onJumpBack,title:t("notice.jumpBackTitle"),"aria-label":t("notice.jumpBackTitle"),children:t("notice.jumpBack")}),u.jsx("button",{type:"button",className:"noticeBannerBtn noticeBannerBtnSecondary",onClick:e.onDismiss,title:t("notice.dismiss"),"aria-label":t("notice.dismiss"),children:t("notice.dismiss")})]})]})}function AB(e,t){return e==="completed"?{label:t("todo.status.completed"),className:"completed"}:e==="in_progress"?{label:t("todo.status.inProgress"),className:"in_progress"}:{label:t("todo.status.pending"),className:"pending"}}function NB(e){const t=[],r=[];for(const n of e)n.status==="in_progress"?t.push(n):r.push(n);return{runningSteps:t,otherSteps:r}}function DB(e){var S,y,g;const{t}=jt(),r=e.variant==="inline",n=((S=e.plan)==null?void 0:S.plan)??[],i=((y=e.plan)==null?void 0:y.explanation)??null,s=((g=e.plan)==null?void 0:g.updatedAtMs)??null,[o,a]=p.useState(!1),l=p.useMemo(()=>{if(!n.length)return t("todo.summary.none");let _=0,w=0;for(const M of n)M.status==="completed"?_+=1:M.status==="in_progress"&&(w+=1);const b=Math.max(0,n.length-_),C=w?t("todo.summary.inProgressSuffix",{inProgress:w}):"";return t("todo.summary.totalRemaining",{total:n.length,remaining:b,inProgressSuffix:C})},[n,t]),c=p.useMemo(()=>{const _=typeof e.threadId=="string"?e.threadId.trim():"",w=typeof s=="number"?new Date(s).toLocaleString():"";return!_&&!w?"":_&&w?t("todo.meta.threadUpdated",{thread:_,updatedAt:w}):_?t("todo.meta.thread",{thread:_}):t("todo.meta.updated",{updatedAt:w})},[e.threadId,t,s]),d=p.useMemo(()=>NB(n),[n]),h=d.otherSteps.length>0,f=p.useMemo(()=>r?o?[...d.runningSteps,...d.otherSteps]:d.runningSteps:n,[o,d,r,n]),v=p.useMemo(()=>n.length?d.runningSteps.length?t("todo.summary.inline.inProgress"):t("todo.summary.inline.noneInProgress"):t("todo.summary.none"),[d.runningSteps.length,n.length,t]),m=r?"todoPanel todoPanel-inline":"todoPanel todoPanel-modal";return u.jsx("section",{className:m,"aria-label":"todo plan panel",children:u.jsxs("div",{className:"todoBody",children:[r?u.jsxs("div",{className:"todoInlineHeader",children:[u.jsx("div",{className:"todoPanelTitle",children:t("todo.title")}),h?u.jsx("button",{type:"button",className:"todoInlineToggle",onClick:()=>a(_=>!_),"aria-expanded":o,children:t(o?"todo.inline.collapse":"todo.inline.expandOthers")}):null]}):null,!r&&c?u.jsx("div",{className:"todoMeta",children:c}):null,!r&&i?u.jsx("div",{className:"todoExplanation",children:i}):null,u.jsx("div",{className:"todoSummary",children:r?v:l}),f.length?u.jsx("ul",{className:"todoList",children:f.map((_,w)=>{const b=AB(_.status,t);return u.jsxs("li",{className:`todoStep todoStep-${b.className}`,children:[u.jsx("span",{className:`todoStatusPill todoStatusPill-${b.className}`,children:b.label}),u.jsx("span",{className:"todoStepText",children:_.step})]},`${w}:${_.step}`)})}):null]})})}const BB=[{name:"/help",descriptionKey:"slash.command.help"},{name:"/plan",descriptionKey:"slash.command.plan"},{name:"/default",descriptionKey:"slash.command.default"},{name:"/workspace",descriptionKey:"slash.command.workspace"},{name:"/model",descriptionKey:"slash.command.model"},{name:"/permissions",descriptionKey:"slash.command.permissions"},{name:"/experimental",descriptionKey:"slash.command.experimental"},{name:"/skills",descriptionKey:"slash.command.skills"},{name:"/review",descriptionKey:"slash.command.review"},{name:"/rename",descriptionKey:"slash.command.rename",args:"<name>"},{name:"/new",descriptionKey:"slash.command.new"},{name:"/resume",descriptionKey:"slash.command.resume",args:"<threadId>"},{name:"/compact",descriptionKey:"slash.command.compact"},{name:"/fork",descriptionKey:"slash.command.fork"},{name:"/archive",descriptionKey:"slash.command.archive"},{name:"/unarchive",descriptionKey:"slash.command.unarchive"},{name:"/rollback",descriptionKey:"slash.command.rollback",args:"<numTurns?>"}];function cg(e){return BB.map(t=>{const r={name:t.name,description:xe(t.descriptionKey,void 0,e)};return t.args&&(r.args=t.args),r})}cg();function OB(e){const t=Math.max(0,Math.min(100,e));return`${Math.round(t)}%`}function $B(e){return e>=85?"high":e>=60?"mid":"low"}function jB(e){var S,y,g;const{locale:t,t:r}=jt(),n=!!e.currentThreadId,i=e.threadSwitching&&!e.attachmentUploading,s=e.chatRefreshing&&!i&&!e.attachmentUploading,o=e.currentThreadContextUsagePercent,a=typeof o=="number",l=a?OB(o):"--",c=a?$B(o):"unknown",d=a?r("main.contextUsage.withValue",{value:l}):r("main.contextUsage.noData"),h=n?e.chatRefreshing?r("main.overlay.chatRefreshing"):r("main.chat.refresh"):r("main.changes.noThread"),f=e.currentThreadId?e.currentDiffCount?r("main.changes.view"):r("main.changes.none"):r("main.changes.noThread"),v=p.useMemo(()=>cg(t),[t]),m=e.currentThreadId&&((S=e.currentTodoPlan)!=null&&S.plan.length)?u.jsx(DB,{threadId:e.currentThreadId,plan:e.currentTodoPlan,variant:"inline"}):null;return u.jsxs("main",{className:"main",children:[e.error?u.jsx("div",{className:"errorBanner",children:e.error}):null,e.updateAvailable?u.jsxs("div",{className:"updateBanner",role:"status","aria-live":"polite",children:[u.jsx("span",{children:r("main.update.available")}),u.jsxs("div",{className:"updateBannerActions",children:[u.jsx("button",{type:"button",className:"updateBannerBtn",onClick:e.onReloadForUpdate,children:r("main.update.reloadNow")}),u.jsx("button",{type:"button",className:"updateBannerBtn updateBannerBtnSecondary",onClick:e.onDismissUpdate,children:r("main.update.later")})]})]}):null,e.approvalResolvedNotice?u.jsx(PB,{notice:e.approvalResolvedNotice,threadTitle:e.approvalResolvedNoticeThreadTitle,showThreadTitle:!e.currentThreadId||e.approvalResolvedNotice.threadId!==e.currentThreadId,onJump:e.onJumpApprovalResolvedNotice,onDismiss:e.onDismissApprovalResolvedNotice}):e.showNoticeJumpBack?u.jsx(LB,{threadTitle:e.noticeJumpBackThreadTitle,onJumpBack:e.onJumpNoticeBack,onDismiss:e.onDismissNoticeBack}):null,u.jsx("div",{className:"mainHeader",children:u.jsxs("div",{className:"mainHeaderRow",children:[u.jsxs("div",{className:"mainHeaderLeft",children:[u.jsxs("button",{className:"sidebarToggle",onClick:e.toggleSidebar,title:e.sidebarOpen?r("main.sidebar.close"):r("main.sidebar.open"),"aria-label":e.sidebarOpen?r("main.sidebar.close"):r("main.sidebar.open"),"aria-controls":"sidebar","aria-expanded":e.sidebarOpen,children:[u.jsx("span",{className:"sidebarToggleIcon","aria-hidden":"true",children:u.jsx(sR,{})}),u.jsx("span",{className:"sidebarToggleText",children:e.sidebarOpen?r("main.close"):r("main.menu")})]}),u.jsx("div",{className:"mainTitle",title:e.currentThreadId||void 0,children:e.currentThreadId?e.currentThreadTitle||r("main.thread.title",{id:e.currentThreadId}):r("main.thread.none")})]}),u.jsxs("div",{className:"mainHeaderActions",children:[u.jsx("button",{type:"button",className:"mainActionBtn mainActionBtnIconOnly",onClick:e.onRefreshChatMessages,disabled:!e.currentThreadId||e.chatRefreshing,title:h,"aria-label":h,children:u.jsx(k_,{})}),u.jsx("button",{type:"button",className:"mainActionBtn mainActionBtnIconOnly",onClick:e.onCreateThread,title:r("sidebar.newThread"),"aria-label":r("sidebar.newThread"),children:u.jsx(Rb,{})}),u.jsxs("button",{type:"button",className:"mainActionBtn",onClick:e.onOpenChanges,disabled:!e.currentThreadId||!e.currentDiffCount||!!e.currentPending,title:f,"aria-label":f,children:[u.jsx(gR,{}),e.currentDiffCount?u.jsx("span",{className:"badge",children:e.currentDiffCount}):null]}),n?u.jsxs("div",{className:`contextUsage contextUsage-${c}`,title:d,"aria-label":d,children:[u.jsx("span",{className:"contextUsageIcon","aria-hidden":"true",children:u.jsx(hR,{usagePercent:o})}),u.jsx("span",{className:"contextUsageText",children:l})]}):null,u.jsx("div",{className:`status status-${e.status} statusIcon`,title:`ws:${e.status}`,"aria-label":`ws:${e.status}`,children:u.jsx(iR,{})})]})]})}),u.jsxs("div",{className:"mainBody",children:[u.jsx(MB,{items:e.currentChat,theme:e.theme,compactView:e.compactView,threadId:e.currentThreadId,canLoadEarlier:!!(e.currentThreadId&&((y=e.threadTurnsMetaByThread[e.currentThreadId])==null?void 0:y.turnsStart)>0),loadingEarlier:!!(e.currentThreadId&&((g=e.threadTurnsMetaByThread[e.currentThreadId])!=null&&g.loadingOlder)),onLoadEarlier:e.currentThreadId?()=>e.onLoadEarlierTurns(e.currentThreadId):void 0,pendingRequest:e.currentPending,pendingRequestKey:e.currentPendingRequestKey,pendingDraftStoreRef:e.userInputDraftByThreadRef,onCancelPendingRequest:e.onCancelPending,onSubmitPendingRequest:e.onSubmitPending,jumpToPendingKey:e.jumpToPendingKey,onJumpedToPending:e.onJumpedToPending,proposedPlanAction:e.currentProposedPlanMessageId&&e.currentThreadInPlan?{messageId:e.currentProposedPlanMessageId,executeDisabled:e.status!=="connected"||e.currentThreadBusy||!!e.currentPending,onExecute:e.executeCurrentProposedPlan,onDismiss:e.dismissCurrentProposedPlan}:null}),e.pendingAttachments.length?u.jsx(bR,{pendingAttachments:e.pendingAttachments,onRemove:e.onRemovePendingAttachment}):null,u.jsx(_R,{mode:e.currentThreadBusy?"stop":"send",textareaDisabled:!1,buttonDisabled:e.currentThreadBusy?!e.currentThreadId||e.status!=="connected":e.status!=="connected"||e.currentThreadBusy,toolbar:u.jsx(yR,{connected:e.status==="connected",threadId:e.currentThreadId,threadCollaboration:e.currentThreadId?e.threadCollaborationOverrides[e.currentThreadId]:void 0,threadModelOverride:e.currentThreadId?e.threadModelOverrides[e.currentThreadId]:void 0,cliDefaults:e.threadStartDefaults,webDefaults:e.webModelDefaults,modelList:e.modelList,onTogglePlan:e.onTogglePlan,onCycleModel:e.onCycleModel,onCycleReasoningEffort:e.onCycleReasoningEffort}),toolbarRight:u.jsx(SR,{connected:e.status==="connected",threadId:e.currentThreadId,busy:e.currentThreadBusy,uploading:e.attachmentUploading,fileInputRef:e.imageFileInputRef,onUpload:_=>{e.currentThreadId&&e.onUploadAttachments(_,e.currentThreadId)}}),topPanel:m,placeholder:e.currentThreadId?e.status!=="connected"?r("main.placeholder.connecting"):e.currentThreadBusy?r("main.placeholder.busy"):r("main.placeholder.typeMessage"):r("main.placeholder.newThread"),text:e.composerText,onTextChange:e.onComposerTextChange,textareaRef:e.composerTextareaRef,onPasteImageFiles:_=>{!(e.status==="connected"&&e.currentThreadId&&!e.currentThreadBusy&&!e.attachmentUploading)||!e.currentThreadId||e.onUploadAttachments(_,e.currentThreadId)},slashCommands:v,skills:e.skillsForPicker,onLoadSkills:e.onLoadSkills,onSubmit:e.onSubmitComposer,onStop:e.onStop})]}),s?u.jsx("div",{className:"chatRefreshOverlay",role:"status","aria-live":"polite","aria-label":r("main.overlay.chatRefreshing"),children:u.jsxs("div",{className:"chatRefreshOverlayPanel",children:[u.jsx("span",{className:"chatRefreshOverlayIcon","aria-hidden":"true",children:u.jsx(k_,{})}),u.jsx("span",{className:"chatRefreshOverlayText",children:r("main.overlay.chatRefreshing")})]})}):null,i?u.jsx("div",{className:"threadSwitchOverlay",role:"status","aria-live":"polite","aria-label":r("main.overlay.threadSwitching"),children:u.jsx("div",{className:"threadSwitchOverlayPanel",children:u.jsx("span",{className:"threadSwitchOverlayText",children:r("main.overlay.threadSwitching")})})}):null,e.attachmentUploading?u.jsx("div",{className:"uploadOverlay",role:"status","aria-live":"polite","aria-label":r("main.overlay.uploading"),children:u.jsxs("div",{className:"uploadOverlayPanel",children:[u.jsx("span",{className:"uploadOverlayIcon","aria-hidden":"true",children:u.jsx(Ib,{})}),u.jsx("span",{className:"uploadOverlayText",children:r("main.overlay.uploading")})]})}):null]})}function zB(e){const t=e.size??18,r=e.title??"codex-cli-web";return u.jsxs("svg",{viewBox:"0 0 64 64",width:t,height:t,className:e.className,role:"img","aria-label":r,focusable:"false",children:[u.jsx("rect",{x:"4",y:"4",width:"56",height:"56",rx:"14",className:"codexLogoShell"}),u.jsx("rect",{x:"12",y:"12",width:"40",height:"9",rx:"4.5",className:"codexLogoTopBar"}),u.jsx("circle",{cx:"18",cy:"16.5",r:"1.6",className:"codexLogoTopDot"}),u.jsx("circle",{cx:"23",cy:"16.5",r:"1.6",className:"codexLogoTopDot codexLogoTopDotDim"}),u.jsx("circle",{cx:"28",cy:"16.5",r:"1.6",className:"codexLogoTopDot codexLogoTopDotFaint"}),u.jsx("path",{d:"M45 23.5C42.3 20 38 17.8 33.3 17.8C25 17.8 18.3 24.5 18.3 32.8C18.3 41.1 25 47.8 33.3 47.8C38 47.8 42.3 45.6 45 42.1",className:"codexLogoTrack"}),u.jsx("circle",{cx:"45.4",cy:"32.8",r:"3.1",className:"codexLogoCursor"})]})}function FB(e){return e?new Date(e*1e3).toLocaleString():""}function Pi(e,t){return e.length<=t?e:e.slice(e.length-t)}function y1(){const e=globalThis.crypto;return e&&typeof e.randomUUID=="function"?e.randomUUID():`m-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function qa(e){const t=e.replace(/[\\\/]+$/,""),r=t.split(/[\\\/]/g).filter(Boolean);return r[r.length-1]||t||e}function HB(e){const r=qa(e).trim().slice(0,1);return r?r.toUpperCase():"?"}function uS(e){const t=qa(e).trim().toLowerCase(),r=t.slice(0,1);return`${r>="a"&&r<="z"?`0-${r}`:`1-${r||"~"}`}-${t}-${e.toLowerCase()}`}function Ji(e){const t=new Set,r=[];for(const n of e){const i=String(n??"").trim();i&&(t.has(i)||(t.add(i),r.push(i)))}return r.sort((n,i)=>uS(n).localeCompare(uS(i))),r}function mm(e){const r=String(e??"").trim().replace(/\\/g,"/").replace(/\/+/g,"/");return(r==="/"?"/":r.replace(/\/+$/,""))||"/"}function mu(e,t){const r=mm(e),n=mm(t);return r==="/"||n===r?!0:n.startsWith(`${r}/`)}function WB(e,t){const r=t.map(mm).filter(Boolean);return r.length?e.filter(n=>r.some(i=>mu(i,n))):[]}function UB(e,t){const r=t.trim().toLowerCase();return!r||e.trim().toLowerCase().startsWith(r)?!0:qa(e).trim().toLowerCase().startsWith(r)}function KB(e){const{t}=jt(),r=p.useMemo(()=>Ji(e.workspaces),[e.workspaces]);return u.jsxs("nav",{className:"workspaceRail","aria-label":t("workspace.aria.nav"),children:[u.jsx("div",{className:"workspaceRailItems",role:"list","aria-label":t("workspace.aria.list"),children:r.map(n=>{const i=e.activeWorkspace===n;return u.jsx("button",{type:"button",className:`workspaceRailBtn${i?" workspaceRailBtnActive":""}`,onClick:()=>e.onSwitchWorkspace(n),title:n,"aria-label":n,children:u.jsx("span",{"aria-hidden":"true",children:HB(n)})},n)})}),u.jsx("button",{type:"button",className:"workspaceRailBtn workspaceRailBtnAdd",onClick:e.onAddWorkspace,disabled:e.canAddWorkspace===!1,title:t("workspace.add"),"aria-label":t("workspace.add"),children:u.jsx(Rb,{})})]})}function dS(e){const t=Number(e.updatedAt??0);if(Number.isFinite(t)&&t>0)return t;const r=Number(e.createdAt??0);return Number.isFinite(r)&&r>0?r:0}function hS(e,t){const r=t[e]??0;return typeof r=="number"&&r>0}function VB(e,t,r){const n=hS(e.id,r),i=hS(t.id,r);if(n!==i)return n?-1:1;const s=dS(t)-dS(e);if(s!==0)return s;const o=Number(t.createdAt??0)-Number(e.createdAt??0);return o!==0?o:e.id.localeCompare(t.id)}function qB(e){const{t}=jt(),[r,n]=p.useState(!1),i=()=>{e.isNarrow&&e.onCloseDrawer()},s=k=>{e.onSwitchWorkspace(k),n(!1)},o=()=>{e.onAddWorkspace(),i(),n(!1)},a=k=>{k(),i()},l=(k,I)=>{const L=t("sidebar.thread.archiveConfirm",{preview:I});window.confirm(L)&&e.onArchiveThread(k)},c=k=>{e.onOpenThread(k),i()},d=(k,I)=>{k.key!=="Enter"&&k.key!==" "||(k.preventDefault(),c(I))},h=e.accentColor??"#2f73d6",f=e.backgroundColor??(e.theme==="dark"?"#0d1422":"#ffffff"),[v,m]=p.useState(h),[S,y]=p.useState(f);p.useEffect(()=>{m(h)},[h]),p.useEffect(()=>{y(f)},[f]);const g=k=>{const I=k.target.value;e.onAccentColorChange(I),m(I)},_=k=>{const I=k.target.value;e.onBackgroundColorChange(I),y(I)},w=k=>{const I=k.target.value;m(I),e.onAccentColorChange(I)},b=()=>{const k=Za(v);k&&e.onAccentColorChange(k),m(k??h)},C=k=>{const I=k.target.value;y(I),e.onBackgroundColorChange(I)},M=()=>{const k=Aa(S);k&&e.onBackgroundColorChange(k),y(k??f)},x=e.activeWorkspace??t("sidebar.projectPath.none"),T=p.useMemo(()=>e.threads.slice().sort((k,I)=>VB(k,I,e.runningTurnsByThread)),[e.threads,e.runningTurnsByThread]);return u.jsxs(u.Fragment,{children:[e.isNarrow&&e.sidebarDrawerOpen?u.jsx("div",{className:"sidebarOverlay",onClick:e.onCloseDrawer}):null,u.jsxs("aside",{className:"sidebar",id:"sidebar","aria-label":t("sidebar.aria.threads"),children:[u.jsx(KB,{workspaces:e.workspaces,activeWorkspace:e.activeWorkspace,onSwitchWorkspace:s,onAddWorkspace:o,canAddWorkspace:e.canAddWorkspace}),u.jsxs("div",{className:"threadSidebar",children:[u.jsxs("div",{className:"sidebarHeader",children:[u.jsxs("div",{className:"sidebarHeaderInfo",children:[u.jsxs("div",{className:"sidebarBrand",children:[u.jsx(zB,{className:"sidebarBrandMark"}),u.jsx("div",{className:"title sidebarBrandTitle",children:"codex-cli-web"})]}),u.jsx("div",{className:"sidebarHeaderSub",title:x,children:x})]}),u.jsx("div",{className:"sidebarHeaderRight",children:u.jsx("button",{className:"sidebarCollapse",onClick:e.closeSidebar,title:t("sidebar.collapse"),"aria-label":t("sidebar.collapse"),children:"X"})})]}),u.jsxs("div",{className:"sidebarActions",children:[u.jsx("button",{onClick:()=>{e.onCreateThread(),i(),n(!1)},children:t("sidebar.newThread")}),u.jsx("button",{className:"sidebarSettingsTrigger",onClick:()=>n(k=>!k),title:t("sidebar.settings.toggle"),"aria-label":t("sidebar.settings.toggle"),"aria-expanded":r,"aria-controls":"sidebar-settings-panel",children:t(r?"sidebar.settings.hide":"sidebar.settings.show")})]}),u.jsxs("div",{id:"sidebar-settings-panel",className:`sidebarSettingsPanel${r?" sidebarSettingsPanelOpen":""}`,children:[u.jsx("button",{onClick:()=>{a(e.onRefreshThreads)},children:t("sidebar.refresh")}),u.jsx("button",{onClick:()=>{a(e.onLogout)},title:e.user?t("sidebar.logoutWithUser",{user:e.user}):t("sidebar.logout"),children:t("sidebar.logout")}),e.canManageUsers?u.jsx("button",{onClick:()=>{a(e.onOpenAdminUsers)},title:t("sidebar.users.open"),children:t("sidebar.users")}):null,u.jsx("button",{onClick:()=>{a(e.onToggleTheme)},title:t("sidebar.theme.toggle"),"aria-label":t("sidebar.theme.toggle"),children:t("sidebar.theme",{theme:rb(e.theme)})}),u.jsx("button",{onClick:()=>{a(e.onToggleLocale)},title:t("language.switch"),"aria-label":t("language.switch"),children:t("language.current",{locale:t(`language.${e.locale}`)})}),u.jsxs("label",{className:"sidebarColorSetting",title:t("sidebar.accent"),children:[u.jsx("span",{className:"sidebarColorLabel",children:t("sidebar.accent")}),u.jsxs("div",{className:"sidebarColorControl",children:[u.jsx("input",{className:"sidebarColorTextInput",type:"text",value:v,onChange:w,onBlur:b,spellCheck:!1,placeholder:t("sidebar.accent.placeholder"),"aria-label":t("sidebar.accent.textInput")}),u.jsx("input",{className:"sidebarColorInput",type:"color",value:h,onChange:g,"aria-label":t("sidebar.accent.picker")})]})]}),u.jsx("button",{onClick:()=>{a(e.onAccentColorReset)},disabled:!e.accentColor,title:t("sidebar.accent.reset"),"aria-label":t("sidebar.accent.reset"),children:t("sidebar.accent.reset")}),u.jsxs("label",{className:"sidebarColorSetting",title:t("sidebar.background"),children:[u.jsx("span",{className:"sidebarColorLabel",children:t("sidebar.background")}),u.jsxs("div",{className:"sidebarColorControl",children:[u.jsx("input",{className:"sidebarColorTextInput",type:"text",value:S,onChange:C,onBlur:M,spellCheck:!1,placeholder:t("sidebar.background.placeholder"),"aria-label":t("sidebar.background.textInput")}),u.jsx("input",{className:"sidebarColorInput",type:"color",value:f,onChange:_,"aria-label":t("sidebar.background.picker")})]})]}),u.jsx("button",{onClick:()=>{a(e.onBackgroundColorReset)},disabled:!e.backgroundColor,title:t("sidebar.background.reset"),"aria-label":t("sidebar.background.reset"),children:t("sidebar.background.reset")}),u.jsx("button",{onClick:()=>{a(e.onToggleCompactView)},title:t("sidebar.compact",{state:e.compactView?t("common.on"):t("common.off")}),"aria-label":t("sidebar.compact",{state:e.compactView?t("common.on"):t("common.off")}),children:t("sidebar.compact",{state:e.compactView?t("common.on"):t("common.off")})})]}),u.jsx("div",{className:"threads",children:e.threadsLoading?u.jsx("div",{className:"threadMeta",children:t("sidebar.threads.loading")}):T.map(k=>{var E;const I=e.runningTurnsByThread[k.id]??0,L=typeof I=="number"&&I>0,R=I>1?` (${I})`:"",A=L?t("sidebar.thread.running",{suffix:R}):void 0,O=e.derivedThreadTitleById[k.id]||((E=e.threadNameOverrides[k.id])==null?void 0:E.trim())||k.preview||k.id,P=e.archivingThreadId===k.id;return u.jsxs("div",{className:`thread ${k.id===e.currentThreadId?"active":""}`,title:k.cwd,children:[u.jsxs("div",{className:"threadMain",role:"button",tabIndex:0,"aria-label":t("sidebar.thread.open",{preview:O}),onClick:()=>c(k.id),onKeyDown:F=>d(F,k.id),children:[u.jsx("div",{className:"threadPreview",children:O}),u.jsxs("div",{className:"threadMeta",children:[u.jsx("span",{children:k.modelProvider||t("common.unknown")}),u.jsxs("span",{className:"threadMetaRight",children:[e.pendingByThread[k.id]?u.jsx("span",{className:"threadPendingDot","aria-label":t("sidebar.thread.pending"),title:t("sidebar.thread.pending")}):null,L?u.jsx("span",{className:"threadRunningPulse","aria-label":A,title:A}):null,u.jsx("span",{children:FB(k.updatedAt||k.createdAt)})]})]})]}),u.jsx("button",{className:"threadArchiveIcon",onClick:()=>l(k.id,O),disabled:P,title:t(P?"sidebar.thread.archiving":"sidebar.thread.archive"),"aria-label":P?t("sidebar.thread.archivingAria",{preview:O}):t("sidebar.thread.archiveAria",{preview:O}),children:u.jsx(pR,{})})]},k.id)})})]})]})]})}function YB(e){return e==="unauthorized"?"需要登录后才能查询路径。":e==="path_not_allowed"?"该路径不在允许范围内。":e==="invalid_query"?"路径不合法。":"请求失败,请稍后重试。"}async function GB(e){const t=e.query.trim();if(!t)return{suggestions:[],error:null};const r=new URL("/api/cwd/suggest",window.location.origin);r.searchParams.set("q",t),Number.isFinite(e.limit)&&r.searchParams.set("limit",String(Math.floor(e.limit)));try{const n=await Ut(r.toString(),{signal:e.signal}),i=await n.json().catch(()=>null),s=i&&typeof i=="object"?i:null;if(!n.ok){const a=typeof(s==null?void 0:s.error)=="string"?String(s.error):"request_failed";return{suggestions:[],error:a}}if(!s||s.ok!==!0){const a=typeof(s==null?void 0:s.error)=="string"?String(s.error):"request_failed";return{suggestions:[],error:a}}return{suggestions:Array.isArray(s.suggestions)?s.suggestions.map(a=>String(a)).filter(Boolean):[],error:null}}catch(n){return(n==null?void 0:n.name)==="AbortError"?{suggestions:[],error:null}:{suggestions:[],error:"request_failed"}}}function S1(e){return e.render==="diff"&&!!(e.diff&&Array.isArray(e.diff.changes)&&e.diff.changes.length)}function XB(e){const t=String(e??"");return t.includes("<proposed_plan>")&&t.includes("</proposed_plan>")}function JB(e){for(let t=e.length-1;t>=0;t-=1){const r=e[t];if(r.role!=="system"&&typeof r.text=="string"&&r.text.trim())return r}return null}const QB=/^v2:uia-(required|resolved)-[^:]+:(.+)$/,ZB=/^v2:(am|cmd|fc|plan|um)-([^:]+):(.+)$/;function eO(e){const t=QB.exec(e);if(!t)return null;const r=String(t[1]??"").trim(),n=String(t[2]??"").trim();return!r||!n?null:`v2:uia-${r}:${n}`}function tO(e){const t=ZB.exec(e);if(!t)return null;const r=String(t[2]??"").trim(),n=String(t[3]??"").trim();return!r||!n?null:`${r}:${n}`}function lr(e){const t=String(e??"").trim();return t?eO(t)??tO(t)??t:""}const rO=200,Ic=500,nO=5e3,iO=Number.MAX_SAFE_INTEGER;function sO(e,t){const r=Number(e);if(Number.isFinite(r)&&r>0)return Math.min(Ic,Math.max(1,Math.floor(r)));const n=Number(t);return Number.isFinite(n)&&n>0?Math.min(Ic,Math.max(1,Math.floor(n))):Ic}function oO(e){const t=Number(e);return!Number.isFinite(t)||t<=0?nO:Math.min(iO,Math.max(1,Math.floor(t)))}function aO(e,t){const r=e[0];if(!r||!Number.isFinite(r.ts))return null;const n=Math.max(0,Math.floor(r.ts));if(n<=0)return null;const i=n+1;return!Number.isFinite(i)||t!==null&&i>=t?null:i}function lO(e){const t=String(e??"").trim();return t==="user"||t==="assistant"||t==="system"||t==="reasoning"?t:"assistant"}function cO(e){const t=e??{},r=String(t.path??"").trim();if(!r)return null;const n=String(t.kind??"change").trim()||"change",i=typeof t.diff=="string"?t.diff:typeof t.patch=="string"?t.patch:typeof t.unifiedDiff=="string"?t.unifiedDiff:"";return{path:r,kind:n,diff:i}}function uO(e){if(!e||typeof e!="object")return null;const t=e,r=Array.isArray(t.changes)?t.changes:[],n=[];for(const a of r){const l=cO(a);l&&n.push(l)}const i=typeof t.output=="string"?t.output:void 0,s=!!(i!=null&&i.trim());return!n.length&&!s?null:{title:String(t.title??"").trim()||"文件变更",changes:n,output:s?i:void 0}}function dO(e){if(!e||typeof e!="object")return;const t=e,r=Number(t.lines),n=Number(t.chars);if(!(!Number.isFinite(r)||!Number.isFinite(n)))return{lines:Math.max(0,Math.floor(r)),chars:Math.max(0,Math.floor(n))}}function hO(e){if(!e||typeof e!="object")return;const r=String(e.type??"");if(!(r!=="root"&&r!=="element"&&r!=="text"))return e}function fO(e){if(!e||typeof e!="object")return;const t=e;if(!(!Array.isArray(t.stages)||!Array.isArray(t.statusLines)))return e}function mO(e){const t=e??{},r=String(t.id??"").trim();if(!r)return null;const n=Number(t.ts),i=Number.isFinite(n)?Math.max(0,Math.floor(n)):Date.now(),s=r.startsWith("v2:uia-");if(s&&r.startsWith("v2:uia-required-"))return null;const o=uO(t.diff),a=String(t.render??"").trim().toLowerCase(),l=r.startsWith("v2:fc-"),c=!!o&&(a==="diff"||l),d=a==="terminal",h=a==="approval"||s,f=dO(t.metrics),v=hO(t.markdownAst),m=fO(t.systemToolCallSummary),S=typeof t.plainText=="string"?t.plainText:void 0,y={id:r,role:lO(t.role),text:String(t.text??""),ts:i,streaming:!!t.streaming};return S!==void 0&&(y.plainText=S),f&&(y.metrics=f),v&&(y.markdownAst=v),m&&(y.systemToolCallSummary=m),c?(y.render="diff",y.diff=o??void 0,y):d?(y.render="terminal",y):(h&&(y.render="approval"),y)}async function w1(e,t){const r=String(e??"").trim();if(!r)return[];const n=Number.isFinite(t==null?void 0:t.limit)?Math.min(Ic,Math.max(1,Math.floor(Number(t==null?void 0:t.limit)))):rO,i=Number.isFinite(t==null?void 0:t.beforeTs)?Math.max(0,Math.floor(Number(t==null?void 0:t.beforeTs))):null,s=i===null?`limit=${n}`:`limit=${n}&beforeTs=${i}`,o=await Ut(`/api/history/threads/${encodeURIComponent(r)}/messages?${s}`,{cache:"no-store"}),a=await o.json().catch(()=>({}));if(!o.ok||(a==null?void 0:a.ok)!==!0||!Array.isArray(a==null?void 0:a.items))throw new Error(String((a==null?void 0:a.details)??(a==null?void 0:a.error)??`HTTP ${o.status}`));const l=[];for(const c of a.items){const d=mO(c);d&&l.push(d)}return l}async function pO(e,t){const r=String(e??"").trim();if(!r)return[];const n=sO(t==null?void 0:t.pageSize,t==null?void 0:t.pageLimit),i=oO(t==null?void 0:t.maxItems),s=new Map;let o=null;for(;s.size<i;){const a=i-s.size,l=Math.min(n,a),c=await w1(r,{limit:l,beforeTs:o});if(!c.length)break;for(const h of c){const f=lr(h.id);f&&(s.has(f)||s.set(f,h))}if(c.length<l)break;const d=aO(c,o);if(d===null)break;o=d}return s.size?Array.from(s.values()).sort((a,l)=>a.ts-l.ts):[]}function gO(e){const t=e.changes.some(n=>!!String(n.diff??"").trim()),r=!!String(e.output??"").trim();return t||r}async function vO(e){const t=String(e??"").trim();if(!t)return[];const n=(await w1(t,{limit:500})).filter(S1);return await Promise.all(n.map(async s=>{if(gO(s.diff))return s;try{const o=await m1({threadId:t,messageId:s.id});return{...s,diff:o}}catch{return s}}))}function _O(e){const[t,r]=p.useState(null),[n,i]=p.useState(!1),[s,o]=p.useState(null);p.useEffect(()=>{let d=!1;return i(!0),o(null),vO(e.threadId).then(h=>{d||r(h)}).catch(h=>{if(d)return;const f=String((h==null?void 0:h.message)??h??"").trim()||"加载失败";o(f),r(null)}).finally(()=>{d||i(!1)}),()=>{d=!0}},[e.threadId]);const a=p.useMemo(()=>t===null||!t.length&&e.items.length?e.items:t,[t,e.items]),l=p.useMemo(()=>a.slice().sort((d,h)=>h.ts-d.ts),[a]),c=p.useMemo(()=>l.reduce((d,h)=>d+h.diff.changes.length,0),[l]);return p.useEffect(()=>{const d=h=>{h.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e.onClose]),u.jsx("div",{className:"modalOverlay",role:"dialog","aria-modal":"true",children:u.jsxs("div",{className:"modal modalChanges",children:[u.jsxs("div",{className:"modalHeader",children:[u.jsx("div",{className:"modalTitle",children:"文件变更列表"}),u.jsx("button",{className:"modalClose",onClick:e.onClose,children:"关闭"})]}),u.jsxs("div",{className:"changesBody",children:[u.jsxs("div",{className:"changesSummary",children:["共 ",l.length," 次变更 · ",c," 个文件(按时间倒序)"]}),n?u.jsx("div",{className:"changesSummary",children:"正在加载最新文件变更…"}):null,s?u.jsxs("div",{className:"changesSummary",children:["加载失败,已展示当前缓存:",s]}):null,u.jsx("div",{className:"changesList",children:l.map((d,h)=>{const v=`${new Date(d.ts).toLocaleString()} · ${d.diff.title||"文件变更"}`;return u.jsx("div",{className:"changesEntry",children:u.jsx(sg,{diff:{...d.diff,title:v},streaming:d.streaming})},`${d.id}:${h}`)})})]})]})})}function yO(e){const t=p.useMemo(()=>{const _=e.threadId,w=_?e.overrides[_]:void 0,b=String(e.webDefaults.model??"").trim(),C=String(e.webDefaults.reasoningEffort??"").trim(),M=String(e.defaults.model??"").trim(),x=String(e.defaults.reasoningEffort??"").trim();return{defaultModel:b||M,defaultEffort:C||x,overrideModel:String((w==null?void 0:w.model)??"").trim(),overrideEffort:String((w==null?void 0:w.reasoningEffort)??"").trim(),webModel:b,webEffort:C,cliModel:M,cliEffort:x}},[e.threadId,e.overrides,e.webDefaults.model,e.webDefaults.reasoningEffort,e.defaults.model,e.defaults.reasoningEffort]),[r,n]=p.useState(!e.threadId),[i,s]=p.useState(e.threadId?t.overrideModel:t.webModel),[o,a]=p.useState(e.threadId?t.overrideEffort:t.webEffort),[l,c]=p.useState("");p.useEffect(()=>{e.onLoadModels()},[]),p.useEffect(()=>{const _=w=>{w.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[e]);const d=p.useMemo(()=>{const _=(i.trim()||t.defaultModel||"").trim();return!e.modelList||!_?null:e.modelList.find(w=>w.model===_||w.id===_)??null},[e.modelList,i,t.defaultModel]),h=p.useMemo(()=>{const _=e.modelList??[],w=i.trim();return!w||_.some(C=>(C.model||C.id)===w)?_:[{id:w,model:w,displayName:`${w}(当前)`,description:"当前选择的模型不在列表中"},..._]},[e.modelList,i]),f=p.useMemo(()=>{const _=Array.isArray(d==null?void 0:d.supportedReasoningEfforts)?d.supportedReasoningEfforts:[];return _.length?_:[{reasoningEffort:"low",description:"更快、推理更轻"},{reasoningEffort:"medium",description:"均衡"},{reasoningEffort:"high",description:"更深推理"},{reasoningEffort:"xhigh",description:"更高推理强度"}]},[d]);p.useEffect(()=>{var _;o&&(f.some(w=>w.reasoningEffort===o)||a(((_=f[0])==null?void 0:_.reasoningEffort)??""))},[o,f]);const v=()=>{const _=i.trim()||void 0,w=o.trim()||void 0;e.threadId&&(!_&&!w?e.onClearThreadOverride(e.threadId):e.onSetThreadOverride(e.threadId,{model:_,reasoningEffort:w})),(r||!e.threadId)&&(!_&&!w?e.onClearWebDefaults():e.onSetWebDefaults({model:_,reasoningEffort:w})),e.onClose()},m=()=>{e.threadId&&e.onClearThreadOverride(e.threadId)},S=()=>{e.onClearWebDefaults()},g=`默认:${t.webModel||t.webEffort?"Web 默认(已覆盖)":"codex-cli 默认"}${t.defaultModel?` · model=${t.defaultModel}`:""}${t.defaultEffort?` · effort=${t.defaultEffort}`:""}`;return u.jsx("div",{className:"modalOverlay",role:"dialog","aria-modal":"true",children:u.jsxs("div",{className:"modal",children:[u.jsxs("div",{className:"modalHeader",children:[u.jsx("div",{className:"modalTitle",children:"模型设置"}),u.jsx("button",{className:"modalClose",onClick:e.onClose,children:"关闭"})]}),u.jsx("div",{className:"modalSub",children:e.threadId?"将应用到当前线程后续消息(已发送的消息不受影响)。":"用于设置 Web 默认(新线程/未覆盖线程生效)。"}),u.jsxs("div",{className:"modalBody",children:[u.jsx("div",{className:"questionText",children:g}),u.jsx("div",{style:{height:12}}),e.threadId?u.jsxs("label",{className:"questionText",style:{display:"flex",gap:8,alignItems:"center",marginBottom:10},children:[u.jsx("input",{type:"checkbox",checked:r,onChange:_=>n(_.target.checked)}),"同时设为 Web 默认(覆盖 codex-cli 默认)"]}):null,u.jsx("div",{className:"questionHeader",children:"模型"}),e.modelListLoading?u.jsx("div",{className:"questionText",children:"加载中…"}):null,e.modelListError?u.jsxs("div",{className:"questionText",children:["加载失败:",e.modelListError]}):null,h&&h.length?u.jsxs("select",{className:"otherInput",value:i,onChange:_=>s(_.target.value),children:[u.jsx("option",{value:"",children:"(跟随默认)"}),h.map(_=>u.jsx("option",{value:_.model||_.id,children:_.displayName||_.model||_.id},_.id))]}):u.jsx("input",{className:"otherInput",value:i,onChange:_=>s(_.target.value),placeholder:"手动输入 model id,例如:gpt-5.2-codex"}),d!=null&&d.description?u.jsx("div",{className:"questionText",children:d.description}):null,u.jsx("div",{style:{height:10}}),u.jsx("div",{className:"questionText",children:"自定义模型(本机浏览器保存):"}),u.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",marginTop:6},children:[u.jsx("input",{className:"otherInput",value:l,onChange:_=>c(_.target.value),placeholder:"输入 model id 并添加到自定义列表",style:{flex:1},onKeyDown:_=>{if(_.key!=="Enter")return;_.preventDefault();const w=l.trim();w&&(e.onAddCustomModel(w),s(w),c(""))}}),u.jsx("button",{onClick:()=>{const _=l.trim();_&&(e.onAddCustomModel(_),s(_),c(""))},disabled:!l.trim(),title:"添加到自定义列表并选中",children:"添加"})]}),e.customModels.length?u.jsx("div",{style:{marginTop:8,display:"flex",gap:8,flexWrap:"wrap"},children:e.customModels.map(_=>u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,border:"1px solid rgba(127,127,127,0.35)",borderRadius:999,padding:"4px 10px"},children:[u.jsx("span",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:_}),u.jsx("button",{onClick:()=>s(_),title:"选中这个自定义模型",style:{padding:"2px 8px"},children:"选中"}),u.jsx("button",{className:"danger",onClick:()=>e.onRemoveCustomModel(_),title:"从自定义列表删除(不会自动清除线程/默认里的选择)",style:{padding:"2px 8px"},children:"删除"})]},_))}):u.jsx("div",{className:"questionText",style:{marginTop:6},children:"暂无自定义模型。"}),u.jsx("div",{style:{height:12}}),u.jsx("div",{className:"questionHeader",children:"推理强度"}),u.jsxs("select",{className:"otherInput",value:o,onChange:_=>a(_.target.value),children:[u.jsx("option",{value:"",children:"(跟随默认)"}),f.map(_=>u.jsxs("option",{value:_.reasoningEffort,children:[_.reasoningEffort,_.description?` - ${_.description}`:""]},_.reasoningEffort))]}),u.jsx("div",{className:"questionText",children:"说明:推理强度会在每次发送消息时附带给后端(按消息生效)。"})]}),u.jsxs("div",{className:"modalActions",children:[u.jsx("button",{onClick:v,children:"保存"}),e.threadId?u.jsx("button",{className:"danger",onClick:m,title:"清除当前线程覆盖(恢复为默认)",children:"清除线程"}):null,u.jsx("button",{className:"danger",onClick:S,title:"清除 Web 默认(恢复为 codex-cli 默认)",children:"清除默认"})]})]})})}function SO(e){const t=p.useMemo(()=>{const m=e.threadId,y=(m?e.threadCollaborationOverrides[m]:void 0)??null,g=m?e.threadModelOverrides[m]:void 0;return{base:y,model:String((y==null?void 0:y.settings.model)??"").trim(),reasoningEffort:String((g==null?void 0:g.reasoningEffort)??"").trim()}},[e.threadId,e.threadCollaborationOverrides,e.threadModelOverrides]),[r,n]=p.useState(t.model),[i,s]=p.useState(t.reasoningEffort),[o,a]=p.useState("");p.useEffect(()=>{e.onLoadModels()},[]),p.useEffect(()=>{const m=S=>{S.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[e]);const l=p.useMemo(()=>!e.modelList||!r?null:e.modelList.find(m=>m.model===r||m.id===r)??null,[e.modelList,r]),c=p.useMemo(()=>{const m=e.modelList??[],S=r.trim();return!S||m.some(g=>(g.model||g.id)===S)?m:[{id:S,model:S,displayName:`${S}(当前)`,description:"当前选择的模型不在列表中"},...m]},[e.modelList,r]),d=p.useMemo(()=>{const m=Array.isArray(l==null?void 0:l.supportedReasoningEfforts)?l.supportedReasoningEfforts:[];return m.length?m:[{reasoningEffort:"low",description:"更快、推理更轻"},{reasoningEffort:"medium",description:"均衡"},{reasoningEffort:"high",description:"更深推理"},{reasoningEffort:"xhigh",description:"更高推理强度"}]},[l]);p.useEffect(()=>{var m;i&&(d.some(S=>S.reasoningEffort===i)||s(((m=d[0])==null?void 0:m.reasoningEffort)??""))},[i,d]),p.useEffect(()=>{t.base||e.onClose()},[t.base,e.onClose]);const h=t.base;if(!h)return null;const f=()=>{const m=r.trim();if(!m)return;const S=i.trim()||void 0,y={...h,settings:{...h.settings,model:m,reasoning_effort:null}};e.threadId&&(e.onSetThreadCollaborationOverride(e.threadId,y),e.onSetThreadOverride(e.threadId,{reasoningEffort:S})),e.onClose()},v=()=>{e.threadId&&e.onClearThreadCollaborationOverride(e.threadId),e.onClose()};return u.jsx("div",{className:"modalOverlay",role:"dialog","aria-modal":"true",children:u.jsxs("div",{className:"modal",children:[u.jsxs("div",{className:"modalHeader",children:[u.jsx("div",{className:"modalTitle",children:"协作模式 · 模型设置"}),u.jsx("button",{className:"modalClose",onClick:e.onClose,children:"关闭"})]}),u.jsxs("div",{className:"modalSub",children:["当前协作模式:",h.mode==="plan"?"Plan":"默认"]}),u.jsxs("div",{className:"modalBody",children:[u.jsx("div",{className:"questionHeader",children:"模型"}),e.modelListLoading?u.jsx("div",{className:"questionText",children:"加载中…"}):null,e.modelListError?u.jsxs("div",{className:"questionText",children:["加载失败:",e.modelListError]}):null,c&&c.length?u.jsx("select",{className:"otherInput",value:r,onChange:m=>n(m.target.value),children:c.map(m=>u.jsx("option",{value:m.model||m.id,children:m.displayName||m.model||m.id},m.id))}):u.jsx("input",{className:"otherInput",value:r,onChange:m=>n(m.target.value),placeholder:"手动输入 model id,例如:gpt-5.2-codex"}),l!=null&&l.description?u.jsx("div",{className:"questionText",children:l.description}):null,u.jsx("div",{style:{height:10}}),u.jsx("div",{className:"questionText",children:"自定义模型(本机浏览器保存):"}),u.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",marginTop:6},children:[u.jsx("input",{className:"otherInput",value:o,onChange:m=>a(m.target.value),placeholder:"输入 model id 并添加到自定义列表",style:{flex:1},onKeyDown:m=>{if(m.key!=="Enter")return;m.preventDefault();const S=o.trim();S&&(e.onAddCustomModel(S),n(S),a(""))}}),u.jsx("button",{onClick:()=>{const m=o.trim();m&&(e.onAddCustomModel(m),n(m),a(""))},disabled:!o.trim(),title:"添加到自定义列表并选中",children:"添加"})]}),e.customModels.length?u.jsx("div",{style:{marginTop:8,display:"flex",gap:8,flexWrap:"wrap"},children:e.customModels.map(m=>u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,border:"1px solid rgba(127,127,127,0.35)",borderRadius:999,padding:"4px 10px"},children:[u.jsx("span",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:m}),u.jsx("button",{onClick:()=>n(m),title:"选中这个自定义模型",style:{padding:"2px 8px"},children:"选中"}),u.jsx("button",{className:"danger",onClick:()=>e.onRemoveCustomModel(m),title:"从自定义列表删除(不会自动清除线程里的选择)",style:{padding:"2px 8px"},children:"删除"})]},m))}):u.jsx("div",{className:"questionText",style:{marginTop:6},children:"暂无自定义模型。"}),u.jsx("div",{style:{height:12}}),u.jsx("div",{className:"questionHeader",children:"推理强度"}),u.jsxs("select",{className:"otherInput",value:i,onChange:m=>s(m.target.value),children:[u.jsx("option",{value:"",children:"(默认)"}),d.map(m=>u.jsxs("option",{value:m.reasoningEffort,children:[m.reasoningEffort,m.description?` - ${m.description}`:""]},m.reasoningEffort))]})]}),u.jsxs("div",{className:"modalActions",children:[u.jsx("button",{onClick:f,disabled:!r.trim(),children:"保存"}),u.jsx("button",{className:"danger",onClick:v,title:"清除当前线程协作模式覆盖",children:"清除"})]})]})})}function wO(e){const t=e.threadId?e.overrides[e.threadId]:void 0,[r,n]=p.useState(!!e.threadId),[i,s]=p.useState("custom"),[o,a]=p.useState((t==null?void 0:t.approvalPolicy)??e.defaults.approvalPolicy??""),[l,c]=p.useState((t==null?void 0:t.sandbox)??e.defaults.sandbox??"");p.useEffect(()=>{const f=v=>{v.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e]);const d=()=>{const f=o==="untrusted"||o==="on-failure"||o==="on-request"||o==="never"?o:void 0,v=l==="read-only"||l==="workspace-write"||l==="danger-full-access"?l:void 0;e.threadId&&r&&(!f&&!v?e.onClearThreadOverride(e.threadId):e.onSetThreadOverride(e.threadId,{approvalPolicy:f,sandbox:v})),e.onClose()},h=()=>{e.threadId&&r&&e.onClearThreadOverride(e.threadId),e.onClose()};return u.jsx("div",{className:"modalOverlay",role:"dialog","aria-modal":"true",children:u.jsxs("div",{className:"modal",children:[u.jsxs("div",{className:"modalHeader",children:[u.jsx("div",{className:"modalTitle",children:"权限设置"}),u.jsx("button",{className:"modalClose",onClick:e.onClose,children:"关闭"})]}),u.jsx("div",{className:"modalSub",children:"对齐 codex-cli:可修改当前线程(从下一条消息生效)。新线程默认值来自 codex-cli 配置。"}),u.jsxs("div",{className:"modalBody",children:[e.threadId?u.jsxs("label",{className:"questionText",style:{display:"flex",gap:8,alignItems:"center",marginBottom:10},children:[u.jsx("input",{type:"checkbox",checked:r,onChange:f=>{const v=f.target.checked;n(v)}}),"应用到当前线程(从下一条消息开始)"]}):null,u.jsx("div",{className:"questionHeader",children:"权限预设"}),u.jsxs("select",{className:"otherInput",value:i,onChange:f=>{const v=f.target.value;v!=="default"&&v!=="fullAccess"&&v!=="custom"||(s(v),v==="default"?(a("on-request"),c("workspace-write")):v==="fullAccess"&&(a("never"),c("danger-full-access")))},children:[u.jsx("option",{value:"custom",children:"自定义"}),u.jsx("option",{value:"default",children:"默认(full-auto:on-request + workspace-write)"}),u.jsx("option",{value:"fullAccess",children:"完全访问(危险:never + danger-full-access)"})]}),u.jsx("div",{style:{height:12}}),u.jsx("div",{className:"questionHeader",children:"审批策略(approvalPolicy)"}),u.jsxs("select",{className:"otherInput",value:o,onChange:f=>{s("custom"),a(f.target.value)},children:[u.jsx("option",{value:"",children:"(服务端默认)"}),u.jsx("option",{value:"untrusted",children:"untrusted"}),u.jsx("option",{value:"on-failure",children:"on-failure"}),u.jsx("option",{value:"on-request",children:"on-request"}),u.jsx("option",{value:"never",children:"never"})]}),u.jsx("div",{style:{height:12}}),u.jsx("div",{className:"questionHeader",children:"沙箱(sandbox)"}),u.jsxs("select",{className:"otherInput",value:l,onChange:f=>{s("custom"),c(f.target.value)},children:[u.jsx("option",{value:"",children:"(服务端默认)"}),u.jsx("option",{value:"read-only",children:"read-only"}),u.jsx("option",{value:"workspace-write",children:"workspace-write"}),u.jsx("option",{value:"danger-full-access",children:"danger-full-access"})]}),u.jsx("div",{className:"questionText",children:"提示:当前线程的修改会在发送下一条消息时透传给后端,并对后续 turn 持续生效。"})]}),u.jsxs("div",{className:"modalActions",children:[u.jsx("button",{onClick:d,children:"保存"}),u.jsx("button",{onClick:e.onNewThread,title:"用当前设置新建线程",children:"新建线程"}),u.jsx("button",{className:"danger",onClick:h,title:"清除已勾选范围的设置",children:"清除"})]})]})})}function bO(e){const t=e.trim();return t?t==="stable"?"稳定":t==="underDevelopment"?"开发中":t==="deprecated"?"已废弃":t==="removed"?"已移除":t:""}function CO(e){const[t,r]=p.useState(""),[n,i]=p.useState({}),[s,o]=p.useState(null);p.useEffect(()=>{e.onLoad()},[]),p.useEffect(()=>{const c=d=>{d.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e]);const a=p.useMemo(()=>{const c=e.items??[],d=t.trim().toLowerCase();return d?c.filter(h=>`${h.name} ${h.displayName??""} ${h.description??""} ${h.stage}`.toLowerCase().includes(d)):c},[e.items,t]),l=async(c,d)=>{o(null),i(h=>({...h,[c]:!0}));try{await e.onSet(c,d),await e.onLoad()}catch(h){o(String(h))}finally{i(h=>({...h,[c]:!1}))}};return u.jsx("div",{className:"modalOverlay",role:"dialog","aria-modal":"true",children:u.jsxs("div",{className:"modal",children:[u.jsxs("div",{className:"modalHeader",children:[u.jsx("div",{className:"modalTitle",children:"实验特性"}),u.jsx("button",{className:"modalClose",onClick:e.onClose,children:"关闭"})]}),u.jsx("div",{className:"modalSub",children:"开关会写入 Codex 配置(相当于设置 features.<feature>=true/false)。"}),u.jsxs("div",{className:"modalBody",children:[u.jsx("input",{className:"otherInput",value:t,onChange:c=>r(c.target.value),placeholder:"搜索 feature…"}),e.loading?u.jsx("div",{className:"questionText",children:"加载中…"}):null,e.error?u.jsxs("div",{className:"questionText",children:["加载失败:",e.error]}):null,s?u.jsxs("div",{className:"questionText",children:["保存失败:",s]}):null,u.jsx("div",{style:{height:10}}),u.jsx("div",{className:"slashList",children:a.map(c=>{const d=bO(c.stage),h=c.displayName??c.name,f=c.description??c.announcement??"",v=!!n[c.name];return u.jsxs("div",{className:"slashRow",children:[u.jsxs("div",{className:"slashRowLeft",children:[u.jsxs("div",{className:"slashRowTitle",children:[u.jsx("span",{className:"slashRowName",children:h}),d?u.jsx("span",{className:`badge badge-${c.stage}`,children:d}):null,c.defaultEnabled?u.jsx("span",{className:"badge",children:"默认开"}):null]}),u.jsx("div",{className:"slashRowMeta",children:c.name}),f?u.jsx("div",{className:"slashRowDesc",children:f}):null]}),u.jsxs("label",{className:"toggle",children:[u.jsx("input",{type:"checkbox",checked:!!c.enabled,disabled:v,onChange:m=>void l(c.name,m.target.checked)}),u.jsx("span",{className:"toggleUi","aria-hidden":"true"})]})]},c.name)})})]}),u.jsx("div",{className:"modalActions",children:u.jsx("button",{onClick:e.onLoad,disabled:e.loading,children:"刷新"})})]})})}function xO(e){const[t,r]=p.useState(""),[n,i]=p.useState({}),[s,o]=p.useState(null);p.useEffect(()=>{e.onLoad()},[]),p.useEffect(()=>{const c=d=>{d.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e]);const a=p.useMemo(()=>{const c=e.items??[],d=[];for(const f of c){const v=Array.isArray(f==null?void 0:f.skills)?f.skills:[];for(const m of v)!(m!=null&&m.name)||!(m!=null&&m.path)||d.push({cwd:String(f.cwd??""),skill:m})}const h=t.trim().toLowerCase();return h?d.filter(({cwd:f,skill:v})=>`${f} ${v.name} ${v.description??""} ${v.scope??""} ${v.path}`.toLowerCase().includes(h)):d},[e.items,t]),l=async(c,d)=>{o(null),i(h=>({...h,[c]:!0}));try{await e.onSet(c,d),await e.onLoad()}catch(h){o(String(h))}finally{i(h=>({...h,[c]:!1}))}};return u.jsx("div",{className:"modalOverlay",role:"dialog","aria-modal":"true",children:u.jsxs("div",{className:"modal",children:[u.jsxs("div",{className:"modalHeader",children:[u.jsx("div",{className:"modalTitle",children:"技能"}),u.jsx("button",{className:"modalClose",onClick:e.onClose,children:"关闭"})]}),u.jsx("div",{className:"modalSub",children:"点“插入”会把 `$skill` 前缀插入到输入框,用于指定本次任务使用该 skill。"}),u.jsxs("div",{className:"modalBody",children:[u.jsx("input",{className:"otherInput",value:t,onChange:c=>r(c.target.value),placeholder:"搜索 skill…"}),e.loading?u.jsx("div",{className:"questionText",children:"加载中…"}):null,e.error?u.jsxs("div",{className:"questionText",children:["加载失败:",e.error]}):null,s?u.jsxs("div",{className:"questionText",children:["保存失败:",s]}):null,u.jsx("div",{style:{height:10}}),u.jsx("div",{className:"slashList",children:a.map(({cwd:c,skill:d})=>{const h=!!n[d.path];return u.jsxs("div",{className:"slashRow",children:[u.jsxs("div",{className:"slashRowLeft",children:[u.jsxs("div",{className:"slashRowTitle",children:[u.jsx("span",{className:"slashRowName",children:d.name}),d.scope?u.jsx("span",{className:"badge",children:d.scope}):null]}),u.jsx("div",{className:"slashRowMeta",children:c}),d.description?u.jsx("div",{className:"slashRowDesc",children:d.description}):null,u.jsx("div",{className:"slashRowMeta",children:d.path})]}),u.jsxs("div",{className:"slashRowActions",children:[u.jsx("button",{type:"button",className:"miniBtn",onClick:()=>e.onInsert(d.name),title:"插入到输入框",children:"插入"}),u.jsxs("label",{className:"toggle",title:"启用/禁用(影响是否可被选择/使用)",children:[u.jsx("input",{type:"checkbox",checked:!!d.enabled,disabled:h,onChange:f=>void l(d.path,f.target.checked)}),u.jsx("span",{className:"toggleUi","aria-hidden":"true"})]})]})]},`${c}:${d.path}`)})})]}),u.jsx("div",{className:"modalActions",children:u.jsx("button",{onClick:e.onLoad,disabled:e.loading,children:"刷新"})})]})})}function kO(e){const[t,r]=p.useState("");p.useEffect(()=>{const i=s=>{s.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[e]);const n=p.useMemo(()=>{const i=t.trim().toLowerCase();return i?e.threads.filter(s=>`${s.id} ${s.preview??""} ${s.cwd??""} ${s.modelProvider??""}`.toLowerCase().includes(i)):e.threads},[e.threads,t]);return u.jsx("div",{className:"modalOverlay",role:"dialog","aria-modal":"true",children:u.jsxs("div",{className:"modal",children:[u.jsxs("div",{className:"modalHeader",children:[u.jsx("div",{className:"modalTitle",children:"恢复会话"}),u.jsx("button",{className:"modalClose",onClick:e.onClose,children:"关闭"})]}),u.jsx("div",{className:"modalSub",children:"选择一个已保存线程打开(等价于 CLI 的 /resume)。"}),u.jsxs("div",{className:"modalBody",children:[u.jsx("input",{className:"otherInput",value:t,onChange:i=>r(i.target.value),placeholder:"搜索 threadId / preview / cwd…"}),u.jsx("div",{style:{height:10}}),u.jsx("div",{className:"slashList",children:n.map(i=>u.jsxs("div",{className:"slashRow",children:[u.jsxs("div",{className:"slashRowLeft",children:[u.jsxs("div",{className:"slashRowTitle",children:[u.jsx("span",{className:"slashRowName",children:i.preview||i.id}),u.jsx("span",{className:"badge",children:i.modelProvider||"unknown"})]}),u.jsx("div",{className:"slashRowMeta",children:i.cwd}),u.jsx("div",{className:"slashRowMeta",children:i.id})]}),u.jsx("div",{className:"slashRowActions",children:u.jsx("button",{type:"button",className:"miniBtn",onClick:()=>e.onOpen(i.id),children:"打开"})})]},i.id))})]}),u.jsx("div",{className:"modalActions",children:u.jsx("button",{onClick:e.onClose,children:"关闭"})})]})})}function TO(e){const[t,r]=p.useState(""),[n,i]=p.useState([]),[s,o]=p.useState(null),[a,l]=p.useState(!1);p.useEffect(()=>{const m=S=>{S.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[e]);const c=p.useMemo(()=>Ji(e.allowedWorkspaceRoots),[e.allowedWorkspaceRoots]),d=p.useMemo(()=>Ji(e.workspaces),[e.workspaces]),h=p.useMemo(()=>{const m=t.trim();return m?d.filter(S=>UB(S,m)):d},[t,d]);p.useEffect(()=>{const m=t.trim();if(!m){i([]),o(null),l(!1);return}let S=!1;const y=new AbortController,g=window.setTimeout(()=>{l(!0),(async()=>{const _=await GB({query:m,limit:30,signal:y.signal});S||(l(!1),i(_.suggestions),o(_.error?YB(_.error):null))})()},160);return()=>{S=!0,y.abort(),window.clearTimeout(g)}},[t]);const f=m=>{e.onSwitchWorkspace(m),e.onClose()},v=()=>{const m=t.trim();if(!m)return;const S=n.find(g=>g===m)??null;if(S){f(S);return}if(n.length===1){f(n[0]);return}const y=d.find(g=>g===m)??null;if(y){f(y);return}if(h.length===1){f(h[0]);return}f(m)};return u.jsx("div",{className:"modalOverlay",role:"dialog","aria-modal":"true",children:u.jsxs("div",{className:"modal",children:[u.jsxs("div",{className:"modalHeader",children:[u.jsx("div",{className:"modalTitle",children:"工作区"}),u.jsx("button",{className:"modalClose",onClick:e.onClose,children:"关闭"})]}),u.jsx("div",{className:"modalSub",children:"输入路径前缀可查询服务器目录建议;权限以管理员分配工作区为准。"}),u.jsxs("div",{className:"modalBody",children:[u.jsx("div",{style:{opacity:.9,fontSize:12,lineHeight:1.6,padding:"0 2px 8px 2px"},children:u.jsxs("div",{children:["权限根目录(管理员分配):",c.length?c.join(","):"未分配"]})}),u.jsx("input",{className:"otherInput",value:t,onChange:m=>r(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),v())},placeholder:"输入路径前缀,例如:/root/code/proj"}),u.jsx("div",{style:{height:8}}),u.jsx("button",{type:"button",disabled:!t.trim(),onClick:v,children:"添加到左侧"}),u.jsx("div",{style:{height:10}}),u.jsxs("div",{className:"slashList",children:[t.trim()?u.jsxs("div",{style:{opacity:.8,fontSize:12,padding:"0 2px"},children:["服务器路径建议",a?"(查询中…)":"",s?`:${s}`:""]}):null,t.trim()?n.map(m=>u.jsx("div",{className:"slashRow",role:"button",tabIndex:0,onClick:()=>f(m),onKeyDown:S=>{S.key!=="Enter"&&S.key!==" "||(S.preventDefault(),f(m))},title:m,children:u.jsxs("div",{className:"slashRowLeft",children:[u.jsx("div",{className:"slashRowTitle",children:u.jsx("span",{className:"slashRowName",children:qa(m)})}),u.jsx("div",{className:"slashRowMeta",children:m})]})},`suggest-${m}`)):null,u.jsx("div",{className:"slashRow",role:"button",tabIndex:0,onClick:()=>f(null),onKeyDown:m=>{m.key!=="Enter"&&m.key!==" "||(m.preventDefault(),f(null))},title:"默认工作区",children:u.jsx("div",{className:"slashRowLeft",children:u.jsxs("div",{className:"slashRowTitle",children:[u.jsx("span",{className:"slashRowName",children:"默认工作区"}),e.activeWorkspace?null:u.jsx("span",{className:"badge",children:"当前"})]})})}),h.map(m=>{const S=e.activeWorkspace===m,y=e.canRemoveWorkspace?e.canRemoveWorkspace(m):!0;return u.jsxs("div",{className:"slashRow",role:"button",tabIndex:0,onClick:()=>f(m),onKeyDown:g=>{g.key!=="Enter"&&g.key!==" "||(g.preventDefault(),f(m))},title:m,children:[u.jsxs("div",{className:"slashRowLeft",children:[u.jsxs("div",{className:"slashRowTitle",children:[u.jsx("span",{className:"slashRowName",children:qa(m)}),S?u.jsx("span",{className:"badge",children:"当前"}):null]}),u.jsx("div",{className:"slashRowMeta",children:m})]}),u.jsx("div",{className:"slashRowActions",children:y?u.jsx("button",{type:"button",className:"miniBtn danger",onClick:g=>{g.preventDefault(),g.stopPropagation(),e.onRemoveWorkspace(m)},title:"从列表移除",children:"删除"}):null})]},m)})]})]}),u.jsx("div",{className:"modalActions",children:u.jsx("button",{onClick:e.onClose,children:"关闭"})})]})})}async function ug(e,t){const r=await Ut(e,t),n=await r.json();if(!r.ok||!(n!=null&&n.ok)){const i=(n==null?void 0:n.details)??(n==null?void 0:n.error);throw new Error(i?String(i):`HTTP ${r.status}`)}return n}function EO(e){return e==="admin"?"admin":"member"}function dg(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,r=typeof t.username=="string"?t.username.trim():"";if(!r)return null;const n=EO(t.role),i=Array.isArray(t.workspaces)?t.workspaces.filter(s=>typeof s=="string").map(s=>s.trim()).filter(Boolean):[];return{username:r,role:n,workspaces:i}}async function IO(){const e=await ug("/api/admin/users"),t=Array.isArray(e.users)?e.users:[],r=[];for(const n of t){const i=dg(n);i&&r.push(i)}return r}async function RO(e){const t=await ug("/api/admin/users",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),r=dg(t.user);if(!r)throw new Error("Invalid server response");return r}async function MO(e,t){const r=String(e??"").trim();if(!r)throw new Error("username is required");const n=await ug(`/api/admin/users/${encodeURIComponent(r)}/workspaces`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({workspaces:t})}),i=dg(n.user);if(!i)throw new Error("Invalid server response");return i}function PO(e){const t=e.split(/[\n,]+/g).map(i=>i.trim()).filter(Boolean),r=new Set,n=[];for(const i of t)r.has(i)||(r.add(i),n.push(i));return n}function LO(e){const[t,r]=p.useState([]),[n,i]=p.useState(null),[s,o]=p.useState(!1),[a,l]=p.useState(null),[c,d]=p.useState(""),[h,f]=p.useState(""),[v,m]=p.useState("member"),[S,y]=p.useState(""),[g,_]=p.useState(!1),w=p.useMemo(()=>t.find(k=>k.username===n)??null,[n,t]),b=async()=>{o(!0),l(null);try{const k=await IO();r(k),i(I=>{var L;return I&&k.some(R=>R.username===I)?I:((L=k[0])==null?void 0:L.username)??null})}catch(k){l(String(k))}finally{o(!1)}};p.useEffect(()=>{b()},[]),p.useEffect(()=>{y(w?w.workspaces.join(`
|
|
162
|
-
`):"")},[w]),p.useEffect(()=>{const k=I=>{I.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[e]);const C=!!(c.trim()&&h.trim()&&!g),M=!!(w&&!g),x=async()=>{if(C){_(!0),l(null);try{const k=await RO({username:c.trim(),password:h,role:v});r(I=>{const L=[...I];return L.push(k),L.sort((R,A)=>R.username.localeCompare(A.username)),L}),i(k.username),d(""),f(""),m("member")}catch(k){l(String(k))}finally{_(!1)}}},T=async()=>{if(w&&M){_(!0),l(null);try{const k=PO(S),I=await MO(w.username,k);r(L=>L.map(R=>R.username===I.username?I:R))}catch(k){l(String(k))}finally{_(!1)}}};return u.jsx("div",{className:"modalOverlay",role:"dialog","aria-modal":"true",children:u.jsxs("div",{className:"modal adminUsersModal",children:[u.jsxs("div",{className:"modalHeader",children:[u.jsx("div",{className:"modalTitle",children:"用户管理"}),u.jsx("button",{className:"modalClose",onClick:e.onClose,children:"关闭"})]}),u.jsx("div",{className:"modalSub",children:"仅管理员可见:创建用户、分配可用工作区。"}),u.jsxs("div",{className:"modalBody adminUsersBody",children:[u.jsxs("div",{className:"adminUsersPanel",children:[u.jsxs("div",{className:"adminUsersPanelTitle",children:["用户列表 ",s?u.jsx("span",{className:"badge",children:"加载中"}):null,u.jsx("button",{type:"button",className:"miniBtn",onClick:()=>void b(),disabled:s||g,style:{marginLeft:"auto"},children:"刷新"})]}),u.jsxs("div",{className:"adminUsersList",role:"list",children:[t.map(k=>{const I=k.username===n;return u.jsxs("button",{type:"button",className:`adminUsersRow${I?" adminUsersRowActive":""}`,onClick:()=>i(k.username),title:k.username,children:[u.jsx("span",{className:"adminUsersRowName",children:k.username}),u.jsx("span",{className:"badge",children:k.role}),u.jsx("span",{className:"adminUsersRowMeta",children:k.workspaces.length})]},k.username)}),!t.length&&!s?u.jsx("div",{style:{opacity:.7,fontSize:12},children:"暂无用户"}):null]})]}),u.jsxs("div",{className:"adminUsersPanel",children:[u.jsx("div",{className:"adminUsersPanelTitle",children:"创建用户"}),u.jsxs("div",{className:"adminUsersForm",children:[u.jsxs("label",{className:"loginField",children:[u.jsx("div",{className:"loginLabel",children:"账号"}),u.jsx("input",{className:"loginInput",value:c,onChange:k=>d(k.target.value),disabled:g})]}),u.jsxs("label",{className:"loginField",children:[u.jsx("div",{className:"loginLabel",children:"密码"}),u.jsx("input",{className:"loginInput",type:"password",value:h,onChange:k=>f(k.target.value),disabled:g})]}),u.jsxs("label",{className:"loginField",children:[u.jsx("div",{className:"loginLabel",children:"角色"}),u.jsxs("select",{className:"loginInput",value:v,onChange:k=>m(k.target.value==="admin"?"admin":"member"),disabled:g,children:[u.jsx("option",{value:"member",children:"member"}),u.jsx("option",{value:"admin",children:"admin"})]})]}),u.jsx("button",{type:"button",className:"loginButton",disabled:!C,onClick:()=>void x(),children:"创建"})]}),u.jsx("div",{style:{height:10}}),u.jsx("div",{className:"adminUsersPanelTitle",children:"分配工作区"}),u.jsxs("div",{style:{opacity:.8,fontSize:12,marginBottom:6},children:["当前用户:",w?`${w.username} (${w.role})`:"未选择"]}),u.jsx("textarea",{className:"otherInput adminUsersWorkspaces",value:S,onChange:k=>y(k.target.value),placeholder:"每行一个绝对路径,例如:/root/code/repo-a",disabled:!w||g}),u.jsx("div",{style:{display:"flex",gap:8,marginTop:10},children:u.jsx("button",{type:"button",disabled:!M,onClick:()=>void T(),children:"保存分配"})})]}),a?u.jsx("div",{className:"loginError",style:{gridColumn:"1 / -1"},children:a}):null]})]})})}function AO(e){return u.jsxs(u.Fragment,{children:[e.showAdminUsers?u.jsx(LO,{onClose:e.onCloseAdminUsers}):null,e.showChanges&&e.currentThreadId?u.jsx(_O,{threadId:e.currentThreadId,items:e.currentDiffItems,onClose:e.onCloseChanges}):null,e.showWorkspace?u.jsx(TO,{allowedWorkspaceRoots:e.allowedWorkspaceRoots,workspaces:e.workspaces,activeWorkspace:e.activeWorkspace,onSwitchWorkspace:e.onSwitchWorkspace,canRemoveWorkspace:e.canRemoveWorkspace,onRemoveWorkspace:e.onRemoveWorkspace,onClose:e.onCloseWorkspace}):null,e.showModel?u.jsx(yO,{threadId:e.currentThreadId,modelList:e.modelList,modelListLoading:e.modelListLoading,modelListError:e.modelListError,customModels:e.customModels,onAddCustomModel:e.onAddCustomModel,onRemoveCustomModel:e.onRemoveCustomModel,defaults:e.threadStartDefaults,overrides:e.threadModelOverrides,webDefaults:e.webModelDefaults,onLoadModels:e.onLoadModels,onSetThreadOverride:e.onSetThreadModelOverride,onClearThreadOverride:e.onClearThreadModelOverride,onSetWebDefaults:e.onSetWebDefaults,onClearWebDefaults:e.onClearWebDefaults,onClose:e.onCloseModel}):null,e.showCollabModel?u.jsx(SO,{threadId:e.currentThreadId,threadCollaborationOverrides:e.threadCollaborationOverrides,threadModelOverrides:e.threadModelOverrides,modelList:e.modelList,modelListLoading:e.modelListLoading,modelListError:e.modelListError,customModels:e.customModels,onAddCustomModel:e.onAddCustomModel,onRemoveCustomModel:e.onRemoveCustomModel,onLoadModels:e.onLoadModels,onSetThreadCollaborationOverride:e.onSetThreadCollaborationOverride,onClearThreadCollaborationOverride:e.onClearThreadCollaborationOverride,onSetThreadOverride:e.onSetThreadModelOverride,onClose:e.onCloseCollabModel}):null,e.showPermissions?u.jsx(wO,{threadId:e.currentThreadId,defaults:e.threadStartDefaults,overrides:e.threadPermissionsOverrides,onSetThreadOverride:e.onSetThreadPermissionsOverride,onClearThreadOverride:e.onClearThreadPermissionsOverride,onNewThread:e.onNewThread,onClose:e.onClosePermissions}):null,e.showExperimental?u.jsx(CO,{items:e.experimentalList,loading:e.experimentalLoading,error:e.experimentalError,onLoad:e.onLoadExperimental,onSet:e.onSetExperimentalFeature,onClose:e.onCloseExperimental}):null,e.showSkills?u.jsx(xO,{items:e.skillsList,loading:e.skillsLoading,error:e.skillsError,onLoad:e.onLoadSkills,onSet:e.onSetSkillEnabled,onInsert:e.onInsertSkill,onClose:e.onCloseSkills}):null,e.showResume?u.jsx(kO,{threads:e.threads,onOpen:e.onOpenResume,onClose:e.onCloseResume}):null]})}function fS(e){const t=e.trim().toLowerCase().replace(/[\s-]+/g,"_");return t?t==="pending"?"pending":t==="completed"||t==="done"?"completed":t==="in_progress"||t==="inprogress"||t==="doing"?"in_progress":null:null}function NO(e){return e.id.startsWith("v2:plan-")}function DO(e){const t=/<proposed_plan>([\s\S]*?)<\/proposed_plan>/i.exec(e);return((t==null?void 0:t[1])??"").trim()||null}function BO(e){return/(?:^|\n)\s*(?:[-*+]\s+|\d+[.)]\s+)/m.test(e)||/\[[ xX>~!]\]/.test(e)}function OO(e){return/(?:^|\n)\s*(?:[-*+]|(?:\d+[.)]))\s+(?:\[[ xX>~!]\]|\((?:pending|completed|done|in[\s_-]*progress|inprogress|doing)\)|(?:pending|completed|done|in[\s_-]*progress|inprogress|doing)\s*[::-])/im.test(e)}function $O(e){return/(?:^|\n)\s*(?:#{1,6}\s*)?(?:todo(?:\s*(?:list|checklist|列表|清单))?|待办(?:\s*(?:列表|清单))?|任务清单|checklist)\s*[::]?\s*(?:\n|$)/i.test(e)}function jO(e){const t=e.trim();return!t||!BO(t)?null:OO(t)?{allowLooseBullet:!1}:$O(t)?{allowLooseBullet:!0}:null}function zO(e){const t=e.trim().toLowerCase();return t==="x"?"completed":t===">"||t==="~"||t==="!"?"in_progress":"pending"}function FO(e,t){const r=e.trim();if(!r)return null;const n=/^(?:[-*+]|(?:\d+[.)]))\s+\[(.)\]\s+(.+)$/.exec(r);if(n){const a=n[1]??"",l=(n[2]??"").trim();return l?{status:zO(a),step:l}:null}const i=/^(?:[-*+]|(?:\d+[.)]))\s+\(([^)]+)\)\s+(.+)$/i.exec(r);if(i){const a=fS(i[1]??""),l=(i[2]??"").trim();return!a||!l?null:{status:a,step:l}}const s=/^(?:[-*+]|(?:\d+[.)]))\s+([a-zA-Z_\-\s]+)\s*[::-]\s+(.+)$/.exec(r);if(s){const a=fS(s[1]??""),l=(s[2]??"").trim();if(a&&l)return{status:a,step:l}}if(!t)return null;const o=/^(?:[-*+]|(?:\d+[.)]))\s+(.+)$/.exec(r);if(o){const a=(o[1]??"").trim();return a?{status:"pending",step:a}:null}return null}function HO(e){var n;const t=/^v2:[^-]+-([^:]+):/.exec(e.trim());return(((n=t==null?void 0:t[1])==null?void 0:n.trim())??"")||null}function WO(e){const t=e.text.trim();if(!t)return null;if(NO(e))return{text:t,source:"v2_plan_item",allowLooseBullet:!0};if(e.role!=="assistant")return null;const r=DO(t);if(r)return{text:r,source:"proposed_plan_block",allowLooseBullet:!0};const n=jO(t);return n?{text:t,source:"assistant_checklist",allowLooseBullet:n.allowLooseBullet}:null}function b1(e){for(let t=e.length-1;t>=0;t-=1){const r=e[t];if(!r)continue;const n=WO(r);if(!n)continue;const i=n.text.split(/\r?\n/),s=[],o=[];for(const c of i){const d=c.trim();if(!d)continue;const h=FO(d,n.allowLooseBullet);if(h){s.push(h);continue}s.length||o.push(d)}const l=o.join(`
|
|
163
|
-
`).trim()||null;if(!(!s.length&&!l))return{turnId:HO(r.id),explanation:l,plan:s,updatedAtMs:r.ts}}return null}function UO(e,t){const r=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[];if(r.length!==n.length)return!1;for(let i=0;i<r.length;i+=1){const s=r[i],o=n[i];if(!s||!o||s.status!==o.status||s.step!==o.step)return!1}return!0}function pm(e){return typeof e=="string"?e.trim():""}function KO(e,t){return pm(e)!==pm(t)}function mS(e){const t=pm(e.currentWorkspace);if(t&&e.allowedWorkspaceRoots.some(i=>mu(i,t)))return t;const r=e.effectiveWorkspaces[0];return typeof r=="string"?r:null}function uh(e){const r=String(e??"").trim().replace(/\\/g,"/").replace(/\/+/g,"/");return(r==="/"?"/":r.replace(/\/+$/,""))||"/"}function VO(e){return e.role==="admin"||e.role==="member"}function pS(e){const t=uh(e.cwd),r=(e.allowedWorkspaceRoots??[]).map(uh);return!(!(e.userWorkspaceDirs??[]).map(uh).includes(t)||r.includes(t))}function qO(e){const t=typeof e.activeWorkspace=="string"?e.activeWorkspace.trim():"";return t||null}function gS(e){return{...e,settings:{...e.settings,reasoning_effort:null}}}async function YO(e){const t=e.collaborationList??await e.loadCollaborationModes(),r=e.kind.toLowerCase(),n=t.find(s=>(s.mode??null)===e.kind)??t.find(s=>String(s.name??"").toLowerCase().includes(r))??null,i=String((n==null?void 0:n.model)??"").trim()||String(e.fallbackModel??"").trim();return i?{mode:e.kind,settings:{model:i,developer_instructions:(n==null?void 0:n.developer_instructions)??null,reasoning_effort:(n==null?void 0:n.reasoning_effort)??null}}:null}const GO=120;function XO(e){return{...e,preview:og(String(e.preview??""))}}function JO(e){return e.map(t=>XO(t))}function QO(e,t){const r={id:String(t.id),preview:og(String(t.preview??"")),createdAt:Number(t.createdAt??0),updatedAt:Number(t.updatedAt??0),cwd:String(t.cwd??""),modelProvider:String(t.modelProvider??"")},n=e.findIndex(s=>s.id===r.id);if(n===-1)return[r,...e];const i=e.slice();return i[n]=r,i}function ZO(e){for(const t of e)if(t.role==="user")return e$(t.text);return null}function e$(e){var s;if(!e)return null;const t=((s=e.split(/\r?\n/)[0])==null?void 0:s.trim())||"";if(!t)return null;const r=t.replace(/\s+/g," ").trim(),n=/[。!?.!?]/.exec(r),i=n?r.slice(0,n.index+1):r;return t$(i,GO)}function t$(e,t){const r=e.trim();return r.length<=t?r:`${r.slice(0,Math.max(0,t-1)).trimEnd()}…`}function dh(e){return String(e??"").trim()}function C1(e){const t=dh(e.threadNameOverrides[e.threadId]);if(t)return t;const r=ZO(e.chatItems),n=dh(r);if(n)return n;const i=dh(e.preview);return i||e.threadId}function r$(e){const t={};for(const r of e.threads){const n=e.chatByThread[r.id]??[];t[r.id]=C1({threadId:r.id,preview:r.preview,chatItems:n,threadNameOverrides:e.threadNameOverrides})}return t}async function Si(e,t){const r=await Ut(e,t),n=await r.json();if(!r.ok||!(n!=null&&n.ok))throw new Error(n!=null&&n.details?String(n.details):`HTTP ${r.status}`);return n}async function n$(){const e=await Si("/api/model/list");return(Array.isArray(e==null?void 0:e.data)?e.data:[]).filter(r=>!r.hidden)}async function i$(){const e=await Si("/api/experimental/list");return Array.isArray(e==null?void 0:e.data)?e.data:[]}async function s$(e,t){await Si("/api/experimental/set",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:e,enabled:t})})}async function o$(){const e=await Si("/api/skills/list");return Array.isArray(e==null?void 0:e.data)?e.data:[]}async function a$(e,t){await Si("/api/skills/set",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,enabled:t})})}async function l$(){const e=await Si("/api/collaboration/list");return Array.isArray(e==null?void 0:e.data)?e.data:[]}async function c$(e){const t=typeof e=="string"?e.trim():"",r=t?`/api/thread/list?cwd=${encodeURIComponent(t)}`:"/api/thread/list",n=await Si(r,{cache:"no-store"}),i=Array.isArray(n==null?void 0:n.threads)?n.threads:[],s=typeof(n==null?void 0:n.cwd)=="string"?n.cwd.trim():"";return{threads:i,cwd:s||null}}async function u$(e){await Si("/api/thread/archive",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({threadId:e})})}const x1="threadNameOverrides",k1="threadModelOverrides",T1="webModelDefaults",E1="customModels",I1="threadPermissionsOverrides",R1="threadCollaborationOverrides",M1="chatCompactView",gm="defaultWorkspace";function ll(e){if(!e)return{};try{const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function d$(){const e=localStorage.getItem(gm),t=String(e??"").trim();return t||null}function h$(){const e=ll(localStorage.getItem(x1)),t={};for(const[r,n]of Object.entries(e)){if(typeof n!="string")continue;const i=n.trim();i&&(t[r]=i)}return t}function f$(){const e=ll(localStorage.getItem(k1)),t={};for(const[r,n]of Object.entries(e)){if(!n||typeof n!="object"||Array.isArray(n))continue;const i=n,s=typeof i.model=="string"?i.model.trim():"",o=typeof i.reasoningEffort=="string"?i.reasoningEffort.trim():"";t[r]={model:s||void 0,reasoningEffort:o||void 0}}return t}function m$(){const t=ll(localStorage.getItem(T1)),r=typeof t.model=="string"?t.model.trim():"",n=typeof t.reasoningEffort=="string"?t.reasoningEffort.trim():"";return{model:r||void 0,reasoningEffort:n||void 0}}function p$(){const e=localStorage.getItem(E1);if(!e)return[];try{const t=JSON.parse(e);if(!Array.isArray(t))return[];const r=new Set,n=[];for(const i of t){if(typeof i!="string")continue;const s=i.trim();s&&(r.has(s)||(r.add(s),n.push(s)))}return n}catch{return[]}}function P1(e,t){const r=[],n=new Set,i=s=>{const o=String(s.model||s.id||"").trim();o&&(n.has(o)||(n.add(o),r.push(s)))};for(const s of e??[])i(s);for(const s of t){const o=s.trim();o&&(n.has(o)||(n.add(o),r.push({id:o,model:o,displayName:o,description:"自定义模型"})))}return r.length?r:null}function g$(){const e=ll(localStorage.getItem(I1)),t={};for(const[r,n]of Object.entries(e)){if(!n||typeof n!="object"||Array.isArray(n))continue;const i=n,s=i.approvalPolicy==="untrusted"||i.approvalPolicy==="on-failure"||i.approvalPolicy==="on-request"||i.approvalPolicy==="never"?i.approvalPolicy:void 0,o=i.sandbox==="read-only"||i.sandbox==="workspace-write"||i.sandbox==="danger-full-access"?i.sandbox:void 0;t[r]={approvalPolicy:s,sandbox:o}}return t}function v$(){const e=ll(localStorage.getItem(R1)),t={};for(const[r,n]of Object.entries(e)){if(!n||typeof n!="object"||Array.isArray(n))continue;const i=n,s=i.mode==="plan"||i.mode==="default"?i.mode:null,o=i.settings&&typeof i.settings=="object"&&!Array.isArray(i.settings)?i.settings:null,a=o&&typeof o.model=="string"?o.model.trim():"";!s||!a||(t[r]={mode:s,settings:{model:a,developer_instructions:typeof o.developer_instructions=="string"?o.developer_instructions:o.developer_instructions??null,reasoning_effort:s==="plan"?null:typeof o.reasoning_effort=="string"?o.reasoning_effort:o.reasoning_effort??null}})}return t}function _$(e){const t=e.trim();if(!t.startsWith("/"))return null;if(t==="/")return{cmd:"/",args:""};const r=/^\/(\S+)(?:\s+(.*))?$/.exec(t);return r?{cmd:`/${r[1]}`,args:String(r[2]??"").trim()}:null}function y$(e){const t=e,r=[t==null?void 0:t.threadId,t==null?void 0:t.conversationId,t==null?void 0:t.thread_id,t==null?void 0:t.conversation_id];for(const n of r){if(typeof n!="string")continue;const i=n.trim();if(i)return i}return null}const vS="/login",_S="/session";function S$(e){if(e.auth==="checking")return null;const t=String(e.pathname??"").trim()||"/";return e.auth==="unauthed"?t===vS?null:vS:t===_S?null:_S}const L1="local-user:";function yS(e){return e.startsWith(L1)}function w$(e){const t=`${L1}${e.threadId}:${e.clientMessageId}`,r=og(e.text);return{id:t,ts:e.ts,role:"user",text:r,clientMessageId:e.clientMessageId,deliveryStatus:"pending"}}function b$(e){const t=e.prev[e.threadId]??[];return t.some(r=>r.clientMessageId===e.message.clientMessageId)?e.prev:{...e.prev,[e.threadId]:[...t,e.message]}}function C$(e){let t=null;const r=e.nextStatus==="failed"?String(e.failureReason??"").trim():"",n=r||void 0;for(const[i,s]of Object.entries(e.prev)){let o=!1;const a=s.map(l=>l.clientMessageId!==e.clientMessageId||l.deliveryStatus===e.nextStatus&&l.deliveryError===n?l:(o=!0,{...l,deliveryStatus:e.nextStatus,deliveryError:e.nextStatus==="failed"?n:void 0}));o&&(t||(t={...e.prev}),t[i]=a)}return t??e.prev}function x$(e){const[t,r]=p.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return p.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia(e),i=s=>r(s.matches);return r(n.matches),typeof n.addEventListener=="function"?(n.addEventListener("change",i),()=>n.removeEventListener("change",i)):(n.addListener(i),()=>n.removeListener(i))},[e]),t}function k$(e){const[t,r]=p.useState("checking"),[n,i]=p.useState(null),[s,o]=p.useState(null),[a,l]=p.useState([]),[c,d]=p.useState([]);return p.useEffect(()=>{let h=!1;return(async()=>{try{const f=await fetch("/api/auth/me",{credentials:"same-origin"});if(h)return;if(!f.ok){r("unauthed"),i(null),o(null),l([]),d([]);return}const v=await f.json(),S=(typeof v.username=="string"?v.username.trim():typeof v.user=="string"?v.user.trim():"")||"admin",y=v.role,_=(y==="admin"||y==="member"?y:null)??(S==="admin"?"admin":"member"),b=(Array.isArray(v.workspaces)?v.workspaces:[]).filter(x=>typeof x=="string").map(x=>x.trim()).filter(Boolean),M=(Array.isArray(v.assignedWorkspaces)?v.assignedWorkspaces:[]).filter(x=>typeof x=="string").map(x=>x.trim()).filter(Boolean);i(S),o(_),l(M),d(b),r("authed")}catch(f){r("unauthed"),i(null),o(null),l([]),d([]),e.setError(`Failed to load /api/auth/me: ${String(f)}`)}})(),()=>{h=!0}},[e.reloadToken,e.setError]),{auth:t,setAuth:r,user:n,setUser:i,role:s,assignedWorkspaces:a,workspaces:c}}function T$(){const[e,t]=p.useState(null),[r,n]=p.useState(!1),[i,s]=p.useState(null),[o,a]=p.useState(null),[l,c]=p.useState(!1),[d,h]=p.useState(null),[f,v]=p.useState(null),[m,S]=p.useState(!1),[y,g]=p.useState(null),[_,w]=p.useState(null),[b,C]=p.useState(!1),[M,x]=p.useState(null),T=p.useCallback(async()=>{if(e||r)return e;n(!0),s(null);try{const R=await n$();return t(R),R}catch(R){return s(String(R)),t(null),null}finally{n(!1)}},[e,r]),k=p.useCallback(async()=>{if(!l){c(!0),h(null);try{const R=await i$();a(R)}catch(R){h(String(R)),a(null)}finally{c(!1)}}},[l]),I=p.useCallback(async()=>{if(!m){S(!0),g(null);try{const R=await o$();v(R)}catch(R){g(String(R)),v(null)}finally{S(!1)}}},[m]),L=p.useCallback(async()=>{if(_)return _;if(b)return[];C(!0),x(null);try{const R=await l$();return w(R),R}catch(R){return x(String(R)),w(null),[]}finally{C(!1)}},[_,b]);return{modelList:e,modelListLoading:r,modelListError:i,loadModels:T,experimentalList:o,experimentalLoading:l,experimentalError:d,loadExperimental:k,skillsList:f,skillsLoading:m,skillsError:y,loadSkills:I,collaborationList:_,collaborationLoading:b,collaborationError:M,loadCollaborationModes:L}}function E$(e){const{openThread:t,insertSkillIntoComposer:r,setShowChanges:n,setShowModel:i,setShowCollabModel:s,setShowPermissions:o,setShowExperimental:a,setShowSkills:l,setShowResume:c,setThreadModelOverrides:d,setThreadCollaborationOverrides:h,setThreadPermissionsOverrides:f,setWebModelDefaults:v}=e,m=p.useCallback(()=>n(!1),[n]),S=p.useCallback((E,F)=>{d(N=>({...N,[E]:{...N[E]??{},...F}}))},[d]),y=p.useCallback(E=>{d(F=>{if(!(E in F))return F;const N={...F};return delete N[E],N})},[d]),g=p.useCallback(E=>v(E),[v]),_=p.useCallback(()=>v({}),[v]),w=p.useCallback(()=>i(!1),[i]),b=p.useCallback((E,F)=>h(N=>({...N,[E]:F})),[h]),C=p.useCallback(E=>{h(F=>{if(!(E in F))return F;const N={...F};return delete N[E],N})},[h]),M=p.useCallback(()=>s(!1),[s]),x=p.useCallback((E,F)=>{f(N=>({...N,[E]:{...N[E]??{},...F}}))},[f]),T=p.useCallback(E=>{f(F=>{if(!(E in F))return F;const N={...F};return delete N[E],N})},[f]),k=p.useCallback(()=>t(),[t]),I=p.useCallback(()=>o(!1),[o]),L=p.useCallback(()=>a(!1),[a]),R=p.useCallback(E=>{r(E),l(!1)},[r,l]),A=p.useCallback(()=>l(!1),[l]),O=p.useCallback(E=>{t(E),c(!1)},[t,c]),P=p.useCallback(()=>c(!1),[c]);return{onCloseChanges:m,onSetThreadModelOverride:S,onClearThreadModelOverride:y,onSetWebDefaults:g,onClearWebDefaults:_,onCloseModel:w,onSetThreadCollaborationOverride:b,onClearThreadCollaborationOverride:C,onCloseCollabModel:M,onSetThreadPermissionsOverride:x,onClearThreadPermissionsOverride:T,onNewThread:k,onClosePermissions:I,onCloseExperimental:L,onInsertSkill:R,onCloseSkills:A,onOpenResume:O,onCloseResume:P}}function I$(e){const t=p.useCallback(()=>{if(e.isNarrow){e.setSidebarDrawerOpen(l=>!l);return}e.setSidebarCollapsed(l=>!l)},[e.isNarrow,e.setSidebarCollapsed,e.setSidebarDrawerOpen]),r=p.useCallback(()=>{if(e.isNarrow){e.setSidebarDrawerOpen(!1);return}e.setSidebarCollapsed(!0)},[e.isNarrow,e.setSidebarCollapsed,e.setSidebarDrawerOpen]),n=p.useCallback(()=>{(e.currentThreadId?e.threadCollaborationOverrides[e.currentThreadId]:void 0)?(e.setShowModel(!1),e.setShowCollabModel(!0)):(e.setShowCollabModel(!1),e.setShowModel(!0)),e.loadModels()},[e.currentThreadId,e.loadModels,e.setShowCollabModel,e.setShowModel,e.threadCollaborationOverrides]),i=p.useCallback(l=>{e.setComposerText(c=>{const d=c.replace(/^\s+/,""),f=(d.startsWith("$")?d.replace(/^\$\S+\s*/,""):c).trimStart();return`$${l}${f?` ${f}`:" "}`}),requestAnimationFrame(()=>{var c;return(c=e.composerTextareaRef.current)==null?void 0:c.focus()})},[e.composerTextareaRef,e.setComposerText]),s=p.useCallback((l,c)=>{const d=Date.now(),h=`local-${y1()}`;e.setChatByThread(f=>{const v=f[l]??[];return{...f,[l]:[...v,{id:h,ts:d,role:"system",text:c}]}})},[e.setChatByThread]),o=p.useCallback(l=>{const c=l.trim();return c?(e.setCustomModels(d=>d.includes(c)?d:[...d,c]),!0):!1},[e.setCustomModels]),a=p.useCallback(l=>{const c=l.trim();c&&e.setCustomModels(d=>d.filter(h=>h!==c))},[e.setCustomModels]);return{toggleSidebar:t,closeSidebar:r,openModelSettings:n,insertSkillIntoComposer:i,appendLocalSystemMessage:s,addCustomModel:o,removeCustomModel:a}}function R$(e){const[t,r]=p.useState("checking"),[n,i]=p.useState(null);return p.useEffect(()=>{let s=!1,o=null;const a=e!=null&&e.connected?15e3:3e3,l=async()=>{try{const c=await fetch("/api/status",{credentials:"same-origin",cache:"no-store"});if(!c.ok)throw new Error(`HTTP ${c.status}`);const d=await c.json();if(s)return;r("online"),i(d)}catch{if(s)return;r("offline"),i(null)}finally{if(s)return;o=window.setTimeout(l,a)}};return l(),()=>{s=!0,o&&window.clearTimeout(o)}},[e==null?void 0:e.connected]),{backendReachability:t,backendStatus:n}}const A1="composerDraftByThread",M$="__no_thread__";function P$(e){return String(e??"").trim()||M$}function L$(){const e=localStorage.getItem(A1);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const r={};for(const[n,i]of Object.entries(t)){const s=String(n??"").trim(),o=typeof i=="string"?i:"";s&&o&&(r[s]=o)}return r}catch{return{}}}function A$(e){const[t,r]=p.useState(()=>L$()),n=p.useMemo(()=>P$(e.currentThreadId),[e.currentThreadId]),[i,s]=p.useState(()=>t[n]??"");p.useEffect(()=>{const a=t[n]??"";s(l=>l===a?l:a)},[n,t]);const o=p.useCallback(a=>{s(l=>{const c=typeof a=="function"?a(l):a;return r(d=>{if((d[n]??"")===c)return d;if(!c){if(!(n in d))return d;const f={...d};return delete f[n],f}return{...d,[n]:c}}),c})},[n]);return p.useEffect(()=>{localStorage.setItem(A1,JSON.stringify(t))},[t]),{composerText:i,setComposerText:o}}const N$=100*1024*1024;class N1 extends Error{constructor(){super(...arguments);Qg(this,"code","ATTACHMENT_TOO_LARGE")}}function D$(e){return e instanceof N1}function B$(e){if(!(e.size<=N$))throw new N1(xe("attachment.error.tooLarge",{sizeMb:Math.ceil(e.size/(1024*1024))}))}async function O$(e){const t=new FormData;t.append("file",e,e.name||"attachment");const r=await Ut("/api/uploads/attachment",{method:"POST",body:t}),n=await r.json();if(!r.ok||!(n!=null&&n.ok))throw new Error(n!=null&&n.details?String(n.details):`HTTP ${r.status}`);const i=String(n.apiUrl??"").trim(),s=String(n.localPath??"").trim(),o=String(n.filename??"").trim(),a=String(n.originalName??"").trim(),l=String(n.mime??"").trim(),c=Number(n.size??0);if(!i||!s||!o||!l||!Number.isFinite(c)||c<=0)throw new Error(xe("attachment.error.uploadResponseIncomplete"));return{apiUrl:i,localPath:s,filename:o,originalName:a,mime:l,size:c,withinCodexCwd:!!n.withinCodexCwd}}function hh(e,t){const r=[],n=new Set;for(const i of t){const s=String(i.localPath??"").trim();!s||e.includes(s)||n.has(s)||(n.add(s),r.push(s))}return r.length?`${e}
|
|
164
|
-
|
|
165
|
-
${r.map(i=>`[attachment] ${i}`).join(`
|
|
166
|
-
`)}`:e}function SS(e){const t=cg(e);return[xe("slash.help.title",void 0,e),...t.map(r=>`- ${r.name}${r.args?` ${r.args}`:""}: ${r.description}`),"",xe("slash.help.escapeSlash",void 0,e),xe("slash.help.escapeDollar",void 0,e)].join(`
|
|
167
|
-
`)}function $$(e){const t=e.split(/\s+/).filter(Boolean);if(t[0]==="base"&&t[1])return{type:"baseBranch",branch:t[1]};if(t[0]==="commit"&&t[1])return{type:"commit",sha:t[1]};if(t[0]==="custom"){const r=e.trim().slice(6).trim();if(r)return{type:"custom",instructions:r}}return{type:"uncommittedChanges"}}function j$(e){const{parsed:t,currentThreadId:r,openThread:n,setError:i,openModelSettings:s,setShowPermissions:o,setShowExperimental:a,loadExperimental:l,setShowSkills:c,loadSkills:d,setShowResume:h,setShowWorkspace:f,appendLocalSystemMessage:v,threadModelOverrides:m,webModelDefaults:S,threadStartDefaults:y,effectiveModelList:g,resolveCollaborationMode:_,stripReasoningEffortFromCollab:w,setThreadCollaborationOverrides:b,setThreadNameOverrides:C,refreshThreads:M}=e;if(!r)return(t==null?void 0:t.cmd)==="/new"?(n(),!0):(t==null?void 0:t.cmd)==="/resume"&&t.args?(n(t.args),!0):(t==null?void 0:t.cmd)==="/permissions"||(t==null?void 0:t.cmd)==="/plan"||(t==null?void 0:t.cmd)==="/default"?(i(xe("slash.error.needThread")),!0):(t==null?void 0:t.cmd)==="/"||(t==null?void 0:t.cmd)==="/help"?(i(SS()),!0):(t==null?void 0:t.cmd)==="/model"?(s(),!0):(t==null?void 0:t.cmd)==="/workspace"?(f(!0),!0):(t==null?void 0:t.cmd)==="/permissions"?(o(!0),!0):(t==null?void 0:t.cmd)==="/experimental"?(a(!0),l(),!0):(t==null?void 0:t.cmd)==="/skills"?(c(!0),d(),!0):(t==null?void 0:t.cmd)==="/resume"?(h(!0),!0):(i(xe("slash.error.needThread")),!0);if(!t)return!1;const{cmd:x,args:T}=t,k=r;if(x==="/"||x==="/help")return v(k,SS()),!0;if(x==="/plan")return(async()=>{var A,O;const I=((A=m[k])==null?void 0:A.model)??S.model??y.model??((O=g==null?void 0:g.find(P=>P.isDefault))==null?void 0:O.model)??void 0,L=await _("plan",I),R=L?w(L):null;if(!R){v(k,xe("slash.plan.enableFailed"));return}b(P=>({...P,[k]:R})),v(k,xe("slash.plan.enabled"))})(),!0;if(x==="/default")return b(I=>{if(!(k in I))return I;const L={...I};return delete L[k],L}),v(k,xe("slash.plan.default")),!0;if(x==="/new")return n(),!0;if(x==="/resume")return T?(n(T),!0):(h(!0),!0);if(x==="/model")return s(),!0;if(x==="/workspace")return f(!0),!0;if(x==="/permissions")return o(!0),!0;if(x==="/experimental")return a(!0),l(),!0;if(x==="/skills")return c(!0),d(),!0;if(x==="/rename"){const I=T.trim();return I?I==="-"||I.toLowerCase()==="clear"?(C(L=>{if(!(k in L))return L;const R={...L};return delete R[k],R}),v(k,xe("slash.rename.cleared")),!0):((async()=>{try{const L=await Ut("/api/thread/name/set",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({threadId:k,name:I})}),R=await L.json();if(!L.ok||!(R!=null&&R.ok))throw new Error(R!=null&&R.details?String(R.details):`HTTP ${L.status}`)}catch(L){v(k,xe("slash.rename.failed",{error:String(L)}))}C(L=>({...L,[k]:I})),v(k,xe("slash.rename.succeeded",{name:I}))})(),!0):(v(k,xe("slash.rename.usage")),!0)}if(x==="/compact")return(async()=>{v(k,xe("slash.compact.requested"));try{const I=await Ut("/api/thread/compact/start",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({threadId:k})}),L=await I.json();if(!I.ok||!(L!=null&&L.ok))throw new Error(L!=null&&L.details?String(L.details):`HTTP ${I.status}`)}catch(I){v(k,xe("slash.compact.failed",{error:String(I)}))}})(),!0;if(x==="/fork")return(async()=>{v(k,xe("slash.fork.running"));try{const I=await Ut("/api/thread/fork",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({threadId:k})}),L=await I.json();if(!I.ok||!(L!=null&&L.ok))throw new Error(L!=null&&L.details?String(L.details):`HTTP ${I.status}`);const R=String((L==null?void 0:L.threadId)??"").trim();R?n(R):v(k,xe("slash.fork.successNoId"))}catch(I){v(k,xe("slash.fork.failed",{error:String(I)}))}})(),!0;if(x==="/archive"||x==="/unarchive")return(async()=>{const I=x==="/archive"?"/api/thread/archive":"/api/thread/unarchive";v(k,xe(x==="/archive"?"slash.archive.running":"slash.unarchive.running"));try{const L=await Ut(I,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({threadId:k})}),R=await L.json();if(!L.ok||!(R!=null&&R.ok))throw new Error(R!=null&&R.details?String(R.details):`HTTP ${L.status}`);M(),v(k,xe(x==="/archive"?"slash.archive.done":"slash.unarchive.done"))}catch(L){v(k,xe("slash.command.failed",{cmd:x,error:String(L)}))}})(),!0;if(x==="/rollback"){const I=T.trim(),L=I?Number.parseInt(I,10):1;return!Number.isFinite(L)||L<1?(v(k,xe("slash.rollback.usage")),!0):((async()=>{v(k,xe("slash.rollback.running",{numTurns:Math.floor(L)}));try{const R=await Ut("/api/thread/rollback",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({threadId:k,numTurns:Math.floor(L)})}),A=await R.json();if(!R.ok||!(A!=null&&A.ok))throw new Error(A!=null&&A.details?String(A.details):`HTTP ${R.status}`);n(k),v(k,xe("slash.rollback.done"))}catch(R){v(k,xe("slash.rollback.failed",{error:String(R)}))}})(),!0)}return x==="/review"?((async()=>{const I=$$(T);try{const L=await Ut("/api/review/start",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({threadId:k,target:I})}),R=await L.json();if(!L.ok||!(R!=null&&R.ok))throw new Error(R!=null&&R.details?String(R.details):`HTTP ${L.status}`);const A=String((R==null?void 0:R.reviewThreadId)??"").trim();A?n(A):v(k,xe("slash.review.successNoId"))}catch(L){v(k,xe("slash.review.failed",{error:String(L)}))}})(),!0):x==="/experimental"||x==="/skills"}function z$(e){var f,v,m,S,y,g,_,w,b;if(e.currentThreadBusy)return;const t=e.text.trim();if(!t)return;if(t.startsWith("//")){if(!e.currentThreadId){e.setError("请先打开线程(可输入 /new 新建线程)");return}let C=t.slice(1);C=hh(C,e.pendingAttachments);const M=e.queueWsMessage({type:"submit",threadId:e.currentThreadId,text:C});(f=e.appendOptimisticUserMessage)==null||f.call(e,{threadId:e.currentThreadId,text:C,clientMessageId:M,ts:Date.now()}),e.pendingAttachments.length&&e.clearPendingAttachments();return}if(t.startsWith("$$")){if(!e.currentThreadId){e.setError("请先打开线程(可输入 /new 新建线程)");return}let C=t.slice(1);C=hh(C,e.pendingAttachments);const M=e.queueWsMessage({type:"submit",threadId:e.currentThreadId,text:C});(v=e.appendOptimisticUserMessage)==null||v.call(e,{threadId:e.currentThreadId,text:C,clientMessageId:M,ts:Date.now()}),e.pendingAttachments.length&&e.clearPendingAttachments();return}const r=_$(t);if(j$({parsed:r,currentThreadId:e.currentThreadId,openThread:e.openThread,setError:C=>e.setError(C),openModelSettings:e.openModelSettings,setShowPermissions:e.setShowPermissions,setShowExperimental:e.setShowExperimental,loadExperimental:e.loadExperimental,setShowSkills:e.setShowSkills,loadSkills:e.loadSkills,setShowResume:e.setShowResume,setShowWorkspace:e.setShowWorkspace,appendLocalSystemMessage:e.appendLocalSystemMessage,threadModelOverrides:e.threadModelOverrides,webModelDefaults:e.webModelDefaults,threadStartDefaults:e.threadStartDefaults,effectiveModelList:e.effectiveModelList,resolveCollaborationMode:e.resolveCollaborationMode,stripReasoningEffortFromCollab:e.stripReasoningEffortFromCollab,setThreadCollaborationOverrides:e.setThreadCollaborationOverrides,setThreadNameOverrides:e.setThreadNameOverrides,refreshThreads:e.refreshThreads}))return;const n=e.currentThreadId?e.threadModelOverrides[e.currentThreadId]??{}:{},i=((m=n.model)==null?void 0:m.trim())||((S=e.webModelDefaults.model)==null?void 0:S.trim())||((y=e.threadStartDefaults.model)==null?void 0:y.trim())||void 0,s=((g=n.reasoningEffort)==null?void 0:g.trim())||((_=e.webModelDefaults.reasoningEffort)==null?void 0:_.trim())||((w=e.threadStartDefaults.reasoningEffort)==null?void 0:w.trim())||void 0,o=e.currentThreadId?e.threadPermissionsOverrides[e.currentThreadId]??{}:{},a=e.currentThreadId?e.threadCollaborationOverrides[e.currentThreadId]:void 0;let l=t;l=hh(l,e.pendingAttachments);const c={type:"submit",threadId:e.currentThreadId,text:l};a?c.collaborationMode=a:i&&(c.model=i),s&&(c.effort=s),o.approvalPolicy&&(c.approvalPolicy=o.approvalPolicy),o.sandbox&&(c.sandbox=o.sandbox);const d=e.queueWsMessage(c),h=e.currentThreadId??"__global__";(b=e.appendOptimisticUserMessage)==null||b.call(e,{threadId:h,text:l,clientMessageId:d,ts:Date.now()}),e.pendingAttachments.length&&e.clearPendingAttachments()}function F$(e){e.currentThreadId&&e.queueWsMessage({type:"interrupt",threadId:e.currentThreadId},{ttlMs:5e3})}function H$(e){const t=p.useCallback(n=>{z$({text:n,currentThreadBusy:e.currentThreadBusy,currentThreadId:e.currentThreadId,pendingAttachments:e.pendingAttachments,clearPendingAttachments:e.clearPendingAttachments,queueWsMessage:e.queueWsMessage,appendOptimisticUserMessage:e.appendOptimisticUserMessage,openThread:e.openThread,setError:i=>e.setError(i),openModelSettings:e.openModelSettings,setShowPermissions:i=>e.setShowPermissions(i),setShowExperimental:i=>e.setShowExperimental(i),loadExperimental:e.loadExperimental,setShowSkills:i=>e.setShowSkills(i),loadSkills:e.loadSkills,setShowResume:i=>e.setShowResume(i),setShowWorkspace:i=>e.setShowWorkspace(i),appendLocalSystemMessage:e.appendLocalSystemMessage,threadModelOverrides:e.threadModelOverrides,webModelDefaults:e.webModelDefaults,threadStartDefaults:e.threadStartDefaults,effectiveModelList:e.effectiveModelList,resolveCollaborationMode:e.resolveCollaborationMode,stripReasoningEffortFromCollab:e.stripReasoningEffortFromCollab,setThreadCollaborationOverrides:i=>e.setThreadCollaborationOverrides(i),setThreadNameOverrides:i=>e.setThreadNameOverrides(i),refreshThreads:e.refreshThreads,threadPermissionsOverrides:e.threadPermissionsOverrides,threadCollaborationOverrides:e.threadCollaborationOverrides})},[e]),r=p.useCallback(()=>{F$({currentThreadId:e.currentThreadId,queueWsMessage:e.queueWsMessage})},[e.currentThreadId,e.queueWsMessage]);return{submit:t,stop:r}}function W$(e){const[t,r]=p.useState([]),[n,i]=p.useState(!1);return p.useEffect(()=>{r([])},[e.currentThreadId]),{pendingAttachments:t,attachmentUploading:n,clearPendingAttachments:()=>{r([]),e.imageFileInputRef.current&&(e.imageFileInputRef.current.value=""),requestAnimationFrame(()=>{var l;return(l=e.composerTextareaRef.current)==null?void 0:l.focus()})},removePendingAttachment:l=>{r(c=>c.filter(d=>d.localPath!==l)),requestAnimationFrame(()=>{var c;return(c=e.composerTextareaRef.current)==null?void 0:c.focus()})},uploadAttachmentFiles:async(l,c)=>{if(!n&&l.length){i(!0),e.setError(null);try{for(const d of l){B$(d);const h=await O$(d);r(f=>[...f,h])}requestAnimationFrame(()=>{var d;return(d=e.composerTextareaRef.current)==null?void 0:d.focus()})}catch(d){D$(d)?e.setError(d.message):e.setError(xe("attachment.error.uploadFailed",{error:String(d)}))}finally{i(!1),e.imageFileInputRef.current&&(e.imageFileInputRef.current.value="")}}}}}const wS={light:"#f6f7f9",dark:"#081225"};function U$(e){const t=Za(e);if(!t)return null;const r=Number.parseInt(t.slice(1,3),16),n=Number.parseInt(t.slice(3,5),16),i=Number.parseInt(t.slice(5,7),16);return[r,n,i].every(s=>Number.isFinite(s))?{r,g:n,b:i}:null}function K$(e){p.useEffect(()=>{document.documentElement.dataset.theme=e.theme,localStorage.setItem(tb,e.theme);const t=Aa(e.backgroundColor),r=wS[e.theme]??wS.light,n=t??r,i=t??gI(e.theme),s=vI(n);let o=document.querySelector('meta[name="theme-color"]');o instanceof HTMLMetaElement||(o=document.createElement("meta"),o.setAttribute("name","theme-color"),document.head.appendChild(o)),o.setAttribute("content",i);const a=document.documentElement.style;a.setProperty("--scrollbar-track",s.track),a.setProperty("--scrollbar-thumb",s.thumb),a.setProperty("--scrollbar-thumb-hover",s.thumbHover)},[e.backgroundColor,e.theme]),p.useEffect(()=>{const t=Za(e.accentColor),r=document.documentElement.style;if(!t){localStorage.removeItem(uf),r.removeProperty("--user-accent"),r.removeProperty("--user-accent-soft"),r.removeProperty("--user-accent-strong");return}localStorage.setItem(uf,t),r.setProperty("--user-accent",t);const n=U$(t);if(!n){r.removeProperty("--user-accent-soft"),r.removeProperty("--user-accent-strong");return}const i=`rgba(${n.r}, ${n.g}, ${n.b}, 0.18)`,s=`rgba(${n.r}, ${n.g}, ${n.b}, 0.28)`;r.setProperty("--user-accent-soft",i),r.setProperty("--user-accent-strong",s)},[e.accentColor]),p.useEffect(()=>{const t=Aa(e.backgroundColor),r=document.documentElement.style;if(!t){localStorage.removeItem(df),r.removeProperty("--user-bg");return}localStorage.setItem(df,t),r.setProperty("--user-bg",t)},[e.backgroundColor]),p.useEffect(()=>{localStorage.setItem(x1,JSON.stringify(e.threadNameOverrides))},[e.threadNameOverrides]),p.useEffect(()=>{localStorage.setItem(k1,JSON.stringify(e.threadModelOverrides))},[e.threadModelOverrides]),p.useEffect(()=>{localStorage.setItem(T1,JSON.stringify(e.webModelDefaults))},[e.webModelDefaults]),p.useEffect(()=>{localStorage.setItem(E1,JSON.stringify(e.customModels))},[e.customModels]),p.useEffect(()=>{localStorage.setItem(I1,JSON.stringify(e.threadPermissionsOverrides))},[e.threadPermissionsOverrides]),p.useEffect(()=>{localStorage.setItem(R1,JSON.stringify(e.threadCollaborationOverrides))},[e.threadCollaborationOverrides]),p.useEffect(()=>{if(!e.defaultWorkspace){localStorage.removeItem(gm);return}localStorage.setItem(gm,e.defaultWorkspace)},[e.defaultWorkspace]),p.useEffect(()=>{localStorage.setItem("sidebarCollapsed",String(e.sidebarCollapsed))},[e.sidebarCollapsed]),p.useEffect(()=>{localStorage.setItem(M1,String(e.compactView))},[e.compactView])}function V$(){const[e,t]=p.useState(()=>hI()),[r,n]=p.useState(()=>fI()),[i,s]=p.useState(()=>mI()),[o,a]=p.useState(()=>localStorage.getItem("sidebarCollapsed")!=="false"),[l,c]=p.useState(()=>localStorage.getItem(M1)!=="false"),[d,h]=p.useState(()=>h$()),[f,v]=p.useState(()=>f$()),[m,S]=p.useState(()=>m$()),[y,g]=p.useState(()=>p$()),[_,w]=p.useState(()=>g$()),[b,C]=p.useState(()=>v$()),[M,x]=p.useState(()=>d$());return K$({theme:e,accentColor:r,backgroundColor:i,threadNameOverrides:d,threadModelOverrides:f,webModelDefaults:m,customModels:y,threadPermissionsOverrides:_,threadCollaborationOverrides:b,defaultWorkspace:M,sidebarCollapsed:o,compactView:l}),{theme:e,setTheme:t,accentColor:r,setAccentColor:n,backgroundColor:i,setBackgroundColor:s,sidebarCollapsed:o,setSidebarCollapsed:a,compactView:l,setCompactView:c,threadNameOverrides:d,setThreadNameOverrides:h,threadModelOverrides:f,setThreadModelOverrides:v,webModelDefaults:m,setWebModelDefaults:S,customModels:y,setCustomModels:g,threadPermissionsOverrides:_,setThreadPermissionsOverrides:w,threadCollaborationOverrides:b,setThreadCollaborationOverrides:C,defaultWorkspace:M,setDefaultWorkspace:x}}function q$(e){p.useEffect(()=>{e.isNarrow&&e.setSidebarDrawerOpen(!1)},[e.isNarrow,e.setSidebarDrawerOpen]),p.useEffect(()=>{if(!e.isNarrow||!e.sidebarDrawerOpen)return;const t=r=>{r.key==="Escape"&&e.setSidebarDrawerOpen(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e.isNarrow,e.sidebarDrawerOpen,e.setSidebarDrawerOpen])}async function Y$(e){var R,A;const{currentThreadId:t,currentProposedPlanMessageId:r,status:n,currentThreadBusy:i,currentPending:s,threadCollaborationOverrides:o,threadModelOverrides:a,webModelDefaults:l,threadStartDefaults:c,resolveCollaborationMode:d,setError:h,setDismissedProposedPlanByThread:f,setThreadCollaborationOverrides:v,threadPermissionsOverrides:m,queueWsMessage:S}=e,y=t,g=r;if(!y||!g)return;if(n!=="connected"){h("未连接到后端,暂时无法执行。");return}if(i){h("Codex 正在运行,请稍后再执行。");return}if(s){h("当前有待处理的授权/输入,请先处理后再执行。");return}const _=o[y],w=_?String(_.settings.model??"").trim():"",b=String(((R=a[y])==null?void 0:R.model)??l.model??c.model??"").trim(),C=String(((A=a[y])==null?void 0:A.reasoningEffort)??l.reasoningEffort??c.reasoningEffort??"").trim(),M=w||b,x=C,T=await d("default",M||void 0)??(M?{mode:"default",settings:{model:M,developer_instructions:`# Collaboration Mode: Default
|
|
168
|
-
|
|
169
|
-
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
|
|
170
|
-
`,reasoning_effort:null}}:null);if(!T){h("无法切回默认协作模式(缺少 model 或 collaborationMode 预设未加载)。请先 /model 选一个模型,再重试。");return}f(O=>({...O,[y]:g})),v(O=>{if(!(y in O))return O;const P={...O};return delete P[y],P});const I={type:"submit",threadId:y,text:"请开始按上面的计划执行(不要再输出计划;如需确认请先问我)。",collaborationMode:T};x&&(I.effort=x);const L=m[y]??{};L.approvalPolicy&&(I.approvalPolicy=L.approvalPolicy),L.sandbox&&(I.sandbox=L.sandbox),S(I)}async function G$(e){var f,v,m;const{currentThreadId:t,threadCollaborationOverrides:r,setThreadCollaborationOverrides:n,appendLocalSystemMessage:i,threadModelOverrides:s,webModelDefaults:o,threadStartDefaults:a,effectiveModelList:l,resolveCollaborationMode:c,stripReasoningEffortFromCollab:d,setError:h}=e;if(t){const S=t,y=r[S];if((y==null?void 0:y.mode)==="plan"){n(b=>{if(!(S in b))return b;const C={...b};return delete C[S],C}),i(S,"已切回默认协作模式。");return}const _=String(((f=s[S])==null?void 0:f.model)??"").trim()||String(o.model??"").trim()||String(a.model??"").trim()||((m=(v=l==null?void 0:l.find(b=>b.isDefault))==null?void 0:v.model)==null?void 0:m.trim())||void 0,w=await c("plan",_);if(!w){i(S,"启用 Plan 失败:collaborationMode 预设未提供 model,且当前未选择 model(请先 /model 选一个)。");return}n(b=>({...b,[S]:d(w)})),i(S,"已切换到 Plan 协作模式(持续生效;用 /default 退出)。");return}h("请先打开线程后再切换 Plan 协作模式。")}function X$(e){const{currentThreadId:t,currentProposedPlanMessageId:r,status:n,currentThreadBusy:i,currentPending:s,threadCollaborationOverrides:o,threadModelOverrides:a,webModelDefaults:l,threadStartDefaults:c,resolveCollaborationMode:d,setError:h,setDismissedProposedPlanByThread:f,setThreadCollaborationOverrides:v,threadPermissionsOverrides:m,queueWsMessage:S,composerTextareaRef:y}=e,g=p.useCallback(()=>{const w=t,b=r;!w||!b||(f(C=>({...C,[w]:b})),requestAnimationFrame(()=>{var C;return(C=y.current)==null?void 0:C.focus()}))},[y,r,t,f]),_=p.useCallback(()=>{(async()=>await Y$({currentThreadId:t,currentProposedPlanMessageId:r,status:n,currentThreadBusy:i,currentPending:s,threadCollaborationOverrides:o,threadModelOverrides:a,webModelDefaults:l,threadStartDefaults:c,resolveCollaborationMode:d,setError:w=>h(w),setDismissedProposedPlanByThread:f,setThreadCollaborationOverrides:v,threadPermissionsOverrides:m,queueWsMessage:S}))()},[s,r,i,t,S,d,f,h,v,n,o,a,m,c,l]);return{dismissCurrentProposedPlan:g,executeCurrentProposedPlan:_}}function J$(e){const{pending:t,response:r,queueWsMessage:n,userInputDraftByThreadRef:i,setPendingByThread:s}=e;if(!t)return;n({type:"respond_user_input",requestId:t.requestId,response:r},{ttlMs:10*6e4});const o=t.threadId?t.threadId:"__global__";t.method==="item/tool/requestUserInput"&&delete i.current[o],s(a=>{const l=a[o];if(!l||l.requestId!==t.requestId)return a;const c={...a};return delete c[o],c})}function Q$(e){const{pending:t,respondPending:r}=e;if(t){if(t.method==="item/tool/requestUserInput"){r(t,{answers:{}});return}if(t.method==="applyPatchApproval"||t.method==="execCommandApproval"){r(t,{decision:"abort"});return}r(t,{decision:"decline"})}}async function Z$(e){var f;const{wsRef:t,reconnectAttemptRef:r,wsOutboxRef:n,setAuth:i,setUser:s,setStatus:o,setThreads:a,setChatByThread:l,setCurrentThreadId:c,setPendingByThread:d,userInputDraftByThreadRef:h}=e;try{await fetch("/api/auth/logout",{method:"POST",credentials:"same-origin"})}catch{}(f=t.current)==null||f.close(),t.current=null,r.current=0,n.current.clear(),i("unauthed"),s(null),o("disconnected"),a([]),l({}),c(null),localStorage.removeItem("threadId"),d({}),h.current={}}function e5(e){const{wsRef:t,reconnectAttemptRef:r,wsOutboxRef:n,setAuth:i,setUser:s,setStatus:o,setThreads:a,setChatByThread:l,setCurrentThreadId:c,setPendingByThread:d,userInputDraftByThreadRef:h,queueWsMessage:f}=e,v=p.useCallback((y,g)=>{J$({pending:y,response:g,queueWsMessage:f,userInputDraftByThreadRef:h,setPendingByThread:_=>d(_)})},[f,d,h]),m=p.useCallback(y=>{Q$({pending:y,respondPending:v})},[v]),S=p.useCallback(async()=>{await Z$({wsRef:t,reconnectAttemptRef:r,wsOutboxRef:n,setAuth:y=>i("unauthed"),setUser:y=>s(null),setStatus:y=>o(y),setThreads:y=>a(y),setChatByThread:y=>l(y),setCurrentThreadId:y=>c(null),setPendingByThread:y=>d(y),userInputDraftByThreadRef:h})},[r,i,l,c,d,o,a,s,h,n,t]);return{respondPending:v,cancelPending:m,logout:S}}function t5(e){return p.useMemo(()=>{var s;const t=e.skillsList??[];if(!t.length)return[];const r=e.currentThreadId?(s=e.threads.find(o=>o.id===e.currentThreadId))==null?void 0:s.cwd:null,n=r?t.find(o=>o.cwd===r)??t[0]:t[0];return(Array.isArray(n==null?void 0:n.skills)?n.skills:[]).filter(o=>o&&typeof o.name=="string"&&o.enabled)},[e.currentThreadId,e.skillsList,e.threads])}function r5(e){var l;const t=p.useMemo(()=>{const c=e.currentThreadId??"__global__";return e.chatByThread[c]??[]},[e.currentThreadId,e.chatByThread]),r=p.useMemo(()=>{const c=e.pendingByThread.__global__??null;return e.currentThreadId?e.pendingByThread[e.currentThreadId]??c:c},[e.currentThreadId,e.pendingByThread]),n=p.useMemo(()=>r?g1({threadId:r.threadId,requestId:r.requestId,method:r.method}):"",[r]),i=!!(e.currentThreadId&&((l=e.threadCollaborationOverrides[e.currentThreadId])==null?void 0:l.mode)==="plan"),s=p.useMemo(()=>{if(!e.currentThreadId||!i||r)return null;for(let d=t.length-1;d>=0;d-=1){const h=t[d];if(h.role==="assistant"&&!h.streaming&&h.id.startsWith("v2:plan-"))return e.dismissedProposedPlanByThread[e.currentThreadId]===h.id?null:h.id}const c=JB(t);return!c||c.role!=="assistant"||c.streaming||!XB(c.text)||e.dismissedProposedPlanByThread[e.currentThreadId]===c.id?null:c.id},[t,r,i,e.currentThreadId,e.dismissedProposedPlanByThread]),o=p.useMemo(()=>{if(!e.currentThreadId)return null;const c=e.threads.find(d=>d.id===e.currentThreadId);return C1({threadId:e.currentThreadId,preview:(c==null?void 0:c.preview)??"",chatItems:t,threadNameOverrides:e.threadNameOverrides})},[t,e.currentThreadId,e.threadNameOverrides,e.threads]),a=p.useMemo(()=>t.filter(S1),[t]);return p.useEffect(()=>{e.setShowChanges(!1)},[e.currentThreadId,e.setShowChanges]),p.useEffect(()=>{r&&e.setShowChanges(!1)},[r,e.setShowChanges]),p.useEffect(()=>{if(!e.currentThreadId){document.title="codex-cli-web";return}document.title=o||`Thread: ${e.currentThreadId}`},[o,e.currentThreadId]),{currentChat:t,currentPending:r,currentPendingRequestKey:n,currentThreadInPlan:i,currentProposedPlanMessageId:s,currentThreadTitle:o,currentDiffItems:a}}function n5(e){var v,m;const{currentThreadId:t,threadCollaborationOverrides:r,threadModelOverrides:n,webModelDefaults:i,threadStartDefaults:s,effectiveModelList:o,setThreadModelOverrides:a,appendLocalSystemMessage:l,setError:c}=e,d=["low","medium","high","xhigh"],h=S=>{const y=String(S??"").trim();if(!y||!(o!=null&&o.length))return d;const g=o.find(w=>w.model===y||w.id===y),_=((g==null?void 0:g.supportedReasoningEfforts)??[]).map(w=>w.reasoningEffort).filter(Boolean);return _.length?_:d},f=(S,y)=>{const g=h(y),_=S.trim(),w=g.indexOf(_);return w<0?g[1]??g[0]??"medium":g[(w+1)%g.length]??_};if(t){const S=t,y=r[S],g=y?String(y.settings.model??"").trim()||void 0:String(((v=n[S])==null?void 0:v.model)??i.model??s.model??"").trim()||void 0,_=String(((m=n[S])==null?void 0:m.reasoningEffort)??i.reasoningEffort??s.reasoningEffort??""),w=f(_,g);a(b=>({...b,[S]:{...b[S]??{},reasoningEffort:w}})),l(S,`推理强度已设为 ${w}。`);return}c("请先打开线程后再切换推理强度。")}async function i5(e){var C,M,x;const{modelListLoading:t,effectiveModelList:r,modelList:n,setError:i,loadModels:s,customModels:o,currentThreadId:a,threadCollaborationOverrides:l,threadModelOverrides:c,webModelDefaults:d,threadStartDefaults:h,setThreadCollaborationOverrides:f,setThreadModelOverrides:v,appendLocalSystemMessage:m}=e;if(t)return;let S=r;if(!n){i("模型列表未加载,正在加载…(也可输入 /model 手动选择)");const T=await s();S=P1(T,o)}if(!S||!S.length){i("没有可切换的模型(也可输入 /model 手动设置)");return}const y=S.map(T=>String(T.model||T.id||"").trim()).filter(Boolean),g=[];for(const T of y)g.includes(T)||g.push(T);if(!g.length){i("没有可切换的模型(也可输入 /model 手动设置)");return}const _=T=>S.find(k=>(k.model||k.id)===T)??null,w=(T,k)=>{const I=String(T??"").trim();if(!I)return null;const L=_(k),R=((L==null?void 0:L.supportedReasoningEfforts)??[]).map(O=>O.reasoningEffort).filter(Boolean);if(!R.length||R.includes(I))return I;const A=String((L==null?void 0:L.defaultReasoningEffort)??"").trim();return A&&R.includes(A)?A:R[0]??null},b=T=>{const k=String(T??"").trim(),I=g.indexOf(k);return I<0?g[0]:g[(I+1)%g.length]??g[0]};if(a){const T=a,k=l[T];if(k){const O=b(k.settings.model),P=w(((C=c[T])==null?void 0:C.reasoningEffort)??d.reasoningEffort??h.reasoningEffort??null,O),E={...k,settings:{...k.settings,model:O,reasoning_effort:null}};f(F=>({...F,[T]:E})),v(F=>({...F,[T]:{...F[T]??{},reasoningEffort:P??void 0}})),m(T,`模型已切换为 ${((M=_(O))==null?void 0:M.displayName)||O}(协作模式)。`);return}const I=c[T]??{},L=String(I.model??d.model??h.model??"").trim()||void 0,R=b(L),A=w(I.reasoningEffort??d.reasoningEffort??h.reasoningEffort??null,R);v(O=>({...O,[T]:{...O[T]??{},model:R,reasoningEffort:A??void 0}})),m(T,`模型已切换为 ${((x=_(R))==null?void 0:x.displayName)||R}。`);return}i("请先打开线程后再切换模型。")}function s5(e){const{modelListLoading:t,effectiveModelList:r,modelList:n,loadModels:i,customModels:s,currentThreadId:o,threadCollaborationOverrides:a,threadModelOverrides:l,webModelDefaults:c,threadStartDefaults:d,resolveCollaborationMode:h,stripReasoningEffortFromCollab:f,setThreadCollaborationOverrides:v,setThreadModelOverrides:m,appendLocalSystemMessage:S,setError:y}=e,g=p.useCallback(async()=>{await G$({currentThreadId:o,threadCollaborationOverrides:a,setThreadCollaborationOverrides:v,appendLocalSystemMessage:S,threadModelOverrides:l,webModelDefaults:c,threadStartDefaults:d,effectiveModelList:r,resolveCollaborationMode:h,stripReasoningEffortFromCollab:f,setError:b=>y(b)})},[S,o,r,h,y,v,f,a,l,d,c]),_=p.useCallback(()=>{n5({currentThreadId:o,threadCollaborationOverrides:a,threadModelOverrides:l,webModelDefaults:c,threadStartDefaults:d,effectiveModelList:r,setThreadModelOverrides:m,appendLocalSystemMessage:S,setError:b=>y(b)})},[S,o,r,y,m,a,l,d,c]),w=p.useCallback(async()=>{await i5({modelListLoading:t,effectiveModelList:r,modelList:n,setError:b=>y(b),loadModels:i,customModels:s,currentThreadId:o,threadCollaborationOverrides:a,threadModelOverrides:l,webModelDefaults:c,threadStartDefaults:d,setThreadCollaborationOverrides:v,setThreadModelOverrides:m,appendLocalSystemMessage:S})},[S,o,s,r,i,n,t,y,v,m,a,l,d,c]);return{togglePlanFromToolbar:g,cycleReasoningEffortFromToolbar:_,cycleModelFromToolbar:w}}function o5(e){const[t,r]=p.useState({});return p.useEffect(()=>{if(e!=="authed")return;let n=!1;return(async()=>{try{const i=await Ut("/api/config");if(!i.ok)return;const s=await i.json();if(n)return;const o=s.approvalPolicy==="untrusted"||s.approvalPolicy==="on-failure"||s.approvalPolicy==="on-request"||s.approvalPolicy==="never"?s.approvalPolicy:void 0,a=s.sandboxMode==="read-only"||s.sandboxMode==="workspace-write"||s.sandboxMode==="danger-full-access"?s.sandboxMode:void 0,l=typeof s.model=="string"?s.model.trim():"",c=typeof s.reasoningEffort=="string"?s.reasoningEffort.trim():"";r({approvalPolicy:o,sandbox:a,model:l||void 0,reasoningEffort:c||void 0})}catch{}})(),()=>{n=!0}},[e]),t}function D1(e){const t=Array.isArray(e)?e:[],r=new Set,n=[];for(const i of t){const s=String(i??"").trim();s&&(r.has(s)||(r.add(s),n.push(s)))}return n}async function B1(e){const t=await Ut("/api/workspaces/user-created",e),r=await t.json();if(!t.ok||!(r!=null&&r.ok)){const n=r!=null&&r.details?String(r.details):r!=null&&r.error?r.error:`HTTP ${t.status}`;throw new Error(n)}return{workspaceDirs:D1(r.workspaceDirs)}}async function a5(){return(await B1()).workspaceDirs}async function l5(e){const t=D1(e);return(await B1({method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({workspaceDirs:t})})).workspaceDirs}function c5(e){const[t,r]=p.useState([]),[n,i]=p.useState(!1),[s,o]=p.useState(!1),a=p.useRef(0),l=p.useCallback(async()=>{if(e.auth!=="authed"||!e.username){r([]);return}const f=a.current+1;a.current=f,i(!0);try{const v=await a5();if(a.current!==f)return;r(v)}catch(v){if(a.current!==f)return;r([]),e.setError(`加载用户工作目录失败:${String(v)}`)}finally{a.current===f&&i(!1)}},[e.auth,e.username,e.setError]),c=p.useCallback(async f=>{if(e.auth!=="authed"||!e.username)return r([]),[];const v=Ji(f);o(!0);try{const m=await l5(v);return r(m),m}catch(m){return e.setError(`保存用户工作目录失败:${String(m)}`),t}finally{o(!1)}},[e.auth,e.username,e.setError,t]),d=p.useCallback(async f=>{const v=String(f??"").trim();if(!v)return;const m=Ji([...t,v]);await c(m)},[c,t]),h=p.useCallback(async f=>{const v=String(f??"").trim();if(!v)return;const m=t.filter(S=>S!==v);await c(m)},[c,t]);return p.useEffect(()=>{if(e.auth!=="authed"||!e.username){r([]),i(!1);return}l()},[e.auth,e.username,l]),{workspaceDirs:t,loading:n,saving:s,reloadWorkspaceDirs:l,replaceWorkspaceDirs:c,addWorkspaceDir:d,removeWorkspaceDir:h}}const u5={locale:"zh-CN",theme:"light",accentColor:null,backgroundColor:null,sidebarCollapsed:!0,compactView:!0,threadNameOverrides:{},threadModelOverrides:{},webModelDefaults:{},customModels:[],threadPermissionsOverrides:{},threadCollaborationOverrides:{},defaultWorkspace:null};function pn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Gs(e){const t=typeof e=="string"?e.trim():"";return t||null}function pu(e){const t=typeof e=="string"?e.trim():"";return t||void 0}function d5(e){return Sp(e)??"zh-CN"}function h5(e){if(!Array.isArray(e))return[];const t=new Set,r=[];for(const n of e){const i=String(n??"").trim();i&&(t.has(i)||(t.add(i),r.push(i)))}return r}function f5(e){if(!pn(e))return{};const t={};for(const[r,n]of Object.entries(e)){const i=String(r??"").trim();if(!i)continue;const s=String(n??"").trim();s&&(t[i]=s)}return t}function m5(e){if(!pn(e))return{};const t={};for(const[r,n]of Object.entries(e)){const i=String(r??"").trim();if(!i||!pn(n))continue;const s=pu(n.model),o=pu(n.reasoningEffort);!s&&!o||(t[i]={model:s,reasoningEffort:o})}return t}function p5(e){if(!pn(e))return{};const t=pu(e.model),r=pu(e.reasoningEffort);return!t&&!r?{}:{model:t,reasoningEffort:r}}function g5(e){if(!pn(e))return{};const t={};for(const[r,n]of Object.entries(e)){const i=String(r??"").trim();if(!i||!pn(n))continue;const s=n.approvalPolicy,o=s==="untrusted"||s==="on-failure"||s==="on-request"||s==="never"?s:void 0,a=n.sandbox,l=a==="read-only"||a==="workspace-write"||a==="danger-full-access"?a:void 0;!o&&!l||(t[i]={approvalPolicy:o,sandbox:l})}return t}function v5(e){if(!pn(e))return{};const t={};for(const[r,n]of Object.entries(e)){const i=String(r??"").trim();if(!i||!pn(n))continue;const s=n.mode==="plan"||n.mode==="default"?n.mode:null,o=pn(n.settings)?n.settings:null,a=Gs(o==null?void 0:o.model);if(!s||!o||!a)continue;const l=Gs(o.developer_instructions),c=s==="plan"?null:Gs(o.reasoning_effort);t[i]={mode:s,settings:{model:a,developer_instructions:l,reasoning_effort:c}}}return t}function Ku(e){const t=pn(e)?e:{};return{locale:d5(t.locale),theme:t.theme==="dark"?"dark":"light",accentColor:Gs(t.accentColor),backgroundColor:Gs(t.backgroundColor),sidebarCollapsed:typeof t.sidebarCollapsed=="boolean"?t.sidebarCollapsed:!0,compactView:typeof t.compactView=="boolean"?t.compactView:!0,threadNameOverrides:f5(t.threadNameOverrides),threadModelOverrides:m5(t.threadModelOverrides),webModelDefaults:p5(t.webModelDefaults),customModels:h5(t.customModels),threadPermissionsOverrides:g5(t.threadPermissionsOverrides),threadCollaborationOverrides:v5(t.threadCollaborationOverrides),defaultWorkspace:Gs(t.defaultWorkspace)}}function O1(e,t){if(!(e.ok&&(t!=null&&t.ok)))throw new Error(t!=null&&t.details?String(t.details):`HTTP ${e.status}`)}async function $1(e){const t=await e.text(),r=String(t??"");if(!r.trim())return{};try{return JSON.parse(r)}catch{const n=r.slice(0,120).replace(/\s+/g," ");throw new Error(`non_json_response status=${e.status} body=${n}`)}}async function _5(){const e=await Ut("/api/user-settings"),t=await $1(e);return O1(e,t),Ku(t.settings??u5)}async function y5(e){const t=await Ut("/api/user-settings",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({settings:e})}),r=await $1(t);return O1(t,r),Ku(r.settings??e)}const S5=600,w5=1200;function bS(e){const t=String(e??"");return t?!!(t.includes("non_json_response")||t.includes("HTTP 404")||t.includes("HTTP 501")):!1}function b5(e){return Ku({locale:e.locale,theme:e.theme,accentColor:e.accentColor,backgroundColor:e.backgroundColor,sidebarCollapsed:e.sidebarCollapsed,compactView:e.compactView,threadNameOverrides:e.threadNameOverrides,threadModelOverrides:e.threadModelOverrides,webModelDefaults:e.webModelDefaults,customModels:e.customModels,threadPermissionsOverrides:e.threadPermissionsOverrides,threadCollaborationOverrides:e.threadCollaborationOverrides,defaultWorkspace:e.defaultWorkspace})}function CS(e,t){e.setLocale(t.locale),e.setTheme(t.theme),e.setAccentColor(t.accentColor),e.setBackgroundColor(t.backgroundColor),e.setSidebarCollapsed(t.sidebarCollapsed),e.setCompactView(t.compactView),e.setThreadNameOverrides(t.threadNameOverrides),e.setThreadModelOverrides(t.threadModelOverrides),e.setWebModelDefaults(t.webModelDefaults),e.setCustomModels(t.customModels),e.setThreadPermissionsOverrides(t.threadPermissionsOverrides),e.setThreadCollaborationOverrides(t.threadCollaborationOverrides),e.setDefaultWorkspace(t.defaultWorkspace)}function C5(e){const t=p.useRef(e.setters),r=p.useRef(e.setError),n=p.useRef(null),i=p.useRef(!1),s=p.useRef(null),o=p.useRef(0),a=p.useRef(null),l=p.useRef(!0),c=p.useMemo(()=>b5(e.state),[e.state]),d=p.useMemo(()=>JSON.stringify(c),[c]);p.useEffect(()=>{t.current=e.setters,r.current=e.setError},[e.setError,e.setters]),p.useEffect(()=>{const h=String(e.username??"").trim();if(e.auth!=="authed"||!h){n.current=null,i.current=!1,s.current=null,o.current=0,l.current=!0,a.current!==null&&(window.clearTimeout(a.current),a.current=null);return}if(n.current===h)return;let f=!1;return i.current=!0,_5().then(v=>{f||(CS(t.current,v),s.current=JSON.stringify(v),o.current=Date.now()+w5)}).catch(v=>{if(!f){if(bS(v)){l.current=!1;return}r.current(`加载用户配置失败:${String(v)}`)}}).finally(()=>{f||(n.current=h,i.current=!1)}),()=>{f=!0}},[e.auth,e.username]),p.useEffect(()=>{const h=String(e.username??"").trim();if(!(e.auth!=="authed"||!h)&&n.current===h&&l.current&&!i.current&&!(Date.now()<o.current)&&d!==s.current)return a.current!==null&&(window.clearTimeout(a.current),a.current=null),a.current=window.setTimeout(()=>{const f=Ku(JSON.parse(d));y5(f).then(v=>{const m=JSON.stringify(v);s.current=m,m!==d&&CS(t.current,v)}).catch(v=>{if(bS(v)){l.current=!1;return}r.current(`保存用户配置失败:${String(v)}`)}),a.current=null},S5),()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null)}},[e.auth,e.username,d])}const _n=Object.create(null);_n.open="0";_n.close="1";_n.ping="2";_n.pong="3";_n.message="4";_n.upgrade="5";_n.noop="6";const Rc=Object.create(null);Object.keys(_n).forEach(e=>{Rc[_n[e]]=e});const vm={type:"error",data:"parser error"},j1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",z1=typeof ArrayBuffer=="function",F1=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,hg=({type:e,data:t},r,n)=>j1&&t instanceof Blob?r?n(t):xS(t,n):z1&&(t instanceof ArrayBuffer||F1(t))?r?n(t):xS(new Blob([t]),n):n(_n[e]+(t||"")),xS=(e,t)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];t("b"+(n||""))},r.readAsDataURL(e)};function kS(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let fh;function x5(e,t){if(j1&&e.data instanceof Blob)return e.data.arrayBuffer().then(kS).then(t);if(z1&&(e.data instanceof ArrayBuffer||F1(e.data)))return t(kS(e.data));hg(e,!1,r=>{fh||(fh=new TextEncoder),t(fh.encode(r))})}const TS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ra=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<TS.length;e++)ra[TS.charCodeAt(e)]=e;const k5=e=>{let t=e.length*.75,r=e.length,n,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(n=0;n<r;n+=4)s=ra[e.charCodeAt(n)],o=ra[e.charCodeAt(n+1)],a=ra[e.charCodeAt(n+2)],l=ra[e.charCodeAt(n+3)],d[i++]=s<<2|o>>4,d[i++]=(o&15)<<4|a>>2,d[i++]=(a&3)<<6|l&63;return c},T5=typeof ArrayBuffer=="function",fg=(e,t)=>{if(typeof e!="string")return{type:"message",data:H1(e,t)};const r=e.charAt(0);return r==="b"?{type:"message",data:E5(e.substring(1),t)}:Rc[r]?e.length>1?{type:Rc[r],data:e.substring(1)}:{type:Rc[r]}:vm},E5=(e,t)=>{if(T5){const r=k5(e);return H1(r,t)}else return{base64:!0,data:e}},H1=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},W1="",I5=(e,t)=>{const r=e.length,n=new Array(r);let i=0;e.forEach((s,o)=>{hg(s,!1,a=>{n[o]=a,++i===r&&t(n.join(W1))})})},R5=(e,t)=>{const r=e.split(W1),n=[];for(let i=0;i<r.length;i++){const s=fg(r[i],t);if(n.push(s),s.type==="error")break}return n};function M5(){return new TransformStream({transform(e,t){x5(e,r=>{const n=r.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(r)})}})}let mh;function rc(e){return e.reduce((t,r)=>t+r.length,0)}function nc(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let n=0;for(let i=0;i<t;i++)r[i]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function P5(e,t){mh||(mh=new TextDecoder);const r=[];let n=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(r.push(o);;){if(n===0){if(rc(r)<1)break;const l=nc(r,1);s=(l[0]&128)===128,i=l[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(rc(r)<2)break;const l=nc(r,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),n=3}else if(n===2){if(rc(r)<8)break;const l=nc(r,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(vm);break}i=d*Math.pow(2,32)+c.getUint32(4),n=3}else{if(rc(r)<i)break;const l=nc(r,i);a.enqueue(fg(s?l:mh.decode(l),t)),n=0}if(i===0||i>e){a.enqueue(vm);break}}}})}const U1=4;function mt(e){if(e)return L5(e)}function L5(e){for(var t in mt.prototype)e[t]=mt.prototype[t];return e}mt.prototype.on=mt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};mt.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this};mt.prototype.off=mt.prototype.removeListener=mt.prototype.removeAllListeners=mt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var n,i=0;i<r.length;i++)if(n=r[i],n===t||n.fn===t){r.splice(i,1);break}return r.length===0&&delete this._callbacks["$"+e],this};mt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,i=r.length;n<i;++n)r[n].apply(this,t)}return this};mt.prototype.emitReserved=mt.prototype.emit;mt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};mt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Vu=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,r)=>r(t,0),Pr=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),A5="arraybuffer";function K1(e,...t){return t.reduce((r,n)=>(e.hasOwnProperty(n)&&(r[n]=e[n]),r),{})}const N5=Pr.setTimeout,D5=Pr.clearTimeout;function qu(e,t){t.useNativeTimers?(e.setTimeoutFn=N5.bind(Pr),e.clearTimeoutFn=D5.bind(Pr)):(e.setTimeoutFn=Pr.setTimeout.bind(Pr),e.clearTimeoutFn=Pr.clearTimeout.bind(Pr))}const B5=1.33;function O5(e){return typeof e=="string"?$5(e):Math.ceil((e.byteLength||e.size)*B5)}function $5(e){let t=0,r=0;for(let n=0,i=e.length;n<i;n++)t=e.charCodeAt(n),t<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(n++,r+=4);return r}function V1(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function j5(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}function z5(e){let t={},r=e.split("&");for(let n=0,i=r.length;n<i;n++){let s=r[n].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class F5 extends Error{constructor(t,r,n){super(t),this.description=r,this.context=n,this.type="TransportError"}}class mg extends mt{constructor(t){super(),this.writable=!1,qu(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,r,n){return super.emitReserved("error",new F5(t,r,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const r=fg(t,this.socket.binaryType);this.onPacket(r)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,r={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const r=j5(t);return r.length?"?"+r:""}}class H5 extends mg{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const r=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};R5(t,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,I5(t,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=V1()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(t,r)}}let q1=!1;try{q1=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const W5=q1;function U5(){}class K5 extends H5{constructor(t){if(super(t),typeof location<"u"){const r=location.protocol==="https:";let n=location.port;n||(n=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||n!==t.port}}doWrite(t,r){const n=this.request({method:"POST",data:t});n.on("success",r),n.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=t}}class gn extends mt{constructor(t,r,n){super(),this.createRequest=t,qu(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var t;const r=K1(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=gn.requestsCount++,gn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=U5,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete gn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}gn.requestsCount=0;gn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ES);else if(typeof addEventListener=="function"){const e="onpagehide"in Pr?"pagehide":"unload";addEventListener(e,ES,!1)}}function ES(){for(let e in gn.requests)gn.requests.hasOwnProperty(e)&&gn.requests[e].abort()}const V5=function(){const e=Y1({xdomain:!1});return e&&e.responseType!==null}();class q5 extends K5{constructor(t){super(t);const r=t&&t.forceBase64;this.supportsBinary=V5&&!r}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new gn(Y1,this.uri(),t)}}function Y1(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||W5))return new XMLHttpRequest}catch{}if(!t)try{return new Pr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const G1=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Y5 extends mg{get name(){return"websocket"}doOpen(){const t=this.uri(),r=this.opts.protocols,n=G1?{}:K1(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,r,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let r=0;r<t.length;r++){const n=t[r],i=r===t.length-1;hg(n,this.supportsBinary,s=>{try{this.doWrite(n,s)}catch{}i&&Vu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=V1()),this.supportsBinary||(r.b64=1),this.createUri(t,r)}}const ph=Pr.WebSocket||Pr.MozWebSocket;class G5 extends Y5{createSocket(t,r,n){return G1?new ph(t,r,n):r?new ph(t,r):new ph(t)}doWrite(t,r){this.ws.send(r)}}class X5 extends mg{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const r=P5(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(r).getReader(),i=M5();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{n.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let r=0;r<t.length;r++){const n=t[r],i=r===t.length-1;this._writer.write(n).then(()=>{i&&Vu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const J5={websocket:G5,webtransport:X5,polling:q5},Q5=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Z5=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function _m(e){if(e.length>8e3)throw"URI too long";const t=e,r=e.indexOf("["),n=e.indexOf("]");r!=-1&&n!=-1&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));let i=Q5.exec(e||""),s={},o=14;for(;o--;)s[Z5[o]]=i[o]||"";return r!=-1&&n!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=e3(s,s.path),s.queryKey=t3(s,s.query),s}function e3(e,t){const r=/\/{2,9}/g,n=t.replace(r,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&n.splice(0,1),t.slice(-1)=="/"&&n.splice(n.length-1,1),n}function t3(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,s){i&&(r[i]=s)}),r}const ym=typeof addEventListener=="function"&&typeof removeEventListener=="function",Mc=[];ym&&addEventListener("offline",()=>{Mc.forEach(e=>e())},!1);class li extends mt{constructor(t,r){if(super(),this.binaryType=A5,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(r=t,t=null),t){const n=_m(t);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=_m(r.host).host);qu(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=z5(this.opts.query)),ym&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Mc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const r=Object.assign({},this.opts.query);r.EIO=U1,r.transport=t,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&li.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(t);r.open(),this.setTransport(r)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",li.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=t.data,this._onError(r);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(r+=O5(i)),n>0&&r>this._maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Vu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,r,n){return this._sendPacket("message",t,r,n),this}send(t,r,n){return this._sendPacket("message",t,r,n),this}_sendPacket(t,r,n,i){if(typeof r=="function"&&(i=r,r=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const s={type:t,data:r,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),t()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}_onError(t){if(li.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ym&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=Mc.indexOf(this._offlineEventListener);n!==-1&&Mc.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,r),this.writeBuffer=[],this._prevBufferLen=0}}}li.protocol=U1;class r3 extends li{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let r=this.createTransport(t),n=!1;li.priorWebsocketSuccess=!1;const i=()=>{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",h=>{if(!n)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;li.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(d(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=r.name,this.emitReserved("upgradeError",f)}}))};function s(){n||(n=!0,d(),r.close(),r=null)}const o=h=>{const f=new Error("probe error: "+h);f.transport=r.name,s(),this.emitReserved("upgradeError",f)};function a(){o("transport closed")}function l(){o("socket closed")}function c(h){r&&h.name!==r.name&&s()}const d=()=>{r.removeListener("open",i),r.removeListener("error",o),r.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};r.once("open",i),r.once("error",o),r.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const r=[];for(let n=0;n<t.length;n++)~this.transports.indexOf(t[n])&&r.push(t[n]);return r}}let n3=class extends r3{constructor(t,r={}){const n=typeof t=="object"?t:r;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(i=>J5[i]).filter(i=>!!i)),super(t,n)}};function i3(e,t="",r){let n=e;r=r||typeof location<"u"&&location,e==null&&(e=r.protocol+"//"+r.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=r.protocol+e:e=r.host+e),/^(https?|wss?):\/\//.test(e)||(typeof r<"u"?e=r.protocol+"//"+e:e="https://"+e),n=_m(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const s=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+t,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}const s3=typeof ArrayBuffer=="function",o3=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,X1=Object.prototype.toString,a3=typeof Blob=="function"||typeof Blob<"u"&&X1.call(Blob)==="[object BlobConstructor]",l3=typeof File=="function"||typeof File<"u"&&X1.call(File)==="[object FileConstructor]";function pg(e){return s3&&(e instanceof ArrayBuffer||o3(e))||a3&&e instanceof Blob||l3&&e instanceof File}function Pc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,n=e.length;r<n;r++)if(Pc(e[r]))return!0;return!1}if(pg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Pc(e.toJSON(),!0);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&Pc(e[r]))return!0;return!1}function c3(e){const t=[],r=e.data,n=e;return n.data=Sm(r,t),n.attachments=t.length,{packet:n,buffers:t}}function Sm(e,t){if(!e)return e;if(pg(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}else if(Array.isArray(e)){const r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=Sm(e[n],t);return r}else if(typeof e=="object"&&!(e instanceof Date)){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=Sm(e[n],t));return r}return e}function u3(e,t){return e.data=wm(e.data,t),delete e.attachments,e}function wm(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=wm(e[r],t);else if(typeof e=="object")for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=wm(e[r],t));return e}const d3=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ee;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ee||(Ee={}));class h3{constructor(t){this.replacer=t}encode(t){return(t.type===Ee.EVENT||t.type===Ee.ACK)&&Pc(t)?this.encodeAsBinary({type:t.type===Ee.EVENT?Ee.BINARY_EVENT:Ee.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let r=""+t.type;return(t.type===Ee.BINARY_EVENT||t.type===Ee.BINARY_ACK)&&(r+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(r+=t.nsp+","),t.id!=null&&(r+=t.id),t.data!=null&&(r+=JSON.stringify(t.data,this.replacer)),r}encodeAsBinary(t){const r=c3(t),n=this.encodeAsString(r.packet),i=r.buffers;return i.unshift(n),i}}class gg extends mt{constructor(t){super(),this.reviver=t}add(t){let r;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(t);const n=r.type===Ee.BINARY_EVENT;n||r.type===Ee.BINARY_ACK?(r.type=n?Ee.EVENT:Ee.ACK,this.reconstructor=new f3(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(pg(t)||t.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(t),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let r=0;const n={type:Number(t.charAt(0))};if(Ee[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===Ee.BINARY_EVENT||n.type===Ee.BINARY_ACK){const s=r+1;for(;t.charAt(++r)!=="-"&&r!=t.length;);const o=t.substring(s,r);if(o!=Number(o)||t.charAt(r)!=="-")throw new Error("Illegal attachments");n.attachments=Number(o)}if(t.charAt(r+1)==="/"){const s=r+1;for(;++r&&!(t.charAt(r)===","||r===t.length););n.nsp=t.substring(s,r)}else n.nsp="/";const i=t.charAt(r+1);if(i!==""&&Number(i)==i){const s=r+1;for(;++r;){const o=t.charAt(r);if(o==null||Number(o)!=o){--r;break}if(r===t.length)break}n.id=Number(t.substring(s,r+1))}if(t.charAt(++r)){const s=this.tryParse(t.substr(r));if(gg.isPayloadValid(n.type,s))n.data=s;else throw new Error("invalid payload")}return n}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,r){switch(t){case Ee.CONNECT:return IS(r);case Ee.DISCONNECT:return r===void 0;case Ee.CONNECT_ERROR:return typeof r=="string"||IS(r);case Ee.EVENT:case Ee.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&d3.indexOf(r[0])===-1);case Ee.ACK:case Ee.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class f3{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const r=u3(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function IS(e){return Object.prototype.toString.call(e)==="[object Object]"}const m3=Object.freeze(Object.defineProperty({__proto__:null,Decoder:gg,Encoder:h3,get PacketType(){return Ee}},Symbol.toStringTag,{value:"Module"}));function Kr(e,t,r){return e.on(t,r),function(){e.off(t,r)}}const p3=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class J1 extends mt{constructor(t,r,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=r,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Kr(t,"open",this.onopen.bind(this)),Kr(t,"packet",this.onpacket.bind(this)),Kr(t,"error",this.onerror.bind(this)),Kr(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...r){var n,i,s;if(p3.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(r.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const o={type:Ee.EVENT,data:r};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const d=this.ids++,h=r.pop();this._registerAckCallback(d,h),o.id=d}const a=(i=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,r){var n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(i===void 0){this.acks[t]=r;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);r.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),r.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...r){return new Promise((n,i)=>{const s=(o,a)=>o?i(o):n(a);s.withError=!0,r.push(s),this.emit(t,...r)})}_addToQueue(t){let r;typeof t[t.length-1]=="function"&&(r=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>(this._queue[0],i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(i)):(this._queue.shift(),r&&r(null,...s)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!t||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ee.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(n=>String(n.id)===t)){const n=this.acks[t];delete this.acks[t],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ee.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ee.EVENT:case Ee.BINARY_EVENT:this.onevent(t);break;case Ee.ACK:case Ee.BINARY_ACK:this.onack(t);break;case Ee.DISCONNECT:this.ondisconnect();break;case Ee.CONNECT_ERROR:this.destroy();const n=new Error(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n);break}}onevent(t){const r=t.data||[];t.id!=null&&r.push(this.ack(t.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const r=this;let n=!1;return function(...i){n||(n=!0,r.packet({type:Ee.ACK,id:t,data:i}))}}onack(t){const r=this.acks[t.id];typeof r=="function"&&(delete this.acks[t.id],r.withError&&t.data.unshift(null),r.apply(this,t.data))}onconnect(t,r){this.id=t,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ee.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const r=this._anyListeners;for(let n=0;n<r.length;n++)if(t===r[n])return r.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const r=this._anyOutgoingListeners;for(let n=0;n<r.length;n++)if(t===r[n])return r.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const n of r)n.apply(this,t.data)}}}function vo(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}vo.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+r:e-r}return Math.min(e,this.max)|0};vo.prototype.reset=function(){this.attempts=0};vo.prototype.setMin=function(e){this.ms=e};vo.prototype.setMax=function(e){this.max=e};vo.prototype.setJitter=function(e){this.jitter=e};class bm extends mt{constructor(t,r){var n;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(r=t,t=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,qu(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new vo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=t;const i=r.parser||m3;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var r;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(r=this.backoff)===null||r===void 0||r.setMin(t),this)}randomizationFactor(t){var r;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(r=this.backoff)===null||r===void 0||r.setJitter(t),this)}reconnectionDelayMax(t){var r;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(r=this.backoff)===null||r===void 0||r.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new n3(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=Kr(r,"open",function(){n.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Kr(r,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),r.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Kr(t,"ping",this.onping.bind(this)),Kr(t,"data",this.ondata.bind(this)),Kr(t,"error",this.onerror.bind(this)),Kr(t,"close",this.onclose.bind(this)),Kr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(r){this.onclose("parse error",r)}}ondecoded(t){Vu(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,r){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new J1(this,t,r),this.nsps[t]=n),n}_destroy(t){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(t){const r=this.encoder.encode(t);for(let n=0;n<r.length;n++)this.engine.write(r[n],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,r){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Uo={};function Lc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const r=i3(e,t.path||"/socket.io"),n=r.source,i=r.id,s=r.path,o=Uo[i]&&s in Uo[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new bm(n,t):(Uo[i]||(Uo[i]=new bm(n,t)),l=Uo[i]),r.query&&!t.query&&(t.query=r.queryKey),l.socket(r.path,t)}Object.assign(Lc,{Manager:bm,Socket:J1,io:Lc,connect:Lc});function g3(e){if(!e)return 0;let t=1;for(let r=0;r<e.length;r+=1)e.charCodeAt(r)===10&&(t+=1);return t}function v3(e){if(!e)return 0;let t=0;for(let r=0;r<e.length;r+=1)e.charCodeAt(r)===10&&(t+=1);return t}function Ko(e){return{chars:e.length,lines:g3(e)}}function _3(e){return yS(e.id)&&e.deliveryStatus==="pending"?3:yS(e.id)?2:e.id.startsWith("u-")||e.id.startsWith("u:")?1:0}function y3(e,t){let r=-1,n=0;for(let o=e.length-1;o>=0;o-=1){const a=e[o];if(a.role!=="user"||a.text!==t.message)continue;const l=_3(a);if(!(l<=0)&&!(l<=n)&&(r=o,n=l,n===3))break}if(r===-1)return null;const i=e[r],s=e.slice();return s[r]={...i,id:t.id,ts:t.ts,deliveryStatus:"sent"},s}function ic(e){const t=new Map;for(let r=0;r<e.length;r+=1){const n=lr(e[r].id);n&&t.set(n,r)}return t}function S3(e,t){var s,o,a,l,c,d,h,f;if(!t.length)return e;let r=e,n=ic(r),i=!1;for(const v of t){if(v.op==="upsert"){const m=v.item;if(!(m!=null&&m.id))continue;if(m.role==="user"&&m.text){const w=y3(r,{id:m.id,message:m.text,ts:m.ts});if(w){r=w,n=ic(r),i=!0;continue}}const S=lr(m.id),y=S?n.get(S):void 0;if(y===void 0){i||(r=r.slice(),i=!0),n.set(S||m.id,r.length),r.push(m);continue}const g=r[y];if(!g)continue;const _={...g,...m,id:g.id,ts:v.preserveTs?g.ts:m.ts};_.metrics||(_.metrics=Ko(_.plainText??_.text)),i||(r=r.slice(),i=!0),r[y]=_;continue}if(v.op==="text_delta"){const m=lr(v.id),S=m?n.get(m):void 0;if(S===void 0){i||(r=r.slice(),i=!0),n.set(m||v.id,r.length),r.push({id:v.id,ts:v.ts,role:v.role,text:v.delta,streaming:!0,render:v.render,metrics:Ko(v.delta)});continue}const y=r[S];if(!y)continue;const g=y.metrics??Ko(y.plainText??y.text),_=v3(v.delta),w=y.text.length===0?Ko(v.delta):{chars:g.chars+v.delta.length,lines:g.lines+_},b={...y,text:y.text+v.delta,streaming:!0,render:y.render??v.render,metrics:w};i||(r=r.slice(),i=!0),r[S]=b;continue}if(v.op==="diff_output_delta"){const m=lr(v.id),S=m?n.get(m):void 0;if(S===void 0)continue;const y=r[S];if(!y)continue;const g=y.diff?{...y.diff,output:`${y.diff.output??""}${v.delta}`}:{title:y.text||"文件变更",changes:[],output:v.delta},_={...y,diff:g,streaming:!0,render:y.render??"diff"};i||(r=r.slice(),i=!0),r[S]=_;continue}if(v.op==="finalize"){const m=lr(v.id),S=m?n.get(m):void 0;if(S===void 0)continue;const y=r[S];if(!y)continue;const g=typeof((s=v.patch)==null?void 0:s.text)=="string"&&v.patch.text?v.patch.text:y.text,_={...y,text:g,streaming:!1,render:y.render??((o=v.patch)==null?void 0:o.render),diff:((a=v.patch)==null?void 0:a.diff)??y.diff,plainText:((l=v.patch)==null?void 0:l.plainText)??y.plainText,markdownAst:((c=v.patch)==null?void 0:c.markdownAst)??y.markdownAst,systemToolCallSummary:((d=v.patch)==null?void 0:d.systemToolCallSummary)??y.systemToolCallSummary,metrics:((h=v.patch)==null?void 0:h.metrics)??y.metrics??Ko(((f=v.patch)==null?void 0:f.plainText)??y.plainText??g)};i||(r=r.slice(),i=!0),r[S]=_;continue}if(v.op==="mark_all_streaming_done"){if(!r.some(m=>m.streaming))continue;i||(r=r.slice(),i=!0),r=r.map(m=>m.streaming?{...m,streaming:!1}:m),n=ic(r);continue}if(v.op==="mark_streaming_done_by_prefix"){const m=String(v.prefix??"");if(!m)continue;let S=!1;const y=r.map(g=>!g.streaming||!g.id.startsWith(m)?g:(S=!0,{...g,streaming:!1}));if(!S)continue;r=y,n=ic(r),i=!0;continue}}return r}function w3(e){const t=new Map;for(const r of e.localItems){const n=lr(r.id);n&&t.set(n,r)}for(const r of e.historyItems){const n=lr(r.id);if(!n)continue;const i=t.get(n);t.set(n,i?{...i,...r}:r)}return Array.from(t.values()).sort((r,n)=>r.ts-n.ts)}const RS="v2:rs-";function b3(e){if(!e.startsWith(RS))return null;const t=e.slice(RS.length),r=t.indexOf(":");if(r<=0)return null;const n=t.slice(0,r).trim();if(!n)return null;const i=t.slice(r+1),s=i.indexOf(":");if(s<=0)return null;const o=i.slice(0,s).trim();return o?`${n}:${o}`:null}function C3(e){if(e.startsWith("v2:"))return null;const t=e.indexOf(":");if(t<=0)return null;const r=e.slice(0,t).trim(),n=e.slice(t+1).trim();return!r||!n?null:`${r}:${n}`}function x3(e){const t=new Set;for(const i of e){if(i.role!=="reasoning")continue;const s=b3(i.id);s&&t.add(s)}if(!t.size)return e;let r=!1;const n=e.filter(i=>{if(i.role!=="reasoning")return!0;const s=C3(i.id);return!s||!t.has(s)?!0:(r=!0,!1)});return r?n:e}function Cm(e){return String(e??"").trim()}function k3(e){const t=Cm(e.threadId);if(!t)return null;const r=Cm(e.pendingThreadId),n=g1({threadId:r||null,requestId:e.requestId,method:e.method});return n?{type:"required",kind:v1(e.method)?"choice":"approval",threadId:t,pendingKey:n,requestId:e.requestId,createdAtMs:e.createdAtMs}:null}function T3(e){const t=Cm(e.threadId);return t?{type:"session_completed",threadId:t,createdAtMs:e.createdAtMs}:null}function E3(e){return(String(e??"").trim()||"unknown-request").replace(/[^a-zA-Z0-9._-]/g,"_")}function I3(e){return String(e??"").trim()||"unknown-thread"}function Q1(e,t,r){const n=I3(e),i=E3(t);return`v2:uia-${r}-${n}:${i}`}function gu(e){try{return JSON.stringify(e)}catch{return String(e??"")}}function xm(e){let t=String(e??"").replace(/\s+/g," ").trim();return t=t.replace(/\s*\((?:recommended|推荐)\)\s*$/i,"").trim(),t=t.replace(/\s*((?:recommended|推荐))\s*$/i,"").trim(),t}const vu="审核类型",R3="审核结论";function Yu(e){for(const t of e){if(typeof t!="string")continue;const r=t.trim();if(r)return r}return""}function M3(e){var r,n,i;const t=e??{};return Yu([(r=t==null?void 0:t.item)==null?void 0:r.command,t==null?void 0:t.command,(n=t==null?void 0:t.proposed)==null?void 0:n.command,(i=t==null?void 0:t.request)==null?void 0:i.command])}function P3(e){var r,n;const t=e??{};return Yu([t==null?void 0:t.reason,t==null?void 0:t.prompt,t==null?void 0:t.message,(r=t==null?void 0:t.request)==null?void 0:r.reason,(n=t==null?void 0:t.item)==null?void 0:n.reason])}function L3(e){var r;const t=e??{};return Yu([t==null?void 0:t.cwd,t==null?void 0:t.workingDirectory,(r=t==null?void 0:t.request)==null?void 0:r.cwd])}function A3(e){var r;const t=e??{};return Yu([t==null?void 0:t.itemId,t==null?void 0:t.item_id,(r=t==null?void 0:t.item)==null?void 0:r.id])}function N3(e){return{reason:P3(e),command:M3(e),cwd:L3(e),itemId:A3(e)}}function Z1(e){const t=N3(e),r=[];return t.reason&&r.push(`- reason: ${t.reason}`),t.command&&r.push(`- command: ${t.command}`),t.cwd&&r.push(`- cwd: ${t.cwd}`),!t.command&&t.itemId&&r.push(`- itemId: ${t.itemId}`),r}function D3(e,t){if(e==="item/tool/requestUserInput"){const n=Array.isArray(t==null?void 0:t.questions)?t.questions:[],i=["选择题请求"];if(n.length)for(const s of n){const o=String((s==null?void 0:s.id)??"").trim(),a=String((s==null?void 0:s.header)??"").trim(),l=String((s==null?void 0:s.question)??"").trim(),c=Array.isArray(s==null?void 0:s.options)?s.options.map(h=>String((h==null?void 0:h.label)??"").trim()).filter(Boolean):[],d=a||o||"未命名问题";i.push(`- ${d}${l?`: ${l}`:""}`),c.length&&i.push(` 选项: ${c.join(" / ")}`)}else i.push(`- ${vu}: ${e}`),i.push(`- payload: ${gu(t)}`);return i.join(`
|
|
171
|
-
`)}const r=["审核请求",`- ${vu}: ${e||"unknown"}`];return r.push(...Z1(t)),r.join(`
|
|
172
|
-
`)}function MS(e){const t=e??{},r=t==null?void 0:t.answers;if(!r||typeof r!="object")return[];const n=[];for(const[i,s]of Object.entries(r)){const o=String(i??"").trim()||"unknown",l=(Array.isArray(s==null?void 0:s.answers)?s.answers:Array.isArray(s)?s:[s]).map(d=>String(d??"").trim()).filter(Boolean);if(!l.length)continue;const c=l.map(d=>/[✓✔]$/u.test(d)?d:`${d}✓`);n.push(`- ${o}`),n.push(` 选项: ${c.join(" / ")}`)}return n}function B3(e){const t=e??{},r=t==null?void 0:t.answers;if(!r||typeof r!="object")return{};const n={};for(const[i,s]of Object.entries(r)){const o=String(i??"").trim();if(!o)continue;const l=(Array.isArray(s==null?void 0:s.answers)?s.answers:Array.isArray(s)?s:[s]).map(c=>xm(c)).filter(Boolean);l.length&&(n[o]=l)}return n}function O3(e,t){const r=t??{},n=Array.isArray(r==null?void 0:r.questions)?r.questions:[];if(!n.length)return MS(e);const i=B3(e),s=[];for(const o of n){const a=String((o==null?void 0:o.id)??"").trim();if(!a)continue;const l=String((o==null?void 0:o.header)??"").trim(),c=String((o==null?void 0:o.question)??"").trim(),d=l||a,h=new Set((i[a]??[]).map(v=>xm(v))),f=Array.isArray(o==null?void 0:o.options)?o.options.map(v=>String((v==null?void 0:v.label)??"").trim()).filter(Boolean):[];if(s.push(`- ${d}${c?`: ${c}`:""}`),f.length){const v=f.map(m=>{const S=xm(m);return h.has(S)?`${m}✓`:m});s.push(` 选项: ${v.join(" / ")}`);continue}if(h.size){s.push(` 选项: ${Array.from(h).join(" / ")}✓`);continue}}return s.length?s:MS(e)}function $3(e){const t=e??{},r=t==null?void 0:t.decision;return typeof r=="string"?r.trim():r&&typeof r=="object"&&!Array.isArray(r)?r.acceptWithExecpolicyAmendment?"acceptWithExecpolicyAmendment":r.approved_execpolicy_amendment?"approved_execpolicy_amendment":gu(r):""}function j3(e){return e==="item/commandExecution/requestApproval"?["accept","acceptForSession","acceptWithExecpolicyAmendment","decline","cancel"]:e==="item/fileChange/requestApproval"?["accept","acceptForSession","decline","cancel"]:e==="applyPatchApproval"||e==="execCommandApproval"?["approved","approved_for_session","approved_execpolicy_amendment","denied","abort"]:[]}function z3(e,t,r,n){const i=r??t;if(e==="item/tool/requestUserInput"){const a=["选择题结果"],l=O3(i,n);return l.length?a.push(...l):(a.push(`- ${vu}: ${e}`),a.push(`- payload: ${gu(i)}`)),a.join(`
|
|
173
|
-
`)}const s=$3(i),o=["审核结果",`- ${vu}: ${e||"unknown"}`];if(o.push(...Z1(n)),s){o.push(`- ${R3}: ${s}`);const a=j3(e);if(s&&a.length&&!a.includes(s)&&a.push(s),a.length){const l=a.map(c=>c===s?`${c}✓`:c);o.push(` 选项: ${l.join(" / ")}`)}}else o.push(`- payload: ${gu(i)}`);return o.join(`
|
|
174
|
-
`)}function F3(e){return{id:Q1(e.threadId,e.requestId,"required"),ts:e.ts,role:"system",text:D3(String(e.method??""),e.params),render:"approval",streaming:!1}}function H3(e){return{id:Q1(e.threadId,e.requestId,"resolved"),ts:e.ts,role:"system",text:z3(String(e.method??""),e.response,e.mappedResponse,e.requestParams??null),render:"approval",streaming:!1}}function W3(e,t){const r=`${t} failed`;if(!e.toLowerCase().startsWith(r))return null;const n=e.slice(r.length).trimStart();return n?n.startsWith(":")?n.slice(1).trim()||null:n.trim()||null:null}function vg(e){return String(e??"").trim().toLowerCase()}function ex(e){return vg(e).includes("open_thread failed")}function tx(e){const t=vg(e);return t.includes("thread not found")||t.includes("no such thread")||t.includes("no rollout found for thread id")}function U3(e){const t=String(e??"").trim();if(!t)return"请求失败";const r=vg(t);if(ex(r)){if(r.includes("cwd not allowed"))return"工作区不可用:该目录不在允许范围内。";if(r.includes("cwd not found"))return"工作区不可用:目录不存在。";if(r.includes("cwd is not a directory"))return"工作区不可用:该路径不是目录。";if(r.includes("invalid cwd"))return"工作区不可用:目录路径不合法。";if(r.includes("eacces")||r.includes("eperm")||r.includes("permission denied"))return"工作区不可用:没有权限访问该目录。";if(tx(r))return"会话不可用:该会话不存在或已被清理。";const n=W3(t,"open_thread");return n?`打开会话失败:${n}`:"打开会话失败:请稍后重试。"}return t}const Gn=Number.MAX_SAFE_INTEGER,K3=Gn;function V3(e){const{existing:t,requestId:r,method:n,threadId:i}=e;return t?t.requestId===r&&t.method===n&&t.threadId===i:!1}function PS(e){const t=e.prevChatByThread[e.threadId]??[],r=lr(e.chatItem.id),n=t.findIndex(s=>lr(s.id)===r);if(n===-1)return{...e.prevChatByThread,[e.threadId]:Pi([...t,e.chatItem],Gn)};const i=t.slice();return i[n]={...i[n],...e.chatItem},{...e.prevChatByThread,[e.threadId]:Pi(i,Gn)}}function LS(e){const t=String(e??"").trim().toLowerCase();return t.includes("unauthorized")||t.includes(xe("app.error.authExpired").toLowerCase())}function q3(e){if(!e)return null;if(typeof e=="string")try{const t=JSON.parse(e);return!t||typeof t!="object"||typeof t.type!="string"?null:t}catch{return null}return typeof e!="object"||typeof e.type!="string"?null:e}function Y3(e,t){const r=e,n=Array.isArray(r==null?void 0:r.turns)?r.turns:[],i=Number.isFinite(r==null?void 0:r.createdAt)?Number(r.createdAt)*1e3:(t==null?void 0:t.createdAtMs)??Date.now(),s=Number.isFinite(r==null?void 0:r.turnsTotal)?Math.max(0,Math.floor(Number(r.turnsTotal))):n.length,o=Number.isFinite(r==null?void 0:r.turnsStart)?Math.max(0,Math.floor(Number(r.turnsStart))):Math.max(0,s-n.length);return{createdAtMs:i,turnsStart:o,turnsTotal:s,loadingOlder:!1}}function G3(e){const t=p.useRef(!1),r=p.useRef(!1),n=p.useRef({}),i=p.useRef({}),s=p.useRef({}),o=p.useRef(e.currentThreadId),a=p.useRef(e.chatByThread),l=p.useRef(e.threadTurnsMetaByThread);p.useEffect(()=>{o.current=e.currentThreadId},[e.currentThreadId]),p.useEffect(()=>{a.current=e.chatByThread},[e.chatByThread]),p.useEffect(()=>{l.current=e.threadTurnsMetaByThread},[e.threadTurnsMetaByThread]);const c=p.useRef({}),d=p.useRef(null),h=p.useCallback(()=>{const b=c.current;c.current={};const C=Object.keys(b);C.length&&p.startTransition(()=>{e.setChatByThread(M=>{let x=null;for(const T of C){const k=b[T]??[];if(!k.length)continue;const I=M[T]??[];let L=S3(I,k);L=Pi(L,Gn),L!==I&&(x||(x={...M}),x[T]=L)}return x??M})})},[e]),f=p.useCallback(()=>{d.current===null&&(d.current=window.requestAnimationFrame(()=>{d.current=null,h()}))},[h]);p.useEffect(()=>()=>{d.current!==null&&window.cancelAnimationFrame(d.current)},[]);const v=p.useCallback(b=>{const C=b??e.wsRef.current;if(!C||!C.connected)return;const M=Date.now();for(const[x,T]of e.wsOutboxRef.current.entries()){if(T.expiresAtMs!==null&&T.expiresAtMs<=M){e.wsOutboxRef.current.delete(x);continue}C.emit("message",{...T.message,clientMessageId:x})}},[e.wsOutboxRef,e.wsRef]),m=p.useCallback((b,C)=>{const M=y1(),x=typeof(C==null?void 0:C.ttlMs)=="number"&&Number.isFinite(C.ttlMs)?Math.max(0,C.ttlMs):null,T=x===null?null:Date.now()+x;return e.wsOutboxRef.current.set(M,{message:b,enqueuedAtMs:Date.now(),expiresAtMs:T}),v(),M},[v,e.wsOutboxRef]),S=p.useCallback((b,C)=>{b&&(n.current[b]=C)},[]),y=p.useCallback(b=>{if(!b)return null;const C=n.current[b]??null;return delete n.current[b],C},[]);p.useEffect(()=>{if(e.auth!=="authed")return;let b=!1;t.current=!1,e.setStatus(e.reconnectAttemptRef.current>0?"reconnecting":"connecting");const C=Lc({path:"/socket.io",withCredentials:!0,transports:["polling","websocket"],timeout:1e4,reconnection:!0,reconnectionAttempts:Number.POSITIVE_INFINITY,reconnectionDelay:500,reconnectionDelayMax:5e3,randomizationFactor:.5});e.wsRef.current=C;const M=(P,E)=>{var W;const F=typeof P=="string"?P.trim():"";if(!F)return;const N=Number(E);if(!Number.isFinite(N))return;const V=Math.max(0,Math.min(100,N));s.current[F]!==V&&(s.current[F]=V,(W=e.onThreadContextUsage)==null||W.call(e,{threadId:F,usagePercent:V}))},x=P=>{var D,W;const E=i.current,F=((D=P==null?void 0:P.codexTask)==null?void 0:D.activeByThread)??{},N={},V=new Set([...Object.keys(E),...Object.keys(F)]);for(const j of V){const ee=String(j??"").trim();if(!ee)continue;const te=E[ee]??0,ae=Number(F[ee]??0),H=Number.isFinite(ae)?Math.max(0,Math.floor(ae)):0;if(H>0&&(N[ee]=H),te>0&&H===0){const se=T3({threadId:ee,createdAtMs:Date.now()});se&&((W=e.onSessionCompletedNotice)==null||W.call(e,se))}}i.current=N},T=P=>{var F,N,V,D,W,j,ee,te,ae;const E=q3(P);if(E){if(E.type==="ack"){typeof E.clientMessageId=="string"&&(e.wsOutboxRef.current.delete(E.clientMessageId),E.ackType==="open_thread"&&y(E.clientMessageId),E.ackType==="submit"&&((F=e.onSubmitAck)==null||F.call(e,E.clientMessageId)));return}if(E.type==="ready"){e.setStatus("connected"),e.setWsStatusSnapshot(null);const H=o.current;if(!r.current&&H){const se=a.current[H];if(!se||se.length===0){const B=m({type:"open_thread",threadId:H});S(B,H)}}r.current=!0,C.emit("message",{type:"get_status"}),v(C);return}if(E.type==="status"){e.setWsStatusSnapshot(E.snapshot),x(E.snapshot);return}if(E.type==="thread_opened"){const H=String(E.thread.id),se=typeof E.thread.cwd=="string"?String(E.thread.cwd).trim():"",B=((N=e.shouldIncludeOpenedThreadInList)==null?void 0:N.call(e,{threadId:H,cwd:se||null}))??!0,z=o.current;o.current=H,e.setCurrentThreadId(Z=>Z===H?Z:H),z!==H&&localStorage.setItem("threadId",H),e.setThreads(Z=>B?QO(Z,E.thread):Z.findIndex(re=>re.id===H)<0?Z:Z.filter(re=>re.id!==H)),e.setThreadTurnsMetaByThread(Z=>({...Z,[H]:Y3(E.thread,Z[H])}));const Y=Array.isArray(E.chatItems)?E.chatItems:[];if(Y.length){const Z=b1(Y);Z!=null&&Z.plan.length&&((V=e.onThreadTodoPlanUpdate)==null||V.call(e,{threadId:H,turnId:Z.turnId,explanation:Z.explanation,plan:Z.plan})),e.setChatByThread(ce=>{const re=ce[H];if(!(re!=null&&re.length))return{...ce,[H]:Pi(Y,Gn)};const ge=new Set(Y.map(we=>lr(we.id))),Re=re.filter(we=>!ge.has(lr(we.id))),Oe=Pi([...Y,...Re],Gn);return{...ce,[H]:Oe}})}pO(H,{maxItems:K3}).then(Z=>{Z.length&&e.setChatByThread(ce=>{const re=ce[H]??[],ge=w3({localItems:re,historyItems:Z}),Re=x3(ge);return{...ce,[H]:Pi(Re,Gn)}})}).catch(()=>{}),M(H,(D=E.thread)==null?void 0:D.contextUsagePercent),(W=e.onThreadOpened)==null||W.call(e,{threadId:H,cwd:se||null});return}if(E.type==="thread_turns"){const H=String(E.threadId??""),se=l.current[H],B=(se==null?void 0:se.createdAtMs)??Date.now();e.setChatByThread(z=>{const Y=z[H]??[],Z=Array.isArray(E.chatItems)?E.chatItems:[];if(!Z.length)return z;const ce=new Set(Y.map(ge=>lr(ge.id))),re=[...Z.filter(ge=>!ce.has(lr(ge.id))),...Y];return{...z,[H]:Pi(re,Gn)}}),e.setThreadTurnsMetaByThread(z=>({...z,[H]:{createdAtMs:B,turnsStart:E.turnsStart,turnsTotal:E.turnsTotal,loadingOlder:!1}}));return}if(E.type==="todo_plan_update"){(j=e.onThreadTodoPlanUpdate)==null||j.call(e,E.update);return}if(E.type==="thread_context_usage"){M(E.threadId,E.usagePercent);return}if(E.type==="chat_ops"){const H=o.current;if(!H||E.threadId!==H)return;const se=Array.isArray(E.ops)?E.ops:[];if(!se.length)return;(c.current[E.threadId]??(c.current[E.threadId]=[])).push(...se),f();return}if(E.type==="user_input_required"){const H=typeof E.threadId=="string"||E.threadId===null?E.threadId:y$(E.params),se=typeof H=="string"?H.trim():null,B=se||"__global__";e.setPendingByThread(Z=>{const ce=Z[B];return V3({existing:ce,requestId:E.requestId,method:E.method,threadId:se})?Z:{...Z,[B]:{requestId:E.requestId,threadId:se,method:E.method,params:E.params,fileChanges:Array.isArray(E.fileChanges)?E.fileChanges:void 0}}});const z=se||o.current||"";if(z&&vB(E.method)){const Z=F3({threadId:se,requestId:E.requestId,method:E.method,params:E.params,ts:Date.now()});e.setChatByThread(ce=>PS({prevChatByThread:ce,threadId:z,chatItem:Z}))}const Y=k3({threadId:z||null,pendingThreadId:se,requestId:E.requestId,method:E.method,createdAtMs:Date.now()});Y&&((ee=e.onUserInputRequiredNotice)==null||ee.call(e,Y));return}if(E.type==="user_input_resolved"){e.setPendingByThread(B=>{let z=!1;const Y={...B};for(const[Z,ce]of Object.entries(B))ce.requestId===E.requestId&&(delete Y[Z],z=!0);return z?Y:B});const H=typeof E.threadId=="string"?E.threadId.trim():"",se=H||o.current||"";if(se){const B=H3({threadId:H||null,requestId:E.requestId,method:typeof E.method=="string"?E.method:"",response:E.response,mappedResponse:E.mappedResponse,requestParams:E.requestParams,ts:Date.now()});e.setChatByThread(z=>PS({prevChatByThread:z,threadId:se,chatItem:B}))}return}if(E.type==="error"){const H=U3(E.message),se=ex(E.message);if(se&&((te=e.onThreadOpenFailed)==null||te.call(e)),LS(E.message)){t.current=!0,e.setAuth("unauthed"),e.setUser(null),e.setStatus("disconnected"),e.setError(xe("app.error.authExpired")),C.connected&&C.disconnect();return}let B=null;if(typeof E.clientMessageId=="string"&&E.clientMessageId.trim()){const z=E.clientMessageId.trim();e.wsOutboxRef.current.delete(z),B=y(z),(ae=e.onSubmitError)==null||ae.call(e,z,H)}if(se&&tx(E.message)){const z=o.current;B&&z&&B===z&&(o.current=null,localStorage.removeItem("threadId"),e.setCurrentThreadId(Y=>Y===B?null:Y))}e.setError(H)}}},k=()=>{e.reconnectAttemptRef.current=0,i.current={},v(C)},I=P=>{if(e.wsRef.current===C&&(e.wsRef.current=null),b)return;if(t.current){t.current=!1,e.setStatus("disconnected");return}const E=String(P||"").toLowerCase();e.setStatus("reconnecting"),E==="io server disconnect"&&(e.reconnectAttemptRef.current+=1,C.connect())},L=P=>{const E=String((P==null?void 0:P.message)||"").toLowerCase();if(LS(E)){t.current=!0,e.setAuth("unauthed"),e.setUser(null),e.setStatus("disconnected"),e.setError(xe("app.error.authExpired"));return}e.setStatus("reconnecting")},R=P=>{e.reconnectAttemptRef.current=Number.isFinite(P)?Math.max(0,Math.floor(P)):e.reconnectAttemptRef.current+1,e.setStatus("reconnecting")},A=()=>{e.reconnectAttemptRef.current=0},O=()=>{e.setStatus("disconnected")};return C.on("connect",k),C.on("message",T),C.on("disconnect",I),C.on("connect_error",L),C.io.on("reconnect_attempt",R),C.io.on("reconnect",A),C.io.on("reconnect_failed",O),()=>{b=!0,C.off("connect",k),C.off("message",T),C.off("disconnect",I),C.off("connect_error",L),C.io.off("reconnect_attempt",R),C.io.off("reconnect",A),C.io.off("reconnect_failed",O),C.disconnect(),e.wsRef.current===C&&(e.wsRef.current=null)}},[e.auth]);const g=p.useCallback(b=>{const C=e.wsRef.current;!C||!C.connected||C.emit("message",b)},[e.wsRef]),_=p.useCallback((b,C)=>{if(b&&b.trim()){const T=b.trim(),k=m({type:"open_thread",threadId:T});S(k,T);return}const M={type:"open_thread"};typeof(C==null?void 0:C.cwd)=="string"&&C.cwd.trim()&&(M.cwd=C.cwd.trim()),e.webModelDefaults.model&&(M.model=e.webModelDefaults.model);const x=m(M);S(x,null)},[e.webModelDefaults.model,m,S]),w=p.useCallback(b=>{const C=l.current[b];!C||C.loadingOlder||C.turnsStart<=0||(e.setThreadTurnsMetaByThread(M=>({...M,[b]:{...C,loadingOlder:!0}})),m({type:"load_thread_turns",threadId:b,before:C.turnsStart,limit:50}))},[e.setThreadTurnsMetaByThread,m]);return{queueWsMessage:m,send:g,openThread:_,loadEarlierTurns:w}}const X3=3500,AS=15e3,J3=12e3,Q3=12e3;function Z3(){var Jg;const{locale:e,setLocale:t,t:r,toggleLocale:n}=jt(),i=p.useRef(null),s=p.useRef(0),o=p.useRef(new Map),a=p.useRef({}),l=p.useRef({}),c=p.useRef(null),d=p.useRef(null),h=p.useRef(0),f=p.useRef(!1),v=p.useRef(null),m=p.useRef(null),S=x$("(max-width: 900px)"),[y,g]=p.useState(!1),[_,w]=p.useState("disconnected"),[b,C]=p.useState(null),[M,x]=p.useState(0),{auth:T,setAuth:k,user:I,setUser:L,role:R,workspaces:A}=k$({setError:C,reloadToken:M}),{backendReachability:O,backendStatus:P}=R$({connected:_==="connected"}),[E,F]=p.useState(null),[N,V]=p.useState([]),[D,W]=p.useState(!1),[j,ee]=p.useState(!1),[te,ae]=p.useState(!1),[H,se]=p.useState(()=>localStorage.getItem("threadId")),{composerText:B,setComposerText:z}=A$({currentThreadId:H}),[Y,Z]=p.useState(null),{pendingAttachments:ce,attachmentUploading:re,clearPendingAttachments:ge,removePendingAttachment:Re,uploadAttachmentFiles:Oe}=W$({currentThreadId:H,composerTextareaRef:v,imageFileInputRef:m,setError:C}),{theme:we,setTheme:Me,accentColor:wt,setAccentColor:ue,backgroundColor:ze,setBackgroundColor:st,sidebarCollapsed:bt,setSidebarCollapsed:Lt,compactView:Yt,setCompactView:_o,threadNameOverrides:On,setThreadNameOverrides:yo,threadModelOverrides:Sn,setThreadModelOverrides:So,webModelDefaults:Zr,setWebModelDefaults:cl,customModels:wo,setCustomModels:_g,threadPermissionsOverrides:ul,setThreadPermissionsOverrides:yg,threadCollaborationOverrides:$n,setThreadCollaborationOverrides:bo,defaultWorkspace:Co,setDefaultWorkspace:wn}=V$();C5({auth:T,username:I,setError:C,state:{locale:e,theme:we,accentColor:wt,backgroundColor:ze,sidebarCollapsed:bt,compactView:Yt,threadNameOverrides:On,threadModelOverrides:Sn,webModelDefaults:Zr,customModels:wo,threadPermissionsOverrides:ul,threadCollaborationOverrides:$n,defaultWorkspace:Co},setters:{setLocale:t,setTheme:Me,setAccentColor:ue,setBackgroundColor:st,setSidebarCollapsed:Lt,setCompactView:_o,setThreadNameOverrides:yo,setThreadModelOverrides:So,setWebModelDefaults:cl,setCustomModels:_g,setThreadPermissionsOverrides:yg,setThreadCollaborationOverrides:bo,setDefaultWorkspace:wn}});const[dl,is]=p.useState(null),hl=R??(I?"member":null),lt=hl==="admin",{workspaceDirs:ss,addWorkspaceDir:os,removeWorkspaceDir:rx}=c5({auth:T,username:I,setError:C}),as=p.useMemo(()=>{if(!A.length)return[];const $=N.map(_e=>String(_e.cwd??"").trim()).filter(Boolean),U=Ji([...A,...ss,...$]),he=WB(U,A);return Ji(he)},[A,N,ss]),mr=lt?Co:dl,xo=o5(T),[nx,Sg]=p.useState(!1),[ix,wg]=p.useState(!1),[sx,bg]=p.useState(!1),[ox,Cg]=p.useState(!1),[ax,xg]=p.useState(!1),[lx,kg]=p.useState(!1),[cx,Tg]=p.useState(!1),[ux,Gu]=p.useState(!1),Eg=p.useMemo(()=>VO({role:hl}),[A,hl]),Xu=p.useCallback($=>{Tg(U=>typeof $=="function"?$(U):$)},[]),{modelList:Ju,modelListLoading:Ig,modelListError:dx,loadModels:Qu,experimentalList:hx,experimentalLoading:fx,experimentalError:mx,loadExperimental:Rg,skillsList:Mg,skillsLoading:px,skillsError:gx,loadSkills:Zu,collaborationList:Pg,loadCollaborationModes:Lg}=T$(),[fl,ko]=p.useState({}),[Ag,vx]=p.useState({}),[Ng,Dg]=p.useState({}),[Bg,Og]=p.useState({}),[_x,ed]=p.useState(!1),[$g,jg]=p.useState({}),[yx,Sx]=p.useState({}),[ml,td]=p.useState(null),[en,To]=p.useState(null),[jr,Eo]=p.useState(null),[pl,rd]=p.useState(null),gl=p.useRef(null),nd=p.useRef(null),zg=p.useRef(null),ls=p.useRef(null),cs=p.useRef(null),id=p.useRef(null),vl=p.useRef(null),us=p.useRef(new Map),sd=p.useRef(new Set),Fg=p.useRef([]),od=p.useRef(!1),Hg=p.useRef(os),wx=p.useMemo(()=>r("app.submitTimeoutReason",{seconds:Math.floor(AS/1e3)}),[r]);p.useEffect(()=>{lt||Tg(!1)},[lt]),p.useEffect(()=>{lt||Gu(!1)},[lt]),p.useEffect(()=>{if(T!=="authed"||lt){is(null);return}const $=mS({allowedWorkspaceRoots:A,effectiveWorkspaces:as,currentWorkspace:dl});$!==dl&&is($)},[A,T,as,lt,dl]),p.useEffect(()=>{if(T!=="authed"||!lt)return;const $=mS({allowedWorkspaceRoots:A,effectiveWorkspaces:as,currentWorkspace:Co});$!==Co&&wn($)},[T,A,Co,as,lt,wn]),p.useEffect(()=>{T!=="authed"&&(Dg({}),Og({}))},[T]),p.useEffect(()=>{const $=typeof H=="string"?H.trim():"";id.current=$||null},[H]),p.useEffect(()=>{const $=typeof mr=="string"?mr.trim():"";vl.current=$||null},[mr]),p.useEffect(()=>{sd.current=new Set(ss.map($=>String($??"").trim()).filter(Boolean))},[ss]),p.useEffect(()=>{if(T!=="authed"){us.current=new Map;return}const $=us.current;for(const U of N){const he=String(U.id??"").trim(),_e=String(U.cwd??"").trim();!he||!_e||$.set(he,_e)}},[T,N]),p.useEffect(()=>{if(!jr)return;const $=typeof H=="string"?H.trim():"";$&&$===jr.threadId&&Eo(null)},[H,jr]),p.useEffect(()=>{Fg.current=A},[A]),p.useEffect(()=>{od.current=lt},[lt]),p.useEffect(()=>{Hg.current=os},[os]);const bx=p.useCallback($=>{const U=$.threadId.trim();U&&Dg(he=>he[U]===$.usagePercent?he:{...he,[U]:$.usagePercent})},[]),Cx=p.useCallback($=>{const U=$.threadId.trim();U&&Og(he=>{const _e=he[U];return _e&&_e.turnId===$.turnId&&_e.explanation===$.explanation&&UO(_e.plan,$.plan)?he:{...he,[U]:{turnId:$.turnId,explanation:$.explanation,plan:$.plan,updatedAtMs:Date.now()}}})},[]),xx=p.useCallback($=>{const U=$.threadId.trim(),he=$.pendingKey.trim();if(!U||!he||id.current===U)return;const _e=us.current.get(U),Ve=String(_e??"").trim();if(!Ve)return;const Ci=vl.current,ps=Ci?Ve===Ci:!1,kl=sd.current.has(Ve);if(!ps&&!kl)return;const md=`${U}:${String($.requestId)}:${he}`;zg.current!==md&&(zg.current=md,To(gs=>gs&&gs.type==="required"&&`${gs.threadId}:${String(gs.requestId)}:${gs.pendingKey}`===md?gs:$))},[]),kx=p.useCallback($=>{const U=$.threadId.trim();if(!U||id.current===U)return;const he=us.current.get(U),_e=String(he??"").trim();if(!_e)return;const Ve=vl.current,Ci=Ve?_e===Ve:!1,ps=sd.current.has(_e);!Ci&&!ps||To($)},[]);p.useEffect(()=>{const $=typeof H=="string"?H.trim():"";$&&To(U=>{if(!U)return U;const he=U.threadId.trim();return!he||he!==$?U:null})},[H]);const ds=p.useCallback(($,U,he)=>{ko(_e=>C$({prev:_e,clientMessageId:$,nextStatus:U,failureReason:he}))},[]),Tx=p.useCallback($=>{const U=w$($);ko(_e=>b$({prev:_e,threadId:$.threadId,message:U}));const he=l.current[$.clientMessageId];typeof he=="number"&&window.clearTimeout(he),l.current[$.clientMessageId]=window.setTimeout(()=>{delete l.current[$.clientMessageId],ds($.clientMessageId,"failed",wx)},AS)},[ds]),Ex=p.useCallback($=>{const U=l.current[$];typeof U=="number"&&(window.clearTimeout(U),delete l.current[$]),ds($,"sent",null)},[ds]),Ix=p.useCallback(($,U)=>{const he=l.current[$];typeof he=="number"&&(window.clearTimeout(he),delete l.current[$]),ds($,"failed",U)},[ds]),Rx=p.useCallback($=>{const U=String($??"").trim();if(!U)return;const he=Fg.current;!he.length||!he.some(Ve=>mu(Ve,U))||(od.current?wn(Ve=>Ve===U?Ve:U):is(Ve=>Ve===U?Ve:U),Hg.current(U))},[wn]);p.useEffect(()=>()=>{for(const $ of Object.values(l.current))typeof $=="number"&&window.clearTimeout($);l.current={}},[]);const hs=p.useCallback(()=>{const $=c.current;$!==null&&(window.clearTimeout($),c.current=null)},[]),ad=p.useCallback(()=>{ee(!0),hs(),c.current=window.setTimeout(()=>{c.current=null,ee(!1)},J3)},[hs]),_l=p.useCallback(()=>{hs(),ee(!1)},[hs]),fs=p.useCallback(()=>{const $=d.current;$!==null&&(window.clearTimeout($),d.current=null)},[]),Wg=p.useCallback(()=>{ae(!0),fs(),d.current=window.setTimeout(()=>{d.current=null,ae(!1)},Q3)},[fs]),yl=p.useCallback(()=>{fs(),ae(!1)},[fs]);p.useEffect(()=>()=>{hs()},[hs]),p.useEffect(()=>()=>{fs()},[fs]);const Mx=p.useCallback($=>{const U=String($.cwd??"").trim();if(!U)return!1;const he=vl.current;return he?U===he:od.current},[]),{queueWsMessage:ld,openThread:cd,loadEarlierTurns:Px}=G3({auth:T,currentThreadId:H,chatByThread:fl,threadTurnsMetaByThread:Ag,webModelDefaults:Zr,wsRef:i,reconnectAttemptRef:s,wsOutboxRef:o,setAuth:k,setUser:L,setStatus:w,setThreads:V,setWsStatusSnapshot:F,setCurrentThreadId:se,setThreadTurnsMetaByThread:vx,setChatByThread:ko,setPendingByThread:jg,setError:C,onSubmitAck:Ex,onSubmitError:Ix,onThreadContextUsage:bx,onThreadTodoPlanUpdate:Cx,onUserInputRequiredNotice:xx,onSessionCompletedNotice:kx,shouldIncludeOpenedThreadInList:Mx,onThreadOpened:$=>{const U=String($.threadId??"").trim(),he=String($.cwd??"").trim();U&&he&&us.current.set(U,he),_l(),yl();const _e=ls.current,Ve=cs.current;_e&&(ls.current=null,cs.current=null,_e===$.threadId&&(Rx($.cwd),Ve&&Ve!==$.threadId?Eo({threadId:Ve}):Eo(null)))},onThreadOpenFailed:()=>{ls.current=null,cs.current=null,_l(),yl()}}),zr=p.useCallback($=>{const U=typeof H=="string"?H.trim():"",he=typeof $=="string"?$.trim():"";if(he){(!U||U!==he)&&ad(),cd(he);return}ad();const _e=typeof mr=="string"?mr.trim():"";cd(void 0,{cwd:_e||void 0})},[mr,H,cd,ad]),Lx=p.useCallback(()=>{const $=typeof H=="string"?H.trim():"";$&&(Wg(),zr($))},[H,zr,Wg]),Sl=p.useCallback(()=>{se(null),localStorage.removeItem("threadId")},[]),Ug=p.useMemo(()=>qO({activeWorkspace:mr}),[mr,lt]),ms=p.useCallback($=>{const U=typeof $=="string"?$.trim():"";if(!lt&&!U){h.current+=1,V([]),W(!1);return}const he=h.current+1;h.current=he,W(!0),V([]),c$(U||null).then(_e=>{if(he!==h.current)return;const Ve=JO(_e.threads);V(Ve);for(const Ci of Ve){const ps=String(Ci.id??"").trim(),kl=String(Ci.cwd??"").trim();!ps||!kl||us.current.set(ps,kl)}W(!1)}).catch(_e=>{he===h.current&&(W(!1),C(String((_e==null?void 0:_e.message)??_e)))})},[lt,C]),wl=p.useCallback(()=>{ms(Ug)},[ms,Ug]),bl=p.useCallback(()=>{wl()},[wl]),Kg=p.useCallback($=>{const U=typeof $=="string"?$.trim():"",he=typeof mr=="string"?mr.trim():"",_e=KO(he||null,U||null);if(!U){_e&&Sl(),lt?wn(null):is(null),ms(null);return}if(lt){if(A.length&&!A.some(Ve=>mu(Ve,U))){C(r("app.error.workspaceUnauthorized",{workspace:U}));return}_e&&Sl(),wn(U),os(U),ms(U);return}_e&&Sl(),is(U),os(U),ms(U)},[mr,os,A,Sl,lt,ms,wn,C]);p.useEffect(()=>{T!=="authed"&&(h.current+=1)},[T]),p.useEffect(()=>{T!=="authed"||_!=="connected"||wl()},[T,wl,_]),p.useEffect(()=>{T==="authed"&&_==="connected"||(_l(),yl())},[T,_,yl,_l]),q$({isNarrow:S,sidebarDrawerOpen:y,setSidebarDrawerOpen:g});const{currentChat:ud,currentPending:Cl,currentPendingRequestKey:Ax,currentThreadInPlan:Nx,currentProposedPlanMessageId:Vg,currentThreadTitle:Dx,currentDiffItems:qg}=r5({currentThreadId:H,chatByThread:fl,pendingByThread:$g,threadCollaborationOverrides:$n,dismissedProposedPlanByThread:yx,threadNameOverrides:On,threads:N,setShowChanges:ed}),wi=_==="connected"?(E==null?void 0:E.codexTask)??(O==="online"?(P==null?void 0:P.codexTask)??null:null):O==="online"?(P==null?void 0:P.codexTask)??null:null,dd=p.useMemo(()=>{var U;if(!H)return!1;const $=(U=wi==null?void 0:wi.activeByThread)==null?void 0:U[H];return typeof $=="number"&&$>0},[wi,H]),Bx=p.useMemo(()=>{if(!H)return null;const $=Ng[H];return typeof $=="number"?$:null},[H,Ng]),Ox=p.useMemo(()=>{if(!H)return null;const $=Bg[H]??null;if($!=null&&$.plan.length)return $;const U=b1(ud);return U!=null&&U.plan.length?U:$??U??null},[H,ud,Bg]),$x=(wi==null?void 0:wi.activeByThread)??{},Io=p.useMemo(()=>r$({threads:N,chatByThread:fl,threadNameOverrides:On}),[fl,On,N]),jx=p.useMemo(()=>en?Io[en.threadId]??en.threadId:null,[en,Io]),zx=p.useMemo(()=>jr?Io[jr.threadId]??jr.threadId:null,[Io,jr]),Fx=p.useMemo(()=>{if(!pl)return null;const $=String(H??"").trim();return!$||pl.threadId!==$?null:pl.pendingKey},[H,pl]),Hx=p.useCallback(()=>{rd(null)},[]),Wx=p.useCallback(()=>{To(null)},[]),Ux=p.useCallback(()=>{Eo(null)},[]),Kx=p.useCallback(()=>{if(!jr)return;const $=jr.threadId.trim();if(Eo(null),!$)return;const U=String(H??"").trim();U&&U===$||(ls.current=$,cs.current=null,zr($))},[H,jr,zr]),Vx=p.useCallback(()=>{if(!en)return;const $=en.threadId.trim();if(ls.current=null,cs.current=null,To(null),!$)return;const U=String(H??"").trim();if(U&&U!==$&&(cs.current=U),en.type==="required"){const he=en.pendingKey.trim();if(!he)return;rd({threadId:$,pendingKey:he})}else rd(null);U&&U===$||(ls.current=$,zr($))},[en,H,zr]),xl=p.useMemo(()=>P1(Ju,wo),[Ju,wo]),{toggleSidebar:qx,closeSidebar:Yx,openModelSettings:Gx,insertSkillIntoComposer:Xx,appendLocalSystemMessage:Yg,addCustomModel:Jx,removeCustomModel:Qx}=I$({isNarrow:S,setSidebarCollapsed:Lt,setSidebarDrawerOpen:g,currentThreadId:H,threadCollaborationOverrides:$n,setShowModel:Sg,setShowCollabModel:wg,loadModels:async()=>Qu(),setComposerText:z,composerTextareaRef:v,setChatByThread:ko,setCustomModels:_g}),Zx=async($,U)=>{await s$($,U)},ek=p.useCallback(async $=>{const U=$.trim();if(U){Z(U);try{await u$(U),bl()}catch(he){C(r("app.error.archiveFailed",{error:String(he)}))}finally{Z(he=>he===U?null:he)}}},[bl,C]),hd=p.useCallback(async($,U)=>YO({kind:$,fallbackModel:U,collaborationList:Pg,loadCollaborationModes:Lg}),[Pg,Lg]),Ct=E$({openThread:zr,insertSkillIntoComposer:Xx,setShowChanges:ed,setShowModel:Sg,setShowCollabModel:wg,setShowPermissions:bg,setShowExperimental:Cg,setShowSkills:xg,setShowResume:kg,setThreadModelOverrides:So,setThreadCollaborationOverrides:bo,setThreadPermissionsOverrides:yg,setWebModelDefaults:cl}),tk=async($,U)=>{await a$($,U)},{submit:rk,stop:nk}=H$({currentThreadBusy:dd,currentThreadId:H,pendingAttachments:ce,clearPendingAttachments:ge,queueWsMessage:ld,appendOptimisticUserMessage:Tx,openThread:zr,openModelSettings:Gx,setError:C,setShowPermissions:bg,setShowExperimental:Cg,loadExperimental:Rg,setShowSkills:xg,loadSkills:Zu,setShowResume:kg,setShowWorkspace:Xu,appendLocalSystemMessage:Yg,threadModelOverrides:Sn,webModelDefaults:Zr,threadStartDefaults:xo,effectiveModelList:xl,resolveCollaborationMode:hd,stripReasoningEffortFromCollab:gS,setThreadCollaborationOverrides:bo,setThreadNameOverrides:yo,refreshThreads:bl,threadPermissionsOverrides:ul,threadCollaborationOverrides:$n}),{dismissCurrentProposedPlan:ik,executeCurrentProposedPlan:sk}=X$({currentThreadId:H,currentProposedPlanMessageId:Vg,status:_,currentThreadBusy:dd,currentPending:Cl,threadCollaborationOverrides:$n,threadModelOverrides:Sn,webModelDefaults:Zr,threadStartDefaults:xo,resolveCollaborationMode:hd,setError:C,setDismissedProposedPlanByThread:Sx,setThreadCollaborationOverrides:bo,threadPermissionsOverrides:ul,queueWsMessage:ld,composerTextareaRef:v}),{togglePlanFromToolbar:ok,cycleReasoningEffortFromToolbar:ak,cycleModelFromToolbar:lk}=s5({modelListLoading:Ig,effectiveModelList:xl,modelList:Ju,loadModels:Qu,customModels:wo,currentThreadId:H,threadCollaborationOverrides:$n,threadModelOverrides:Sn,webModelDefaults:Zr,threadStartDefaults:xo,resolveCollaborationMode:hd,stripReasoningEffortFromCollab:gS,setThreadCollaborationOverrides:bo,setThreadModelOverrides:So,appendLocalSystemMessage:Yg,setError:C}),ck=t5({skillsList:Mg,currentThreadId:H,threads:N}),{respondPending:uk,cancelPending:dk,logout:fd}=e5({wsRef:i,reconnectAttemptRef:s,wsOutboxRef:o,setAuth:k,setUser:L,setStatus:w,setThreads:V,setChatByThread:ko,setCurrentThreadId:se,setPendingByThread:jg,userInputDraftByThreadRef:a,queueWsMessage:ld});p.useEffect(()=>{if(T!=="authed"){f.current=!1;return}return QD(()=>{f.current||(f.current=!0,fd().finally(()=>{x($=>$+1),C(r("app.error.authExpired"))}))})},[T,fd,x,C]),p.useEffect(()=>{if(T!=="authed"||!b)return;const $=window.setTimeout(()=>{C(U=>U===b?null:U)},X3);return()=>window.clearTimeout($)},[T,b]),p.useEffect(()=>{const $=S$({auth:T,pathname:window.location.pathname});$&&window.history.replaceState(null,"",$)},[T]);const bi=((Jg=P==null?void 0:P.webUi)==null?void 0:Jg.version)??null;p.useEffect(()=>{if(T!=="authed"){gl.current=null,nd.current=null,td(null);return}if(!bi)return;const $=gl.current;if(!$){gl.current=bi;return}$!==bi&&(gl.current=bi,nd.current!==bi&&td(bi))},[T,bi]);const hk=p.useCallback(()=>{window.location.reload()},[]),fk=p.useCallback(()=>{ml&&(nd.current=ml,td(null))},[ml]),Gg=p.useCallback(()=>{Me($=>pI($))},[Me]),mk=p.useCallback($=>{const U=Za($);U&&ue(U)},[ue]),pk=p.useCallback(()=>{ue(null)},[ue]),gk=p.useCallback($=>{const U=Aa($);U&&st(U)},[st]),vk=p.useCallback(()=>{st(null)},[st]);if(T==="checking")return u.jsx("div",{className:"loginLayout",children:u.jsx("div",{className:"loginCard",role:"status","aria-live":"polite",children:u.jsx("div",{className:"loginBody",children:u.jsx("div",{className:"loginSubtitle",children:r("app.auth.checkingStatus")})})})});if(T!=="authed")return u.jsx(_I,{mode:T,theme:we,error:b,backendReachability:O,onToggleTheme:Gg,onLoggedIn:$=>{C(null),L($),k("authed"),x(U=>U+1)}});const _k=async()=>{await fd(),x($=>$+1)},Xg=S?y:!bt,yk=`layout ${S?"layout-narrow":"layout-wide"} ${Xg?"sidebar-open":"sidebar-closed"}`;return u.jsxs("div",{className:yk,children:[u.jsx(qB,{isNarrow:S,sidebarDrawerOpen:y,closeSidebar:Yx,onCloseDrawer:()=>g(!1),onCreateThread:()=>zr(),onRefreshThreads:bl,workspaces:as,activeWorkspace:mr,onSwitchWorkspace:Kg,onAddWorkspace:()=>Xu(!0),canAddWorkspace:Eg,onLogout:_k,user:I,role:hl,theme:we,onToggleTheme:Gg,locale:e,onToggleLocale:n,accentColor:wt,onAccentColorChange:mk,onAccentColorReset:pk,backgroundColor:ze,onBackgroundColorChange:gk,onBackgroundColorReset:vk,compactView:Yt,onToggleCompactView:()=>_o($=>!$),canManageUsers:lt,onOpenAdminUsers:()=>Gu(!0),currentThreadId:H,threads:N,threadsLoading:D,runningTurnsByThread:$x,threadNameOverrides:On,derivedThreadTitleById:Io,pendingByThread:$g,onOpenThread:zr,archivingThreadId:Y,onArchiveThread:ek}),u.jsx(jB,{error:b,updateAvailable:!!ml,onReloadForUpdate:hk,onDismissUpdate:fk,approvalResolvedNotice:en,approvalResolvedNoticeThreadTitle:jx,onJumpApprovalResolvedNotice:Vx,onDismissApprovalResolvedNotice:Wx,showNoticeJumpBack:!!jr,noticeJumpBackThreadTitle:zx,onJumpNoticeBack:Kx,onDismissNoticeBack:Ux,jumpToPendingKey:Fx,onJumpedToPending:Hx,toggleSidebar:qx,sidebarOpen:Xg,currentThreadId:H,currentThreadTitle:Dx,currentDiffCount:qg.length,currentThreadContextUsagePercent:Bx,currentTodoPlan:Ox,currentPending:Cl,status:_,threadSwitching:j,chatRefreshing:te,onRefreshChatMessages:Lx,onCreateThread:()=>zr(),onOpenChanges:()=>ed(!0),currentChat:ud,theme:we,compactView:Yt,currentThreadBusy:dd,threadTurnsMetaByThread:Ag,onLoadEarlierTurns:Px,currentPendingRequestKey:Ax,currentProposedPlanMessageId:Vg,currentThreadInPlan:Nx,executeCurrentProposedPlan:sk,dismissCurrentProposedPlan:ik,pendingAttachments:ce,onRemovePendingAttachment:Re,userInputDraftByThreadRef:a,onCancelPending:()=>dk(Cl),onSubmitPending:$=>uk(Cl,$),composerText:B,onComposerTextChange:z,composerTextareaRef:v,modelList:xl,threadCollaborationOverrides:$n,threadModelOverrides:Sn,threadStartDefaults:xo,webModelDefaults:Zr,onTogglePlan:ok,onCycleModel:lk,onCycleReasoningEffort:ak,attachmentUploading:re,imageFileInputRef:m,onUploadAttachments:($,U)=>{Oe($,U)},skillsForPicker:ck,onLoadSkills:Zu,onSubmitComposer:rk,onStop:nk}),u.jsx(AO,{showChanges:_x,currentThreadId:H,currentDiffItems:qg,onCloseChanges:Ct.onCloseChanges,showWorkspace:cx&&Eg,allowedWorkspaceRoots:A,workspaces:as,activeWorkspace:mr,onSwitchWorkspace:Kg,canRemoveWorkspace:$=>pS({cwd:$,userWorkspaceDirs:ss,allowedWorkspaceRoots:A}),onRemoveWorkspace:$=>{const U=$.trim();!U||!pS({cwd:U,userWorkspaceDirs:ss,allowedWorkspaceRoots:A})||(rx(U),lt?wn(_e=>_e===U?null:_e):is(_e=>_e===U?null:_e))},onCloseWorkspace:()=>Xu(!1),showModel:nx,modelList:xl,modelListLoading:Ig,modelListError:dx,customModels:wo,onAddCustomModel:Jx,onRemoveCustomModel:Qx,threadStartDefaults:xo,threadModelOverrides:Sn,webModelDefaults:Zr,onLoadModels:Qu,onSetThreadModelOverride:Ct.onSetThreadModelOverride,onClearThreadModelOverride:Ct.onClearThreadModelOverride,onSetWebDefaults:Ct.onSetWebDefaults,onClearWebDefaults:Ct.onClearWebDefaults,onCloseModel:Ct.onCloseModel,showCollabModel:ix,threadCollaborationOverrides:$n,onSetThreadCollaborationOverride:Ct.onSetThreadCollaborationOverride,onClearThreadCollaborationOverride:Ct.onClearThreadCollaborationOverride,onCloseCollabModel:Ct.onCloseCollabModel,showPermissions:sx,threadPermissionsOverrides:ul,onSetThreadPermissionsOverride:Ct.onSetThreadPermissionsOverride,onClearThreadPermissionsOverride:Ct.onClearThreadPermissionsOverride,onNewThread:Ct.onNewThread,onClosePermissions:Ct.onClosePermissions,showExperimental:ox,experimentalList:hx,experimentalLoading:fx,experimentalError:mx,onLoadExperimental:Rg,onSetExperimentalFeature:Zx,onCloseExperimental:Ct.onCloseExperimental,showSkills:ax,skillsList:Mg,skillsLoading:px,skillsError:gx,onLoadSkills:Zu,onSetSkillEnabled:tk,onInsertSkill:Ct.onInsertSkill,onCloseSkills:Ct.onCloseSkills,showResume:lx,threads:N,onOpenResume:Ct.onOpenResume,onCloseResume:Ct.onCloseResume,showAdminUsers:ux&<,onCloseAdminUsers:()=>Gu(!1)})]})}gh.createRoot(document.getElementById("root")).render(u.jsx(ne.StrictMode,{children:u.jsx(sI,{children:u.jsx(Z3,{})})}));
|