The Unified and Autonomous Development Platform
feat: Workspace draft
Robin Shen57872f7807d7
diff --git a/pom.xml b/pom.xmlindex 0d917e91a1..a1c0c1395d 100644--- a/pom.xml+++ b/pom.xml@@ -635,7 +635,7 @@<dependency><groupId>com.hazelcast</groupId><artifactId>hazelcast</artifactId>- <version>5.3.5</version>+ <version>5.3.8</version></dependency><dependency><groupId>com.hazelcast</groupId>@@ -676,8 +676,8 @@</repository></repositories><properties>- <commons.version>3.2.5</commons.version>- <agent.version>2.4.5</agent.version>+ <commons.version>3.2.6</commons.version>+ <agent.version>2.4.7</agent.version><slf4j.version>2.0.9</slf4j.version><logback.version>1.4.14</logback.version><antlr.version>4.7.2</antlr.version>diff --git a/server-core/src/main/java/io/onedev/server/CoreModule.java b/server-core/src/main/java/io/onedev/server/CoreModule.javaindex a0fb295b51..54b4117d0c 100644--- a/server-core/src/main/java/io/onedev/server/CoreModule.java+++ b/server-core/src/main/java/io/onedev/server/CoreModule.java@@ -66,20 +66,17 @@ import com.thoughtworks.xstream.core.JVM;import com.thoughtworks.xstream.mapper.MapperWrapper;import com.vladsch.flexmark.util.misc.Extension;-import io.onedev.agent.ExecutorUtils;import io.onedev.commons.bootstrap.Bootstrap;import io.onedev.commons.loader.AbstractPlugin;import io.onedev.commons.loader.AbstractPluginModule;import io.onedev.commons.utils.ExceptionUtils;import io.onedev.commons.utils.StringUtils;import io.onedev.k8shelper.KubernetesHelper;-import io.onedev.k8shelper.OsInfo;import io.onedev.server.ai.BuildSpecSchemaResource;import io.onedev.server.ai.McpHelperResource;import io.onedev.server.annotation.Shallow;import io.onedev.server.attachment.AttachmentService;import io.onedev.server.attachment.DefaultAttachmentService;-import io.onedev.server.buildspec.job.log.instruction.LogInstruction;import io.onedev.server.cluster.ClusterResource;import io.onedev.server.codequality.CodeProblemContribution;import io.onedev.server.codequality.LineCoverageContribution;@@ -116,11 +113,9 @@ import io.onedev.server.jetty.DefaultJettyService;import io.onedev.server.jetty.DefaultSessionDataStoreFactory;import io.onedev.server.jetty.JettyService;import io.onedev.server.job.DefaultJobService;-import io.onedev.server.job.DefaultResourceAllocator;import io.onedev.server.job.JobService;-import io.onedev.server.job.ResourceAllocator;-import io.onedev.server.job.log.DefaultLogService;-import io.onedev.server.job.log.LogService;+import io.onedev.server.logging.DefaultLogService;+import io.onedev.server.logging.LogService;import io.onedev.server.mail.DefaultMailService;import io.onedev.server.mail.MailService;import io.onedev.server.markdown.DefaultMarkdownService;@@ -135,6 +130,7 @@ import io.onedev.server.notification.IssueNotificationManager;import io.onedev.server.notification.PackNotificationManager;import io.onedev.server.notification.PullRequestNotificationManager;import io.onedev.server.notification.WebHookManager;+import io.onedev.server.notification.WorkspaceNotificationManager;import io.onedev.server.pack.PackFilter;import io.onedev.server.persistence.DefaultIdService;import io.onedev.server.persistence.DefaultSessionFactoryService;@@ -176,6 +172,7 @@ import io.onedev.server.security.AuthorizingService;import io.onedev.server.security.BasicAuthenticationFilter;import io.onedev.server.security.BearerAuthenticationFilter;import io.onedev.server.security.CodePullAuthorizationSource;+import io.onedev.server.security.CodePushAuthorizationSource;import io.onedev.server.security.DefaultAuthenticatingService;import io.onedev.server.security.DefaultAuthorizingService;import io.onedev.server.security.DefaultFilterChainResolver;@@ -231,7 +228,6 @@ import io.onedev.server.service.IssueVoteService;import io.onedev.server.service.IssueWatchService;import io.onedev.server.service.IssueWorkService;import io.onedev.server.service.IterationService;-import io.onedev.server.service.JobCacheService;import io.onedev.server.service.LabelSpecService;import io.onedev.server.service.LinkAuthorizationService;import io.onedev.server.service.LinkSpecService;@@ -260,8 +256,10 @@ import io.onedev.server.service.PullRequestService;import io.onedev.server.service.PullRequestTouchService;import io.onedev.server.service.PullRequestUpdateService;import io.onedev.server.service.PullRequestWatchService;+import io.onedev.server.service.ResourceService;import io.onedev.server.service.ReviewedDiffService;import io.onedev.server.service.RoleService;+import io.onedev.server.service.RunCacheService;import io.onedev.server.service.SettingService;import io.onedev.server.service.SshKeyService;import io.onedev.server.service.SsoAccountService;@@ -318,7 +316,6 @@ import io.onedev.server.service.impl.DefaultIssueVoteService;import io.onedev.server.service.impl.DefaultIssueWatchService;import io.onedev.server.service.impl.DefaultIssueWorkService;import io.onedev.server.service.impl.DefaultIterationService;-import io.onedev.server.service.impl.DefaultJobCacheService;import io.onedev.server.service.impl.DefaultLabelSpecService;import io.onedev.server.service.impl.DefaultLinkAuthorizationService;import io.onedev.server.service.impl.DefaultLinkSpecService;@@ -347,8 +344,10 @@ import io.onedev.server.service.impl.DefaultPullRequestService;import io.onedev.server.service.impl.DefaultPullRequestTouchService;import io.onedev.server.service.impl.DefaultPullRequestUpdateService;import io.onedev.server.service.impl.DefaultPullRequestWatchService;+import io.onedev.server.service.impl.DefaultResourceService;import io.onedev.server.service.impl.DefaultReviewedDiffService;import io.onedev.server.service.impl.DefaultRoleService;+import io.onedev.server.service.impl.DefaultRunCacheService;import io.onedev.server.service.impl.DefaultSettingService;import io.onedev.server.service.impl.DefaultSshKeyService;import io.onedev.server.service.impl.DefaultSsoAccountService;@@ -419,6 +418,12 @@ import io.onedev.server.web.websocket.DefaultWebSocketService;import io.onedev.server.web.websocket.IssueEventBroadcaster;import io.onedev.server.web.websocket.PullRequestEventBroadcaster;import io.onedev.server.web.websocket.WebSocketService;+import io.onedev.server.web.websocket.WorkspaceEventBroadcaster;+import io.onedev.server.workspace.DefaultWorkspaceQueryPersonalizationService;+import io.onedev.server.workspace.DefaultWorkspaceService;+import io.onedev.server.workspace.WorkspacePostCommitCallback;+import io.onedev.server.workspace.WorkspaceQueryPersonalizationService;+import io.onedev.server.workspace.WorkspaceService;import io.onedev.server.xodus.CommitInfoService;import io.onedev.server.xodus.DefaultCommitInfoService;import io.onedev.server.xodus.DefaultIssueInfoService;@@ -504,7 +509,7 @@ public class CoreModule extends AbstractPluginModule {bind(PullRequestReviewService.class).to(DefaultPullRequestReviewService.class);bind(BuildService.class).to(DefaultBuildService.class);bind(JobService.class).to(DefaultJobService.class);- bind(JobCacheService.class).to(DefaultJobCacheService.class);+ bind(RunCacheService.class).to(DefaultRunCacheService.class);bind(LogService.class).to(DefaultLogService.class);bind(MailService.class).to(DefaultMailService.class);bind(IssueService.class).to(DefaultIssueService.class);@@ -533,6 +538,7 @@ public class CoreModule extends AbstractPluginModule {bind(CommitNotificationManager.class);bind(BuildNotificationManager.class);bind(PackNotificationManager.class);+ bind(WorkspaceNotificationManager.class);bind(IssueNotificationManager.class);bind(CodeCommentNotificationManager.class);bind(CodeCommentService.class).to(DefaultCodeCommentService.class);@@ -550,6 +556,7 @@ public class CoreModule extends AbstractPluginModule {bind(CommitQueryPersonalizationService.class).to(DefaultCommitQueryPersonalizationService.class);bind(BuildQueryPersonalizationService.class).to(DefaultBuildQueryPersonalizationService.class);bind(PackQueryPersonalizationService.class).to(DefaultPackQueryPersonalizationService.class);+ bind(WorkspaceQueryPersonalizationService.class).to(DefaultWorkspaceQueryPersonalizationService.class);bind(PullRequestAssignmentService.class).to(DefaultPullRequestAssignmentService.class);bind(SshKeyService.class).to(DefaultSshKeyService.class);bind(BuildMetricService.class).to(DefaultBuildMetricService.class);@@ -571,6 +578,8 @@ public class CoreModule extends AbstractPluginModule {bind(DashboardUserShareService.class).to(DefaultDashboardUserShareService.class);bind(DashboardGroupShareService.class).to(DefaultDashboardGroupShareService.class);bind(DashboardVisitService.class).to(DefaultDashboardVisitService.class);+ bind(WorkspaceService.class).to(DefaultWorkspaceService.class);+ bind(WorkspacePostCommitCallback.class);bind(LabelSpecService.class).to(DefaultLabelSpecService.class);bind(ProjectLabelService.class).to(DefaultProjectLabelService.class);bind(BuildLabelService.class).to(DefaultBuildLabelService.class);@@ -602,6 +611,8 @@ public class CoreModule extends AbstractPluginModule {bind(WebHookManager.class);contribute(CodePullAuthorizationSource.class, DefaultJobService.class);+ contribute(CodePullAuthorizationSource.class, DefaultWorkspaceService.class);+ contribute(CodePushAuthorizationSource.class, DefaultWorkspaceService.class);bind(CodeIndexService.class).to(DefaultCodeIndexService.class);bind(CodeSearchService.class).to(DefaultCodeSearchService.class);@@ -623,11 +634,7 @@ public class CoreModule extends AbstractPluginModule {};bind(ExecutorService.class).toProvider(() -> Bootstrap.executorService).in(Singleton.class);-- bind(OsInfo.class).toProvider(() -> ExecutorUtils.getOsInfo()).in(Singleton.class);-- contributeFromPackage(LogInstruction.class, LogInstruction.class);-+contribute(CodeProblemContribution.class, (build, blobPath, reportName) -> newArrayList());contribute(LineCoverageContribution.class, (build, blobPath, reportName) -> new HashMap<>());@@ -728,6 +735,7 @@ public class CoreModule extends AbstractPluginModule {bind(PullRequestEventBroadcaster.class);bind(IssueEventBroadcaster.class);bind(BuildEventBroadcaster.class);+ bind(WorkspaceEventBroadcaster.class);bind(AlertEventBroadcaster.class);bind(UploadService.class).to(DefaultUploadService.class);@@ -736,7 +744,7 @@ public class CoreModule extends AbstractPluginModule {}private void configureBuild() {- bind(ResourceAllocator.class).to(DefaultResourceAllocator.class);+ bind(ResourceService.class).to(DefaultResourceService.class);bind(AgentService.class).to(DefaultAgentService.class);bind(AgentTokenService.class).to(DefaultAgentTokenService.class);bind(AgentAttributeService.class).to(DefaultAgentAttributeService.class);diff --git a/server-core/src/main/java/io/onedev/server/OneDev.java b/server-core/src/main/java/io/onedev/server/OneDev.javaindex 29c5ef0760..99a6328521 100644--- a/server-core/src/main/java/io/onedev/server/OneDev.java+++ b/server-core/src/main/java/io/onedev/server/OneDev.java@@ -183,8 +183,12 @@ public class OneDev extends AbstractPlugin implements Serializable, Runnable {if (maintenanceFile.exists()) {logger.info("Maintenance requested, trying to stop all servers...");clusterService.submitToAllServers(() -> {- if (!localServer.equals(clusterService.getLocalServerAddress()))- restart();+ try {+ if (!localServer.equals(clusterService.getLocalServerAddress()))+ restart();+ } catch (Throwable t) {+ logger.error("Error restarting server", t);+ }return null;});while (thread != null && clusterService.getServerAddresses().size() != 1) {@@ -432,8 +436,12 @@ public class OneDev extends AbstractPlugin implements Serializable, Runnable {if (maintenanceFile.exists()) {logger.info("Maintenance requested, trying to stop all servers...");clusterService.submitToAllServers(() -> {- if (!localServer.equals(clusterService.getLocalServerAddress()))- restart();+ try {+ if (!localServer.equals(clusterService.getLocalServerAddress()))+ restart();+ } catch (Throwable t) {+ logger.error("Error restarting server", t);+ }return null;});while (thread != null && clusterService.getServerAddresses().size() != 1) {diff --git a/server-core/src/main/java/io/onedev/server/agent/ServerSocket.java b/server-core/src/main/java/io/onedev/server/agent/ServerSocket.javaindex 2cd60a73f6..13c2489c5b 100644--- a/server-core/src/main/java/io/onedev/server/agent/ServerSocket.java+++ b/server-core/src/main/java/io/onedev/server/agent/ServerSocket.java@@ -5,10 +5,6 @@ import java.io.Serializable;import java.nio.charset.StandardCharsets;import java.util.concurrent.ExecutorService;-import io.onedev.agent.*;-import io.onedev.commons.utils.ExceptionUtils;-import io.onedev.server.OneDev;-import io.onedev.server.service.AgentService;import org.apache.commons.lang3.SerializationUtils;import org.eclipse.jetty.websocket.api.Session;import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose;@@ -19,15 +15,26 @@ import org.eclipse.jetty.websocket.api.annotations.WebSocket;import org.slf4j.Logger;import org.slf4j.LoggerFactory;+import io.onedev.agent.AgentData;+import io.onedev.agent.CallData;+import io.onedev.agent.Message;+import io.onedev.agent.MessageTypes;+import io.onedev.agent.WaitingForAgentResourceToBeReleased;+import io.onedev.agent.WantToDisconnectAgent;+import io.onedev.agent.WebsocketUtils;+import io.onedev.agent.shell.ShellOutputRequest;+import io.onedev.commons.utils.ExceptionUtils;import io.onedev.commons.utils.ExplicitException;import io.onedev.commons.utils.StringUtils;import io.onedev.commons.utils.TaskLogger;+import io.onedev.server.OneDev;import io.onedev.server.exception.ServerNotReadyException;+import io.onedev.server.job.AgentShell;import io.onedev.server.job.JobContext;import io.onedev.server.job.JobService;-import io.onedev.server.job.ResourceAllocator;-import io.onedev.server.job.log.LogService;-import io.onedev.server.terminal.AgentShell;+import io.onedev.server.logging.LogService;+import io.onedev.server.service.AgentService;+import io.onedev.server.service.ResourceService;@WebSocketpublic class ServerSocket {@@ -132,7 +139,7 @@ public class ServerSocket {if (sessionId.length() == 0)sessionId = null;String logMessage = StringUtils.substringAfter(remaining, ":");- TaskLogger logger = OneDev.getInstance(LogService.class).getJobLogger(jobToken);+ TaskLogger logger = OneDev.getInstance(LogService.class).getLogger(jobToken);if (logger != null)logger.log(logMessage, sessionId);} catch (Exception e) {@@ -142,32 +149,16 @@ public class ServerSocket {case REPORT_JOB_WORKSPACE:String dataString = new String(messageData, StandardCharsets.UTF_8);String jobToken = StringUtils.substringBefore(dataString, ":");- String jobWorkspace = StringUtils.substringAfter(dataString, ":");+ String jobWorkDir = StringUtils.substringAfter(dataString, ":");JobContext jobContext = getJobService().getJobContext(jobToken, false);if (jobContext != null)- getJobService().reportJobWorkspace(jobContext, jobWorkspace);+ getJobService().reportJobWorkDir(jobContext, jobWorkDir);break;- case SHELL_OUTPUT:- dataString = new String(messageData, StandardCharsets.UTF_8);- String sessionId = StringUtils.substringBefore(dataString, ":");- String output = StringUtils.substringAfter(dataString, ":");+ case SHELL_EXIT:+ String sessionId = new String(messageData, StandardCharsets.UTF_8);AgentShell shell = (AgentShell) getJobService().getShell(sessionId);if (shell != null)- shell.getTerminal().sendOutput(output);- break;- case SHELL_ERROR:- dataString = new String(messageData, StandardCharsets.UTF_8);- sessionId = StringUtils.substringBefore(dataString, ":");- String error = StringUtils.substringAfter(dataString, ":");- shell = (AgentShell) getJobService().getShell(sessionId);- if (shell != null)- shell.getTerminal().sendError(error);- break;- case SHELL_CLOSED:- sessionId = new String(messageData, StandardCharsets.UTF_8);- shell = (AgentShell) getJobService().getShell(sessionId);- if (shell != null)- shell.getTerminal().close();+ shell.getTerminal().onShellExit();break;default:}@@ -188,7 +179,12 @@ public class ServerSocket {try {if (request instanceof WantToDisconnectAgent || request instanceof WaitingForAgentResourceToBeReleased) {if (agentId != null)- OneDev.getInstance(ResourceAllocator.class).agentDisconnecting(agentId);+ OneDev.getInstance(ResourceService.class).agentDisconnecting(agentId);+ return null;+ } else if (request instanceof ShellOutputRequest shellOutputRequest) {+ AgentShell shell = (AgentShell) getJobService().getShell(shellOutputRequest.getSessionId());+ if (shell != null)+ shell.getTerminal().onShellOutput(shellOutputRequest.getBase64Data());return null;} else {throw new ExplicitException("Unknown request: " + request.getClass());diff --git a/server-core/src/main/java/io/onedev/server/ai/DefaultChatService.java b/server-core/src/main/java/io/onedev/server/ai/DefaultChatService.javaindex 8fba9ed807..ebefce2e86 100644--- a/server-core/src/main/java/io/onedev/server/ai/DefaultChatService.java+++ b/server-core/src/main/java/io/onedev/server/ai/DefaultChatService.java@@ -433,18 +433,18 @@ public class DefaultChatService extends BaseEntityService<Chat> implements ChatSif (StringUtils.isBlank(response))throw new ExplicitException("Received empty response");createResponse(response, false);- } catch (Throwable e) {- if (ExceptionUtils.find(e, InterruptedException.class) != null) {+ } catch (Throwable t) {+ if (ExceptionUtils.find(t, InterruptedException.class) != null) {createIncompleteResponse("Conversation cancelled");- } else if (ExceptionUtils.find(e, TimeoutException.class) != null) {+ } else if (ExceptionUtils.find(t, TimeoutException.class) != null) {createIncompleteResponse("Conversation timed out");} else {- var explicitException = ExceptionUtils.find(e, ExplicitException.class);+ var explicitException = ExceptionUtils.find(t, ExplicitException.class);if (explicitException != null) {createResponse(explicitException.getMessage(), true);} else {createResponse("Error getting chat response, check server log for details", true);- logger.error("Error getting chat response", e);+ logger.error("Error getting chat response", t);}}} finally {diff --git a/server-core/src/main/java/io/onedev/server/ai/QueryDescriptions.java b/server-core/src/main/java/io/onedev/server/ai/QueryDescriptions.javaindex a843d74032..f171994970 100644--- a/server-core/src/main/java/io/onedev/server/ai/QueryDescriptions.java+++ b/server-core/src/main/java/io/onedev/server/ai/QueryDescriptions.java@@ -10,6 +10,7 @@ import java.util.stream.IntStream;import io.onedev.server.OneDev;import io.onedev.server.model.Agent;import io.onedev.server.model.Build;+import io.onedev.server.model.Workspace;import io.onedev.server.model.Issue;import io.onedev.server.model.LabelSpec;import io.onedev.server.model.Pack;@@ -482,6 +483,61 @@ public class QueryDescriptions {return description;}+ public static String getWorkspaceQueryDescription() {+ var description = String.format("""+ A structured query should conform to below ANTLR grammar:++ workspaceQuery+ : criteria ('order by' '"'OrderField'"' ('asc'|'desc') (',' '"'OrderField'"' ('asc'|'desc'))*)?+ ;++ criteria+ : 'pending'+ | 'active'+ | 'error'+ | 'created by me'+ | 'created by' '"'LoginNameOfUser'"'+ | '"Number"' 'is' ('not')? '"'EntityReference'"'+ | '"Number"' 'is' ('greater'|'less') 'than' '"'EntityReference'"'+ | '"Project"' 'is' ('not')? '"'ProjectPathOrPattern'"'+ | '"Branch"' 'is' ('not')? '"'BranchNameOrPattern'"'+ | '"Spec"' 'is' ('not')? '"'WorkspaceSpecName'"'+ | '"Create Date"' 'is' ('until'|'since') '"'DateDescription'"'+ | '"Active Date"' 'is' ('until'|'since') '"'DateDescription'"'+ | '"Error Date"' 'is' ('until'|'since') '"'DateDescription'"'+ | criteria 'and' criteria+ | criteria 'or' criteria+ | 'not('criteria')'+ | '('criteria')'+ ;++ EntityReference+ : '#'Number+ | ProjectPath'#'Number+ | ProjectKey'-'Number+ ;++ LabelName+ : %s+ ;++ OrderField+ : %s+ ;++ WS+ : [ ]+ -> skip+ ;++ Please note:+ 1. "LoginNameOfUser" should be retrieved via tool 'getLoginName' if available, with parameter set to user name+ 2. Use an empty query to list all accessible workspaces""",+ getLabelSpecs().stream().map(it -> "'" + it.getName() + "'").collect(joining("\n | ")).trim(),+ Workspace.SORT_FIELDS.keySet().stream().map(it -> "'" + it + "'").collect(joining("\n | ")).trim());++ return description;+ }+public static String getCommitQueryDescription() {var description = """A structured query should conform to below ANTLR grammar:diff --git a/server-core/src/main/java/io/onedev/server/ai/tools/GetBuildSpecEditInstructions.java b/server-core/src/main/java/io/onedev/server/ai/tools/GetBuildSpecEditInstructions.javaindex eecdfc66d7..ce1f95af18 100644--- a/server-core/src/main/java/io/onedev/server/ai/tools/GetBuildSpecEditInstructions.java+++ b/server-core/src/main/java/io/onedev/server/ai/tools/GetBuildSpecEditInstructions.java@@ -50,17 +50,15 @@ public class GetBuildSpecEditInstructions implements TaskTool {When editing CI/CD spec, remember that:- 1. Files in job workspace are shared between different steps. So you can generate workspace files in one step, and use them in another step.+ 1. Files in job workdir are shared between different steps. So you can generate workspace files in one step, and use them in another step.2. If command step is used, turn on the "run in container" if possible, unless requested by user explicitly- 3. Different steps run in isolated environments (only job workspace is shared). So it will not work installing dependencies in one step, and run commands relying on them in another step. You should put them in a single step unless requested by user explicitly+ 3. Different steps run in isolated environments (only job workdir is shared). So it will not work installing dependencies in one step, and run commands relying on them in another step. You should put them in a single step unless requested by user explicitly4. If cache step is used:4.1 It should be placed before the step building or testing the project4.2 If the project has lock files (package.json, pom.xml, etc.):- 4.2.1 A generate checksum step should be placed before the cache step, to generate checksum of all relevant lock files and store it in a file named checksum.txt- 4.2.2 The key property should be configured as <keyname>-@file:checksum.txt@- 4.2.3 The load keys property should be configured as <keyname>+ 4.2.1 The checksum files property should be specified to include all relevant lock files4.2.4 The upload strategy property should be configured as UPLOAD_IF_NOT_HIT- 5. If user wants to pass files between different jobs, one job should publish files via the publish artifact step, and another jobs can then download them into job workspace via job dependency+ 5. If user wants to pass files between different jobs, one job should publish files via the publish artifact step, and another jobs can then download them into job workdir via job dependency6. Call tools such as getRootFilesAndFolders, getFilesAndSubfolders and getTextContent to get project structure, and figure out what docker image and commands to use to build or test the project if requested by user""".formatted(BuildSpecSchema.get(), Joiner.on("\n").join(variables));diff --git a/server-core/src/main/java/io/onedev/server/annotation/Code.java b/server-core/src/main/java/io/onedev/server/annotation/Code.javaindex 6a52ca4e1c..90023674d6 100644--- a/server-core/src/main/java/io/onedev/server/annotation/Code.java+++ b/server-core/src/main/java/io/onedev/server/annotation/Code.java@@ -33,6 +33,8 @@ public @interface Code {String GROOVY_TEMPLATE = "Java Server Pages";+ String PLAIN_TEXT = "Plain Text";+String language();String variableProvider() default "";diff --git a/server-core/src/main/java/io/onedev/server/annotation/EnvironmentName.java b/server-core/src/main/java/io/onedev/server/annotation/EnvVarName.javasimilarity index 95%rename from server-core/src/main/java/io/onedev/server/annotation/EnvironmentName.javarename to server-core/src/main/java/io/onedev/server/annotation/EnvVarName.javaindex 7573044bc7..ba6555d21a 100644--- a/server-core/src/main/java/io/onedev/server/annotation/EnvironmentName.java+++ b/server-core/src/main/java/io/onedev/server/annotation/EnvVarName.java@@ -13,7 +13,7 @@ import io.onedev.server.validation.validator.EnvironmentNameValidator;@Target({ElementType.METHOD, ElementType.FIELD})@Retention(RetentionPolicy.RUNTIME)@Constraint(validatedBy=EnvironmentNameValidator.class)-public @interface EnvironmentName {+public @interface EnvVarName {String message() default "name should start with letter and can only consist of "+ "alphanumeric and underscore characters";diff --git a/server-core/src/main/java/io/onedev/server/annotation/WorkspaceQuery.java b/server-core/src/main/java/io/onedev/server/annotation/WorkspaceQuery.javanew file mode 100644index 0000000000..afcc737729--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/annotation/WorkspaceQuery.java@@ -0,0 +1,28 @@+package io.onedev.server.annotation;++import java.lang.annotation.ElementType;+import java.lang.annotation.Retention;+import java.lang.annotation.RetentionPolicy;+import java.lang.annotation.Target;++import javax.validation.Constraint;+import javax.validation.Payload;++import io.onedev.server.validation.validator.WorkspaceQueryValidator;++@Target({ElementType.METHOD, ElementType.FIELD})+@Retention(RetentionPolicy.RUNTIME)+@Constraint(validatedBy= WorkspaceQueryValidator.class)+public @interface WorkspaceQuery {++ boolean withCurrentUserCriteria() default false;++ boolean withOrder() default true;++ String message() default "";++ Class<?>[] groups() default {};++ Class<? extends Payload>[] payload() default {};++}diff --git a/server-core/src/main/java/io/onedev/server/buildspec/BuildSpec.java b/server-core/src/main/java/io/onedev/server/buildspec/BuildSpec.javaindex 46e9d130f0..4ef4412c19 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/BuildSpec.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/BuildSpec.java@@ -14,7 +14,6 @@ import java.util.Stack;import java.util.function.Consumer;import java.util.function.Function;-import org.jspecify.annotations.Nullable;import javax.validation.ConstraintValidatorContext;import javax.validation.ConstraintViolation;import javax.validation.Valid;@@ -23,6 +22,7 @@ import javax.validation.Validator;import org.apache.commons.lang3.SerializationUtils;import org.apache.wicket.Component;+import org.jspecify.annotations.Nullable;import org.yaml.snakeyaml.DumperOptions.FlowStyle;import org.yaml.snakeyaml.nodes.MappingNode;import org.yaml.snakeyaml.nodes.Node;@@ -2474,4 +2474,121 @@ public class BuildSpec implements Serializable, Validatable {});}+ private static String getStepType(MappingNode stepNode) {+ for (var tuple : stepNode.getValue()) {+ if (((ScalarNode) tuple.getKeyNode()).getValue().equals("type"))+ return ((ScalarNode) tuple.getValueNode()).getValue();+ }+ return null;+ }++ @SuppressWarnings("unused")+ private void migrate47(VersionedYamlDoc doc, Stack<Integer> versions) {+ migrateSteps(doc, versions, stepsNode -> {+ Map<String, String> checksumMap = new LinkedHashMap<>();+ for (Node stepsNodeItem : stepsNode.getValue()) {+ MappingNode stepNode = (MappingNode) stepsNodeItem;+ if ("GenerateChecksumStep".equals(getStepType(stepNode))) {+ String targetFile = null;+ String files = null;+ for (var stepTuple : stepNode.getValue()) {+ var propName = ((ScalarNode) stepTuple.getKeyNode()).getValue();+ if (propName.equals("targetFile"))+ targetFile = ((ScalarNode) stepTuple.getValueNode()).getValue();+ else if (propName.equals("files"))+ files = ((ScalarNode) stepTuple.getValueNode()).getValue();+ }+ if (targetFile != null && files != null)+ checksumMap.put(targetFile, files);+ }+ }++ for (Node stepsNodeItem : stepsNode.getValue()) {+ MappingNode stepNode = (MappingNode) stepsNodeItem;+ if ("SetupCacheStep".equals(getStepType(stepNode))) {+ String checksumFiles = null;+ for (var stepTuple : stepNode.getValue()) {+ var propName = ((ScalarNode) stepTuple.getKeyNode()).getValue();+ if (propName.equals("key")) {+ var keyNode = (ScalarNode) stepTuple.getValueNode();+ var key = keyNode.getValue();+ var sb = new StringBuilder();+ int pos = 0;+ while (pos < key.length()) {+ int start = key.indexOf("@file:", pos);+ if (start == -1) {+ sb.append(key, pos, key.length());+ break;+ }+ sb.append(key, pos, start);+ int end = key.indexOf("@", start + 6);+ if (end == -1) {+ sb.append(key, start, key.length());+ break;+ }+ String filePath = key.substring(start + 6, end);+ String files = checksumMap.get(filePath);+ if (files != null) {+ if (checksumFiles == null)+ checksumFiles = files;+ else+ checksumFiles += " " + files;+ } else {+ sb.append(key, start, end + 1);+ }+ pos = end + 1;+ }+ keyNode.setValue(sb.toString());+ }+ }+ if (checksumFiles != null) {+ stepNode.getValue().add(new NodeTuple(+ new ScalarNode(Tag.STR, "checksumFiles"),+ new ScalarNode(Tag.STR, checksumFiles)));+ }++ for (var itStepTuple = stepNode.getValue().iterator(); itStepTuple.hasNext();) {+ var stepTuple = itStepTuple.next();+ var propName = ((ScalarNode) stepTuple.getKeyNode()).getValue();+ if (propName.equals("loadKeys"))+ itStepTuple.remove();+ }++ for (var stepTuple : stepNode.getValue()) {+ var propName = ((ScalarNode) stepTuple.getKeyNode()).getValue();+ if (propName.equals("uploadStrategy")) {+ var valueNode = (ScalarNode) stepTuple.getValueNode();+ if ("UPLOAD_IF_NOT_HIT".equals(valueNode.getValue()))+ valueNode.setValue("UPLOAD_IF_NOT_EXACT_MATCH");+ }+ }++ for (var stepTuple : stepNode.getValue()) {+ var propName = ((ScalarNode) stepTuple.getKeyNode()).getValue();+ if (propName.equals("paths")) {+ SequenceNode pathsNode = (SequenceNode) stepTuple.getValueNode();+ List<Node> newPathNodes = new ArrayList<>();+ for (Node pathNode : pathsNode.getValue()) {+ String pathValue = ((ScalarNode) pathNode).getValue();+ var cachePathNode = new MappingNode(Tag.MAP, new ArrayList<>(), FlowStyle.BLOCK);+ cachePathNode.getValue().add(new NodeTuple(+ new ScalarNode(Tag.STR, "relativeToHomeIfNotAbsolute"),+ new ScalarNode(Tag.BOOL, "false")));+ cachePathNode.getValue().add(new NodeTuple(+ new ScalarNode(Tag.STR, "pathValue"),+ new ScalarNode(Tag.STR, pathValue)));+ newPathNodes.add(cachePathNode);+ }+ pathsNode.getValue().clear();+ pathsNode.getValue().addAll(newPathNodes);+ }+ }+ }+ }++ stepsNode.getValue().removeIf(node ->+ "GenerateChecksumStep".equals(getStepType((MappingNode) node)));+ });+ }+}diff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/EnvVar.java b/server-core/src/main/java/io/onedev/server/buildspec/job/EnvVar.javaindex 1ca07922c4..9d6b16f632 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/job/EnvVar.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/job/EnvVar.java@@ -7,7 +7,7 @@ import javax.validation.constraints.NotEmpty;import io.onedev.commons.codeassist.InputSuggestion;import io.onedev.server.buildspec.BuildSpec;-import io.onedev.server.annotation.EnvironmentName;+import io.onedev.server.annotation.EnvVarName;import io.onedev.server.annotation.Editable;import io.onedev.server.annotation.Interpolative;@@ -22,7 +22,7 @@ public class EnvVar implements Serializable {@Editable(order=100, description="Specify name of the environment variable")@Interpolative(variableSuggester="suggestVariables")- @EnvironmentName+ @EnvVarName@NotEmptypublic String getName() {return name;diff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/Job.java b/server-core/src/main/java/io/onedev/server/buildspec/job/Job.javaindex c5cbbc434a..ca02e10982 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/job/Job.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/job/Job.java@@ -189,7 +189,7 @@ public class Job implements NamedElement, Validatable {return SuggestionUtils.suggest(applicableJobExecutors, matchWith);}- @Editable(order=200, description="Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>")+ @Editable(order=200, description="Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>")@Validpublic List<Step> getSteps() {return steps;diff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/JobDependency.java b/server-core/src/main/java/io/onedev/server/buildspec/job/JobDependency.javaindex 63ca5b65c3..af6c57f663 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/job/JobDependency.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/job/JobDependency.java@@ -111,7 +111,7 @@ public class JobDependency implements Serializable {@Editable(order=300, name="Artifacts to Retrieve", placeholder="Do not retrieve", description=""+ "Optionally specify artifacts to retrieve from the dependency into "- + "<a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. "+ + "<a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. "+ "Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not "+ "retrieve any artifacts")@Interpolative(variableSuggester="suggestVariables")@@ -125,8 +125,8 @@ public class JobDependency implements Serializable {}@Editable(order=400, placeholder="Job workspace", description=""- + "Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> "- + "to put retrieved artifacts. Leave empty to use job workspace itself")+ + "Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> "+ + "to put retrieved artifacts. Leave empty to use job workdir itself")@Interpolative(variableSuggester="suggestVariables")public String getDestinationPath() {return destinationPath;diff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/JobVariable.java b/server-core/src/main/java/io/onedev/server/buildspec/job/JobVariable.javaindex 4f4afce036..b81c73bb9d 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/job/JobVariable.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/job/JobVariable.java@@ -42,7 +42,7 @@ public enum JobVariable {JOB_TOKEN {@Overridepublic String getValue(Build build) {- return build.getJobToken();+ return build.getToken();}},REF {diff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/action/condition/LogCriteria.java b/server-core/src/main/java/io/onedev/server/buildspec/job/action/condition/LogCriteria.javaindex af3b30f33a..62acb6536e 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/job/action/condition/LogCriteria.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/job/action/condition/LogCriteria.java@@ -9,7 +9,7 @@ import javax.persistence.criteria.From;import javax.persistence.criteria.Predicate;import io.onedev.server.OneDev;-import io.onedev.server.job.log.LogService;+import io.onedev.server.logging.LogService;import io.onedev.server.model.Build;import io.onedev.server.util.ProjectScope;import io.onedev.server.util.criteria.Criteria;@@ -32,7 +32,7 @@ public class LogCriteria extends Criteria<Build> {@Overridepublic boolean matches(Build build) {Pattern pattern = Pattern.compile(value);- return OneDev.getInstance(LogService.class).matches(build, pattern);+ return OneDev.getInstance(LogService.class).matches(build.getLoggingSupport(), pattern);}@Overridediff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/log/JobLogEntryEx.java b/server-core/src/main/java/io/onedev/server/buildspec/job/log/JobLogEntryEx.javaindex 946ce5999d..4aff519ae1 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/job/log/JobLogEntryEx.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/job/log/JobLogEntryEx.java@@ -17,7 +17,7 @@ import org.jspecify.annotations.Nullable;import com.google.common.base.Splitter;import com.google.common.collect.Lists;-import io.onedev.server.job.log.StyleBuilder;+import io.onedev.server.logging.StyleBuilder;import io.onedev.server.web.asset.emoji.Emojis;public class JobLogEntryEx implements Serializable {diff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/log/instruction/LogInstruction.java b/server-core/src/main/java/io/onedev/server/buildspec/job/log/instruction/LogInstruction.javaindex 21fc9ca14f..86b3e6a50c 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/job/log/instruction/LogInstruction.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/job/log/instruction/LogInstruction.java@@ -15,9 +15,7 @@ import org.antlr.v4.runtime.tree.TerminalNode;import io.onedev.commons.codeassist.FenceAware;import io.onedev.commons.loader.ExtensionPoint;import io.onedev.commons.utils.StringUtils;-import io.onedev.commons.utils.TaskLogger;import io.onedev.server.buildspec.job.log.instruction.LogInstructionParser.InstructionContext;-import io.onedev.server.model.Build;@ExtensionPointpublic abstract class LogInstruction {@@ -26,7 +24,7 @@ public abstract class LogInstruction {public abstract String getName();- public abstract void execute(Build build, Map<String, List<String>> params, TaskLogger logger);+ public abstract void execute(Map<String, List<String>> params);public static String getValue(TerminalNode valueNode) {return StringUtils.unescape(FenceAware.unfence(valueNode.getText()));diff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/log/instruction/PauseExecution.java b/server-core/src/main/java/io/onedev/server/buildspec/job/log/instruction/PauseExecution.javadeleted file mode 100644index b173f1fb11..0000000000--- a/server-core/src/main/java/io/onedev/server/buildspec/job/log/instruction/PauseExecution.java+++ /dev/null@@ -1,37 +0,0 @@-package io.onedev.server.buildspec.job.log.instruction;--import java.util.List;-import java.util.Map;--import javax.inject.Inject;-import javax.inject.Singleton;--import io.onedev.commons.utils.TaskLogger;-import io.onedev.server.event.ListenerRegistry;-import io.onedev.server.event.project.build.BuildUpdated;-import io.onedev.server.model.Build;-import io.onedev.server.persistence.annotation.Transactional;--@Singleton-public class PauseExecution extends LogInstruction {-- private final ListenerRegistry listenerRegistry;-- @Inject- public PauseExecution(ListenerRegistry listenerRegistry) {- this.listenerRegistry = listenerRegistry;- }-- @Override- public String getName() {- return "PauseExecution";- }-- @Transactional- @Override- public void execute(Build build, Map<String, List<String>> params, TaskLogger taskLogger) {- build.setPaused(true);- listenerRegistry.post(new BuildUpdated(build));- }--}diff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/log/instruction/SetBuildVersion.java b/server-core/src/main/java/io/onedev/server/buildspec/job/log/instruction/SetBuildVersion.javadeleted file mode 100644index ef0c77ffe1..0000000000--- a/server-core/src/main/java/io/onedev/server/buildspec/job/log/instruction/SetBuildVersion.java+++ /dev/null@@ -1,43 +0,0 @@-package io.onedev.server.buildspec.job.log.instruction;--import java.util.List;-import java.util.Map;--import javax.inject.Inject;-import javax.inject.Singleton;--import org.apache.commons.lang3.StringUtils;--import io.onedev.commons.utils.TaskLogger;-import io.onedev.server.event.ListenerRegistry;-import io.onedev.server.event.project.build.BuildUpdated;-import io.onedev.server.model.Build;-import io.onedev.server.persistence.annotation.Transactional;--@Singleton-public class SetBuildVersion extends LogInstruction {-- private final ListenerRegistry listenerRegistry;-- @Inject- public SetBuildVersion(ListenerRegistry listenerRegistry) {- this.listenerRegistry = listenerRegistry;- }-- @Override- public String getName() {- return "SetBuildVersion";- }-- @Transactional- @Override- public void execute(Build build, Map<String, List<String>> params, TaskLogger taskLogger) {- String version = params.values().iterator().next().iterator().next();- if (StringUtils.isNotBlank(version))- build.setVersion(version);- else- build.setVersion(null);- listenerRegistry.post(new BuildUpdated(build));- }--}diff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/projectdependency/ProjectDependency.java b/server-core/src/main/java/io/onedev/server/buildspec/job/projectdependency/ProjectDependency.javaindex 50146b5e8a..6b3ee11760 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/job/projectdependency/ProjectDependency.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/job/projectdependency/ProjectDependency.java@@ -90,7 +90,7 @@ public class ProjectDependency implements Serializable {return null;}- @Editable(order=400, name="Artifacts to Retrieve", description="Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. "+ @Editable(order=400, name="Artifacts to Retrieve", description="Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. "+ "Only published artifacts (via artifact publish step) can be retrieved.")@Interpolative(variableSuggester="suggestVariables")@Patterns(path=true)@@ -104,8 +104,8 @@ public class ProjectDependency implements Serializable {}@Editable(order=500, placeholder="Job workspace", description=""- + "Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> "- + "to put retrieved artifacts. Leave empty to use job workspace itself")+ + "Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> "+ + "to put retrieved artifacts. Leave empty to use job workdir itself")@Interpolative(variableSuggester="suggestVariables")public String getDestinationPath() {return destinationPath;diff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/retrycondition/LogCriteria.java b/server-core/src/main/java/io/onedev/server/buildspec/job/retrycondition/LogCriteria.javaindex c053b7d3bb..8bde5b3f1d 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/job/retrycondition/LogCriteria.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/job/retrycondition/LogCriteria.java@@ -9,7 +9,7 @@ import javax.persistence.criteria.From;import javax.persistence.criteria.Predicate;import io.onedev.server.OneDev;-import io.onedev.server.job.log.LogService;+import io.onedev.server.logging.LogService;import io.onedev.server.model.Build;import io.onedev.server.util.ProjectScope;import io.onedev.server.util.criteria.Criteria;@@ -33,7 +33,7 @@ public class LogCriteria extends Criteria<RetryContext> {public boolean matches(RetryContext context) {Pattern pattern = Pattern.compile(value);return context.getErrorMessage() != null && pattern.matcher(context.getErrorMessage()).find()- || OneDev.getInstance(LogService.class).matches(context.getBuild(), pattern);+ || OneDev.getInstance(LogService.class).matches(context.getBuild().getLoggingSupport(), pattern);}@Overridediff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/BuildImageStep.java b/server-core/src/main/java/io/onedev/server/buildspec/step/BuildImageStep.javaindex ae395aaada..4642e7a20c 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/BuildImageStep.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/BuildImageStep.java@@ -46,8 +46,8 @@ public class BuildImageStep extends Step {private String moreOptions;- @Editable(order=100, description="Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. "- + "Leave empty to use job workspace itself")+ @Editable(order=100, description="Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. "+ + "Leave empty to use job workdir itself")@Interpolative(variableSuggester="suggestVariables")@SubPathpublic String getBuildPath() {@@ -58,7 +58,7 @@ public class BuildImageStep extends Step {this.buildPath = buildPath;}- @Editable(order=200, description="Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. "+ @Editable(order=200, description="Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. "+ "Leave empty to use file <tt>Dockerfile</tt> under build path specified above")@Interpolative(variableSuggester="suggestVariables")@SubPath@@ -178,7 +178,7 @@ public class BuildImageStep extends Step {private String destPath;- @Editable(name="OCI Layout Directory", description = "Specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout")+ @Editable(name="OCI Layout Directory", description = "Specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout")@SubPath@NoSpace@Interpolative(variableSuggester="suggestVariables")diff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/BuildImageWithKanikoStep.java b/server-core/src/main/java/io/onedev/server/buildspec/step/BuildImageWithKanikoStep.javaindex b945dc65eb..221ca006b1 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/BuildImageWithKanikoStep.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/BuildImageWithKanikoStep.java@@ -19,7 +19,7 @@ import java.util.ArrayList;import java.util.List;import java.util.Map;-import static io.onedev.agent.DockerExecutorUtils.buildDockerConfig;+import static io.onedev.agent.AgentUtils.buildDockerConfig;import static io.onedev.k8shelper.RegistryLoginFacade.merge;import static io.onedev.server.buildspec.step.StepGroup.DOCKER_IMAGE;@@ -59,8 +59,8 @@ public class BuildImageWithKanikoStep extends CommandStep {return null;}- @Editable(order=100, description="Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. "- + "Leave empty to use job workspace itself. The file <code>Dockerfile</code> is expected to exist in build context " ++ @Editable(order=100, description="Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. "+ + "Leave empty to use job workdir itself. The file <code>Dockerfile</code> is expected to exist in build context " +"directory, unless you specify a different location with option <code>--dockerfile</code>")@Interpolative(variableSuggester="suggestVariables")@SubPath@@ -216,7 +216,7 @@ public class BuildImageWithKanikoStep extends CommandStep {private String destPath;- @Editable(name="OCI Layout Directory", description = "Specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout")+ @Editable(name="OCI Layout Directory", description = "Specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout")@Interpolative(variableSuggester="suggestVariables")@SubPath@NoSpacediff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/CachePath.java b/server-core/src/main/java/io/onedev/server/buildspec/step/CachePath.javanew file mode 100644index 0000000000..c0c54f443a--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/CachePath.java@@ -0,0 +1,61 @@+package io.onedev.server.buildspec.step;++import java.io.Serializable;+import java.util.List;++import javax.validation.constraints.NotEmpty;++import io.onedev.commons.codeassist.InputSuggestion;+import io.onedev.k8shelper.CachePathFacade;+import io.onedev.server.annotation.Editable;+import io.onedev.server.annotation.Interpolative;+import io.onedev.server.buildspec.BuildSpec;++@Editable+public class CachePath implements Serializable {++ private static final long serialVersionUID = 1L;++ private boolean relativeToHomeIfNotAbsolute = false;++ private String pathValue;++ @Editable(order=100, description = """+ If true, the path is considered to be relative to user home directory if not absolute;+ otherwise, it is considered to be relative to job workdir""")+ public boolean isRelativeToHomeIfNotAbsolute() {+ return relativeToHomeIfNotAbsolute;+ }++ public void setRelativeToHomeIfNotAbsolute(boolean relativeToHomeIfNotAbsolute) {+ this.relativeToHomeIfNotAbsolute = relativeToHomeIfNotAbsolute;+ }++ @Editable(order=200, name="Path")+ @Interpolative(variableSuggester="suggestVariables")+ @NotEmpty+ public String getPathValue() {+ return pathValue;+ }++ public void setPathValue(String pathValue) {+ this.pathValue = pathValue;+ }++ @SuppressWarnings("unused")+ private static List<InputSuggestion> suggestVariables(String matchWith) {+ return BuildSpec.suggestVariables(matchWith, true, true, false);+ }++ public CachePathFacade toFacade() {+ return new CachePathFacade(relativeToHomeIfNotAbsolute, pathValue);+ }++ public static CachePath of(boolean relativeToHomeIfNotAbsolute, String pathValue) {+ var cachePath = new CachePath();+ cachePath.setRelativeToHomeIfNotAbsolute(relativeToHomeIfNotAbsolute);+ cachePath.setPathValue(pathValue);+ return cachePath;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/CheckoutStep.java b/server-core/src/main/java/io/onedev/server/buildspec/step/CheckoutStep.javaindex d3467bd521..17625fdeeb 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/CheckoutStep.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/CheckoutStep.java@@ -76,9 +76,9 @@ public class CheckoutStep extends Step {this.cloneDepth = cloneDepth;}- @Editable(order=300, placeholder="Job workspace", description="Optionally specify relative path under "- + "<a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to clone code into. "- + "Leave empty to use job workspace itself")+ @Editable(order=300, placeholder="Job workdir", description="Optionally specify relative path under "+ + "<a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to clone code into. "+ + "Leave empty to use job workdir itself")@Interpolative(variableSuggester="suggestVariables")@SubPathpublic String getCheckoutPath() {diff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/CraneStep.java b/server-core/src/main/java/io/onedev/server/buildspec/step/CraneStep.javaindex 7ddd601004..3692cb980b 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/CraneStep.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/CraneStep.java@@ -1,6 +1,6 @@package io.onedev.server.buildspec.step;-import static io.onedev.agent.DockerExecutorUtils.buildDockerConfig;+import static io.onedev.agent.AgentUtils.buildDockerConfig;import static io.onedev.k8shelper.RegistryLoginFacade.merge;import java.util.List;diff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/GenerateChecksumStep.java b/server-core/src/main/java/io/onedev/server/buildspec/step/GenerateChecksumStep.javadeleted file mode 100644index 9089358977..0000000000--- a/server-core/src/main/java/io/onedev/server/buildspec/step/GenerateChecksumStep.java+++ /dev/null@@ -1,101 +0,0 @@-package io.onedev.server.buildspec.step;--import static io.onedev.server.buildspec.step.StepGroup.UTILITIES;--import java.util.ArrayList;-import java.util.List;--import javax.validation.constraints.NotEmpty;--import io.onedev.commons.codeassist.InputSuggestion;-import io.onedev.server.annotation.Editable;-import io.onedev.server.annotation.Interpolative;-import io.onedev.server.buildspec.BuildSpec;-import io.onedev.server.buildspec.step.commandinterpreter.Interpreter;-import io.onedev.server.buildspec.step.commandinterpreter.ShellInterpreter;--@Editable(order=1110, group = UTILITIES, name="Generate File Checksum", description = "" +- "This step can only be executed by a docker aware executor")-public class GenerateChecksumStep extends CommandStep {-- private static final long serialVersionUID = 1L;-- private String files;-- private String targetFile;-- @Editable(order=100, description = "Specify files to create md5 checksum from. Multiple files " +- "should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. " +- "Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>")- @Interpolative(variableSuggester="suggestVariables")- @NotEmpty- public String getFiles() {- return files;- }-- public void setFiles(String files) {- this.files = files;- }-- @Editable(order=200, description = "Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to write checksum into")- @Interpolative(variableSuggester="suggestVariables")- @NotEmpty- public String getTargetFile() {- return targetFile;- }-- public void setTargetFile(String targetFile) {- this.targetFile = targetFile;- }-- static List<InputSuggestion> suggestVariables(String matchWith) {- return BuildSpec.suggestVariables(matchWith, true, true, false);- }-- @Override- public boolean isRunInContainer() {- return true;- }-- @Override- public String getImage() {- return "ubuntu:20.04";- }-- @Override- public String getRunAs() {- return null;- }-- @Override- public boolean isUseTTY() {- return false;- }-- @Override- public List<RegistryLogin> getRegistryLogins() {- return new ArrayList<>();- }-- @Override- public Interpreter getInterpreter() {- return new ShellInterpreter() {-- @Override- public String getShell() {- return "bash";- }-- @Override- public String getCommands() {- var commandsBuilder = new StringBuilder();- commandsBuilder.append("set -e\n");- commandsBuilder.append("shopt -s globstar\n");- commandsBuilder.append("cat `ls -1 ").append(files).append(" 2>/dev/null` | md5sum | awk '{ print $1 }' > ").append(targetFile).append("\n");- commandsBuilder.append("echo Generated checksum: `cat ").append(targetFile).append("`").append("\n");- return commandsBuilder.toString();- }- };- }--}diff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/PublishArtifactStep.java b/server-core/src/main/java/io/onedev/server/buildspec/step/PublishArtifactStep.javaindex e4d3afbe38..49db9bf51c 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/PublishArtifactStep.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/PublishArtifactStep.java@@ -23,7 +23,7 @@ import java.util.List;import static io.onedev.server.buildspec.step.StepGroup.PUBLISH;-@Editable(order=1050, group= PUBLISH, name="Artifacts", description="This step copies files from job workspace " ++@Editable(order=1050, group= PUBLISH, name="Artifacts", description="This step copies files from job workdir " +"to build artifacts directory, so that they can be accessed after job is completed")public class PublishArtifactStep extends ServerSideStep {@@ -34,8 +34,8 @@ public class PublishArtifactStep extends ServerSideStep {private String artifacts;@Editable(order=50, name="From Directory", placeholder="Job workspace", description="Optionally specify path "- + "relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to publish "- + "artifacts from. Leave empty to use job workspace itself")+ + "relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to publish "+ + "artifacts from. Leave empty to use job workdir itself")@Interpolative(variableSuggester="suggestVariables")@SubPath@Overridediff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/PublishReportStep.java b/server-core/src/main/java/io/onedev/server/buildspec/step/PublishReportStep.javaindex 5aecd6b583..b6d2dc532f 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/PublishReportStep.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/PublishReportStep.java@@ -44,7 +44,7 @@ public abstract class PublishReportStep extends ServerSideStep {return PatternSet.parse(getFilePatterns());}- @Editable(order=100, description="Specify files relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published. "+ @Editable(order=100, description="Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published. "+ "Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")@Patterns(path=true)diff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/PublishSiteStep.java b/server-core/src/main/java/io/onedev/server/buildspec/step/PublishSiteStep.javaindex 1ff7c759ac..a9259c920a 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/PublishSiteStep.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/PublishSiteStep.java@@ -53,8 +53,8 @@ public class PublishSiteStep extends ServerSideStep {}@Editable(order=50, name="From Directory", placeholder="Job workspace", description="Optionally specify path "- + "relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to publish "- + "artifacts from. Leave empty to use job workspace itself")+ + "relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to publish "+ + "artifacts from. Leave empty to use job workdir itself")@Interpolative(variableSuggester="suggestVariables")@SubPath@Overridediff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/PullImageStep.java b/server-core/src/main/java/io/onedev/server/buildspec/step/PullImageStep.javaindex a98520674b..a82bcd496d 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/PullImageStep.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/PullImageStep.java@@ -38,7 +38,7 @@ public class PullImageStep extends CraneStep {this.srcImage = srcImage;}- @Editable(order=200, name="OCI Layout Directory", description = "Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout")+ @Editable(order=200, name="OCI Layout Directory", description = "Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout")@Interpolative(variableSuggester="suggestVariables")@SubPath@NoSpacediff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/PushImageStep.java b/server-core/src/main/java/io/onedev/server/buildspec/step/PushImageStep.javaindex 36be3d5311..b61c126e85 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/PushImageStep.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/PushImageStep.java@@ -22,7 +22,7 @@ public class PushImageStep extends CraneStep {private String moreOptions;- @Editable(order=100, name="OCI Layout Directory", description = "Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to push from")+ @Editable(order=100, name="OCI Layout Directory", description = "Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to push from")@Interpolative(variableSuggester="suggestVariables")@SubPath@NoSpacediff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/RunContainerStep.java b/server-core/src/main/java/io/onedev/server/buildspec/step/RunContainerStep.javaindex a7bfd8a510..9ec25d2a2a 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/RunContainerStep.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/RunContainerStep.java@@ -26,8 +26,8 @@ import io.onedev.server.model.support.administration.jobexecutor.DockerAware;import io.onedev.server.model.support.administration.jobexecutor.JobExecutor;import io.onedev.server.model.support.administration.jobexecutor.KubernetesAware;-@Editable(order=150, name="Run Docker Container", description="Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job workspace</a> "- + "is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKSPACE</code>. " ++@Editable(order=150, name="Run Docker Container", description="Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job workspace</a> "+ + "is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKDIR</code>. " +"<b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote " +"docker executor")public class RunContainerStep extends Step {@@ -108,7 +108,7 @@ public class RunContainerStep extends Step {this.envVars = envVars;}- @Editable(order=500, group = "More Settings", description="Optionally mount directories or files under job workspace into container")+ @Editable(order=500, group = "More Settings", description="Optionally mount directories or files under job workdir into container")@Validpublic List<VolumeMount> getVolumeMounts() {return volumeMounts;diff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/SCPCommandStep.java b/server-core/src/main/java/io/onedev/server/buildspec/step/SCPCommandStep.javaindex 57f202daa4..a8b4ae48b5 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/SCPCommandStep.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/SCPCommandStep.java@@ -20,7 +20,7 @@ import io.onedev.server.model.Build;import io.onedev.server.model.Project;@Editable(order=1100, group = UTILITIES, name="Copy Files with SCP", description = "" +- "This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>")+ "This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>")public class SCPCommandStep extends CommandStep {private static final long serialVersionUID = 1L;diff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/SetupCacheStep.java b/server-core/src/main/java/io/onedev/server/buildspec/step/SetupCacheStep.javaindex 62cb0076c8..13a5bac9aa 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/SetupCacheStep.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/SetupCacheStep.java@@ -1,15 +1,18 @@package io.onedev.server.buildspec.step;-import static io.onedev.k8shelper.SetupCacheFacade.UploadStrategy.UPLOAD_IF_NOT_HIT;+import static io.onedev.k8shelper.SetupCacheFacade.UploadStrategy.UPLOAD_IF_NOT_EXACT_MATCH;import static java.util.stream.Collectors.toList;-import java.util.ArrayList;import java.util.List;+import java.util.Set;+import javax.validation.Valid;import javax.validation.constraints.NotEmpty;import javax.validation.constraints.NotNull;import javax.validation.constraints.Size;+import org.apache.commons.lang3.tuple.Pair;+import io.onedev.commons.codeassist.InputSuggestion;import io.onedev.k8shelper.SetupCacheFacade;import io.onedev.k8shelper.StepFacade;@@ -23,21 +26,23 @@ import io.onedev.server.buildspec.param.ParamCombination;import io.onedev.server.model.Build;import io.onedev.server.model.Project;import io.onedev.server.model.support.administration.jobexecutor.JobExecutor;+import io.onedev.server.util.patternset.PatternSet;-@Editable(order=55, name="Set Up Cache", description = "Set up job cache to speed up job execution. " +- "Check <a href='https://docs.onedev.io/tutorials/cicd/job-cache' target='_blank'>this tutorial</a> " +- "on how to use job cache")+@Editable(order=55, name="Set Up Cache", description = """+ Set up job cache to speed up job execution. \+ Check <a href='https://docs.onedev.io/tutorials/cicd/job-cache' target='_blank'>this tutorial</a> \+ on how to use job cache""")public class SetupCacheStep extends Step {private static final long serialVersionUID = 1L;private String key;- private List<String> loadKeys = new ArrayList<>();+ private String checksumFiles;- private List<String> paths;+ private List<CachePath> paths;- private SetupCacheFacade.UploadStrategy uploadStrategy = UPLOAD_IF_NOT_HIT;+ private SetupCacheFacade.UploadStrategy uploadStrategy = UPLOAD_IF_NOT_EXACT_MATCH;private String changeDetectionExcludes;@@ -45,12 +50,11 @@ public class SetupCacheStep extends Step {private String uploadAccessTokenSecret;- @Editable(order=100, name="Cache Key", description = "This key is used to determine if there is a cache hit in " +- "project hierarchy (search from current project to root project in order, same for load keys below). " +- "A cache is considered hit if its key is exactly the same as the key defined here.<br>" +- "<b>NOTE:</b> In case your project has lock files(package.json, pom.xml, etc.) able to represent cache state, " +- "this key should be defined as <cache name>-@file:checksum.txt@, where checksum.txt is generated " +- "from these lock files with the <b>generate checksum step</b> defined before this step")+ @Editable(order=100, name="Cache Key", description = """+ This key will be used to identify the cache in project hierarchy (search from current+ project to root project in order), together with checksum (see below). An exact match+ means that both key and checksum match, and a partial match means that only key+ matches""")@Interpolative(variableSuggester="suggestVariables")@NotEmptypublic String getKey() {@@ -61,36 +65,39 @@ public class SetupCacheStep extends Step {this.key = key;}- @Editable(order=200, name="Load Keys", description = "In case cache is not hit via above key, " +- "OneDev will loop through load keys defined here in order until a matching cache is found " +- "in project hierarchy. A cache is considered matching if its key is prefixed with the load " +- "key. If multiple caches matches, the most recent cache will be returned")+ @Editable(order=175, name="Checksum Files", description = """+ Optionally specify files to compute checksum from. This is useful when your project+ has lock files (package-lock.json, pom.xml, etc.) that represent cache state. When+ checksum changes, cache can still be loaded as a partial match, but+ will be re-uploaded with the new checksum if upload strategy is set to <i>Upload If Not Exact Match</i>.+ Use '**', '*' or '?' for <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>path wildcard match</a>.+ Multiple files should be separated by space, and single file containing space should be quoted.+ Non-absolute file is relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>.<br>+ <b>NOTE: </b> An empty checksum is assumed if this property is empty.""")@Interpolative(variableSuggester="suggestVariables")- public List<String> getLoadKeys() {- return loadKeys;+ public String getChecksumFiles() {+ return checksumFiles;}- public void setLoadKeys(List<String> loadKeys) {- this.loadKeys = loadKeys;+ public void setChecksumFiles(String checksumFiles) {+ this.checksumFiles = checksumFiles;}-- @Editable(order=300, name="Cache Paths", description = "For docker aware executors, this path is inside container, " +- "and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>). " +- "For shell related executors which runs on host machine directly, only relative path is accepted")- @Interpolative(variableSuggester="suggestVariables")++ @Editable(order=300, name="Cache Paths")+ @Valid@Size(min=1, max=100)- public List<String> getPaths() {+ public List<CachePath> getPaths() {return paths;}- public void setPaths(List<String> paths) {+ public void setPaths(List<CachePath> paths) {this.paths = paths;}- @Editable(order=400, description = "Specify cache upload strategy after build successful. " +- "<var>Upload If Not Hit</var> means to upload when cache is not found with " +- "cache key (not load keys), and <var>Upload If Changed</var> means to upload if some files " +- "in cache path are changed")+ @Editable(order=400, description = """+ Specify cache upload strategy after build successful. <i>Upload If Not Exact Match</i>+ means to upload when no cache found with matching key and checksum , and+ <i>Upload If Changed</i> means to upload if some files in cache path are changed""")@NotNullpublic SetupCacheFacade.UploadStrategy getUploadStrategy() {return uploadStrategy;@@ -100,9 +107,10 @@ public class SetupCacheStep extends Step {this.uploadStrategy = uploadStrategy;}- @Editable(order=425, description = "Optionally specify files relative to cache path to ignore when " +- "detect cache changes. Use '**', '*' or '?' for <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>path wildcard match</a>. " +- "Multiple files should be separated by space, and single file containing space should be quoted")+ @Editable(order=425, description = """+ Optionally specify files relative to cache path to ignore when detect cache changes.+ Use '**', '*' or '?' for <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>path wildcard match</a>.+ Multiple files should be separated by space, and single file containing space should be quoted""")@Interpolative(variableSuggester="suggestVariables")@DependsOn(property="uploadStrategy", value="UPLOAD_IF_CHANGED")public String getChangeDetectionExcludes() {@@ -113,8 +121,9 @@ public class SetupCacheStep extends Step {this.changeDetectionExcludes = changeDetectionExcludes;}- @Editable(order=450, name="Upload to Project", placeholder = "Current project", description = "In case cache needs to be uploaded, this property " +- "specifies target project for the upload. Leave empty for current project")+ @Editable(order=450, name="Upload to Project", placeholder = "Current project", description = """+ In case cache needs to be uploaded, this property specifies target project for the upload.+ Leave empty for current project""")@ProjectChoicepublic String getUploadProjectPath() {return uploadProjectPath;@@ -129,9 +138,11 @@ public class SetupCacheStep extends Step {return BuildSpec.suggestVariables(matchWith, true, true, false);}- @Editable(order=500, description = "Specify a <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> whose value is an access token with upload cache permission " +- "for above project. Note that this property is not required if upload cache to current or child project " +- "and build commit is reachable from default branch")+ @Editable(order=500, description = """+ Specify a <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a>+ whose value is an access token with upload cache permission for above project.+ Note that this property is not required if upload cache to current or child+ project and build commit is reachable from default branch""")@ChoiceProvider("getAccessTokenSecretChoices")public String getUploadAccessTokenSecret() {return uploadAccessTokenSecret;@@ -154,8 +165,16 @@ public class SetupCacheStep extends Step {uploadAccessToken = build.getJobAuthorizationContext().getSecretValue(getUploadAccessTokenSecret());elseuploadAccessToken = null;- return new SetupCacheFacade(getKey(), getLoadKeys(), getPaths(), getUploadStrategy(),- getChangeDetectionExcludes(), getUploadProjectPath(), uploadAccessToken);+ var pathFacades = getPaths().stream()+ .map(CachePath::toFacade)+ .collect(toList());+ Pair<Set<String>, Set<String>> parsedChecksumFiles = null;+ if (checksumFiles != null) {+ var patterns = PatternSet.parse(checksumFiles);+ parsedChecksumFiles = Pair.of(patterns.getIncludes(), patterns.getExcludes());+ }+ return new SetupCacheFacade(getKey(), parsedChecksumFiles, pathFacades,+ getUploadStrategy(), getChangeDetectionExcludes(), getUploadProjectPath(), uploadAccessToken);}@Override@@ -164,4 +183,3 @@ public class SetupCacheStep extends Step {}}-\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/StepTemplate.java b/server-core/src/main/java/io/onedev/server/buildspec/step/StepTemplate.javaindex 86bc1551c7..59e2635df9 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/StepTemplate.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/StepTemplate.java@@ -50,7 +50,7 @@ public class StepTemplate implements NamedElement {return new ArrayList<>();}- @Editable(order=200, description="Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>")+ @Editable(order=200, description="Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>")@Validpublic List<Step> getSteps() {return steps;diff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/VolumeMount.java b/server-core/src/main/java/io/onedev/server/buildspec/step/VolumeMount.javaindex 5fea255606..18a8126f41 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/VolumeMount.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/VolumeMount.java@@ -20,8 +20,8 @@ public class VolumeMount implements Serializable {private String target;- @Editable(order = 100, placeholder = "Job workspace", description = "Specify a path relative to job workspace " +- "to be used as mount source. Leave empty to mount job workspace itself")+ @Editable(order = 100, placeholder = "Job workspace", description = "Specify a path relative to job workdir " ++ "to be used as mount source. Leave empty to mount job workdir itself")@Interpolative(variableSuggester="suggestVariables")@SubPathpublic String getSourcePath() {diff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/DefaultInterpreter.java b/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/DefaultInterpreter.javaindex 06ed45a849..2458aa9a04 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/DefaultInterpreter.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/DefaultInterpreter.java@@ -18,7 +18,7 @@ public class DefaultInterpreter extends Interpreter {private static final long serialVersionUID = 1L;@Editable(order=110, description="Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute "- + "under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>")+ + "under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>")@Interpolative@Code(language=Code.SHELL, variableProvider="suggestVariables")@NotEmptydiff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/PowerShellInterpreter.java b/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/PowerShellInterpreter.javaindex f4f9c4b483..22a25b4810 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/PowerShellInterpreter.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/PowerShellInterpreter.java@@ -31,7 +31,7 @@ public class PowerShellInterpreter extends Interpreter {}@Editable(order=110, description="Specify PowerShell commands to execute "- + "under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>.<br>"+ + "under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>.<br>"+ "<b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. "+ "Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script "+ "and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of "diff --git a/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/ShellInterpreter.java b/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/ShellInterpreter.javaindex 7b69c53778..c61726e9f8 100644--- a/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/ShellInterpreter.java+++ b/server-core/src/main/java/io/onedev/server/buildspec/step/commandinterpreter/ShellInterpreter.java@@ -31,7 +31,7 @@ public class ShellInterpreter extends Interpreter {}@Editable(order=110, description="Specify shell commands to execute "- + "under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>")+ + "under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>")@Interpolative@Code(language=Code.SHELL, variableProvider="suggestVariables")@NotEmptydiff --git a/server-core/src/main/java/io/onedev/server/cluster/ClusterResource.java b/server-core/src/main/java/io/onedev/server/cluster/ClusterResource.javaindex 7d214d623e..790716fb47 100644--- a/server-core/src/main/java/io/onedev/server/cluster/ClusterResource.java+++ b/server-core/src/main/java/io/onedev/server/cluster/ClusterResource.java@@ -32,22 +32,17 @@ import javax.ws.rs.core.MediaType;import javax.ws.rs.core.Response;import javax.ws.rs.core.StreamingOutput;-import io.onedev.server.annotation.NoDBAccess;import org.apache.shiro.authz.UnauthorizedException;import org.eclipse.jgit.lib.Repository;-import com.google.common.base.Splitter;import com.google.common.collect.Sets;import io.onedev.commons.utils.FileUtils;import io.onedev.commons.utils.TarUtils;import io.onedev.server.OneDev;import io.onedev.server.StorageService;+import io.onedev.server.annotation.NoDBAccess;import io.onedev.server.attachment.AttachmentService;-import io.onedev.server.service.BuildService;-import io.onedev.server.service.JobCacheService;-import io.onedev.server.service.PackBlobService;-import io.onedev.server.service.ProjectService;import io.onedev.server.git.CommandUtils;import io.onedev.server.git.GitFilter;import io.onedev.server.git.GitUtils;@@ -59,6 +54,11 @@ import io.onedev.server.model.PackBlob;import io.onedev.server.model.Project;import io.onedev.server.rest.annotation.Api;import io.onedev.server.security.SecurityUtils;+import io.onedev.server.service.BuildService;+import io.onedev.server.service.PackBlobService;+import io.onedev.server.service.ProjectService;+import io.onedev.server.service.RunCacheService;+import io.onedev.server.service.support.CacheQueryResult;import io.onedev.server.util.IOUtils;import io.onedev.server.util.concurrent.WorkExecutionService;import io.onedev.server.util.patternset.PatternSet;@@ -71,41 +71,33 @@ import io.onedev.server.xodus.VisitInfoService;@Singletonpublic class ClusterResource {- private final ProjectService projectService;-- private final AttachmentService attachmentService;+ @Inject+ private ProjectService projectService;- private final CommitInfoService commitInfoService;+ @Inject+ private AttachmentService attachmentService;- private final VisitInfoService visitInfoService;+ @Inject+ private CommitInfoService commitInfoService;- private final StorageService storageService;+ @Inject+ private VisitInfoService visitInfoService;- private final PackBlobService packBlobService;+ @Inject+ private StorageService storageService;- private final BuildService buildService;+ @Inject+ private PackBlobService packBlobService;- private final JobCacheService jobCacheService;+ @Inject+ private BuildService buildService;- private final WorkExecutionService workExecutionService;+ @Inject+ private RunCacheService cacheService;@Inject- public ClusterResource(ProjectService projectService, CommitInfoService commitInfoService,- AttachmentService attachmentService, VisitInfoService visitInfoService,- WorkExecutionService workExecutionService, StorageService storageService,- PackBlobService packBlobService, BuildService buildService,- JobCacheService jobCacheService) {- this.commitInfoService = commitInfoService;- this.projectService = projectService;- this.workExecutionService = workExecutionService;- this.attachmentService = attachmentService;- this.visitInfoService = visitInfoService;- this.storageService = storageService;- this.packBlobService = packBlobService;- this.buildService = buildService;- this.jobCacheService = jobCacheService;- }-+ private WorkExecutionService workExecutionService;+@Path("/project-files")@Produces(MediaType.APPLICATION_OCTET_STREAM)@GET@@ -241,11 +233,12 @@ public class ClusterResource {public Response downloadCache(@QueryParam("projectId") Long projectId,@QueryParam("cacheId") Long cacheId,- @QueryParam("cachePaths") String joinedCachePaths) {+ @QueryParam("exactMatch") boolean exactMatch,+ @QueryParam("cachePathsString") String cachePathsString) {if (!SecurityUtils.isSystem())throw new UnauthorizedException("This api can only be accessed via cluster credential");- var cachePaths = Splitter.on('\n').splitToList(joinedCachePaths);- StreamingOutput out = os -> jobCacheService.downloadCache(projectId, cacheId, cachePaths, os);+ var cacheQueryResult = new CacheQueryResult(projectId, cacheId, exactMatch);+ StreamingOutput out = os -> cacheService.downloadCache(cacheQueryResult, cachePathsString, os);return ok(out).build();}@@ -294,7 +287,7 @@ public class ClusterResource {throw new UnauthorizedException("This api can only be accessed via cluster credential");StreamingOutput os = output -> {- Map<String, String> hookEnvs = HookUtils.getHookEnvs(projectId, principal);+ Map<String, String> hookEnvs = HookUtils.getReceiveHookEnvs(projectId, principal);try {File gitDir = projectService.getGitDir(projectId);@@ -468,11 +461,11 @@ public class ClusterResource {public Response uploadCache(@QueryParam("projectId") Long projectId,@QueryParam("cacheId") Long cacheId,- @QueryParam("cachePaths") String cachePaths,+ @QueryParam("cachePathsString") String cachePathsString,InputStream cacheStream) {if (!SecurityUtils.isSystem())throw new UnauthorizedException("This api can only be accessed via cluster credential");- jobCacheService.uploadCache(projectId, cacheId, Splitter.on('\n').splitToList(cachePaths), cacheStream);+ cacheService.uploadCache(projectId, cacheId, cachePathsString, cacheStream);return ok().build();}diff --git a/server-core/src/main/java/io/onedev/server/cluster/ClusterService.java b/server-core/src/main/java/io/onedev/server/cluster/ClusterService.javaindex cf186bad7a..d936190076 100644--- a/server-core/src/main/java/io/onedev/server/cluster/ClusterService.java+++ b/server-core/src/main/java/io/onedev/server/cluster/ClusterService.java@@ -1,12 +1,5 @@package io.onedev.server.cluster;-import com.hazelcast.cluster.Member;-import com.hazelcast.core.HazelcastInstance;-import com.hazelcast.cp.IAtomicLong;-import io.onedev.server.annotation.NoDBAccess;-import io.onedev.server.replica.ProjectReplica;--import org.jspecify.annotations.Nullable;import java.util.Collection;import java.util.LinkedHashMap;import java.util.List;@@ -14,6 +7,15 @@ import java.util.Map;import java.util.concurrent.Callable;import java.util.concurrent.Future;+import org.jspecify.annotations.Nullable;++import com.hazelcast.cluster.Member;+import com.hazelcast.core.HazelcastInstance;+import com.hazelcast.cp.IAtomicLong;++import io.onedev.server.annotation.NoDBAccess;+import io.onedev.server.replica.ProjectReplica;+public interface ClusterService {void start();diff --git a/server-core/src/main/java/io/onedev/server/data/DefaultDataService.java b/server-core/src/main/java/io/onedev/server/data/DefaultDataService.javaindex cd7e8fbb29..9b53c4c371 100644--- a/server-core/src/main/java/io/onedev/server/data/DefaultDataService.java+++ b/server-core/src/main/java/io/onedev/server/data/DefaultDataService.java@@ -100,6 +100,7 @@ import io.onedev.server.model.support.administration.BackupSetting;import io.onedev.server.model.support.administration.BrandingSetting;import io.onedev.server.model.support.administration.ClusterSetting;import io.onedev.server.model.support.administration.GlobalBuildSetting;+import io.onedev.server.model.support.administration.GlobalWorkspaceSetting;import io.onedev.server.model.support.administration.GlobalIssueSetting;import io.onedev.server.model.support.administration.GlobalPackSetting;import io.onedev.server.model.support.administration.GlobalProjectSetting;@@ -788,6 +789,9 @@ public class DefaultDataService implements DataService, Serializable {setting = settingService.findSetting(Key.JOB_EXECUTORS);if (setting == null)settingService.saveJobExecutors(new ArrayList<>());+ setting = settingService.findSetting(Key.WORKSPACE_PROVISIONERS);+ if (setting == null)+ settingService.saveWorkspaceProvisioners(new ArrayList<>());setting = settingService.findSetting(Key.GROOVY_SCRIPTS);if (setting == null) {settingService.saveGroovyScripts(Lists.newArrayList());@@ -804,6 +808,10 @@ public class DefaultDataService implements DataService, Serializable {if (setting == null) {settingService.savePackSetting(new GlobalPackSetting());}+ setting = settingService.findSetting(Key.WORKSPACE);+ if (setting == null) {+ settingService.saveWorkspaceSetting(new GlobalWorkspaceSetting());+ }setting = settingService.findSetting(Key.PROJECT);if (setting == null) {settingService.saveProjectSetting(new GlobalProjectSetting());@@ -960,7 +968,11 @@ public class DefaultDataService implements DataService, Serializable {@Overridepublic Void call() throws Exception {- scheduleBackup(backupSetting);+ try {+ scheduleBackup(backupSetting);+ } catch (Throwable t) {+ logger.error("Error scheduling backup", t);+ }return null;}diff --git a/server-core/src/main/java/io/onedev/server/data/migration/DataMigrator.java b/server-core/src/main/java/io/onedev/server/data/migration/DataMigrator.javaindex 8fbfc95fa4..751d67b6a3 100644--- a/server-core/src/main/java/io/onedev/server/data/migration/DataMigrator.java+++ b/server-core/src/main/java/io/onedev/server/data/migration/DataMigrator.java@@ -35,7 +35,6 @@ import java.util.UUID;import java.util.regex.Matcher;import java.util.regex.Pattern;-import org.jspecify.annotations.Nullable;import javax.inject.Singleton;import org.apache.commons.io.IOUtils;@@ -44,6 +43,7 @@ import org.apache.sshd.common.config.keys.KeyUtils;import org.apache.sshd.common.digest.BuiltinDigests;import org.dom4j.Element;import org.dom4j.Node;+import org.jspecify.annotations.Nullable;import org.slf4j.Logger;import org.slf4j.LoggerFactory;@@ -56,7 +56,6 @@ import io.onedev.commons.utils.FileUtils;import io.onedev.commons.utils.StringUtils;import io.onedev.server.OneDev;import io.onedev.server.buildspecmodel.inputspec.InputSpec;-import io.onedev.server.service.SettingService;import io.onedev.server.markdown.MarkdownService;import io.onedev.server.markdown.MentionParser;import io.onedev.server.model.Issue;@@ -66,6 +65,7 @@ import io.onedev.server.model.PullRequest;import io.onedev.server.model.PullRequestComment;import io.onedev.server.model.User;import io.onedev.server.model.support.TimeGroups;+import io.onedev.server.service.SettingService;import io.onedev.server.ssh.SshKeyUtils;import io.onedev.server.util.CryptoUtils;import io.onedev.server.util.DateUtils;@@ -8536,4 +8536,87 @@ public class DataMigrator {}}+ private void migrate222(File dataDir, Stack<Integer> versions) {+ String template;+ try (InputStream is = getClass().getResourceAsStream("migrate173_default_notification.tpl")) {+ Preconditions.checkNotNull(is);+ template = IOUtils.toString(is, UTF_8);+ } catch (IOException e) {+ throw new RuntimeException(e);+ }++ for (File file : dataDir.listFiles()) {+ if (file.getName().startsWith("JobCaches.xml")) {+ File renamedFile = new File(dataDir, file.getName().replace("JobCaches.xml", "RunCaches.xml"));+ try {+ FileUtils.moveFile(file, renamedFile);+ } catch (IOException e) {+ throw new RuntimeException(e);+ }+ }+ }+ for (File file : dataDir.listFiles()) {+ if (file.isFile()) {+ try {+ String content = FileUtils.readFileToString(file, UTF_8.name());+ if (content.contains("io.onedev.server.model.JobCache")) {+ content = StringUtils.replace(content,+ "io.onedev.server.model.JobCache",+ "io.onedev.server.model.RunCache");+ FileUtils.writeFile(file, content, UTF_8);+ }+ } catch (IOException e) {+ throw new RuntimeException(e);+ }+ }+ }++ for (File file : dataDir.listFiles()) {+ if (file.getName().startsWith("Projects.xml")) {+ VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);+ for (Element projectElement : dom.getRootElement().elements()) {+ projectElement.addElement("workspaceSetting");+ projectElement.addElement("workspaceSpecs");+ }+ dom.writeToFile(file, false);+ } else if (file.getName().startsWith("Users.xml")) {+ VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);+ for (Element userElement : dom.getRootElement().elements()) {+ userElement.addElement("workspaceQueries");+ userElement.addElement("workspaceQuerySubscriptions");+ }+ dom.writeToFile(file, false);+ } else if (file.getName().startsWith("Roles.xml")) {+ VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);+ for (Element roleElement : dom.getRootElement().elements()) {+ roleElement.addElement("manageWorkspaces").setText("false");+ }+ dom.writeToFile(file, false);+ } else if (file.getName().startsWith("Settings.xml")) {+ VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);+ for (Element element : dom.getRootElement().elements()) {+ Element keyElement = element.element("key");+ if (keyElement != null && keyElement.getTextTrim().equals("EMAIL_TEMPLATES")) {+ Element valueElement = element.element("value");+ if (valueElement != null) {+ valueElement.addElement("workspaceNotification").setText(template);+ }+ }+ }+ dom.writeToFile(file, false);+ } else if (file.getName().startsWith("Builds.xml")) {+ VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);+ for (Element buildElement : dom.getRootElement().elements()) {+ Element workspacePathElement = buildElement.element("workspacePath");+ if (workspacePathElement != null)+ workspacePathElement.setName("workDirPath");+ Element tokenElement = buildElement.element("jobToken");+ if (tokenElement != null)+ tokenElement.setName("token");+ }+ dom.writeToFile(file, false);+ }+ }+ }+}diff --git a/server-core/src/main/java/io/onedev/server/entityreference/EntityReference.java b/server-core/src/main/java/io/onedev/server/entityreference/EntityReference.javaindex 146387e3f1..89261a40b5 100644--- a/server-core/src/main/java/io/onedev/server/entityreference/EntityReference.java+++ b/server-core/src/main/java/io/onedev/server/entityreference/EntityReference.java@@ -46,6 +46,8 @@ public abstract class EntityReference implements Serializable {return new IssueReference(project, number);else if (type.equalsIgnoreCase(BuildReference.TYPE))return new BuildReference(project, number);+ else if (type.equalsIgnoreCase(WorkspaceReference.TYPE))+ return new WorkspaceReference(project, number);elsereturn new PullRequestReference(project, number);}diff --git a/server-core/src/main/java/io/onedev/server/entityreference/LinkTransformer.java b/server-core/src/main/java/io/onedev/server/entityreference/LinkTransformer.javaindex 46be80492f..84fd19b5fb 100644--- a/server-core/src/main/java/io/onedev/server/entityreference/LinkTransformer.java+++ b/server-core/src/main/java/io/onedev/server/entityreference/LinkTransformer.java@@ -8,6 +8,7 @@ import org.apache.wicket.request.cycle.RequestCycle;import org.unbescape.html.HtmlEscape;import io.onedev.server.web.page.project.builds.detail.dashboard.BuildDashboardPage;+import io.onedev.server.web.page.project.workspaces.detail.dashboard.WorkspaceDashboardPage;import io.onedev.server.web.page.project.issues.detail.IssueActivitiesPage;import io.onedev.server.web.page.project.pullrequests.detail.activities.PullRequestActivitiesPage;@@ -31,6 +32,9 @@ public class LinkTransformer implements BiFunction<EntityReference, String, Stri} else if (reference instanceof PullRequestReference) {return "<a class='embedded-reference link-info' href='" + RequestCycle.get().urlFor(PullRequestActivitiesPage.class,PullRequestActivitiesPage.paramsOf(reference.getProject(), reference.getNumber())) + "'>" + text + "</a>";+ } else if (reference instanceof WorkspaceReference) {+ return "<a class='embedded-reference link-info' href='" + RequestCycle.get().urlFor(WorkspaceDashboardPage.class,+ WorkspaceDashboardPage.paramsOf(reference.getProject(), reference.getNumber())) + "'>" + text + "</a>";} else if (noneReferenceUrl != null) {return String.format("<a href='%s'>%s</a>", noneReferenceUrl, text);} else {diff --git a/server-core/src/main/java/io/onedev/server/entityreference/ReferenceUtils.java b/server-core/src/main/java/io/onedev/server/entityreference/ReferenceUtils.javaindex 5ad970441d..25c12499c0 100644--- a/server-core/src/main/java/io/onedev/server/entityreference/ReferenceUtils.java+++ b/server-core/src/main/java/io/onedev/server/entityreference/ReferenceUtils.java@@ -33,7 +33,7 @@ public class ReferenceUtils {private static final Collection<String> IGNORED_TAGS = ImmutableSet.of("code", "a");- private static final Pattern PATTERN = compile(format("(?<prefix>^|\\W+)(?<type>(issue|build|pr|(pull\\s+request))\\s+)?(?<reference>(((?<projectPath>%s)?#)|((?<projectKey>%s)-))(?<number>\\d+))(?=$|[\\W]+)", ProjectPathValidator.PATTERN.pattern(), ProjectKeyValidator.PATTERN.pattern()), CASE_INSENSITIVE);+ private static final Pattern PATTERN = compile(format("(?<prefix>^|\\W+)(?<type>(issue|build|workspace|pr|(pull\\s+request))\\s+)?(?<reference>(((?<projectPath>%s)?#)|((?<projectKey>%s)-))(?<number>\\d+))(?=$|[\\W]+)", ProjectPathValidator.PATTERN.pattern(), ProjectKeyValidator.PATTERN.pattern()), CASE_INSENSITIVE);public static List<EntityReference> extractReferences(String text, @Nullable Project currentProject) {Set<EntityReference> references = new LinkedHashSet<>();diff --git a/server-core/src/main/java/io/onedev/server/entityreference/WorkspaceReference.java b/server-core/src/main/java/io/onedev/server/entityreference/WorkspaceReference.javanew file mode 100644index 0000000000..a28aa42d4e--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/entityreference/WorkspaceReference.java@@ -0,0 +1,30 @@+package io.onedev.server.entityreference;++import org.jspecify.annotations.Nullable;++import io.onedev.server.model.Project;++public class WorkspaceReference extends EntityReference {++ private static final long serialVersionUID = 1L;++ public static final String TYPE = "workspace";++ public WorkspaceReference(Project project, Long number) {+ super(project, number);+ }++ public WorkspaceReference(Long projectId, Long number) {+ super(projectId, number);+ }++ public static WorkspaceReference of(String referenceString, @Nullable Project currentProject) {+ return (WorkspaceReference) of(TYPE, referenceString, currentProject);+ }++ @Override+ public String getType() {+ return TYPE;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/event/DefaultListenerRegistry.java b/server-core/src/main/java/io/onedev/server/event/DefaultListenerRegistry.javaindex 624ef61621..4956dbe0ea 100644--- a/server-core/src/main/java/io/onedev/server/event/DefaultListenerRegistry.java+++ b/server-core/src/main/java/io/onedev/server/event/DefaultListenerRegistry.java@@ -122,8 +122,8 @@ public class DefaultListenerRegistry implements ListenerRegistry, Serializable {} else {sessionService.run(() -> invokeListeners(event));}- } catch (Exception e) {- logger.error("Error invoking listeners", e);+ } catch (Throwable t) {+ logger.error("Error invoking listeners", t);}return null;}));@@ -135,8 +135,8 @@ public class DefaultListenerRegistry implements ListenerRegistry, Serializable {transactionService.runAfterCommit(() -> clusterService.submitToServer(activeServer, () -> {try {sessionService.run(() -> invokeListeners(event));- } catch (Exception e) {- logger.error("Error invoking listeners", e);+ } catch (Throwable t) {+ logger.error("Error invoking listeners", t);}return null;}));@@ -146,8 +146,8 @@ public class DefaultListenerRegistry implements ListenerRegistry, Serializable {transactionService.runAfterCommit(() -> clusterService.submitToServer(activeServerChanged.getActiveServer(), () -> {try {sessionService.run(() -> invokeListeners(event));- } catch (Exception e) {- logger.error("Error invoking listeners", e);+ } catch (Throwable t) {+ logger.error("Error invoking listeners", t);}return null;}));diff --git a/server-core/src/main/java/io/onedev/server/event/cluster/ConnectionLost.java b/server-core/src/main/java/io/onedev/server/event/cluster/ConnectionLost.javadeleted file mode 100644index 7ee61513bd..0000000000--- a/server-core/src/main/java/io/onedev/server/event/cluster/ConnectionLost.java+++ /dev/null@@ -1,9 +0,0 @@-package io.onedev.server.event.cluster;--public class ConnectionLost extends ConnectionEvent {-- public ConnectionLost(String server) {- super(server);- }--}diff --git a/server-core/src/main/java/io/onedev/server/event/cluster/ConnectionRestored.java b/server-core/src/main/java/io/onedev/server/event/cluster/ConnectionRestored.javadeleted file mode 100644index a29a6adab2..0000000000--- a/server-core/src/main/java/io/onedev/server/event/cluster/ConnectionRestored.java+++ /dev/null@@ -1,9 +0,0 @@-package io.onedev.server.event.cluster;--public class ConnectionRestored extends ConnectionEvent {-- public ConnectionRestored(String server) {- super(server);- }--}diff --git a/server-core/src/main/java/io/onedev/server/event/cluster/NodeConnected.java b/server-core/src/main/java/io/onedev/server/event/cluster/NodeConnected.javanew file mode 100644index 0000000000..affe43f9f6--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/event/cluster/NodeConnected.java@@ -0,0 +1,16 @@+package io.onedev.server.event.cluster;++public class NodeConnected extends NodeEvent {++ private final boolean recovered;++ public NodeConnected(String server, boolean recovered) {+ super(server);+ this.recovered = recovered;+ }++ public boolean isRecovered() {+ return recovered;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/event/cluster/NodeDisconnected.java b/server-core/src/main/java/io/onedev/server/event/cluster/NodeDisconnected.javanew file mode 100644index 0000000000..caa67baa65--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/event/cluster/NodeDisconnected.java@@ -0,0 +1,16 @@+package io.onedev.server.event.cluster;++public class NodeDisconnected extends NodeEvent {++ private final boolean abnormal;++ public NodeDisconnected(String server, boolean abnormal) {+ super(server);+ this.abnormal = abnormal;+ }++ public boolean isAbnormal() {+ return abnormal;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/event/cluster/ConnectionEvent.java b/server-core/src/main/java/io/onedev/server/event/cluster/NodeEvent.javasimilarity index 67%rename from server-core/src/main/java/io/onedev/server/event/cluster/ConnectionEvent.javarename to server-core/src/main/java/io/onedev/server/event/cluster/NodeEvent.javaindex 3b40946e4e..c23639df3a 100644--- a/server-core/src/main/java/io/onedev/server/event/cluster/ConnectionEvent.java+++ b/server-core/src/main/java/io/onedev/server/event/cluster/NodeEvent.java@@ -2,11 +2,11 @@ package io.onedev.server.event.cluster;import io.onedev.server.event.Event;-public abstract class ConnectionEvent extends Event {+public abstract class NodeEvent extends Event {private final String server;- public ConnectionEvent(String server) {+ public NodeEvent(String server) {this.server = server;}diff --git a/server-core/src/main/java/io/onedev/server/event/project/workspace/WorkspaceActive.java b/server-core/src/main/java/io/onedev/server/event/project/workspace/WorkspaceActive.javanew file mode 100644index 0000000000..1ac815fbcc--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/event/project/workspace/WorkspaceActive.java@@ -0,0 +1,18 @@+package io.onedev.server.event.project.workspace;++import io.onedev.server.model.Workspace;++public class WorkspaceActive extends WorkspaceEvent {++ private static final long serialVersionUID = 1L;++ public WorkspaceActive(Workspace workspace) {+ super(workspace.getUser(), workspace.getActiveDate(), workspace);+ }++ @Override+ public String getActivity() {+ return "active";+ }++}diff --git a/server-core/src/main/java/io/onedev/server/event/project/workspace/WorkspaceCreated.java b/server-core/src/main/java/io/onedev/server/event/project/workspace/WorkspaceCreated.javanew file mode 100644index 0000000000..258d2795b6--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/event/project/workspace/WorkspaceCreated.java@@ -0,0 +1,18 @@+package io.onedev.server.event.project.workspace;++import io.onedev.server.model.Workspace;++public class WorkspaceCreated extends WorkspaceEvent {++ private static final long serialVersionUID = 1L;++ public WorkspaceCreated(Workspace workspace) {+ super(workspace.getUser(), workspace.getCreateDate(), workspace);+ }++ @Override+ public String getActivity() {+ return "created";+ }++}diff --git a/server-core/src/main/java/io/onedev/server/event/project/workspace/WorkspaceError.java b/server-core/src/main/java/io/onedev/server/event/project/workspace/WorkspaceError.javanew file mode 100644index 0000000000..f4d3687714--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/event/project/workspace/WorkspaceError.java@@ -0,0 +1,18 @@+package io.onedev.server.event.project.workspace;++import io.onedev.server.model.Workspace;++public class WorkspaceError extends WorkspaceEvent {++ private static final long serialVersionUID = 1L;++ public WorkspaceError(Workspace workspace) {+ super(workspace.getUser(), workspace.getErrorDate(), workspace);+ }++ @Override+ public String getActivity() {+ return "error";+ }++}diff --git a/server-core/src/main/java/io/onedev/server/event/project/workspace/WorkspaceEvent.java b/server-core/src/main/java/io/onedev/server/event/project/workspace/WorkspaceEvent.javanew file mode 100644index 0000000000..7c60849c56--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/event/project/workspace/WorkspaceEvent.java@@ -0,0 +1,32 @@+package io.onedev.server.event.project.workspace;++import java.util.Date;++import io.onedev.server.OneDev;+import io.onedev.server.event.project.ProjectEvent;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.User;+import io.onedev.server.service.UrlService;+import io.onedev.server.workspace.WorkspaceService;++public abstract class WorkspaceEvent extends ProjectEvent {++ private static final long serialVersionUID = 1L;++ private final Long workspaceId;++ public WorkspaceEvent(User user, Date date, Workspace workspace) {+ super(user, date, workspace.getProject());+ workspaceId = workspace.getId();+ }++ public Workspace getWorkspace() {+ return OneDev.getInstance(WorkspaceService.class).load(workspaceId);+ }++ @Override+ public String getUrl() {+ return OneDev.getInstance(UrlService.class).urlFor(getWorkspace(), true);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/git/CommandUtils.java b/server-core/src/main/java/io/onedev/server/git/CommandUtils.javaindex 3af3aedcc0..4a46dc7e6c 100644--- a/server-core/src/main/java/io/onedev/server/git/CommandUtils.java+++ b/server-core/src/main/java/io/onedev/server/git/CommandUtils.java@@ -1,5 +1,19 @@package io.onedev.server.git;+import static java.nio.charset.StandardCharsets.UTF_8;++import java.io.File;+import java.io.IOException;+import java.io.InputStream;+import java.io.OutputStream;+import java.util.Map;+import java.util.StringTokenizer;+import java.util.concurrent.atomic.AtomicBoolean;++import org.eclipse.jgit.util.QuotedString;+import org.slf4j.Logger;+import org.slf4j.LoggerFactory;+import io.onedev.agent.Agent;import io.onedev.commons.bootstrap.SecretMasker;import io.onedev.commons.utils.FileUtils;@@ -14,20 +28,6 @@ import io.onedev.server.git.command.FileChange;import io.onedev.server.git.command.ReceivePackCommand;import io.onedev.server.git.command.UploadPackCommand;import io.onedev.server.git.location.GitLocation;-import org.apache.commons.lang3.SystemUtils;-import org.eclipse.jgit.util.QuotedString;-import org.slf4j.Logger;-import org.slf4j.LoggerFactory;--import java.io.File;-import java.io.IOException;-import java.io.InputStream;-import java.io.OutputStream;-import java.util.Map;-import java.util.StringTokenizer;-import java.util.concurrent.atomic.AtomicBoolean;--import static java.nio.charset.StandardCharsets.UTF_8;public class CommandUtils {@@ -37,10 +37,7 @@ public class CommandUtils {public static Commandline newGit() {Commandline cmdline = new Commandline(OneDev.getInstance(GitLocation.class).getExecutable());- if (SystemUtils.IS_OS_MAC_OSX) {- String path = System.getenv("PATH") + ":/usr/local/bin";- cmdline.environments().put("PATH", path);- }+ KubernetesHelper.addMacUsrLocalBinToPath(cmdline);return cmdline;}diff --git a/server-core/src/main/java/io/onedev/server/git/GitFilter.java b/server-core/src/main/java/io/onedev/server/git/GitFilter.javaindex 5e6610e1cc..b754dca999 100644--- a/server-core/src/main/java/io/onedev/server/git/GitFilter.java+++ b/server-core/src/main/java/io/onedev/server/git/GitFilter.java@@ -2,6 +2,7 @@ package io.onedev.server.git;import static io.onedev.server.model.Project.decodeFullRepoNameAsPath;import static io.onedev.server.util.IOUtils.BUFFER_SIZE;+import static io.onedev.server.workspace.WorkspaceService.GIT_PREFIX;import static org.apache.commons.lang3.StringUtils.strip;import java.io.File;@@ -9,6 +10,7 @@ import java.io.FilterInputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;+import java.util.Collections;import java.util.Set;import java.util.concurrent.ExecutionException;@@ -39,20 +41,23 @@ import org.eclipse.jgit.http.server.GitSmartHttpTools;import org.eclipse.jgit.http.server.ServletUtils;import org.eclipse.jgit.transport.PacketLineOut;import org.glassfish.jersey.client.ClientProperties;+import org.jspecify.annotations.Nullable;import io.onedev.commons.utils.ExplicitException;import io.onedev.k8shelper.KubernetesHelper;import io.onedev.server.OneDev;import io.onedev.server.cluster.ClusterService;-import io.onedev.server.service.ProjectService;import io.onedev.server.exception.ServerNotReadyException;import io.onedev.server.git.command.AdvertiseReceiveRefsCommand;import io.onedev.server.git.command.AdvertiseUploadRefsCommand;import io.onedev.server.git.hook.HookUtils;import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;import io.onedev.server.persistence.SessionService;import io.onedev.server.security.CodePullAuthorizationSource;+import io.onedev.server.security.CodePushAuthorizationSource;import io.onedev.server.security.SecurityUtils;+import io.onedev.server.service.ProjectService;import io.onedev.server.util.IOUtils;import io.onedev.server.util.OutputStreamWrapper;import io.onedev.server.util.concurrent.WorkExecutionService;@@ -76,16 +81,20 @@ public class GitFilter implements Filter {private final Set<CodePullAuthorizationSource> codePullAuthorizationSources;+ private final Set<CodePushAuthorizationSource> codePushAuthorizationSources;+@Injectpublic GitFilter(OneDev oneDev, ProjectService projectService, WorkExecutionService workExecutionService,SessionService sessionService, ClusterService clusterService,- Set<CodePullAuthorizationSource> codePullAuthorizationSources) {+ Set<CodePullAuthorizationSource> codePullAuthorizationSources,+ Set<CodePushAuthorizationSource> codePushAuthorizationSources) {this.onedev = oneDev;this.projectService = projectService;this.workExecutionService = workExecutionService;this.sessionService = sessionService;this.clusterService = clusterService;this.codePullAuthorizationSources = codePullAuthorizationSources;+ this.codePushAuthorizationSources = codePushAuthorizationSources;}private String getPathInfo(HttpServletRequest request) {@@ -118,26 +127,69 @@ public class GitFilter implements Filter {response.setHeader("Pragma", "no-cache");response.setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate");}-++ @Nullable+ private File getWorkspaceGitDir(String projectInfo) {+ projectInfo = strip(projectInfo, "/");+ int idx = projectInfo.indexOf(GIT_PREFIX);+ if (idx < 0)+ return null;+ String projectPath = strip(projectInfo.substring(0, idx), "/");+ String numberStr = projectInfo.substring(idx + GIT_PREFIX.length());+ numberStr = strip(numberStr, "/");+ var facade = projectService.findFacadeByPath(projectPath);+ if (facade == null)+ throw new EntityNotFoundException("Project not found: " + projectPath);+ long workspaceNumber = Long.parseLong(numberStr);+ File gitDir = new File(Workspace.getWorkDir(facade.getId(), workspaceNumber), ".git");+ if (!gitDir.exists())+ throw new ExplicitException("Workspace git directory not found");+ return gitDir;+ }+protected void processPack(final HttpServletRequest request, final HttpServletResponse response)throws IOException, InterruptedException, ExecutionException {- String principal = (String) SecurityUtils.getSubject().getPrincipal();- boolean clusterAccess = SecurityUtils.isSystem(principal);-boolean upload = GitSmartHttpTools.isUploadPack(request);- String pathInfo = getPathInfo(request);-+ String pathInfo = getPathInfo(request);String service = StringUtils.substringAfterLast(pathInfo, "/");-String projectInfo = StringUtils.substringBeforeLast(pathInfo, "/");++ String principal = (String) SecurityUtils.getSubject().getPrincipal();+ boolean clusterAccess = SecurityUtils.isSystem(principal);++ File workspaceGitDir = getWorkspaceGitDir(projectInfo);+ if (workspaceGitDir != null) {+ if (!clusterAccess)+ throw new UnauthorizedException("Cluster credential required to access workspace git");+ if (!upload)+ throw new ExplicitException("Push to workspace git is not supported");++ doNotCache(response);+ response.setHeader("Content-Type", "application/x-" + service + "-result");++ InputStream stdin = new FilterInputStream(ServletUtils.getInputStream(request)) {+ @Override+ public void close() {+ }+ };+ OutputStream stdout = new OutputStreamWrapper(response.getOutputStream()) {+ @Override+ public void close() {+ }+ };++ String protocol = request.getHeader("Git-Protocol");+ CommandUtils.uploadPack(workspaceGitDir, Collections.emptyMap(), protocol, stdin, stdout);+ return;+ }var projectPath = decodeFullRepoNameAsPath(strip(projectInfo, "/"));Long projectId = getProjectId(projectPath, clusterAccess, upload);doNotCache(response);response.setHeader("Content-Type", "application/x-" + service + "-result");- var hookEnvs = HookUtils.getHookEnvs(projectId, principal);+ var hookEnvs = HookUtils.getReceiveHookEnvs(projectId, principal);InputStream stdin = new FilterInputStream(ServletUtils.getInputStream(request)) {@@ -162,12 +214,10 @@ public class GitFilter implements Filter {Project project = projectService.load(projectId);if (!canAccessProject(request, project))reportProjectNotFoundOrInaccessible(projectPath);- if (upload) {+ if (upload)checkPullPermission(request, project);- } else {- if (!SecurityUtils.canWriteCode(project))- throw new UnauthorizedException("You do not have permission to push to this project.");- }+ else+ checkPushPermission(request, project);} finally {sessionService.closeSession();}@@ -226,11 +276,11 @@ public class GitFilter implements Filter {KubernetesHelper.checkStatus(gitResponse);try (InputStream is = gitResponse.readEntity(InputStream.class)) {byte[] buffer = new byte[BUFFER_SIZE];- int length;- while ((length = is.read(buffer)) > 0) {- stdout.write(buffer, 0, length);- stdout.flush();- }+ int length;+ while ((length = is.read(buffer)) > 0) {+ stdout.write(buffer, 0, length);+ stdout.flush();+ }} finally {stdout.close();}@@ -250,7 +300,7 @@ public class GitFilter implements Filter {// Run immediately. See above for reasonCommandUtils.receivePack(gitDir, hookEnvs, protocol, stdin, stdout);}- }+ }}private void writeInitial(HttpServletResponse response, String service) throws IOException {@@ -277,6 +327,20 @@ public class GitFilter implements Filter {}}+ private void checkPushPermission(HttpServletRequest request, Project project) {+ if (!SecurityUtils.canWriteCode(project)) {+ boolean isAuthorized = false;+ for (CodePushAuthorizationSource source: codePushAuthorizationSources) {+ if (source.canPushCode(request, project)) {+ isAuthorized = true;+ break;+ }+ }+ if (!isAuthorized)+ throw new UnauthorizedException("You do not have permission to push to this project.");+ }+ }+private boolean canAccessProject(HttpServletRequest request, Project project) {if (!SecurityUtils.canAccessProject(project)) {for (CodePullAuthorizationSource source: codePullAuthorizationSources) {@@ -290,8 +354,6 @@ public class GitFilter implements Filter {}protected void processRefs(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {- boolean clusterAccess = SecurityUtils.isSystem();-String service = request.getParameter("service");boolean upload = service.contains("upload");@@ -299,6 +361,27 @@ public class GitFilter implements Filter {pathInfo = StringUtils.stripStart(pathInfo, "/");String projectInfo = pathInfo.substring(0, pathInfo.length() - INFO_REFS.length());++ boolean clusterAccess = SecurityUtils.isSystem();+ File workspaceGitDir = getWorkspaceGitDir(projectInfo);+ if (workspaceGitDir != null) {+ if (!clusterAccess)+ throw new UnauthorizedException("Cluster credential required to access workspace git");+ if (!upload)+ throw new ExplicitException("Push to workspace git is not supported");++ writeInitial(response, service);++ OutputStream output = new OutputStreamWrapper(response.getOutputStream()) {+ @Override+ public void close() throws IOException {+ }+ };++ String protocol = request.getHeader("Git-Protocol");+ new AdvertiseUploadRefsCommand(workspaceGitDir, output).protocol(protocol).run();+ return;+ }var projectPath = decodeFullRepoNameAsPath(strip(projectInfo, "/"));Long projectId = getProjectId(projectPath, clusterAccess, upload);@@ -312,8 +395,7 @@ public class GitFilter implements Filter {checkPullPermission(request, project);writeInitial(response, service);} else {- if (!SecurityUtils.canWriteCode(project))- throw new UnauthorizedException("You do not have permission to push to this project.");+ checkPushPermission(request, project);writeInitial(response, service);}} finally {@@ -363,7 +445,7 @@ public class GitFilter implements Filter {} finally {client.close();}- }+ }}@Overridediff --git a/server-core/src/main/java/io/onedev/server/git/GitLfsFilter.java b/server-core/src/main/java/io/onedev/server/git/GitLfsFilter.javaindex 352892390b..8eaf3759be 100644--- a/server-core/src/main/java/io/onedev/server/git/GitLfsFilter.java+++ b/server-core/src/main/java/io/onedev/server/git/GitLfsFilter.java@@ -5,6 +5,7 @@ import static io.onedev.k8shelper.KubernetesHelper.BEARER;import static io.onedev.server.model.Project.decodeFullRepoNameAsPath;import static io.onedev.server.util.CollectionUtils.newHashMap;import static io.onedev.server.util.IOUtils.BUFFER_SIZE;+import static io.onedev.server.workspace.WorkspaceService.GIT_PREFIX;import static javax.servlet.http.HttpServletResponse.SC_CONFLICT;import static javax.servlet.http.HttpServletResponse.SC_CREATED;import static javax.servlet.http.HttpServletResponse.SC_FORBIDDEN;@@ -15,10 +16,13 @@ import static javax.servlet.http.HttpServletResponse.SC_NOT_IMPLEMENTED;import static javax.servlet.http.HttpServletResponse.SC_UNAUTHORIZED;import static javax.ws.rs.core.HttpHeaders.AUTHORIZATION;import static javax.ws.rs.core.MediaType.APPLICATION_OCTET_STREAM;+import static org.apache.commons.lang3.StringUtils.strip;import static org.apache.commons.lang3.StringUtils.substringBeforeLast;import static org.apache.tika.mime.MimeTypes.OCTET_STREAM;import static org.glassfish.jersey.client.ClientProperties.REQUEST_ENTITY_PROCESSING;+import java.io.File;+import java.io.FileInputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;@@ -31,7 +35,6 @@ import java.util.Set;import java.util.concurrent.atomic.AtomicReference;import java.util.function.BooleanSupplier;-import org.jspecify.annotations.Nullable;import javax.inject.Inject;import javax.inject.Singleton;import javax.servlet.Filter;@@ -53,6 +56,7 @@ import javax.ws.rs.core.StreamingOutput;import org.apache.commons.codec.binary.Hex;import org.apache.commons.lang3.StringUtils;import org.hibernate.criterion.Restrictions;+import org.jspecify.annotations.Nullable;import org.slf4j.Logger;import org.slf4j.LoggerFactory;@@ -63,15 +67,17 @@ import com.google.common.hash.HashingInputStream;import io.onedev.commons.utils.ExplicitException;import io.onedev.k8shelper.KubernetesHelper;import io.onedev.server.cluster.ClusterService;-import io.onedev.server.service.GitLfsLockService;-import io.onedev.server.service.ProjectService;-import io.onedev.server.service.SettingService;import io.onedev.server.model.GitLfsLock;import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;import io.onedev.server.persistence.SessionService;import io.onedev.server.persistence.dao.EntityCriteria;import io.onedev.server.security.CodePullAuthorizationSource;+import io.onedev.server.security.CodePushAuthorizationSource;import io.onedev.server.security.SecurityUtils;+import io.onedev.server.service.GitLfsLockService;+import io.onedev.server.service.ProjectService;+import io.onedev.server.service.SettingService;import io.onedev.server.util.IOUtils;import io.onedev.server.util.facade.ProjectFacade;@@ -99,11 +105,14 @@ public class GitLfsFilter implements Filter {private final ClusterService clusterService;private final Set<CodePullAuthorizationSource> codePullAuthorizationSources;++ private final Set<CodePushAuthorizationSource> codePushAuthorizationSources;@Injectpublic GitLfsFilter(ProjectService projectService, ObjectMapper objectMapper, SessionService sessionService,SettingService settingService, GitLfsLockService lockService, ClusterService clusterService,- Set<CodePullAuthorizationSource> codePullAuthorizationSources) {+ Set<CodePullAuthorizationSource> codePullAuthorizationSources,+ Set<CodePushAuthorizationSource> codePushAuthorizationSources) {this.projectService = projectService;this.objectMapper = objectMapper;this.sessionService = sessionService;@@ -111,6 +120,7 @@ public class GitLfsFilter implements Filter {this.lockService = lockService;this.clusterService = clusterService;this.codePullAuthorizationSources = codePullAuthorizationSources;+ this.codePushAuthorizationSources = codePushAuthorizationSources;}@Override@@ -133,6 +143,18 @@ public class GitLfsFilter implements Filter {}}+ private boolean canWriteCode(HttpServletRequest request, Project project) {+ if (!SecurityUtils.canWriteCode(project)) {+ for (CodePushAuthorizationSource source: codePushAuthorizationSources) {+ if (source.canPushCode(request, project))+ return true;+ }+ return false;+ } else {+ return true;+ }+ }+private boolean canAccessProject(HttpServletRequest request, Project project) {if (!SecurityUtils.canAccessProject(project)) {for (CodePullAuthorizationSource source: codePullAuthorizationSources) {@@ -145,8 +167,49 @@ public class GitLfsFilter implements Filter {}}- private String getObjectUrl(HttpServletRequest request, String projectPath, String objectId) {- var serverUrl = settingService.getSystemSetting().getServerUrl();+ private boolean isWorkspacePath(String pathInfo) {+ return pathInfo.contains(GIT_PREFIX);+ }++ @Nullable+ private long[] parseWorkspaceInfo(String pathInfo) {+ int idx = pathInfo.indexOf(GIT_PREFIX);+ if (idx < 0)+ return null;+ String projectPath = strip(pathInfo.substring(0, idx), "/");+ String afterWorkspaces = pathInfo.substring(idx + GIT_PREFIX.length());+ String numberStr;+ int dotGitIdx = afterWorkspaces.indexOf(".git/");+ if (dotGitIdx >= 0) {+ numberStr = afterWorkspaces.substring(0, dotGitIdx);+ } else {+ int slashIdx = afterWorkspaces.indexOf('/');+ numberStr = slashIdx >= 0 ? afterWorkspaces.substring(0, slashIdx) : afterWorkspaces;+ }+ var facade = projectService.findFacadeByPath(projectPath);+ if (facade == null)+ throw new ExplicitException("Project not found: " + projectPath);+ long workspaceNumber = Long.parseLong(numberStr);+ return new long[]{facade.getId(), workspaceNumber};+ }++ private File getWorkspaceLfsFile(long projectId, long workspaceNumber, String objectId) {+ File workDir = Workspace.getWorkDir(projectId, workspaceNumber);+ return new File(workDir, ".git/lfs/objects/"+ + objectId.substring(0, 2) + "/"+ + objectId.substring(2, 4) + "/" + objectId);+ }++ private String getWorkspaceObjectUrl(long projectId, long workspaceNumber, String objectId) {+ var serverUrl = clusterService.getServerUrl(clusterService.getLocalServerAddress());+ var projectPath = projectService.findFacadeById(projectId).getPath();+ return String.format("%s/%s/%s%d.git/lfs/objects/%s?lfs-objects=true",+ serverUrl, projectPath, GIT_PREFIX, workspaceNumber, objectId);+ }++ private String getObjectUrl(HttpServletRequest request, String projectPath,+ String objectId, boolean clusterAccess) {+ var serverUrl = clusterAccess ? clusterService.getServerUrl(clusterService.getLocalServerAddress()) : settingService.getSystemSetting().getServerUrl();return String.format("%s/%s.git/lfs/objects/%s?lfs-objects=true",StringUtils.stripEnd(serverUrl, "/\\"), projectPath, objectId);}@@ -178,6 +241,32 @@ public class GitLfsFilter implements Filter {boolean clusterAccess = SecurityUtils.isSystem();if ("true".equals(httpRequest.getParameter("lfs-objects"))) {+ if (isWorkspacePath(pathInfo)) {+ if (!clusterAccess) {+ sendBatchError(httpResponse, SC_UNAUTHORIZED,+ "Cluster credential required to access workspace LFS");+ return;+ }+ if (!httpRequest.getMethod().equals("GET")) {+ sendBatchError(httpResponse, SC_FORBIDDEN,+ "Upload to workspace LFS is not supported");+ return;+ }+ long[] workspaceInfo = parseWorkspaceInfo(pathInfo);+ String objectId = StringUtils.substringAfterLast(pathInfo, "/");+ File lfsFile = getWorkspaceLfsFile(workspaceInfo[0], workspaceInfo[1], objectId);+ if (lfsFile.exists()) {+ httpResponse.setContentType(OCTET_STREAM);+ try (InputStream is = new FileInputStream(lfsFile);+ OutputStream os = httpResponse.getOutputStream()) {+ IOUtils.copy(is, os, BUFFER_SIZE);+ }+ } else {+ httpResponse.setStatus(SC_NOT_FOUND);+ }+ return;+ }+String projectPath = getProjectPath(pathInfo);String objectId = StringUtils.substringAfterLast(pathInfo, "/");@@ -242,7 +331,7 @@ public class GitLfsFilter implements Filter {Project project = projectService.findByPath(getProjectPath(pathInfo));if (project == null || !canAccessProject(httpRequest, project))reportProjectNotFoundOrInaccessible(httpResponse, projectPath);- else if (SecurityUtils.canWriteCode(project))+ else if (canWriteCode(httpRequest, project))lfsObject = new LfsObject(project.getId(), objectId);elsesendAuthorizationError(httpResponse);@@ -300,31 +389,38 @@ public class GitLfsFilter implements Filter {}}}- }+ }} else if (httpRequest.getContentType() != null&& httpRequest.getContentType().startsWith(CONTENT_TYPE)|| httpRequest.getHeader("Accept") != null&& httpRequest.getHeader("Accept").startsWith(CONTENT_TYPE)) {- String projectPath = getProjectPath(pathInfo);-+ if (isWorkspacePath(pathInfo)) {+ if (!clusterAccess) {+ sendBatchError(httpResponse, SC_UNAUTHORIZED,+ "Cluster credential required to access workspace LFS");+ return;+ }+ httpResponse.setContentType(CONTENT_TYPE);+ if (pathInfo.endsWith("/batch")) {+ long[] workspaceInfo = parseWorkspaceInfo(pathInfo);+ processWorkspaceBatch(httpRequest, httpResponse, workspaceInfo[0], workspaceInfo[1]);+ } else {+ sendBatchError(httpResponse, SC_NOT_IMPLEMENTED,+ "Locks are not supported for workspace LFS");+ }+ return;+ }+ String projectPath = getProjectPath(pathInfo);if (clusterAccess) {ProjectFacade project = projectService.findFacadeByPath(projectPath);if (project == null) {sendBatchError(httpResponse, SC_NOT_FOUND, "Project not found: " + projectPath);} else {httpResponse.setContentType(CONTENT_TYPE);- if (pathInfo.endsWith("/batch")) {- processBatch(httpRequest, httpResponse, project, new BooleanSupplier() {-- @Override- public boolean getAsBoolean() {- return true;- }-- }, () -> true, clusterService.getCredential());- } else {+ if (pathInfo.endsWith("/batch"))+ processBatch(httpRequest, httpResponse, project, () -> true, () -> true, clusterService.getCredential());+ elsehttpResponse.setStatus(SC_NOT_IMPLEMENTED);- }}} else {sessionService.openSession();@@ -338,11 +434,11 @@ public class GitLfsFilter implements Filter {String accessToken = SecurityUtils.createTemporalAccessTokenIfUserPrincipal(300);processBatch(httpRequest, httpResponse, project.getFacade(),() -> canReadCode(httpRequest, project),- () -> SecurityUtils.canWriteCode(project),+ () -> canWriteCode(httpRequest, project),accessToken);} else if (pathInfo.endsWith("/locks")) {if (httpRequest.getMethod().equals("POST")) {- if (SecurityUtils.canWriteCode(project)) {+ if (canWriteCode(httpRequest, project)) {JsonNode lockRequestNode;try (InputStream is = httpRequest.getInputStream()) {lockRequestNode = objectMapper.readTree(is);@@ -404,7 +500,7 @@ public class GitLfsFilter implements Filter {}}} else if (pathInfo.endsWith("/locks/verify")) {- if (SecurityUtils.canWriteCode(project)) {+ if (canWriteCode(httpRequest, project)) {JsonNode lockVerifyNode;try (InputStream is = httpRequest.getInputStream()) {lockVerifyNode = objectMapper.readTree(is);@@ -457,7 +553,7 @@ public class GitLfsFilter implements Filter {sendAuthorizationError(httpResponse);}} else if (pathInfo.endsWith("/unlock")) {- if (SecurityUtils.canWriteCode(project)) {+ if (canWriteCode(httpRequest, project)) {Long id = Long.valueOf(StringUtils.substringAfterLast(substringBeforeLast(pathInfo, "/"), "/"));@@ -497,15 +593,15 @@ public class GitLfsFilter implements Filter {} finally {sessionService.closeSession();}- }+ }} else {chain.doFilter(request, response);}}- private void processBatch(HttpServletRequest httpRequest, HttpServletResponse httpResponse,- ProjectFacade project, BooleanSupplier readCheck,- BooleanSupplier writeCheck, @Nullable String accessToken) {+ @Nullable+ private JsonNode parseAndValidateBatchRequest(HttpServletRequest httpRequest,+ HttpServletResponse httpResponse) {JsonNode batchRequestNode;try (InputStream is = httpRequest.getInputStream()) {batchRequestNode = objectMapper.readTree(is);@@ -517,7 +613,7 @@ public class GitLfsFilter implements Filter {JsonNode transfersNode = batchRequestNode.get("transfers");if (transfersNode != null) {supportBasicTransfer = false;- for (JsonNode transferNode: transfersNode) {+ for (JsonNode transferNode : transfersNode) {if (transferNode.asText().equals("basic")) {supportBasicTransfer = true;break;@@ -527,49 +623,101 @@ public class GitLfsFilter implements Filter {supportBasicTransfer = true;}if (!supportBasicTransfer) {- sendBatchError(httpResponse, SC_NOT_ACCEPTABLE,+ sendBatchError(httpResponse, SC_NOT_ACCEPTABLE,"This server can only accept basic transfer");+ return null;+ }++ boolean supportSha256;+ JsonNode hashAlgoNode = batchRequestNode.get("hash_algo");+ if (hashAlgoNode != null)+ supportSha256 = hashAlgoNode.asText().equals("sha256");+ else+ supportSha256 = true;+ if (!supportSha256) {+ sendBatchError(httpResponse, SC_NOT_ACCEPTABLE,+ "This server can only accept sha256 hash algorithm");+ return null;+ }++ return batchRequestNode;+ }++ private void processBatch(HttpServletRequest httpRequest, HttpServletResponse httpResponse,+ ProjectFacade project, BooleanSupplier readCheck,+ BooleanSupplier writeCheck, @Nullable String accessToken) {+ JsonNode batchRequestNode = parseAndValidateBatchRequest(httpRequest, httpResponse);+ if (batchRequestNode == null)+ return;++ boolean upload = batchRequestNode.get("operation").asText().equals("upload");+ boolean authorized = false;+ if (upload) {+ if (!writeCheck.getAsBoolean())+ sendAuthorizationError(httpResponse);+ else+ authorized = true;} else {- boolean supportSha256;- JsonNode hashAlgoNode = batchRequestNode.get("hash_algo");- if (hashAlgoNode != null)- supportSha256 = hashAlgoNode.asText().equals("sha256");+ if (!readCheck.getAsBoolean())+ sendAuthorizationError(httpResponse);else- supportSha256 = true;- if (!supportSha256) {- sendBatchError(httpResponse, SC_NOT_ACCEPTABLE,- "This server can only accept sha256 hash algorithm");- } else {- boolean upload = batchRequestNode.get("operation").asText().equals("upload");- boolean authorized = false;- if (upload) {- if (!writeCheck.getAsBoolean())- sendAuthorizationError(httpResponse);- else- authorized = true;- } else {- if (!readCheck.getAsBoolean())- sendAuthorizationError(httpResponse);- else- authorized = true;- }- if (authorized) {- List<Map<String, Object>> objectsResponse = new ArrayList<>();- for (JsonNode objectNode: batchRequestNode.get("objects")) {- String objectId = objectNode.get("oid").asText();- long objectSize = objectNode.get("size").asLong();- objectsResponse.add(getObjectResponse(- httpRequest, project, upload, objectId, objectSize, accessToken));- }-- Map<String, Object> batchResponse = new HashMap<>();- batchResponse.put("objects", objectsResponse);- writeTo(httpResponse, batchResponse);- }+ authorized = true;+ }+ if (authorized) {+ List<Map<String, Object>> objectsResponse = new ArrayList<>();+ for (JsonNode objectNode: batchRequestNode.get("objects")) {+ String objectId = objectNode.get("oid").asText();+ long objectSize = objectNode.get("size").asLong();+ objectsResponse.add(getObjectResponse(+ httpRequest, project, upload, objectId, objectSize, accessToken));}- }++ Map<String, Object> batchResponse = new HashMap<>();+ batchResponse.put("objects", objectsResponse);+ writeTo(httpResponse, batchResponse);+ }}+ private void processWorkspaceBatch(HttpServletRequest httpRequest, HttpServletResponse httpResponse,+ long projectId, long workspaceNumber) {+ JsonNode batchRequestNode = parseAndValidateBatchRequest(httpRequest, httpResponse);+ if (batchRequestNode == null)+ return;++ boolean upload = batchRequestNode.get("operation").asText().equals("upload");+ if (upload) {+ sendBatchError(httpResponse, SC_FORBIDDEN,+ "Upload to workspace LFS is not supported");+ return;+ }++ List<Map<String, Object>> objectsResponse = new ArrayList<>();+ for (JsonNode objectNode : batchRequestNode.get("objects")) {+ String objectId = objectNode.get("oid").asText();+ long objectSize = objectNode.get("size").asLong();+ Map<String, Object> objectResponse = new HashMap<>();+ objectResponse.put("oid", objectId);+ objectResponse.put("size", objectSize);+ File lfsFile = getWorkspaceLfsFile(projectId, workspaceNumber, objectId);+ if (lfsFile.exists()) {+ Map<Object, Object> actionResponse = newHashMap(+ "href", getWorkspaceObjectUrl(projectId, workspaceNumber, objectId));+ actionResponse.put("header", newHashMap(+ "Authorization", BEARER + " " + clusterService.getCredential()));+ objectResponse.put("actions", newHashMap("download", actionResponse));+ } else {+ objectResponse.put("error", newHashMap(+ "code", SC_NOT_FOUND,+ "message", "Object not found"));+ }+ objectsResponse.add(objectResponse);+ }++ Map<String, Object> batchResponse = new HashMap<>();+ batchResponse.put("objects", objectsResponse);+ writeTo(httpResponse, batchResponse);+ }+private void sendAuthorizationError(HttpServletResponse response) {if (SecurityUtils.getUser() != null) {sendBatchError(response, SC_FORBIDDEN, "Permission denied");@@ -599,7 +747,7 @@ public class GitLfsFilter implements Filter {private Map<Object, Object> getActionResponse(HttpServletRequest request, ProjectFacade project,String objectId, @Nullable String accessToken) {Map<Object, Object> actionResponse = newHashMap(- "href", getObjectUrl(request, project.getPath(), objectId));+ "href", getObjectUrl(request, project.getPath(), objectId, clusterService.getCredential().equals(accessToken)));if (accessToken != null) {actionResponse.put("header", newHashMap(diff --git a/server-core/src/main/java/io/onedev/server/git/SshCommand.java b/server-core/src/main/java/io/onedev/server/git/SshCommand.javaindex deeab42e22..6ab0510ed7 100644--- a/server-core/src/main/java/io/onedev/server/git/SshCommand.java+++ b/server-core/src/main/java/io/onedev/server/git/SshCommand.java@@ -112,7 +112,7 @@ class SshCommand implements Command, ServerSessionAware {if (clusterAccess || activeServerAddress.equals(clusterService.getLocalServerAddress())) {File gitDir = OneDev.getInstance(ProjectService.class).getGitDir(projectFacade.getId());String principal = (String) SecurityUtils.getSubject().getPrincipal();- Map<String, String> hookEnvs = HookUtils.getHookEnvs(projectFacade.getId(), principal);+ Map<String, String> hookEnvs = HookUtils.getReceiveHookEnvs(projectFacade.getId(), principal);if (!clusterAccess) {SessionService sessionService = OneDev.getInstance(SessionService.class);diff --git a/server-core/src/main/java/io/onedev/server/git/hook/GitPostReceiveCallback.java b/server-core/src/main/java/io/onedev/server/git/hook/GitPostReceiveCallback.javaindex fc47be3b60..e8fef2a8f7 100644--- a/server-core/src/main/java/io/onedev/server/git/hook/GitPostReceiveCallback.java+++ b/server-core/src/main/java/io/onedev/server/git/hook/GitPostReceiveCallback.java@@ -70,7 +70,7 @@ public class GitPostReceiveCallback extends HttpServlet {List<String> fields = StringUtils.splitAndTrim(request.getPathInfo(), "/");Preconditions.checkState(fields.size() == 3);- if (!fields.get(2).equals(HookUtils.HOOK_TOKEN)) {+ if (!fields.get(2).equals(HookUtils.RECEIVE_HOOK_TOKEN)) {response.sendError(HttpServletResponse.SC_FORBIDDEN,"Git hook callbacks can only be accessed by OneDev itself");return;diff --git a/server-core/src/main/java/io/onedev/server/git/hook/GitPreReceiveCallback.java b/server-core/src/main/java/io/onedev/server/git/hook/GitPreReceiveCallback.javaindex 61acde44f4..bbfadd1fe4 100644--- a/server-core/src/main/java/io/onedev/server/git/hook/GitPreReceiveCallback.java+++ b/server-core/src/main/java/io/onedev/server/git/hook/GitPreReceiveCallback.java@@ -68,7 +68,7 @@ public class GitPreReceiveCallback extends HttpServlet {List<String> fields = StringUtils.splitAndTrim(request.getPathInfo(), "/");Preconditions.checkState(fields.size() == 3);- if (!fields.get(2).equals(HookUtils.HOOK_TOKEN)) {+ if (!fields.get(2).equals(HookUtils.RECEIVE_HOOK_TOKEN)) {response.sendError(HttpServletResponse.SC_FORBIDDEN,"Git hook callbacks can only be accessed by OneDev itself");return;diff --git a/server-core/src/main/java/io/onedev/server/git/hook/HookUtils.java b/server-core/src/main/java/io/onedev/server/git/hook/HookUtils.javaindex 9993ff91dc..919f97eb00 100644--- a/server-core/src/main/java/io/onedev/server/git/hook/HookUtils.java+++ b/server-core/src/main/java/io/onedev/server/git/hook/HookUtils.java@@ -18,9 +18,11 @@ import java.util.Map;public class HookUtils {- public static final String HOOK_TOKEN = CryptoUtils.generateSecret();+ public static final String RECEIVE_HOOK_TOKEN = CryptoUtils.generateSecret();private static final String gitReceiveHook;++ private static final String gitWorkspacePostCommitHook;static {try (InputStream is = HookUtils.class.getClassLoader().getResourceAsStream("git-receive-hook")) {@@ -29,9 +31,15 @@ public class HookUtils {} catch (IOException e) {throw new RuntimeException(e);}+ try (InputStream is = HookUtils.class.getClassLoader().getResourceAsStream("git-workspace-postcommit-hook")) {+ Preconditions.checkNotNull(is);+ gitWorkspacePostCommitHook = StringUtils.join(IOUtils.readLines(is, Charset.defaultCharset()), "\n");+ } catch (IOException e) {+ throw new RuntimeException(e);+ }}-- public static Map<String, String> getHookEnvs(Long projectId, String principal) {++ public static Map<String, String> getCommonHookEnvs() {ServerConfig serverConfig = OneDev.getInstance(ServerConfig.class);SettingService settingService = OneDev.getInstance(SettingService.class);String hookUrl = "http://localhost:" + serverConfig.getHttpPort();@@ -41,14 +49,19 @@ public class HookUtils {envs.put("ONEDEV_CURL", curl);envs.put("ONEDEV_URL", hookUrl);- envs.put("ONEDEV_HOOK_TOKEN", HOOK_TOKEN);- envs.put("ONEDEV_USER_ID", principal);- envs.put("ONEDEV_REPOSITORY_ID", projectId.toString());return envs;}++ public static Map<String, String> getReceiveHookEnvs(Long projectId, String principal) {+ var envs = getCommonHookEnvs();+ envs.put("ONEDEV_HOOK_TOKEN", RECEIVE_HOOK_TOKEN);+ envs.put("ONEDEV_USER_ID", principal);+ envs.put("ONEDEV_REPOSITORY_ID", projectId.toString());+ return envs;+ }- public static boolean isHookValid(File gitDir, String hookName) {+ public static boolean isReceiveHookValid(File gitDir, String hookName) {File hookFile = new File(gitDir, "hooks/" + hookName);if (!hookFile.exists())return false;@@ -67,9 +80,30 @@ public class HookUtils {return true;}- public static void checkHooks(File gitDir) {- if (!isHookValid(gitDir, "pre-receive")- || !isHookValid(gitDir, "post-receive")) {+ public static Map<String, String> getWorkspacePostCommitHookEnvs(String workspaceToken) {+ var envs = getCommonHookEnvs();+ envs.put("ONEDEV_HOOK_TOKEN", workspaceToken);+ return envs;+ }++ public static void setupWorkspacePostCommitHook(File gitDir, boolean lfsEnabled) {+ File hooksDir = new File(gitDir, "hooks");+ FileUtils.createDir(hooksDir);+ File postCommitHookFile = new File(hooksDir, "post-commit");++ String lfsAwareHook;+ if (lfsEnabled) {+ lfsAwareHook = String.format(gitWorkspacePostCommitHook, "git lfs post-commit \"$@\"");+ } else {+ lfsAwareHook = String.format(gitWorkspacePostCommitHook, "");+ }++ FileUtils.writeFile(postCommitHookFile, lfsAwareHook);+ postCommitHookFile.setExecutable(true);+ }++ public static void checkReceiveHooks(File gitDir) {+ if (!isReceiveHookValid(gitDir, "pre-receive") || !isReceiveHookValid(gitDir, "post-receive")) {File hooksDir = new File(gitDir, "hooks");File gitPreReceiveHookFile = new File(hooksDir, "pre-receive");diff --git a/server-core/src/main/java/io/onedev/server/jetty/DefaultJettyService.java b/server-core/src/main/java/io/onedev/server/jetty/DefaultJettyService.javaindex c70b90ba45..6935834151 100644--- a/server-core/src/main/java/io/onedev/server/jetty/DefaultJettyService.java+++ b/server-core/src/main/java/io/onedev/server/jetty/DefaultJettyService.java@@ -24,6 +24,8 @@ import org.eclipse.jetty.server.session.HouseKeeper;import org.eclipse.jetty.server.session.SessionDataStoreFactory;import org.eclipse.jetty.servlet.ErrorPageErrorHandler;import org.eclipse.jetty.servlet.ServletContextHandler;+import org.slf4j.Logger;+import org.slf4j.LoggerFactory;import com.google.inject.servlet.GuiceFilter;@@ -45,6 +47,8 @@ import io.onedev.server.service.SettingService;@Singletonpublic class DefaultJettyService implements JettyService, Serializable {+ private static final Logger logger = LoggerFactory.getLogger(DefaultJettyService.class);+private static final int DEFAULT_SESSION_TIMEOUT = 300;private static final int MAX_CONTENT_SIZE = 5000000;@@ -181,10 +185,14 @@ public class DefaultJettyService implements JettyService, Serializable {@Overridepublic Void call() throws Exception {- if (systemSetting.getSessionTimeout() != null)- servletContextHandler.getSessionHandler().setMaxInactiveInterval(systemSetting.getSessionTimeout() * 60);- else- servletContextHandler.getSessionHandler().setMaxInactiveInterval(DEFAULT_SESSION_TIMEOUT);+ try {+ if (systemSetting.getSessionTimeout() != null)+ servletContextHandler.getSessionHandler().setMaxInactiveInterval(systemSetting.getSessionTimeout() * 60);+ else+ servletContextHandler.getSessionHandler().setMaxInactiveInterval(DEFAULT_SESSION_TIMEOUT);+ } catch (Throwable t) {+ logger.error("Error setting session timeout", t);+ }return null;}diff --git a/server-core/src/main/java/io/onedev/server/job/AgentRunnable.java b/server-core/src/main/java/io/onedev/server/job/AgentRunnable.javadeleted file mode 100644index 5750c0b13f..0000000000--- a/server-core/src/main/java/io/onedev/server/job/AgentRunnable.java+++ /dev/null@@ -1,9 +0,0 @@-package io.onedev.server.job;--import java.io.Serializable;--public interface AgentRunnable extends Serializable {-- boolean run(Long agentId);--}diff --git a/server-core/src/main/java/io/onedev/server/job/AgentShell.java b/server-core/src/main/java/io/onedev/server/job/AgentShell.javanew file mode 100644index 0000000000..ff9bb4a304--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/job/AgentShell.java@@ -0,0 +1,53 @@+package io.onedev.server.job;++import java.util.concurrent.TimeoutException;++import org.eclipse.jetty.websocket.api.Session;++import io.onedev.agent.Message;+import io.onedev.agent.WebsocketUtils;+import io.onedev.agent.shell.ShellInputRequest;+import io.onedev.agent.shell.ShellResizeRequest;+import io.onedev.server.terminal.Shell;+import io.onedev.server.terminal.Terminal;++public class AgentShell implements Shell {++ private final JobTerminal terminal;++ private final Session agent;++ public AgentShell(JobTerminal terminal, Session agent, String jobToken) {+ this.terminal = terminal;+ this.agent = agent;+ new Message(io.onedev.agent.MessageTypes.SHELL_OPEN, terminal.getSessionId() + ":" + jobToken).sendBy(agent);+ }++ public Terminal getTerminal() {+ return terminal;+ }++ @Override+ public void writeToStdin(String data) {+ try {+ WebsocketUtils.call(agent, new ShellInputRequest(terminal.getSessionId(), data), 0);+ } catch (InterruptedException | TimeoutException e) {+ throw new RuntimeException(e);+ }+ }++ @Override+ public void resize(int rows, int cols) {+ try {+ WebsocketUtils.call(agent, new ShellResizeRequest(terminal.getSessionId(), rows, cols), 0);+ } catch (InterruptedException | TimeoutException e) {+ throw new RuntimeException(e);+ }+ }++ @Override+ public void terminate() {+ new Message(io.onedev.agent.MessageTypes.SHELL_TERMINATE, terminal.getSessionId()).sendBy(agent);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/job/DefaultJobService.java b/server-core/src/main/java/io/onedev/server/job/DefaultJobService.javaindex 7bb3473d4e..96f92db3f6 100644--- a/server-core/src/main/java/io/onedev/server/job/DefaultJobService.java+++ b/server-core/src/main/java/io/onedev/server/job/DefaultJobService.java@@ -36,7 +36,6 @@ import java.util.concurrent.TimeoutException;import java.util.concurrent.atomic.AtomicReference;import java.util.concurrent.locks.Lock;-import org.jspecify.annotations.Nullable;import javax.inject.Inject;import javax.inject.Singleton;import javax.servlet.http.HttpServletRequest;@@ -53,6 +52,7 @@ import javax.ws.rs.core.Response;import org.apache.shiro.subject.Subject;import org.eclipse.jgit.lib.ObjectId;import org.joda.time.DateTime;+import org.jspecify.annotations.Nullable;import org.quartz.CronExpression;import org.quartz.CronScheduleBuilder;import org.quartz.ScheduleBuilder;@@ -119,12 +119,13 @@ import io.onedev.server.event.system.SystemStarted;import io.onedev.server.event.system.SystemStarting;import io.onedev.server.event.system.SystemStopping;import io.onedev.server.exception.HttpResponseAwareException;+import io.onedev.server.exception.ServerNotFoundException;import io.onedev.server.git.GitUtils;import io.onedev.server.git.service.GitService;-import io.onedev.server.job.log.LogService;-import io.onedev.server.job.log.ServerJobLogger;import io.onedev.server.job.match.JobMatch;import io.onedev.server.job.match.JobMatchContext;+import io.onedev.server.logging.LogService;+import io.onedev.server.logging.ServerLogger;import io.onedev.server.model.Build;import io.onedev.server.model.Build.Status;import io.onedev.server.model.BuildDependence;@@ -155,10 +156,8 @@ import io.onedev.server.service.UserService;import io.onedev.server.taskschedule.SchedulableTask;import io.onedev.server.taskschedule.TaskScheduler;import io.onedev.server.terminal.Shell;-import io.onedev.server.terminal.Terminal;-import io.onedev.server.terminal.WebShell;-import io.onedev.server.util.ProjectScopedCommitAware;import io.onedev.server.util.ProjectScopedCommit;+import io.onedev.server.util.ProjectScopedCommitAware;import io.onedev.server.util.concurrent.BatchWorkExecutionService;import io.onedev.server.util.concurrent.BatchWorker;import io.onedev.server.util.concurrent.Prioritized;@@ -252,6 +251,9 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz@Injectprivate WorkExecutionService workExecutionService;+ @Inject+ private JobTerminalService jobTerminalService;+private volatile Thread thread;private final Map<String, JobContext> jobContexts = new ConcurrentHashMap<>();@@ -315,8 +317,8 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthorizreturn doSubmit(user, project, commitId, jobName, paramMap, refName, request, issue, reason);} catch (ValidationException e) {throw new HttpResponseAwareException(SC_BAD_REQUEST, e.getMessage());- } catch (Throwable e) {- throw ExceptionUtils.unchecked(e);+ } catch (Throwable t) {+ throw ExceptionUtils.unchecked(t);} finally {JobAuthorizationContext.pop();}@@ -334,7 +336,7 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthorizbuild.setProject(project);build.setCommitHash(commitId.name());build.setJobName(jobName);- build.setJobToken(UUID.randomUUID().toString());+ build.setToken(UUID.randomUUID().toString());build.setSubmitDate(new Date());build.setStatus(Build.Status.WAITING);build.setSubmitReason(reason);@@ -569,16 +571,16 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz}}}- throw new ExplicitException("No applicable job executor discovered for current job");+ throw new ExplicitException("No applicable executor discovered for current job");}}}private Future<Boolean> execute(Build build) {- String jobToken = build.getJobToken();+ String jobToken = build.getToken();VariableInterpolator interpolator = new VariableInterpolator(build, build.getParamCombination());- TaskLogger jobLogger = logService.newLogger(build);+ TaskLogger jobLogger = logService.newLogger(build.getLoggingSupport());String jobExecutorName = interpolator.interpolate(build.getJob().getJobExecutor());JobExecutor jobExecutor = interpolator.interpolateProperties(getJobExecutor(build, jobExecutorName, jobLogger));String sequentialGroup = interpolator.interpolate(build.getJob().getSequentialGroup());@@ -643,7 +645,7 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz// Store original job actions as the copy in job context will be fetched from cluster and// some transient fields (such as step object in ServerSideFacade) will not be preservedjobActions.put(jobToken, actions);- logService.addJobLogger(jobToken, jobLogger);+ logService.addLogger(jobToken, jobLogger);serverStepThreads.put(jobToken, new ArrayList<>());try {var future = executorService.submit(() -> jobExecutor.execute(jobContext, jobLogger));@@ -680,11 +682,13 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthorizfor (Thread thread : threads)thread.interrupt();}- logService.removeJobLogger(jobToken);+ logService.removeLogger(jobToken);jobActions.remove(jobToken);if (sequentialKey != null)sequentialKeys.remove(sequentialKey);++ jobTerminalService.terminateShells(buildId);}}});@@ -760,7 +764,7 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthorizprivate void markBuildError(Build build, String errorMessage) {build.setStatus(Build.Status.FAILED);- logService.newLogger(build).error(errorMessage);+ logService.newLogger(build.getLoggingSupport()).error(errorMessage);build.setFinishDate(new Date());buildService.update(build);listenerRegistry.post(new BuildFinished(build));@@ -829,10 +833,10 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz}}}- } catch (Throwable e) {+ } catch (Throwable t) {String message = String.format("Error checking job triggers (project: %s, commit: %s)",event.getProject().getPath(), commitId.name());- logger.error(message, e);+ logger.error(message, t);} finally {JobAuthorizationContext.pop();}@@ -865,7 +869,7 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthorizbuild.setStatus(Build.Status.WAITING);build.setSubmitSequence(build.getSubmitSequence()+1);- build.setJobToken(UUID.randomUUID().toString());+ build.setToken(UUID.randomUUID().toString());build.setFinishDate(null);build.setPendingDate(null);build.setRetryDate(null);@@ -886,8 +890,8 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz}var systemUser = userService.getSystem();- for (BuildDependence dependence : build.getDependencies()) {- Build dependency = dependence.getDependency();+ for (var dependence : build.getDependencies()) {+ var dependency = dependence.getDependency();if (dependence.isRequireSuccessful() && !dependency.isSuccessful())resubmit(systemUser, dependency, "Resubmitted by dependent build");}@@ -899,10 +903,10 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz@Transactional@Overridepublic void resume(Build build) {- Long buildId = build.getId();- JobContext jobContext = getJobContext(buildId);+ var buildId = build.getId();+ var jobContext = getJobContext(buildId);if (jobContext != null) {- String jobServer = jobServers.get(jobContext.getJobToken());+ var jobServer = jobServers.get(jobContext.getJobToken());if (jobServer != null) {clusterService.runOnServer(jobServer, new ClusterTask<Void>() {@@ -910,9 +914,9 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz@Overridepublic Void call() {- JobContext jobContext = getJobContext(buildId);+ var jobContext = getJobContext(buildId);if (jobContext != null) {- JobRunnable jobRunnable = jobRunnables.get(jobContext.getJobToken());+ var jobRunnable = jobRunnables.get(jobContext.getJobToken());if (jobRunnable != null)jobRunnable.resume(jobContext);}@@ -928,17 +932,17 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz@Sessional@Override- public WebShell openShell(Build build, Terminal terminal) {- JobContext jobContext = getJobContext(build.getId());+ public JobShell openShell(Build build, JobTerminal terminal) {+ var jobContext = getJobContext(build.getId());if (jobContext != null) {- String jobToken = jobContext.getJobToken();- String shellServer = jobServers.get(jobToken);+ var jobToken = jobContext.getJobToken();+ var shellServer = jobServers.get(jobToken);if (shellServer != null) {clusterService.runOnServer(shellServer, () -> {- JobContext innerJobContext = getJobContext(jobToken, true);- JobRunnable jobRunnable = jobRunnables.get(innerJobContext.getJobToken());+ var innerJobContext = getJobContext(jobToken, true);+ var jobRunnable = jobRunnables.get(innerJobContext.getJobToken());if (jobRunnable != null) {- Shell shell = jobRunnable.openShell(innerJobContext, terminal);+ var shell = jobRunnable.openShell(innerJobContext, terminal);jobShells.put(terminal.getSessionId(), shell);} else {throw new ExplicitException("Job shell not ready");@@ -946,18 +950,18 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthorizreturn null;});- return new WebShell(build.getId(), terminal.getSessionId()) {+ return new JobShell(build.getId(), terminal.getSessionId()) {private static final long serialVersionUID = 1L;@Override- public void sendInput(String input) {- clusterService.submitToServer(shellServer, () -> {+ public void writeToStdin(String data) {+ clusterService.runOnServer(shellServer, () -> {try {- Shell shell = jobShells.get(terminal.getSessionId());+ var shell = jobShells.get(terminal.getSessionId());if (shell != null)- shell.sendInput(input);- } catch (Exception e) {+ shell.writeToStdin(data);+ } catch (Throwable e) {logger.error("Error sending shell input", e);}return null;@@ -968,10 +972,10 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthorizpublic void resize(int rows, int cols) {clusterService.submitToServer(shellServer, () -> {try {- Shell shell = jobShells.get(terminal.getSessionId());+ var shell = jobShells.get(terminal.getSessionId());if (shell != null)shell.resize(rows, cols);- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error resizing shell", e);}return null;@@ -979,13 +983,13 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz}@Override- public void exit() {+ public void terminate() {clusterService.submitToServer(shellServer, () -> {try {- Shell shell = jobShells.remove(terminal.getSessionId());+ var shell = jobShells.remove(terminal.getSessionId());if (shell != null)- shell.exit();- } catch (Exception e) {+ shell.terminate();+ } catch (Throwable e) {logger.error("Error exiting shell", e);}return null;@@ -1008,9 +1012,9 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz@Overridepublic JobContext getJobContext(Long buildId) {- Map<String, JobContext> result = clusterService.runOnAllServers(() -> {+ var result = clusterService.runOnAllServers(() -> {for (Map.Entry<String, JobContext> entry : jobContexts.entrySet()) {- JobContext jobContext = entry.getValue();+ var jobContext = entry.getValue();if (jobContext.getBuildId().equals(buildId))return jobContext;}@@ -1022,9 +1026,9 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz@Transactional@Overridepublic void cancel(Build build) {- Long projectId = build.getProject().getId();- Long buildId = build.getId();- Long userId = User.idOf(SecurityUtils.getUser());+ var projectId = build.getProject().getId();+ var buildId = build.getId();+ var userId = User.idOf(SecurityUtils.getUser());projectService.runOnActiveServer(projectId, () -> {var future = jobFutures.get(buildId);if (future != null) {@@ -1104,7 +1108,7 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz@Overridepublic void execute() {- batchWorkExecutionService.submit(new BatchWorker("job-manager-maintenance") {+ batchWorkExecutionService.submit(new BatchWorker("job-service-maintenance") {@Overridepublic void doWorks(List<Prioritized> works) {@@ -1213,7 +1217,7 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthorizwhile (!jobFutures.isEmpty() || thread != null) {if (thread == null) {if (!jobFutures.isEmpty())- logger.info("Waiting for jobs to finish...");+ logger.info("Callelling running builds...");for (var execution: jobFutures.values()) {if (!execution.isDone())execution.cancel(true);@@ -1237,44 +1241,50 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthorizvar server = entry.getKey();var buildIdsOfServer = entry.getValue();futures.add(clusterService.submitToServer(server, () -> {- transactionService.run(() -> {- for (var buildId : buildIdsOfServer) {- var build = buildService.load(buildId);- if (build.getStatus() == Status.WAITING) {- if (build.getDependencies().stream().anyMatch(it -> it.isRequireSuccessful()- && it.getDependency().isFinished()- && it.getDependency().getStatus() != Status.SUCCESSFUL)) {- markBuildError(build, "Some dependencies are required to be successful but failed");- } else if (build.getDependencies().stream().allMatch(it -> it.getDependency().isFinished())) {- build.setStatus(Status.PENDING);- build.setPendingDate(new Date());- listenerRegistry.post(new BuildPending(build));- }- } else if (build.getStatus() == Status.PENDING) {- var future = jobFutures.get(build.getId());- if (future == null && thread != null) {- try {- jobFutures.put(build.getId(), execute(build));- } catch (Throwable t) {- ExplicitException explicitException = find(t, ExplicitException.class);- if (explicitException != null)- markBuildError(build, explicitException.getMessage());- else- markBuildError(build, Throwables.getStackTraceAsString(t));+ try {+ while (thread == null)+ Thread.sleep(1000);+ transactionService.run(() -> {+ for (var buildId : buildIdsOfServer) {+ var build = buildService.load(buildId);+ if (build.getStatus() == Status.WAITING) {+ if (build.getDependencies().stream().anyMatch(it -> it.isRequireSuccessful()+ && it.getDependency().isFinished()+ && it.getDependency().getStatus() != Status.SUCCESSFUL)) {+ markBuildError(build, "Some dependencies are required to be successful but failed");+ } else if (build.getDependencies().stream().allMatch(it -> it.getDependency().isFinished())) {+ build.setStatus(Status.PENDING);+ build.setPendingDate(new Date());+ listenerRegistry.post(new BuildPending(build));+ }+ } else if (build.getStatus() == Status.PENDING) {+ var future = jobFutures.get(build.getId());+ if (future == null && thread != null) {+ try {+ jobFutures.put(build.getId(), execute(build));+ } catch (Throwable t) {+ ExplicitException explicitException = find(t, ExplicitException.class);+ if (explicitException != null)+ markBuildError(build, explicitException.getMessage());+ else+ markBuildError(build, Throwables.getStackTraceAsString(t));+ }+ }+ } else if (build.getStatus() == Status.RUNNING) {+ if (jobFutures.get(build.getId()) == null) {+ build.setRunningDate(null);+ build.setPendingDate(new Date());+ build.setRetryDate(null);+ build.getCheckoutPaths().clear();+ build.setStatus(Status.PENDING);+ listenerRegistry.post(new BuildPending(build));}- }- } else if (build.getStatus() == Status.RUNNING) {- if (jobFutures.get(build.getId()) == null) {- build.setRunningDate(null);- build.setPendingDate(new Date());- build.setRetryDate(null);- build.getCheckoutPaths().clear();- build.setStatus(Status.PENDING);- listenerRegistry.post(new BuildPending(build));}}- }- });+ });+ } catch (Throwable t) {+ logger.error("Error checking unfinished builds", t);+ }return null;}));}@@ -1297,7 +1307,7 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthorizfuture.cancel(true);} else if (future.isDone()) {it.remove();- var jobLogger = logService.newLogger(build);+ var jobLogger = logService.newLogger(build.getLoggingSupport());try {if (future.get())build.setStatus(Status.SUCCESSFUL);@@ -1321,8 +1331,9 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz}});Thread.sleep(CHECK_INTERVAL);- } catch (Throwable e) {- logger.error("Error checking unfinished builds", e);+ } catch (Throwable t) {+ if (ExceptionUtils.find(t, ServerNotFoundException.class) == null)+ logger.error("Error checking builds", t);}}}@@ -1367,25 +1378,6 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthorizreturn false;}- @Override- public boolean runJob(String server, ClusterTask<Boolean> runnable) {- Future<Boolean> future = null;- try {- future = clusterService.submitToServer(server, runnable);-- // future.get() here does not respond to thread interruption- while (!future.isDone())- Thread.sleep(1000);- return future.get();- } catch (InterruptedException e) {- if (future != null)- future.cancel(true);- throw new RuntimeException(e);- } catch (ExecutionException e) {- throw new RuntimeException(e);- }- }-@Overridepublic boolean runJob(JobContext jobContext, JobRunnable runnable) {while (thread == null) {@@ -1401,15 +1393,15 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthorizjobContexts.put(jobToken, jobContext);jobRunnables.put(jobToken, runnable);try {- TaskLogger jobLogger = logService.getJobLogger(jobToken);+ TaskLogger jobLogger = logService.getLogger(jobToken);if (jobLogger == null) {var activeServer = projectService.getActiveServer(jobContext.getProjectId(), true);- jobLogger = new ServerJobLogger(activeServer, jobContext.getJobToken());- logService.addJobLogger(jobToken, jobLogger);+ jobLogger = new ServerLogger(activeServer, jobContext.getJobToken());+ logService.addLogger(jobToken, jobLogger);try {return runnable.run(jobLogger);} finally {- logService.removeJobLogger(jobToken);+ logService.removeLogger(jobToken);}} else {return runnable.run(jobLogger);@@ -1429,15 +1421,15 @@ public class DefaultJobService implements JobService, Runnable, CodePullAuthoriz}@Override- public void reportJobWorkspace(JobContext jobContext, String workspacePath) {+ public void reportJobWorkDir(JobContext jobContext, String workDirPath) {transactionService.run(() -> {Build build = buildService.load(jobContext.getBuildId());- build.setWorkspacePath(normalizeFilePath(workspacePath));+ build.setWorkDirPath(normalizeFilePath(workDirPath));CompositeFacade entryFacade = new CompositeFacade(jobContext.getActions());entryFacade.traverse((LeafVisitor<Void>) (executable, position) -> {if (executable instanceof CheckoutFacade) {CheckoutFacade checkoutFacade = (CheckoutFacade) executable;- var checkoutPath = workspacePath;+ var checkoutPath = workDirPath;if (checkoutFacade.getCheckoutPath() != null)checkoutPath += "/" + checkoutFacade.getCheckoutPath();build.getCheckoutPaths().add(normalizeFilePath(checkoutPath));diff --git a/server-core/src/main/java/io/onedev/server/job/JobRunnable.java b/server-core/src/main/java/io/onedev/server/job/JobRunnable.javaindex bfe4501838..3aaf11101b 100644--- a/server-core/src/main/java/io/onedev/server/job/JobRunnable.java+++ b/server-core/src/main/java/io/onedev/server/job/JobRunnable.java@@ -1,10 +1,9 @@package io.onedev.server.job;+import java.io.Serializable;+import io.onedev.commons.utils.TaskLogger;import io.onedev.server.terminal.Shell;-import io.onedev.server.terminal.Terminal;--import java.io.Serializable;public interface JobRunnable extends Serializable {@@ -12,6 +11,6 @@ public interface JobRunnable extends Serializable {void resume(JobContext jobContext);- Shell openShell(JobContext jobContext, Terminal terminal);+ Shell openShell(JobContext jobContext, JobTerminal terminal);}diff --git a/server-core/src/main/java/io/onedev/server/job/JobService.java b/server-core/src/main/java/io/onedev/server/job/JobService.javaindex 2e9c206d02..20107f3fa3 100644--- a/server-core/src/main/java/io/onedev/server/job/JobService.java+++ b/server-core/src/main/java/io/onedev/server/job/JobService.java@@ -4,21 +4,17 @@ import java.io.File;import java.util.List;import java.util.Map;-import org.jspecify.annotations.Nullable;-import org.eclipse.jgit.lib.ObjectId;+import org.jspecify.annotations.Nullable;import io.onedev.commons.utils.TaskLogger;import io.onedev.k8shelper.ServerStepResult;-import io.onedev.server.cluster.ClusterTask;import io.onedev.server.model.Build;import io.onedev.server.model.Issue;import io.onedev.server.model.Project;import io.onedev.server.model.PullRequest;import io.onedev.server.model.User;import io.onedev.server.terminal.Shell;-import io.onedev.server.terminal.Terminal;-import io.onedev.server.terminal.WebShell;public interface JobService {@@ -32,18 +28,16 @@ public interface JobService {void resume(Build build);- boolean runJob(String server, ClusterTask<Boolean> runnable);-boolean runJob(JobContext jobContext, JobRunnable runnable);- WebShell openShell(Build build, Terminal terminal);+ JobShell openShell(Build build, JobTerminal terminal);JobContext getJobContext(String jobToken, boolean mustExist);@NullableShell getShell(String sessionId);- void reportJobWorkspace(JobContext jobContext, String workspacePath);+ void reportJobWorkDir(JobContext jobContext, String workspacePath);@NullableJobContext getJobContext(Long buildId);diff --git a/server-core/src/main/java/io/onedev/server/terminal/WebShell.java b/server-core/src/main/java/io/onedev/server/job/JobShell.javasimilarity index 62%rename from server-core/src/main/java/io/onedev/server/terminal/WebShell.javarename to server-core/src/main/java/io/onedev/server/job/JobShell.javaindex 7eefb11901..a3f1503f75 100644--- a/server-core/src/main/java/io/onedev/server/terminal/WebShell.java+++ b/server-core/src/main/java/io/onedev/server/job/JobShell.java@@ -1,8 +1,10 @@-package io.onedev.server.terminal;+package io.onedev.server.job;import java.io.Serializable;-public abstract class WebShell implements Shell, Serializable {+import io.onedev.server.terminal.Shell;++public abstract class JobShell implements Shell, Serializable {private static final long serialVersionUID = 1L;@@ -10,7 +12,7 @@ public abstract class WebShell implements Shell, Serializable {private final String sessionId;- public WebShell(Long buildId, String sessionId) {+ public JobShell(Long buildId, String sessionId) {this.buildId = buildId;this.sessionId = sessionId;}diff --git a/server-core/src/main/java/io/onedev/server/job/JobTerminal.java b/server-core/src/main/java/io/onedev/server/job/JobTerminal.javanew file mode 100644index 0000000000..80a1ef4e11--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/job/JobTerminal.java@@ -0,0 +1,9 @@+package io.onedev.server.job;++import io.onedev.server.terminal.Terminal;++public interface JobTerminal extends Terminal {++ String getSessionId();++}diff --git a/server-core/src/main/java/io/onedev/server/terminal/TerminalService.java b/server-core/src/main/java/io/onedev/server/job/JobTerminalService.javasimilarity index 51%rename from server-core/src/main/java/io/onedev/server/terminal/TerminalService.javarename to server-core/src/main/java/io/onedev/server/job/JobTerminalService.javaindex 12ada91771..ca3d1c9e71 100644--- a/server-core/src/main/java/io/onedev/server/terminal/TerminalService.java+++ b/server-core/src/main/java/io/onedev/server/job/JobTerminalService.java@@ -1,9 +1,9 @@-package io.onedev.server.terminal;+package io.onedev.server.job;import io.onedev.server.model.Build;import org.apache.wicket.protocol.ws.api.IWebSocketConnection;-public interface TerminalService {+public interface JobTerminalService {String getTerminalUrl(Build build);@@ -11,8 +11,10 @@ public interface TerminalService {void onClose(IWebSocketConnection connection);- void onResize(IWebSocketConnection connection, int rows, int cols);+ void onResized(IWebSocketConnection connection, int rows, int cols);- void onInput(IWebSocketConnection connection, String input);+ void writeToStdin(IWebSocketConnection connection, String data);+ void terminateShells(Long buildId);+}diff --git a/server-core/src/main/java/io/onedev/server/job/ResourceAllocator.java b/server-core/src/main/java/io/onedev/server/job/ResourceAllocator.javadeleted file mode 100644index 301f3872a7..0000000000--- a/server-core/src/main/java/io/onedev/server/job/ResourceAllocator.java+++ /dev/null@@ -1,16 +0,0 @@-package io.onedev.server.job;--import io.onedev.server.cluster.ClusterTask;-import io.onedev.server.search.entity.agent.AgentQuery;--public interface ResourceAllocator {-- boolean runServerJob(String executorName, int totalConcurrency, int requiredConcurrency,- ClusterTask<Boolean> runnable);-- boolean runAgentJob(AgentQuery agentQuery, String executorName, int totalConcurrency,- int requiredConcurrency, AgentRunnable runnable);-- void agentDisconnecting(Long agentId);--}diff --git a/server-core/src/main/java/io/onedev/server/job/ServerCacheHelper.java b/server-core/src/main/java/io/onedev/server/job/ServerCacheHelper.javaindex 3c39baf96a..1abfb1d46b 100644--- a/server-core/src/main/java/io/onedev/server/job/ServerCacheHelper.java+++ b/server-core/src/main/java/io/onedev/server/job/ServerCacheHelper.java@@ -1,63 +1,61 @@package io.onedev.server.job;-import com.google.common.base.Joiner;+import java.io.File;+import java.io.IOException;+import java.io.InputStream;+import java.util.List;++import javax.ws.rs.client.Client;+import javax.ws.rs.client.ClientBuilder;+import javax.ws.rs.client.Entity;+import javax.ws.rs.client.Invocation;+import javax.ws.rs.core.HttpHeaders;+import javax.ws.rs.core.MediaType;+import javax.ws.rs.core.Response;+import javax.ws.rs.core.StreamingOutput;++import org.glassfish.jersey.client.ClientProperties;+import org.jspecify.annotations.Nullable;+import io.onedev.commons.utils.ExplicitException;import io.onedev.commons.utils.TaskLogger;+import io.onedev.k8shelper.CacheAvailability;import io.onedev.k8shelper.CacheHelper;import io.onedev.k8shelper.KubernetesHelper;import io.onedev.k8shelper.SetupCacheFacade;import io.onedev.server.OneDev;import io.onedev.server.cluster.ClusterService;-import io.onedev.server.service.AccessTokenService;-import io.onedev.server.service.JobCacheService;-import io.onedev.server.service.ProjectService;import io.onedev.server.model.Project;import io.onedev.server.persistence.SessionService;import io.onedev.server.security.SecurityUtils;-import org.apache.commons.lang3.tuple.Pair;-import org.glassfish.jersey.client.ClientProperties;--import javax.ws.rs.client.Client;-import javax.ws.rs.client.ClientBuilder;-import javax.ws.rs.client.Entity;-import javax.ws.rs.client.Invocation;-import javax.ws.rs.core.HttpHeaders;-import javax.ws.rs.core.MediaType;-import javax.ws.rs.core.Response;-import javax.ws.rs.core.StreamingOutput;-import java.io.File;-import java.io.IOException;-import java.io.InputStream;-import java.util.List;+import io.onedev.server.service.AccessTokenService;+import io.onedev.server.service.ProjectService;+import io.onedev.server.service.RunCacheService;+import io.onedev.server.service.support.CacheQueryResult;public class ServerCacheHelper extends CacheHelper {private final JobContext jobContext;- public ServerCacheHelper(File buildHome, JobContext jobContext, TaskLogger logger) {- super(buildHome, logger);+ public ServerCacheHelper(File buildDir, JobContext jobContext, TaskLogger logger) {+ super(buildDir, logger);this.jobContext = jobContext;}@Override- protected boolean downloadCache(String cacheKey, List<String> cachePaths, List<File> cacheDirs) {- var cacheInfo = getCacheService().getCacheInfoForDownload(jobContext.getProjectId(), cacheKey);- return downloadCache(cacheInfo, cachePaths, cacheDirs);+ protected CacheAvailability downloadCache(String key, @Nullable String checksum,+ String cachePathsString, List<File> cacheDirs) {+ var cacheQueryResult = getCacheService().queryCache(jobContext.getProjectId(), key, checksum);+ return downloadCache(cacheQueryResult, cachePathsString, cacheDirs);}- @Override- protected boolean downloadCache(List<String> loadKeys, List<String> cachePaths, List<File> cacheDirs) {- var cacheInfo = getCacheService().getCacheInfoForDownload(jobContext.getProjectId(), loadKeys);- return downloadCache(cacheInfo, cachePaths, cacheDirs);- }-- private boolean downloadCache(Pair<Long, Long> cacheInfo, List<String> cachePaths, List<File> cacheDirs) {- if (cacheInfo != null) {- var projectId = cacheInfo.getLeft();- var cacheId = cacheInfo.getRight();+ private CacheAvailability downloadCache(@Nullable CacheQueryResult cacheQueryResult, String cachePathsString, List<File> cacheDirs) {+ if (cacheQueryResult != null) {+ var projectId = cacheQueryResult.getProjectId();+ var cacheId = cacheQueryResult.getCacheId();var activeServer = getProjectService().getActiveServer(projectId, true);if (activeServer.equals(getClusterService().getLocalServerAddress())) {- return getCacheService().downloadCache(projectId, cacheId, cachePaths, is -> untar(cacheDirs, is));+ return getCacheService().downloadCache(cacheQueryResult, cachePathsString, is -> untar(cacheDirs, is));} else {Client client = ClientBuilder.newClient();client.property(ClientProperties.REQUEST_ENTITY_PROCESSING, "CHUNKED");@@ -67,19 +65,18 @@ public class ServerCacheHelper extends CacheHelper {.path("~api/cluster/cache").queryParam("projectId", projectId).queryParam("cacheId", cacheId)- .queryParam("cachePaths", Joiner.on('\n').join(cachePaths));+ .queryParam("exactMatch", cacheQueryResult.isExactMatch())+ .queryParam("cachePathsString", cachePathsString);Invocation.Builder builder = target.request();builder.header(HttpHeaders.AUTHORIZATION,KubernetesHelper.BEARER + " " + getClusterService().getCredential());try (Response response = builder.get()) {KubernetesHelper.checkStatus(response);try (var is = response.readEntity(InputStream.class)) {- if (is.read() == 1) {+ var cacheAvailability = CacheAvailability.values()[is.read()];+ if (cacheAvailability != CacheAvailability.NOT_FOUND)untar(cacheDirs, is);- return true;- } else {- return false;- }+ return cacheAvailability;} catch (IOException e) {throw new RuntimeException(e);}@@ -89,16 +86,17 @@ public class ServerCacheHelper extends CacheHelper {}}} else {- return false;+ return CacheAvailability.NOT_FOUND;}}@Overrideprotected boolean uploadCache(SetupCacheFacade cacheConfig, List<File> cacheDirs) {- var cacheKey = cacheConfig.getKey();+ var key = cacheConfig.getKey();+ var checksum = cacheConfig.getChecksum();var projectPath = cacheConfig.getUploadProjectPath();var accessTokenValue = cacheConfig.getUploadAccessToken();- var cachePaths = cacheConfig.getPaths();+ var cachePathsString = cacheConfig.getPathsAsString();var projectId = getSessionService().call(() -> {Project project;if (projectPath != null) {@@ -119,10 +117,10 @@ public class ServerCacheHelper extends CacheHelper {});if (projectId != null) {- Long cacheId = getCacheService().getCacheIdForUpload(projectId, cacheKey);+ Long cacheId = getCacheService().createCache(projectId, key, checksum);var activeServer = getProjectService().getActiveServer(projectId, true);if (activeServer.equals(getClusterService().getLocalServerAddress())) {- getCacheService().uploadCache(projectId, cacheId, cachePaths, os -> tar(cacheDirs, os));+ getCacheService().uploadCache(projectId, cacheId, cachePathsString, os -> tar(cacheDirs, os));} else {Client client = ClientBuilder.newClient();client.property(ClientProperties.REQUEST_ENTITY_PROCESSING, "CHUNKED");@@ -132,7 +130,7 @@ public class ServerCacheHelper extends CacheHelper {.path("~api/cluster/cache").queryParam("projectId", projectId).queryParam("cacheId", cacheId)- .queryParam("cachePaths", Joiner.on('\n').join(cachePaths));+ .queryParam("cachePathsString", cachePathsString);Invocation.Builder builder = target.request();builder.header(HttpHeaders.AUTHORIZATION,KubernetesHelper.BEARER + " " + getClusterService().getCredential());@@ -166,8 +164,8 @@ public class ServerCacheHelper extends CacheHelper {return OneDev.getInstance(AccessTokenService.class);}- private JobCacheService getCacheService() {- return OneDev.getInstance(JobCacheService.class);+ private RunCacheService getCacheService() {+ return OneDev.getInstance(RunCacheService.class);}}diff --git a/server-core/src/main/java/io/onedev/server/job/log/LogListener.java b/server-core/src/main/java/io/onedev/server/job/log/LogListener.javadeleted file mode 100644index 5f63dbbd26..0000000000--- a/server-core/src/main/java/io/onedev/server/job/log/LogListener.java+++ /dev/null@@ -1,7 +0,0 @@-package io.onedev.server.job.log;--public interface LogListener {-- void logged(Long buildId);--}diff --git a/server-core/src/main/java/io/onedev/server/logging/BuildLoggingIdentity.java b/server-core/src/main/java/io/onedev/server/logging/BuildLoggingIdentity.javanew file mode 100644index 0000000000..eebe32ed38--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/logging/BuildLoggingIdentity.java@@ -0,0 +1,43 @@+package io.onedev.server.logging;++import java.io.File;++import io.onedev.server.model.Build;++public class BuildLoggingIdentity implements LoggingIdentity {++ private static final long serialVersionUID = 1L;++ private final Long projectId;++ private final Long buildNumber;++ public BuildLoggingIdentity(Long projectId, Long buildNumber) {+ this.projectId = projectId;+ this.buildNumber = buildNumber;+ }++ public Long getProjectId() {+ return projectId;+ }++ public Long getBuildNumber() {+ return buildNumber;+ }++ @Override+ public File getFile() {+ return Build.getLogFile(projectId, buildNumber);+ }++ @Override+ public String getLockName() {+ return Build.getLogLockName(projectId, buildNumber);+ }++ @Override+ public String getCacheKey() {+ return "build-log:" + projectId + ":" + buildNumber;+ }++}\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/logging/BuildLoggingSupport.java b/server-core/src/main/java/io/onedev/server/logging/BuildLoggingSupport.javanew file mode 100644index 0000000000..357f1d1661--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/logging/BuildLoggingSupport.java@@ -0,0 +1,123 @@+package io.onedev.server.logging;++import java.util.Collection;+import java.util.Date;+import java.util.List;+import java.util.Map;+import java.util.Set;++import org.apache.commons.lang3.StringUtils;+import org.jspecify.annotations.Nullable;++import io.onedev.server.OneDev;+import io.onedev.server.buildspec.job.log.instruction.LogInstruction;+import io.onedev.server.cluster.ClusterTask;+import io.onedev.server.event.ListenerRegistry;+import io.onedev.server.event.project.build.BuildUpdated;+import io.onedev.server.model.Build;+import io.onedev.server.service.BuildService;+import io.onedev.server.service.ProjectService;++public class BuildLoggingSupport implements LoggingSupport {++ private static final long serialVersionUID = 1L;++ private final BuildLoggingIdentity identity;++ private final Long buildId;++ private final Collection<String> maskSecrets;++ public BuildLoggingSupport(Build build) {+ identity = new BuildLoggingIdentity(build.getProject().getId(), build.getNumber());+ buildId = build.getId();+ maskSecrets = build.getMaskSecrets();+ }++ @Override+ public LoggingIdentity getIdentity() {+ return identity;+ }++ public Long getBuildId() {+ return buildId;+ }++ @Override+ public Collection<String> getMaskSecrets() {+ return maskSecrets;+ }++ @Override+ public String getChangeObservable() {+ return Build.getLogChangeObservable(buildId);+ }++ private ListenerRegistry getListenerRegistry() {+ return OneDev.getInstance(ListenerRegistry.class);+ }++ private ProjectService getProjectService() {+ return OneDev.getInstance(ProjectService.class);+ }++ private Build getBuild() {+ return OneDev.getInstance(BuildService.class).load(buildId);+ }++ @Override+ public Collection<LogInstruction> getInstructions() {+ return Set.of(+ new LogInstruction() {++ @Override+ public String getName() {+ return "SetBuildVersion";+ }++ @Override+ public void execute(Map<String, List<String>> params) {+ String version = params.values().iterator().next().iterator().next();+ var build = getBuild();+ if (StringUtils.isNotBlank(version))+ build.setVersion(version);+ else+ build.setVersion(null);+ getListenerRegistry().post(new BuildUpdated(build));+ }++ },+ new LogInstruction() {++ @Override+ public String getName() {+ return "PauseExecution";+ }++ @Override+ public void execute(Map<String, List<String>> params) {+ var build = getBuild();+ build.setPaused(true);+ getListenerRegistry().post(new BuildUpdated(build));+ }++ }+ );+ }++ @Override+ public <T> T runOnActiveServer(ClusterTask<T> task) {+ return getProjectService().runOnActiveServer(identity.getProjectId(), task);+ }++ @Override+ public void fileModified() {+ getProjectService().directoryModified(identity.getProjectId(), identity.getFile().getParentFile());+ }++ @Override+ public @Nullable Date getEffectiveDate() {+ return getBuild().getRetryDate();+ }++}\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/job/log/DefaultLogService.java b/server-core/src/main/java/io/onedev/server/logging/DefaultLogService.javasimilarity index 74%rename from server-core/src/main/java/io/onedev/server/job/log/DefaultLogService.javarename to server-core/src/main/java/io/onedev/server/logging/DefaultLogService.javaindex 03ce2dc8f9..2bea8333e9 100644--- a/server-core/src/main/java/io/onedev/server/job/log/DefaultLogService.java+++ b/server-core/src/main/java/io/onedev/server/logging/DefaultLogService.java@@ -1,9 +1,8 @@-package io.onedev.server.job.log;+package io.onedev.server.logging;import static io.onedev.commons.utils.LockUtils.getReadWriteLock;import static io.onedev.commons.utils.LockUtils.read;import static io.onedev.commons.utils.LockUtils.write;-import static io.onedev.server.model.Build.getLogLockName;import static io.onedev.server.util.IOUtils.BUFFER_SIZE;import java.io.BufferedInputStream;@@ -20,11 +19,11 @@ import java.io.ObjectStreamException;import java.io.Serializable;import java.nio.charset.StandardCharsets;import java.util.ArrayList;-import java.util.Collection;import java.util.HashMap;import java.util.List;import java.util.Map;import java.util.concurrent.ConcurrentHashMap;+import java.util.concurrent.atomic.AtomicReference;import java.util.concurrent.locks.Lock;import java.util.concurrent.locks.ReadWriteLock;import java.util.concurrent.locks.ReentrantReadWriteLock;@@ -50,14 +49,9 @@ import io.onedev.server.buildspec.job.log.instruction.LogInstructionParser.Paramimport io.onedev.server.buildspecmodel.inputspec.SecretInput;import io.onedev.server.cluster.ClusterService;import io.onedev.server.cluster.ClusterTask;-import io.onedev.server.event.Listen;-import io.onedev.server.event.project.build.BuildFinished;-import io.onedev.server.model.Build;import io.onedev.server.model.Project;+import io.onedev.server.persistence.SessionService;import io.onedev.server.persistence.TransactionService;-import io.onedev.server.persistence.annotation.Sessional;-import io.onedev.server.service.BuildService;-import io.onedev.server.service.ProjectService;import io.onedev.server.web.websocket.WebSocketService;@Singleton@@ -72,12 +66,6 @@ public class DefaultLogService implements LogService, Serializable {@Injectprivate WebSocketService webSocketService;- @Inject- private ProjectService projectService;-- @Inject- private BuildService buildService;-@Injectprivate ClusterService clusterService;@@ -86,7 +74,7 @@ public class DefaultLogService implements LogService, Serializable {private final Map<String, LogSnippet> recentSnippets = new ConcurrentHashMap<>();- private final Map<String, TaskLogger> jobLoggers = new ConcurrentHashMap<>();+ private final Map<String, TaskLogger> loggers = new ConcurrentHashMap<>();private final ReadWriteLock logListenersLock = new ReentrantReadWriteLock();@@ -96,41 +84,41 @@ public class DefaultLogService implements LogService, Serializable {return new ManagedSerializedForm(LogService.class);}- private void notifyListeners(Long buildId) {+ private void notifyListeners(LoggingSupport loggingSupport) {clusterService.submitToAllServers(() -> {- var lock = logListenersLock.readLock();- lock.lock();try {- for (var logListener: logListeners)- logListener.logged(buildId);- } finally {- lock.unlock();+ var lock = logListenersLock.readLock();+ lock.lock();+ try {+ for (var logListener: logListeners)+ logListener.logged(loggingSupport);+ } finally {+ lock.unlock();+ }+ } catch (Throwable t) {+ logger.error("Error notifying log listeners", t);}return null;});}@Override- public TaskLogger newLogger(Build build) {- Long projectId = build.getProject().getId();- Long buildId = build.getId();- Long buildNumber = build.getNumber();- Collection<String> secretsToMask = build.getMaskSecrets();+ public TaskLogger newLogger(LoggingSupport loggingSupport) {return new TaskLogger() {private final Map<String, StyleBuilder> styleBuilders = new ConcurrentHashMap<>();private void doLog(String message, StyleBuilder styleBuilder) {message = Project.decodeFullRepoNameAsPath(message);- for (String maskSecret: secretsToMask)+ for (String maskSecret: loggingSupport.getMaskSecrets())message = StringUtils.replace(message, maskSecret, SecretInput.MASK);String maskedMessage = message;- write(getLogLockName(projectId, buildNumber), () -> {- String logKey = getLogKey(projectId, buildNumber);+ write(loggingSupport.getIdentity().getLockName(), () -> {+ String logKey = loggingSupport.getIdentity().getCacheKey();LogSnippet snippet = recentSnippets.get(logKey);if (snippet == null) {- File logFile = Build.getLogFile(projectId, buildNumber);+ File logFile = loggingSupport.getIdentity().getFile();if (!logFile.exists()) {snippet = new LogSnippet();recentSnippets.put(logKey, snippet);@@ -142,11 +130,11 @@ public class DefaultLogService implements LogService, Serializable {snippet.entries.add(JobLogEntryEx.parse(maskedMessage, styleBuilder));entryAdded = true;} catch (Exception e) {- logger.error("Failed to parse job log message: " + maskedMessage, e);+ logger.error("Failed to parse log message: " + maskedMessage, e);}if (entryAdded) {if (snippet.entries.size() > MAX_CACHE_ENTRIES) {- File logFile = Build.getLogFile(projectId, buildNumber);+ File logFile = loggingSupport.getIdentity().getFile();try (ObjectOutputStream oos = newOutputStream(logFile)) {while (snippet.entries.size() > MIN_CACHE_ENTRIES) {writeLogEntry(oos, snippet.entries.remove(0));@@ -156,8 +144,8 @@ public class DefaultLogService implements LogService, Serializable {throw new RuntimeException(e);}}- webSocketService.notifyObservableChange(Build.getLogChangeObservable(buildId), null);- notifyListeners(buildId);+ webSocketService.notifyObservableChange(loggingSupport.getChangeObservable(), null);+ notifyListeners(loggingSupport);}}return null;@@ -184,15 +172,15 @@ public class DefaultLogService implements LogService, Serializable {InstructionContext instructionContext = LogInstruction.parse(normalizedMessage);String name = instructionContext.Identifier().getText();- LogInstruction instruction = null;- for (LogInstruction extension: OneDev.getExtensions(LogInstruction.class)) {- if (extension.getName().equals(name)) {- instruction = extension;+ AtomicReference<LogInstruction> instructionRef = new AtomicReference<>(null);+ for (LogInstruction instruction: loggingSupport.getInstructions()) {+ if (instruction.getName().equals(name)) {+ instructionRef.set(instruction);break;}}- if (instruction != null) {+ if (instructionRef.get() != null) {Map<String, List<String>> params = new HashMap<>();for (ParamContext paramContext: instructionContext.param()) {String paramName;@@ -205,7 +193,9 @@ public class DefaultLogService implements LogService, Serializable {paramValues.add(LogInstruction.getValue(terminalNode));params.put(paramName, paramValues);}- doInSession(instruction, buildId, params, this);+ OneDev.getInstance(SessionService.class).run(() -> {+ instructionRef.get().execute(params);+ });} else {doLog("Unsupported log instruction: " + name, new StyleBuilder());}@@ -223,33 +213,27 @@ public class DefaultLogService implements LogService, Serializable {};}- @Sessional- protected void doInSession(LogInstruction instruction, Long buildId,- Map<String, List<String>> params, TaskLogger logger) {- instruction.execute(buildService.load(buildId), params, logger);- }-@Override- public boolean matches(Build build, Pattern pattern) {- String key = getLogKey(build.getProject().getId(), build.getNumber());- return read(build.getLogLockName(), () -> {+ public boolean matches(LoggingSupport loggingSupport, Pattern pattern) {+ String key = loggingSupport.getIdentity().getCacheKey();+ return read(loggingSupport.getIdentity().getLockName(), () -> {LogSnippet snippet = recentSnippets.get(key);if (snippet != null) {for (JobLogEntryEx entry: snippet.entries) {- if ((build.getRetryDate() == null || !entry.getDate().before(build.getRetryDate()))+ if ((loggingSupport.getEffectiveDate() == null || !entry.getDate().before(loggingSupport.getEffectiveDate()))&& pattern.matcher(entry.getMessageText()).find()) {return true;}}}- File logFile = build.getLogFile();+ File logFile = loggingSupport.getIdentity().getFile();if (logFile.exists()) {try (ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(new FileInputStream(logFile)))) {while (true) {JobLogEntry entry = (JobLogEntry) ois.readObject();- if ((build.getRetryDate() == null || !entry.getDate().before(build.getRetryDate()))+ if ((loggingSupport.getEffectiveDate() == null || !entry.getDate().before(loggingSupport.getEffectiveDate()))&& pattern.matcher(entry.getMessage()).find()) {return true;}@@ -301,7 +285,7 @@ public class DefaultLogService implements LogService, Serializable {}private LogSnippet readLogSnippetReversely(File logFile, int count) {- LogSnippet snippet = new LogSnippet();+ var snippet = new LogSnippet();if (logFile.exists()) {try (ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(new FileInputStream(logFile)))) {while (true) {@@ -331,16 +315,16 @@ public class DefaultLogService implements LogService, Serializable {}@Override- public List<JobLogEntryEx> readLogEntries(Long projectId, Long buildNumber, int from, int count) {- return projectService.runOnActiveServer(projectId, new ClusterTask<>() {+ public List<JobLogEntryEx> readLogEntries(LoggingSupport loggingSupport, int from, int count) {+ return loggingSupport.runOnActiveServer(new ClusterTask<>() {private static final long serialVersionUID = 1L;@Overridepublic List<JobLogEntryEx> call() {- return read(getLogLockName(projectId, buildNumber), () -> {- File logFile = Build.getLogFile(projectId, buildNumber);- LogSnippet snippet = recentSnippets.get(getLogKey(projectId, buildNumber));+ return read(loggingSupport.getIdentity().getLockName(), () -> {+ File logFile = loggingSupport.getIdentity().getFile();+ LogSnippet snippet = recentSnippets.get(loggingSupport.getIdentity().getCacheKey());if (snippet != null) {if (from >= snippet.offset) {return readLogEntries(snippet.entries, from - snippet.offset, count);@@ -362,18 +346,18 @@ public class DefaultLogService implements LogService, Serializable {}@Override- public LogSnippet readLogSnippetReversely(Long projectId, Long buildNumber, int count) {- return projectService.runOnActiveServer(projectId, new ClusterTask<>() {+ public LogSnippet readLogSnippetReversely(LoggingSupport loggingSupport, int count) {+ return loggingSupport.runOnActiveServer(new ClusterTask<>() {private static final long serialVersionUID = 1L;@Overridepublic LogSnippet call() {- return read(getLogLockName(projectId, buildNumber), () -> {- File logFile = Build.getLogFile(projectId, buildNumber);- LogSnippet recentSnippet = recentSnippets.get(getLogKey(projectId, buildNumber));+ return read(loggingSupport.getIdentity().getLockName(), () -> {+ File logFile = loggingSupport.getIdentity().getFile();+ LogSnippet recentSnippet = recentSnippets.get(loggingSupport.getIdentity().getCacheKey());if (recentSnippet != null) {- LogSnippet snippet = new LogSnippet();+ var snippet = new LogSnippet();if (count <= recentSnippet.entries.size()) {snippet.entries.addAll(recentSnippet.entries.subList(recentSnippet.entries.size() - count, recentSnippet.entries.size()));@@ -411,35 +395,28 @@ public class DefaultLogService implements LogService, Serializable {}}- @Sessional- @Listen- public void on(BuildFinished event) {- Build build = event.getBuild();- Long projectId = build.getProject().getId();- write(build.getLogLockName(), () -> {- LogSnippet snippet = recentSnippets.remove(getLogKey(projectId, build.getNumber()));+ @Override+ public void flush(LoggingSupport loggingSupport) {+ write(loggingSupport.getIdentity().getLockName(), () -> {+ LogSnippet snippet = recentSnippets.remove(loggingSupport.getIdentity().getCacheKey());if (snippet != null) {- File logFile = build.getLogFile();+ File logFile = loggingSupport.getIdentity().getFile();try (ObjectOutputStream oos = newOutputStream(logFile)) {for (JobLogEntryEx entry: snippet.entries)writeLogEntry(oos, entry);} catch (IOException e) {throw new RuntimeException(e);}- projectService.directoryModified(projectId, logFile.getParentFile());+ loggingSupport.fileModified();}return null;});- transactionService.runAfterCommit(() -> notifyListeners(build.getId()));+ transactionService.runAfterCommit(() -> notifyListeners(loggingSupport));}- private String getLogKey(Long projectId, Long buildNumber) {- return projectId + ":" + buildNumber;- }-@Override- public InputStream openLogStream(Long projectId, Long buildNumber) {- return new LogStream(projectId, buildNumber);+ public InputStream openLogStream(LoggingIdentity loggingIdentity) {+ return new LogStream(loggingIdentity);}class LogStream extends InputStream {@@ -454,16 +431,16 @@ public class DefaultLogService implements LogService, Serializable {private int pos = 0;- public LogStream(Long projectId, Long buildNumber) {- lock = getReadWriteLock(getLogLockName(projectId, buildNumber)).readLock();+ public LogStream(LoggingIdentity loggingIdentity) {+ lock = getReadWriteLock(loggingIdentity.getLockName()).readLock();lock.lock();try {- File logFile = Build.getLogFile(projectId, buildNumber);+ File logFile = loggingIdentity.getFile();if (logFile.exists())ois = new ObjectInputStream(new BufferedInputStream(new FileInputStream(logFile)));- LogSnippet snippet = recentSnippets.get(getLogKey(projectId, buildNumber));+ LogSnippet snippet = recentSnippets.get(loggingIdentity.getCacheKey());if (snippet != null) {StringBuilder builder = new StringBuilder();for (JobLogEntryEx entry: snippet.entries)@@ -542,17 +519,18 @@ public class DefaultLogService implements LogService, Serializable {}@Override- public TaskLogger getJobLogger(String jobToken) {- return jobLoggers.get(jobToken);+ public TaskLogger getLogger(String token) {+ return loggers.get(token);}@Override- public void addJobLogger(String jobToken, TaskLogger logger) {- jobLoggers.put(jobToken, logger);+ public void addLogger(String token, TaskLogger logger) {+ loggers.put(token, logger);}@Override- public void removeJobLogger(String jobToken) {- jobLoggers.remove(jobToken);+ public void removeLogger(String token) {+ loggers.remove(token);}+}diff --git a/server-core/src/main/java/io/onedev/server/logging/LogListener.java b/server-core/src/main/java/io/onedev/server/logging/LogListener.javanew file mode 100644index 0000000000..59bfb041aa--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/logging/LogListener.java@@ -0,0 +1,7 @@+package io.onedev.server.logging;++public interface LogListener {++ void logged(LoggingSupport loggingSupport);++}diff --git a/server-core/src/main/java/io/onedev/server/job/log/LogService.java b/server-core/src/main/java/io/onedev/server/logging/LogService.javasimilarity index 51%rename from server-core/src/main/java/io/onedev/server/job/log/LogService.javarename to server-core/src/main/java/io/onedev/server/logging/LogService.javaindex b0efece9f3..cf6b81ba8e 100644--- a/server-core/src/main/java/io/onedev/server/job/log/LogService.java+++ b/server-core/src/main/java/io/onedev/server/logging/LogService.java@@ -1,4 +1,4 @@-package io.onedev.server.job.log;+package io.onedev.server.logging;import java.io.InputStream;import java.util.List;@@ -8,17 +8,14 @@ import org.jspecify.annotations.Nullable;import io.onedev.commons.utils.TaskLogger;import io.onedev.server.buildspec.job.log.JobLogEntryEx;-import io.onedev.server.model.Build;public interface LogService {- TaskLogger newLogger(Build build);+ TaskLogger newLogger(LoggingSupport loggingSupport);/**- * Read specified number of log entries from specified build, starting from specified index+ * Read specified number of log entries from specified index*- * @param build- * build to read log entries from* @param offset* index of the log entry to start read* @param count@@ -28,34 +25,32 @@ public interface LogService {* log entries. Number of entries may be less than required count if there is no* enough log entries*/- List<JobLogEntryEx> readLogEntries(Long projectId, Long buildNumber, int offset, int count);+ List<JobLogEntryEx> readLogEntries(LoggingSupport loggingSupport, int offset, int count);void registerListener(LogListener listener);- void deregisterListener(LogListener logListener);+ void deregisterListener(LogListener listener);- boolean matches(Build build, Pattern pattern);+ boolean matches(LoggingSupport loggingSupport, Pattern pattern);+ void flush(LoggingSupport loggingSupport);+/*** Read specified number of log entries starting from end of the log*- * @param build- * build to read log entries from- * @param count- * number of log entries to read* @return* log entries with normal order. Number of entries may be less than required count* if there is no enough log entries*/- LogSnippet readLogSnippetReversely(Long projectId, Long buildNumber, int count);+ LogSnippet readLogSnippetReversely(LoggingSupport loggingSupport, int count);- InputStream openLogStream(Long projectId, Long buildNumber);+ InputStream openLogStream(LoggingIdentity loggingIdentity);@Nullable- TaskLogger getJobLogger(String jobToken);+ TaskLogger getLogger(String token);- void addJobLogger(String jobToken, TaskLogger logger);+ void addLogger(String token, TaskLogger logger);- void removeJobLogger(String jobToken);+ void removeLogger(String token);}diff --git a/server-core/src/main/java/io/onedev/server/job/log/LogSnippet.java b/server-core/src/main/java/io/onedev/server/logging/LogSnippet.javasimilarity index 91%rename from server-core/src/main/java/io/onedev/server/job/log/LogSnippet.javarename to server-core/src/main/java/io/onedev/server/logging/LogSnippet.javaindex c862cd111b..bb01df837f 100644--- a/server-core/src/main/java/io/onedev/server/job/log/LogSnippet.java+++ b/server-core/src/main/java/io/onedev/server/logging/LogSnippet.java@@ -1,4 +1,4 @@-package io.onedev.server.job.log;+package io.onedev.server.logging;import java.io.Serializable;import java.util.LinkedList;@@ -9,7 +9,7 @@ import io.onedev.server.buildspec.job.log.JobLogEntryEx;public class LogSnippet implements Serializable {private static final long serialVersionUID = 1L;-+public List<JobLogEntryEx> entries = new LinkedList<>();/**diff --git a/server-core/src/main/java/io/onedev/server/job/log/LogTask.java b/server-core/src/main/java/io/onedev/server/logging/LogTask.javasimilarity index 60%rename from server-core/src/main/java/io/onedev/server/job/log/LogTask.javarename to server-core/src/main/java/io/onedev/server/logging/LogTask.javaindex d424626b04..8960bd8e6b 100644--- a/server-core/src/main/java/io/onedev/server/job/log/LogTask.java+++ b/server-core/src/main/java/io/onedev/server/logging/LogTask.java@@ -1,4 +1,4 @@-package io.onedev.server.job.log;+package io.onedev.server.logging;import org.jspecify.annotations.Nullable;@@ -10,22 +10,22 @@ public class LogTask implements ClusterTask<Void> {private static final long serialVersionUID = 1L;- private final String jobToken;+ private final String token;private final String message;private final String sessionId;- public LogTask(String jobToken, String message, @Nullable String sessionId) {- this.jobToken = jobToken;+ public LogTask(String token, String message, @Nullable String sessionId) {+ this.token = token;this.message = message;this.sessionId = sessionId;}@Overridepublic Void call() {- TaskLogger logger = OneDev.getInstance(LogService.class).getJobLogger(jobToken);- if (logger != null && !(logger instanceof ServerJobLogger))+ TaskLogger logger = OneDev.getInstance(LogService.class).getLogger(token);+ if (logger != null && !(logger instanceof ServerLogger))logger.log(message, sessionId);return null;}diff --git a/server-core/src/main/java/io/onedev/server/logging/LoggingIdentity.java b/server-core/src/main/java/io/onedev/server/logging/LoggingIdentity.javanew file mode 100644index 0000000000..3f1bda2d45--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/logging/LoggingIdentity.java@@ -0,0 +1,14 @@+package io.onedev.server.logging;++import java.io.File;+import java.io.Serializable;++public interface LoggingIdentity extends Serializable {++ File getFile();++ String getCacheKey();++ String getLockName();++}\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/logging/LoggingSupport.java b/server-core/src/main/java/io/onedev/server/logging/LoggingSupport.javanew file mode 100644index 0000000000..557dc2137a--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/logging/LoggingSupport.java@@ -0,0 +1,29 @@+package io.onedev.server.logging;++import java.io.Serializable;+import java.util.Collection;+import java.util.Date;++import org.jspecify.annotations.Nullable;++import io.onedev.server.buildspec.job.log.instruction.LogInstruction;+import io.onedev.server.cluster.ClusterTask;++public interface LoggingSupport extends Serializable {++ LoggingIdentity getIdentity();++ Collection<String> getMaskSecrets();++ String getChangeObservable();++ Collection<LogInstruction> getInstructions();++ <T> T runOnActiveServer(ClusterTask<T> task);++ void fileModified();++ @Nullable+ Date getEffectiveDate();++}diff --git a/server-core/src/main/java/io/onedev/server/job/log/ServerJobLogger.java b/server-core/src/main/java/io/onedev/server/logging/ServerLogger.javasimilarity index 57%rename from server-core/src/main/java/io/onedev/server/job/log/ServerJobLogger.javarename to server-core/src/main/java/io/onedev/server/logging/ServerLogger.javaindex 01f96e8746..b9551e8167 100644--- a/server-core/src/main/java/io/onedev/server/job/log/ServerJobLogger.java+++ b/server-core/src/main/java/io/onedev/server/logging/ServerLogger.java@@ -1,25 +1,25 @@-package io.onedev.server.job.log;+package io.onedev.server.logging;import io.onedev.commons.utils.TaskLogger;import io.onedev.server.OneDev;import io.onedev.server.cluster.ClusterService;import org.jetbrains.annotations.Nullable;-public class ServerJobLogger extends TaskLogger {+public class ServerLogger extends TaskLogger {private final String server;- private final String jobToken;+ private final String token;- public ServerJobLogger(String server, String jobToken) {+ public ServerLogger(String server, String token) {this.server = server;- this.jobToken = jobToken;+ this.token = token;}@Overridepublic void log(String message, @Nullable String sessionId) {var clusterService = OneDev.getInstance(ClusterService.class);- clusterService.runOnServer(server, new LogTask(jobToken, message, sessionId));+ clusterService.runOnServer(server, new LogTask(token, message, sessionId));}}diff --git a/server-core/src/main/java/io/onedev/server/job/log/StyleBuilder.java b/server-core/src/main/java/io/onedev/server/logging/StyleBuilder.javasimilarity index 96%rename from server-core/src/main/java/io/onedev/server/job/log/StyleBuilder.javarename to server-core/src/main/java/io/onedev/server/logging/StyleBuilder.javaindex cc68a1f325..50e9336766 100644--- a/server-core/src/main/java/io/onedev/server/job/log/StyleBuilder.java+++ b/server-core/src/main/java/io/onedev/server/logging/StyleBuilder.java@@ -1,4 +1,4 @@-package io.onedev.server.job.log;+package io.onedev.server.logging;import java.io.Serializable;diff --git a/server-core/src/main/java/io/onedev/server/logging/WorkspaceLoggingIdentity.java b/server-core/src/main/java/io/onedev/server/logging/WorkspaceLoggingIdentity.javanew file mode 100644index 0000000000..3720d0a714--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/logging/WorkspaceLoggingIdentity.java@@ -0,0 +1,43 @@+package io.onedev.server.logging;++import java.io.File;++import io.onedev.server.model.Workspace;++public class WorkspaceLoggingIdentity implements LoggingIdentity {++ private static final long serialVersionUID = 1L;++ private final Long projectId;++ private final Long workspaceNumber;++ public WorkspaceLoggingIdentity(Long projectId, Long workspaceNumber) {+ this.projectId = projectId;+ this.workspaceNumber = workspaceNumber;+ }++ public Long getProjectId() {+ return projectId;+ }++ public Long getWorkspaceNumber() {+ return workspaceNumber;+ }++ @Override+ public File getFile() {+ return Workspace.getLogFile(projectId, workspaceNumber);+ }++ @Override+ public String getLockName() {+ return Workspace.getLogLockName(projectId, workspaceNumber);+ }++ @Override+ public String getCacheKey() {+ return "workspace-log:" + projectId + ":" + workspaceNumber;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/logging/WorkspaceLoggingSupport.java b/server-core/src/main/java/io/onedev/server/logging/WorkspaceLoggingSupport.javanew file mode 100644index 0000000000..0ac41b438b--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/logging/WorkspaceLoggingSupport.java@@ -0,0 +1,72 @@+package io.onedev.server.logging;++import java.util.Collection;+import java.util.Date;+import java.util.Set;++import org.jspecify.annotations.Nullable;++import io.onedev.server.OneDev;+import io.onedev.server.buildspec.job.log.instruction.LogInstruction;+import io.onedev.server.cluster.ClusterTask;+import io.onedev.server.model.Workspace;+import io.onedev.server.service.ProjectService;++public class WorkspaceLoggingSupport implements LoggingSupport {++ private static final long serialVersionUID = 1L;++ private final WorkspaceLoggingIdentity identity;++ private final Long workspaceId;++ public WorkspaceLoggingSupport(Workspace workspace) {+ identity = new WorkspaceLoggingIdentity(workspace.getProject().getId(), workspace.getNumber());+ workspaceId = workspace.getId();+ }++ @Override+ public LoggingIdentity getIdentity() {+ return identity;+ }++ public Long getWorkspaceId() {+ return workspaceId;+ }++ @Override+ public Collection<String> getMaskSecrets() {+ return Set.of();+ }++ @Override+ public String getChangeObservable() {+ return Workspace.getLogChangeObservable(workspaceId);+ }++ @Override+ public Collection<LogInstruction> getInstructions() {+ return Set.of();+ }++ private ProjectService getProjectService() {+ return OneDev.getInstance(ProjectService.class);+ }++ @Override+ public <T> T runOnActiveServer(ClusterTask<T> task) {+ return getProjectService().runOnActiveServer(identity.getProjectId(), task);+ }++ @Override+ public void fileModified() {+ getProjectService().directoryModified(identity.getProjectId(), identity.getFile().getParentFile());+ }++ @Override+ @Nullable+ public Date getEffectiveDate() {+ return null;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/markdown/ReferenceProcessor.java b/server-core/src/main/java/io/onedev/server/markdown/ReferenceProcessor.javaindex 3bd4b57872..8efb3db317 100644--- a/server-core/src/main/java/io/onedev/server/markdown/ReferenceProcessor.java+++ b/server-core/src/main/java/io/onedev/server/markdown/ReferenceProcessor.java@@ -12,12 +12,14 @@ import io.onedev.server.OneDev;import io.onedev.server.service.BuildService;import io.onedev.server.service.UrlService;import io.onedev.server.entityreference.BuildReference;+import io.onedev.server.entityreference.WorkspaceReference;import io.onedev.server.entityreference.IssueReference;import io.onedev.server.entityreference.PullRequestReference;import io.onedev.server.model.Project;import io.onedev.server.web.component.markdown.SuggestionSupport;import io.onedev.server.web.page.project.blob.render.BlobRenderContext;import io.onedev.server.web.page.project.builds.detail.dashboard.BuildDashboardPage;+import io.onedev.server.web.page.project.workspaces.detail.dashboard.WorkspaceDashboardPage;import io.onedev.server.web.page.project.issues.detail.IssueActivitiesPage;import io.onedev.server.web.page.project.pullrequests.detail.activities.PullRequestActivitiesPage;@@ -57,6 +59,14 @@ public class ReferenceProcessor implements HtmlProcessor {url = OneDev.getInstance(UrlService.class).urlForPullRequest(reference.getProject(), reference.getNumber(), true);return String.format("<a href='%s' class='pull-request reference' data-reference='%s'>%s</a>",url, reference, text);+ } else if (reference instanceof WorkspaceReference) {+ String url;+ if (RequestCycle.get() != null)+ url = RequestCycle.get().urlFor(WorkspaceDashboardPage.class, WorkspaceDashboardPage.paramsOf(reference.getProject(), reference.getNumber())).toString();+ else+ url = OneDev.getInstance(UrlService.class).urlForWorkspace(reference.getProject(), reference.getNumber(), true);+ return String.format("<a href='%s' class='workspace reference' data-reference='%s'>%s</a>",+ url, reference, text);} else {return text;}diff --git a/server-core/src/main/java/io/onedev/server/model/Agent.java b/server-core/src/main/java/io/onedev/server/model/Agent.javaindex 225c956127..a9bc57bc13 100644--- a/server-core/src/main/java/io/onedev/server/model/Agent.java+++ b/server-core/src/main/java/io/onedev/server/model/Agent.java@@ -39,8 +39,8 @@ import io.onedev.agent.AgentData;import io.onedev.k8shelper.OsInfo;import io.onedev.server.OneDev;import io.onedev.server.cluster.ClusterService;-import io.onedev.server.service.AgentService;import io.onedev.server.search.entity.SortField;+import io.onedev.server.service.AgentService;@Entity@Table(indexes={@@ -108,7 +108,7 @@ public class Agent extends AbstractEntity {@OneToMany(mappedBy="agent")private Collection<Build> builds = new ArrayList<>();-+@Column(nullable=false)private String name;diff --git a/server-core/src/main/java/io/onedev/server/model/Build.java b/server-core/src/main/java/io/onedev/server/model/Build.javaindex dc4fb7278c..0013730c1f 100644--- a/server-core/src/main/java/io/onedev/server/model/Build.java+++ b/server-core/src/main/java/io/onedev/server/model/Build.java@@ -85,6 +85,8 @@ import io.onedev.server.entityreference.EntityReference;import io.onedev.server.git.GitUtils;import io.onedev.server.git.service.GitService;import io.onedev.server.job.JobAuthorizationContext;+import io.onedev.server.logging.BuildLoggingSupport;+import io.onedev.server.logging.LoggingSupport;import io.onedev.server.model.support.BuildMetric;import io.onedev.server.model.support.LabelSupport;import io.onedev.server.model.support.ProjectBelonging;@@ -373,10 +375,10 @@ public class Build extends ProjectBelonging@JsonIgnore@Column(nullable=false)- private String jobToken;+ private String token;@Column- private String workspacePath;+ private String workDirPath;@Lob@Column(nullable=false)@@ -529,21 +531,21 @@ public class Build extends ProjectBelongingthis.jobName = jobName;}- public String getJobToken() {- return jobToken;+ public String getToken() {+ return token;}- public void setJobToken(String jobToken) {- this.jobToken = jobToken;+ public void setToken(String token) {+ this.token = token;}@Nullable- public String getWorkspacePath() {- return workspacePath;+ public String getWorkDirPath() {+ return workDirPath;}- public void setWorkspacePath(String workspacePath) {- this.workspacePath = workspacePath;+ public void setWorkDirPath(String workDirPath) {+ this.workDirPath = workDirPath;}public Collection<String> getCheckoutPaths() {@@ -921,7 +923,7 @@ public class Build extends ProjectBelongingpublic Collection<String> getMaskSecrets() {Collection<String> maskSecrets = new HashSet<>();- maskSecrets.add(getJobToken());+ maskSecrets.add(getToken());maskSecrets.add(OneDev.getInstance(ClusterService.class).getCredential());for (JobSecret secret: getProject().getHierarchyJobSecrets())@@ -1024,7 +1026,7 @@ public class Build extends ProjectBelonging}public static String getDetailChangeObservable(Long buildId) {- return Build.class.getName() + ":" + buildId;+ return "build:" + buildId;}public static String getCommitStatusChangeObservable(Long projectId, String commitHash) {@@ -1123,8 +1125,8 @@ public class Build extends ProjectBelonging@Nullablepublic String getBlobPath(String filePath) {- if (FilenameUtils.getPrefix(filePath).length() == 0 && workspacePath != null)- filePath = workspacePath + "/" + filePath;+ if (FilenameUtils.getPrefix(filePath).length() == 0 && workDirPath != null)+ filePath = workDirPath + "/" + filePath;filePath = filePath.replace('\\', '/');filePath = Paths.get(filePath).normalize().toString();filePath = filePath.replace('\\', '/');@@ -1140,11 +1142,14 @@ public class Build extends ProjectBelongingreturn null;}- public String getSummary(@Nullable Project currentProject) {- var summary = getJobName();+ public String getCaption(@Nullable Project currentProject) {+ var caption = getJobName();if (getVersion() != null)- summary += ": " + getVersion();- return summary + " (" + getReference().toString(currentProject) + ")";+ caption += ": " + getVersion();+ return caption + " (" + getReference().toString(currentProject) + ")";}+ public LoggingSupport getLoggingSupport() {+ return new BuildLoggingSupport(this);+ }}diff --git a/server-core/src/main/java/io/onedev/server/model/LabelSpec.java b/server-core/src/main/java/io/onedev/server/model/LabelSpec.javaindex 05b14a62a3..c946d7ffe0 100644--- a/server-core/src/main/java/io/onedev/server/model/LabelSpec.java+++ b/server-core/src/main/java/io/onedev/server/model/LabelSpec.java@@ -45,7 +45,7 @@ public class LabelSpec extends AbstractEntity {@OneToMany(mappedBy="spec", cascade=CascadeType.REMOVE)private Collection<PackLabel> packLabels = new ArrayList<>();-+@OneToMany(mappedBy="spec", cascade=CascadeType.REMOVE)private Collection<PullRequestLabel> pullRequestLabels = new ArrayList<>();diff --git a/server-core/src/main/java/io/onedev/server/model/Project.java b/server-core/src/main/java/io/onedev/server/model/Project.javaindex 0b0c7733c3..c7af24776f 100644--- a/server-core/src/main/java/io/onedev/server/model/Project.java+++ b/server-core/src/main/java/io/onedev/server/model/Project.java@@ -25,7 +25,6 @@ import java.util.Stack;import java.util.concurrent.ConcurrentHashMap;import java.util.stream.Collectors;-import org.jspecify.annotations.Nullable;import javax.persistence.CascadeType;import javax.persistence.Column;import javax.persistence.Entity;@@ -57,6 +56,7 @@ import org.eclipse.jgit.revwalk.RevCommit;import org.hibernate.annotations.Cache;import org.hibernate.annotations.CacheConcurrencyStrategy;import org.hibernate.annotations.DynamicUpdate;+import org.jspecify.annotations.Nullable;import com.google.common.base.Optional;import com.google.common.base.Preconditions;@@ -78,19 +78,6 @@ import io.onedev.server.annotation.ProjectKey;import io.onedev.server.annotation.ProjectName;import io.onedev.server.annotation.SubscriptionRequired;import io.onedev.server.buildspec.BuildSpec;-import io.onedev.server.service.BuildService;-import io.onedev.server.service.BuildQueryPersonalizationService;-import io.onedev.server.service.CodeCommentQueryPersonalizationService;-import io.onedev.server.service.CommitQueryPersonalizationService;-import io.onedev.server.service.EmailAddressService;-import io.onedev.server.service.IssueService;-import io.onedev.server.service.IssueQueryPersonalizationService;-import io.onedev.server.service.PackQueryPersonalizationService;-import io.onedev.server.service.ProjectService;-import io.onedev.server.service.PullRequestQueryPersonalizationService;-import io.onedev.server.service.SettingService;-import io.onedev.server.service.UrlService;-import io.onedev.server.service.UserService;import io.onedev.server.git.BlameBlock;import io.onedev.server.git.Blob;import io.onedev.server.git.BlobIdent;@@ -106,9 +93,9 @@ import io.onedev.server.git.signatureverification.VerificationSuccessful;import io.onedev.server.model.Build.Status;import io.onedev.server.model.support.CodeAnalysisSetting;import io.onedev.server.model.support.LabelSupport;-import io.onedev.server.model.support.ProjectAiSetting;import io.onedev.server.model.support.NamedCodeCommentQuery;import io.onedev.server.model.support.NamedCommitQuery;+import io.onedev.server.model.support.ProjectAiSetting;import io.onedev.server.model.support.WebHook;import io.onedev.server.model.support.build.BuildPreservation;import io.onedev.server.model.support.build.DefaultFixedIssueFilter;@@ -116,7 +103,10 @@ import io.onedev.server.model.support.build.JobProperty;import io.onedev.server.model.support.build.JobSecret;import io.onedev.server.model.support.build.NamedBuildQuery;import io.onedev.server.model.support.build.ProjectBuildSetting;+import io.onedev.server.model.support.workspace.NamedWorkspaceQuery;+import io.onedev.server.model.support.workspace.ProjectWorkspaceSetting;import io.onedev.server.model.support.code.BranchProtection;+import io.onedev.server.model.support.workspace.spec.WorkspaceSpec;import io.onedev.server.model.support.code.GitPackConfig;import io.onedev.server.model.support.code.TagProtection;import io.onedev.server.model.support.issue.BoardSpec;@@ -130,6 +120,19 @@ import io.onedev.server.model.support.pullrequest.NamedPullRequestQuery;import io.onedev.server.model.support.pullrequest.ProjectPullRequestSetting;import io.onedev.server.search.entity.SortField;import io.onedev.server.security.SecurityUtils;+import io.onedev.server.service.BuildQueryPersonalizationService;+import io.onedev.server.service.BuildService;+import io.onedev.server.service.CodeCommentQueryPersonalizationService;+import io.onedev.server.service.CommitQueryPersonalizationService;+import io.onedev.server.service.EmailAddressService;+import io.onedev.server.service.IssueQueryPersonalizationService;+import io.onedev.server.service.IssueService;+import io.onedev.server.service.PackQueryPersonalizationService;+import io.onedev.server.service.ProjectService;+import io.onedev.server.service.PullRequestQueryPersonalizationService;+import io.onedev.server.service.SettingService;+import io.onedev.server.service.UrlService;+import io.onedev.server.service.UserService;import io.onedev.server.util.ComponentContext;import io.onedev.server.util.StatusInfo;import io.onedev.server.util.diff.WhitespaceOption;@@ -139,6 +142,7 @@ import io.onedev.server.util.usermatch.UserMatch;import io.onedev.server.web.page.project.setting.ContributedProjectSetting;import io.onedev.server.web.util.ProjectAware;import io.onedev.server.web.util.WicketUtils;+import io.onedev.server.workspace.WorkspaceQueryPersonalizationService;import io.onedev.server.xodus.CommitInfoService;@Entity@@ -274,7 +278,7 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabelprivate Collection<Build> builds = new ArrayList<>();@OneToMany(mappedBy="project", cascade=CascadeType.REMOVE)- private Collection<JobCache> jobCaches = new ArrayList<>();+ private Collection<RunCache> jobCaches = new ArrayList<>();@OneToMany(mappedBy= "project")private Collection<PackBlob> packBlobs = new ArrayList<>();@@ -363,7 +367,10 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabel@OneToMany(mappedBy="project", cascade=CascadeType.REMOVE)private Collection<PackQueryPersonalization> packQueryPersonalizations = new ArrayList<>();-++ @OneToMany(mappedBy="project", cascade=CascadeType.REMOVE)+ private Collection<WorkspaceQueryPersonalization> workspaceQueryPersonalizations = new ArrayList<>();+@OneToMany(mappedBy="project", cascade=CascadeType.REMOVE)@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)private Collection<Iteration> iterations = new ArrayList<>();@@ -376,6 +383,14 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabel@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)private Collection<Audit> audits = new ArrayList<>();+ @OneToMany(mappedBy="project", cascade=CascadeType.REMOVE)+ @Cache(usage=CacheConcurrencyStrategy.READ_WRITE)+ private Collection<Workspace> workspaces = new ArrayList<>();++ @Lob+ @Column(nullable=false, length=65535)+ private ArrayList<WorkspaceSpec> workspaceSpecs = new ArrayList<>();+private boolean codeManagement = true;private boolean packManagement = true;@@ -416,7 +431,11 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabel@Lob@Column(length=65535, nullable=false)private ProjectPackSetting packSetting = new ProjectPackSetting();-++ @Lob+ @Column(length=65535, nullable=false)+ private ProjectWorkspaceSetting workspaceSetting = new ProjectWorkspaceSetting();+@Lob@Column(length=65535)private ArrayList<NamedCommitQuery> namedCommitQueries;@@ -447,9 +466,11 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabelprivate transient Optional<CodeCommentQueryPersonalization> codeCommentQueryPersonalizationOfCurrentUserHolder;- private transient Optional<BuildQueryPersonalization> buildQueryPersonalizationOfCurrentUserHolder;+ private transient Optional<BuildQueryPersonalization> buildQueryPersonalizationOfCurrentUserHolder;private transient Optional<PackQueryPersonalization> packQueryPersonalizationOfCurrentUserHolder;++ private transient Optional<WorkspaceQueryPersonalization> workspaceQueryPersonalizationOfCurrentUserHolder;private transient Optional<CommitQueryPersonalization> commitQueryPersonalizationOfCurrentUserHolder;@@ -1062,6 +1083,25 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabelpublic void setPackManagement(boolean packManagement) {this.packManagement = packManagement;}++ public ArrayList<WorkspaceSpec> getWorkspaceSpecs() {+ return workspaceSpecs;+ }++ public void setWorkspaceSpecs(ArrayList<WorkspaceSpec> workspaceSpecs) {+ this.workspaceSpecs = workspaceSpecs;+ }++ public List<WorkspaceSpec> getHierarchyWorkspaceSpecs() {+ var specMap = new LinkedHashMap<String, WorkspaceSpec>();+ for (var spec : getWorkspaceSpecs())+ specMap.put(spec.getName(), spec);+ if (getParent() != null) {+ for (var spec : getParent().getHierarchyWorkspaceSpecs())+ specMap.putIfAbsent(spec.getName(), spec);+ }+ return new ArrayList<>(specMap.values());+ }@Editable(order=500, placeholder="Default", description="Specify an email address sharing same inbox as " +"the system email address in mail setting definition. Emails sent to this address will be " +@@ -1125,6 +1165,14 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabelthis.packSetting = packSetting;}+ public ProjectWorkspaceSetting getWorkspaceSetting() {+ return workspaceSetting;+ }++ public void setWorkspaceSetting(ProjectWorkspaceSetting workspaceSetting) {+ this.workspaceSetting = workspaceSetting;+ }+public List<JobSecret> getHierarchyJobSecrets() {List<JobSecret> jobSecrets = new ArrayList<>(getBuildSetting().getJobSecrets());if (getParent() != null)@@ -1268,6 +1316,14 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabelthis.packQueryPersonalizations = packQueryPersonalizations;}+ public Collection<WorkspaceQueryPersonalization> getWorkspaceQueryPersonalizations() {+ return workspaceQueryPersonalizations;+ }++ public void setWorkspaceQueryPersonalizations(Collection<WorkspaceQueryPersonalization> workspaceQueryPersonalizations) {+ this.workspaceQueryPersonalizations = workspaceQueryPersonalizations;+ }+public Collection<Build> getBuilds() {return builds;}@@ -1276,11 +1332,11 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabelthis.builds = builds;}- public Collection<JobCache> getJobCaches() {+ public Collection<RunCache> getJobCaches() {return jobCaches;}- public void setJobCaches(Collection<JobCache> jobCaches) {+ public void setJobCaches(Collection<RunCache> jobCaches) {this.jobCaches = jobCaches;}@@ -1526,6 +1582,26 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabel}return packQueryPersonalizationOfCurrentUserHolder.orNull();}++ @Nullable+ public WorkspaceQueryPersonalization getWorkspaceQueryPersonalizationOfCurrentUser() {+ if (workspaceQueryPersonalizationOfCurrentUserHolder == null) {+ User user = SecurityUtils.getAuthUser();+ if (user != null) {+ WorkspaceQueryPersonalization personalization =+ OneDev.getInstance(WorkspaceQueryPersonalizationService.class).find(this, user);+ if (personalization == null) {+ personalization = new WorkspaceQueryPersonalization();+ personalization.setProject(this);+ personalization.setUser(user);+ }+ workspaceQueryPersonalizationOfCurrentUserHolder = Optional.of(personalization);+ } else {+ workspaceQueryPersonalizationOfCurrentUserHolder = Optional.absent();+ }+ }+ return workspaceQueryPersonalizationOfCurrentUserHolder.orNull();+ }@Nullablepublic Iteration getHierarchyIteration(@Nullable String iterationName) {@@ -1856,6 +1932,27 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabelreturn getSettingService().getPackSetting().getNamedQueries();}++ public List<NamedWorkspaceQuery> getNamedWorkspaceQueries() {+ Project current = this;+ do {+ List<NamedWorkspaceQuery> namedQueries = current.getWorkspaceSetting().getNamedQueries();+ if (namedQueries != null)+ return namedQueries;+ current = current.getParent();+ } while (current != null);++ return getSettingService().getWorkspaceSetting().getNamedQueries();+ }++ @Nullable+ public NamedWorkspaceQuery getNamedWorkspaceQuery(String name) {+ for (NamedWorkspaceQuery namedQuery : getNamedWorkspaceQueries()) {+ if (namedQuery.getName().equals(name))+ return namedQuery;+ }+ return null;+ }public List<NamedPullRequestQuery> getNamedPullRequestQueries() {Project current = this;@@ -2036,6 +2133,10 @@ public class Project extends AbstractEntity implements LabelSupport<ProjectLabelpublic void setEntitlements(Collection<ProjectEntitlement> entitlements) {this.entitlements = entitlements;}++ public Collection<Workspace> getWorkspaces() {+ return workspaces;+ }public boolean isEntitledToAi(User ai) {if (ai.getAiSetting().isEntitleToAll())diff --git a/server-core/src/main/java/io/onedev/server/model/PullRequest.java b/server-core/src/main/java/io/onedev/server/model/PullRequest.javaindex 1b0a7d588b..27f80b78c2 100644--- a/server-core/src/main/java/io/onedev/server/model/PullRequest.java+++ b/server-core/src/main/java/io/onedev/server/model/PullRequest.java@@ -116,6 +116,7 @@ import io.onedev.server.web.asset.emoji.Emojis;import io.onedev.server.web.util.PullRequestAware;import io.onedev.server.web.util.TextUtils;import io.onedev.server.web.util.WicketUtils;+import io.onedev.server.workspace.WorkspaceService;import io.onedev.server.xodus.VisitInfoService;@Entity@@ -1050,6 +1051,10 @@ public class PullRequest extends ProjectBelongingprivate GitService getGitService() {return OneDev.getInstance(GitService.class);}++ private WorkspaceService getWorkspaceService() {+ return OneDev.getInstance(WorkspaceService.class);+ }public static String getChangeObservable(Long requestId) {return PullRequest.class.getName() + ":" + requestId;@@ -1243,8 +1248,7 @@ public class PullRequest extends ProjectBelongingreturn _T("Source project no longer exists");if (getSource().getObjectName(false) == null)return _T("Source branch no longer exists");- PullRequestService manager = OneDev.getInstance(PullRequestService.class);- PullRequest request = manager.findEffective(getTarget(), getSource());+ PullRequest request = getPullRequestService().findEffective(getTarget(), getSource());if (request != null) {if (request.isOpen())return _T("Another pull request already open for this change");@@ -1270,6 +1274,8 @@ public class PullRequest extends ProjectBelongingreturn _T("Source branch no longer exists");if (getSource().isDefault())return _T("Source branch is default branch");+ if (getWorkspaceService().count(getSourceProject(), getSourceBranch()) > 0)+ return _T("There are workspaces on source branch");MergePreview preview = checkMergePreview();if (preview == null)return _T("Merge preview not calculated yet");diff --git a/server-core/src/main/java/io/onedev/server/model/Role.java b/server-core/src/main/java/io/onedev/server/model/Role.javaindex 0d9f0f2d95..b584f4da14 100644--- a/server-core/src/main/java/io/onedev/server/model/Role.java+++ b/server-core/src/main/java/io/onedev/server/model/Role.java@@ -96,6 +96,8 @@ public class Role extends AbstractEntity implements BasePermission {private boolean managePullRequests;private boolean manageCodeComments;++ private boolean manageWorkspaces;private CodePrivilege codePrivilege = CodePrivilege.NONE;@@ -199,6 +201,17 @@ public class Role extends AbstractEntity implements BasePermission {this.managePullRequests = managePullRequests;}+ @Editable(order=255, name="Workspace Management", description="Workspace administrative permission inside a project, "+ + "including batch operations over multiple workspaces")+ @DependsOn(property="manageProject", value="false")+ public boolean isManageWorkspaces() {+ return manageWorkspaces;+ }++ public void setManageWorkspaces(boolean manageWorkspaces) {+ this.manageWorkspaces = manageWorkspaces;+ }+@Editable(order=260, name="Code Comment Management", description="Code comment administrative permission inside a project, "+ "including batch operations over multiple code comments")@DependsOn(property="manageProject", value="false")diff --git a/server-core/src/main/java/io/onedev/server/model/JobCache.java b/server-core/src/main/java/io/onedev/server/model/RunCache.javasimilarity index 58%rename from server-core/src/main/java/io/onedev/server/model/JobCache.javarename to server-core/src/main/java/io/onedev/server/model/RunCache.javaindex 20f22bce6d..af5d44e28a 100644--- a/server-core/src/main/java/io/onedev/server/model/JobCache.java+++ b/server-core/src/main/java/io/onedev/server/model/RunCache.java@@ -1,11 +1,21 @@package io.onedev.server.model;-import javax.persistence.*;+import static io.onedev.server.model.RunCache.PROP_ACCESS_DATE;+import static io.onedev.server.model.RunCache.PROP_CHECKSUM;+import static io.onedev.server.model.RunCache.PROP_KEY;import java.util.Date;-import static io.onedev.server.model.JobCache.PROP_ACCESS_DATE;-import static io.onedev.server.model.JobCache.PROP_KEY;+import javax.persistence.Column;+import javax.persistence.Entity;+import javax.persistence.FetchType;+import javax.persistence.Index;+import javax.persistence.JoinColumn;+import javax.persistence.ManyToOne;+import javax.persistence.Table;+import javax.persistence.UniqueConstraint;++import org.jspecify.annotations.Nullable;/*** @author robin@@ -14,8 +24,8 @@ import static io.onedev.server.model.JobCache.PROP_KEY;@Entity@Table(indexes={@Index(columnList="o_project_id"), @Index(columnList=PROP_KEY), @Index(columnList = PROP_ACCESS_DATE)},- uniqueConstraints={@UniqueConstraint(columnNames={"o_project_id", PROP_KEY})})-public class JobCache extends AbstractEntity {+ uniqueConstraints={@UniqueConstraint(columnNames={"o_project_id", PROP_KEY, PROP_CHECKSUM})})+public class RunCache extends AbstractEntity {private static final long serialVersionUID = 1L;@@ -23,6 +33,8 @@ public class JobCache extends AbstractEntity {public static final String PROP_KEY = "key";+ public static final String PROP_CHECKSUM = "checksum";+public static final String PROP_ACCESS_DATE = "accessDate";@ManyToOne(fetch=FetchType.LAZY)@@ -32,6 +44,8 @@ public class JobCache extends AbstractEntity {@Column(nullable=false)private String key;+ private String checksum;+private Date accessDate;public Project getProject() {@@ -50,6 +64,15 @@ public class JobCache extends AbstractEntity {this.key = key;}+ @Nullable+ public String getChecksum() {+ return checksum;+ }++ public void setChecksum(@Nullable String checksum) {+ this.checksum = checksum;+ }+public Date getAccessDate() {return accessDate;}diff --git a/server-core/src/main/java/io/onedev/server/model/Setting.java b/server-core/src/main/java/io/onedev/server/model/Setting.javaindex e1b890bc3a..7d053f61e1 100644--- a/server-core/src/main/java/io/onedev/server/model/Setting.java+++ b/server-core/src/main/java/io/onedev/server/model/Setting.java@@ -21,7 +21,7 @@ public class Setting extends AbstractEntity {GROOVY_SCRIPTS, PULL_REQUEST, BUILD, PACK, PROJECT, SSH, GPG,EMAIL_TEMPLATES, CONTRIBUTED_SETTINGS, SERVICE_DESK_SETTING,AGENT, PERFORMANCE, BRANDING, CLUSTER_SETTING, SUBSCRIPTION_DATA, ALERT,- SYSTEM_UUID, AUDIT, AI+ SYSTEM_UUID, AUDIT, AI, WORKSPACE_PROVISIONERS, WORKSPACE};@Column(nullable=false, unique=true)diff --git a/server-core/src/main/java/io/onedev/server/model/User.java b/server-core/src/main/java/io/onedev/server/model/User.javaindex 5878e2ff54..e23f19be71 100644--- a/server-core/src/main/java/io/onedev/server/model/User.java+++ b/server-core/src/main/java/io/onedev/server/model/User.java@@ -50,6 +50,7 @@ import io.onedev.server.model.support.NamedProjectQuery;import io.onedev.server.model.support.QueryPersonalization;import io.onedev.server.model.support.TwoFactorAuthentication;import io.onedev.server.model.support.build.NamedBuildQuery;+import io.onedev.server.model.support.workspace.NamedWorkspaceQuery;import io.onedev.server.model.support.issue.NamedIssueQuery;import io.onedev.server.model.support.pack.NamedPackQuery;import io.onedev.server.model.support.pullrequest.NamedPullRequestQuery;@@ -188,7 +189,10 @@ public class User extends AbstractEntity implements AuthenticationInfo {@OneToMany(mappedBy="user", cascade=CascadeType.REMOVE)private Collection<PackQueryPersonalization> packQueryPersonalizations = new ArrayList<>();-++ @OneToMany(mappedBy="user", cascade=CascadeType.REMOVE)+ private Collection<WorkspaceQueryPersonalization> workspaceQueryPersonalizations = new ArrayList<>();+@OneToMany(mappedBy="user", cascade=CascadeType.REMOVE)private Collection<PullRequestQueryPersonalization> pullRequestQueryPersonalizations = new ArrayList<>();@@ -264,6 +268,10 @@ public class User extends AbstractEntity implements AuthenticationInfo {@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)private Collection<Chat> userChats = new ArrayList<>();+ @OneToMany(mappedBy="user", cascade=CascadeType.REMOVE)+ @Cache(usage=CacheConcurrencyStrategy.READ_WRITE)+ private Collection<Workspace> workspaces = new ArrayList<>();+@JsonIgnore@Lob@Column(nullable=false, length=65535)@@ -288,7 +296,12 @@ public class User extends AbstractEntity implements AuthenticationInfo {@Lob@Column(nullable=false, length=65535)private ArrayList<NamedPackQuery> packQueries = new ArrayList<>();-++ @JsonIgnore+ @Lob+ @Column(nullable=false, length=65535)+ private ArrayList<NamedWorkspaceQuery> workspaceQueries = new ArrayList<>();+@JsonIgnore@Lob@Column(nullable=false, length=65535)@@ -308,7 +321,12 @@ public class User extends AbstractEntity implements AuthenticationInfo {@Lob@Column(nullable=false, length=65535)private LinkedHashSet<String> packQuerySubscriptions = new LinkedHashSet<>();-++ @JsonIgnore+ @Lob+ @Column(nullable=false, length=65535)+ private LinkedHashSet<String> workspaceQuerySubscriptions = new LinkedHashSet<>();+private transient Collection<Group> groups;private transient List<EmailAddress> sortedEmailAddresses;@@ -553,7 +571,55 @@ public class User extends AbstractEntity implements AuthenticationInfo {};}-++ public QueryPersonalization<NamedWorkspaceQuery> getWorkspaceQueryPersonalization() {+ return new QueryPersonalization<>() {++ @Override+ public Project getProject() {+ return null;+ }++ @Override+ public User getUser() {+ return User.this;+ }++ @Override+ public ArrayList<NamedWorkspaceQuery> getQueries() {+ return workspaceQueries;+ }++ @Override+ public void setQueries(ArrayList<NamedWorkspaceQuery> userQueries) {+ workspaceQueries = userQueries;+ }++ @Override+ public QueryWatchSupport<NamedWorkspaceQuery> getQueryWatchSupport() {+ return null;+ }++ @Override+ public QuerySubscriptionSupport<NamedWorkspaceQuery> getQuerySubscriptionSupport() {+ return new QuerySubscriptionSupport<>() {++ @Override+ public LinkedHashSet<String> getQuerySubscriptions() {+ return workspaceQuerySubscriptions;+ }++ };+ }++ @Override+ public void onUpdated() {+ OneDev.getInstance(UserService.class).update(User.this, null);+ }++ };+ }+@Overridepublic PrincipalCollection getPrincipals() {return asPrincipals(asUserPrincipal(getId()));@@ -775,6 +841,10 @@ public class User extends AbstractEntity implements AuthenticationInfo {this.aiEntitlements = aiEntitlements;}+ public Collection<Workspace> getWorkspaces() {+ return workspaces;+ }+public Collection<IssueAuthorization> getIssueAuthorizations() {return issueAuthorizations;}@@ -963,6 +1033,14 @@ public class User extends AbstractEntity implements AuthenticationInfo {this.packQueryPersonalizations = packQueryPersonalizations;}+ public Collection<WorkspaceQueryPersonalization> getWorkspaceQueryPersonalizations() {+ return workspaceQueryPersonalizations;+ }++ public void setWorkspaceQueryPersonalizations(Collection<WorkspaceQueryPersonalization> workspaceQueryPersonalizations) {+ this.workspaceQueryPersonalizations = workspaceQueryPersonalizations;+ }+public Collection<PullRequestQueryPersonalization> getPullRequestQueryPersonalizations() {return pullRequestQueryPersonalizations;}@@ -1111,7 +1189,24 @@ public class User extends AbstractEntity implements AuthenticationInfo {}return null;}-++ public ArrayList<NamedWorkspaceQuery> getWorkspaceQueries() {+ return workspaceQueries;+ }++ public void setWorkspaceQueries(ArrayList<NamedWorkspaceQuery> workspaceQueries) {+ this.workspaceQueries = workspaceQueries;+ }++ @Nullable+ public NamedWorkspaceQuery getWorkspaceQuery(String name) {+ for (var query: getWorkspaceQueries()) {+ if (query.getName().equals(name))+ return query;+ }+ return null;+ }+public LinkedHashSet<String> getBuildQuerySubscriptions() {return buildQuerySubscriptions;}@@ -1128,6 +1223,14 @@ public class User extends AbstractEntity implements AuthenticationInfo {this.packQuerySubscriptions = packQuerySubscriptions;}+ public LinkedHashSet<String> getWorkspaceQuerySubscriptions() {+ return workspaceQuerySubscriptions;+ }++ public void setWorkspaceQuerySubscriptions(LinkedHashSet<String> workspaceQuerySubscriptions) {+ this.workspaceQuerySubscriptions = workspaceQuerySubscriptions;+ }+public boolean isEnforce2FA() {return OneDev.getInstance(SettingService.class).getSecuritySetting().isEnforce2FA()|| getGroups().stream().anyMatch(it->it.isEnforce2FA());diff --git a/server-core/src/main/java/io/onedev/server/model/Workspace.java b/server-core/src/main/java/io/onedev/server/model/Workspace.javanew file mode 100644index 0000000000..19b1d34245--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/model/Workspace.java@@ -0,0 +1,283 @@+package io.onedev.server.model;++import static io.onedev.server.search.entity.EntitySort.Direction.ASCENDING;+import static io.onedev.server.search.entity.EntitySort.Direction.DESCENDING;++import java.io.File;+import java.util.Date;+import java.util.LinkedHashMap;+import java.util.List;+import java.util.Map;++import javax.persistence.Column;+import javax.persistence.Entity;+import javax.persistence.FetchType;+import javax.persistence.Index;+import javax.persistence.JoinColumn;+import javax.persistence.ManyToOne;+import javax.persistence.Table;+import javax.persistence.UniqueConstraint;++import org.hibernate.annotations.Cache;+import org.hibernate.annotations.CacheConcurrencyStrategy;+import org.jspecify.annotations.Nullable;++import com.fasterxml.jackson.annotation.JsonIgnore;+import com.google.common.collect.Lists;++import io.onedev.server.OneDev;+import io.onedev.server.entityreference.WorkspaceReference;+import io.onedev.server.logging.WorkspaceLoggingSupport;+import io.onedev.server.search.entity.SortField;+import io.onedev.server.web.util.TextUtils;+import io.onedev.server.workspace.WorkspaceService;++@Entity+@Table(+ indexes={+ @Index(columnList="o_user_id"),+ @Index(columnList="o_project_id"),+ @Index(columnList=Workspace.PROP_SPEC),+ @Index(columnList= Workspace.PROP_STATUS),+ @Index(columnList= Workspace.PROP_BRANCH),+ @Index(columnList= Workspace.PROP_CREATE_DATE),+ @Index(columnList= Workspace.PROP_ACTIVE_DATE),+ @Index(columnList=AbstractEntity.PROP_NUMBER),+ @Index(columnList="o_numberScope_id")},+ uniqueConstraints={@UniqueConstraint(columnNames={"o_numberScope_id", AbstractEntity.PROP_NUMBER})}+)+@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)+public class Workspace extends AbstractEntity {++ private static final long serialVersionUID = 1L;++ public static final String WORKSPACES_DIR = "workspaces";++ public static final String LOG_FILE = "workspace.log";++ public static final String WORK_DIR = "work";++ public static final int MAX_BRANCH_LEN = 255;++ public static final int MAX_ERROR_MESSAGE_LEN = 2048;++ public static final String PROP_USER = "user";++ public static final String PROP_PROJECT = "project";++ public static final String PROP_SPEC = "specName";++ public static final String PROP_BRANCH = "branch";++ public static final String PROP_STATUS = "status";++ public static final String NAME_USER = "User";++ public static final String NAME_PROJECT = "Project";++ public static final String NAME_BRANCH = "Branch";++ public static final String NAME_SPEC = "Spec";++ public static final String NAME_STATUS = "Status";++ public static final String NAME_CREATE_DATE = "Create Date";++ public static final String PROP_CREATE_DATE = "createDate";++ public static final String NAME_ACTIVE_DATE = "Active Date";++ public static final String PROP_ACTIVE_DATE = "activeDate";++ public static final List<String> QUERY_FIELDS = Lists.newArrayList(+ NAME_NUMBER, NAME_PROJECT, NAME_BRANCH, NAME_SPEC, NAME_CREATE_DATE, NAME_ACTIVE_DATE);++ public static final Map<String, SortField<Workspace>> SORT_FIELDS = new LinkedHashMap<>();+ static {+ SORT_FIELDS.put(NAME_NUMBER, new SortField<>(PROP_NUMBER, DESCENDING));+ SORT_FIELDS.put(NAME_USER, new SortField<>(PROP_USER));+ SORT_FIELDS.put(NAME_PROJECT, new SortField<>(PROP_PROJECT));+ SORT_FIELDS.put(NAME_BRANCH, new SortField<>(PROP_BRANCH));+ SORT_FIELDS.put(NAME_SPEC, new SortField<>(PROP_SPEC));+ SORT_FIELDS.put(NAME_STATUS, new SortField<>(PROP_STATUS, ASCENDING));+ SORT_FIELDS.put(NAME_CREATE_DATE, new SortField<>(PROP_CREATE_DATE, DESCENDING));+ SORT_FIELDS.put(NAME_ACTIVE_DATE, new SortField<>(PROP_ACTIVE_DATE, DESCENDING));+ }++ public enum Status {+ PENDING, ACTIVE, ERROR;++ @Override+ public String toString() {+ return TextUtils.getDisplayValue(this);+ }++ }++ @ManyToOne(fetch=FetchType.LAZY)+ @JoinColumn(nullable=false)+ private Project numberScope;++ private long number;++ @ManyToOne(fetch=FetchType.LAZY)+ @JoinColumn(nullable=false)+ private User user;++ @ManyToOne(fetch=FetchType.LAZY)+ @JoinColumn(nullable=false)+ private Project project;++ @Column(nullable=false)+ private String specName;++ @Column(nullable=false, length=MAX_BRANCH_LEN)+ private String branch;++ @Column(nullable=false)+ private Status status = Status.PENDING;++ @Column(nullable=false)+ private Date createDate = new Date();++ private Date activeDate;++ private Date errorDate;++ @JsonIgnore+ @Column(nullable=false)+ private String token;++ public Project getNumberScope() {+ return numberScope;+ }++ public void setNumberScope(Project numberScope) {+ this.numberScope = numberScope;+ }++ public long getNumber() {+ return number;+ }++ public void setNumber(long number) {+ this.number = number;+ }++ public User getUser() {+ return user;+ }++ public void setUser(User user) {+ this.user = user;+ }++ public Project getProject() {+ return project;+ }++ public void setProject(Project project) {+ this.project = project;+ }++ public String getSpecName() {+ return specName;+ }++ public void setSpecName(String specName) {+ this.specName = specName;+ }++ public String getBranch() {+ return branch;+ }++ public void setBranch(String branch) {+ this.branch = branch;+ }++ public Status getStatus() {+ return status;+ }++ public void setStatus(Status status) {+ this.status = status;+ }++ public Date getCreateDate() {+ return createDate;+ }++ public void setCreateDate(Date createDate) {+ this.createDate = createDate;+ }++ @Nullable+ public Date getActiveDate() {+ return activeDate;+ }++ public void setActiveDate(Date activeDate) {+ this.activeDate = activeDate;+ }++ @Nullable+ public Date getErrorDate() {+ return errorDate;+ }++ public void setErrorDate(Date errorDate) {+ this.errorDate = errorDate;+ }++ public String getToken() {+ return token;+ }++ public void setToken(String token) {+ this.token = token;+ }++ public static String getProjectRelativeDirPath(Long workspaceNumber) {+ return WORKSPACES_DIR + "/s" + String.format("%03d", workspaceNumber % 1000) + "/" + workspaceNumber;+ }++ public File getDir() {+ return getWorkspaceService().getWorkspaceDir(getProject().getId(), getNumber());+ }++ public static File getLogFile(Long projectId, Long workspaceNumber) {+ File workspaceDir = getWorkspaceService().getWorkspaceDir(projectId, workspaceNumber);+ return new File(workspaceDir, LOG_FILE);+ }++ public static File getWorkDir(Long projectId, Long workspaceNumber) {+ File workspaceDir = getWorkspaceService().getWorkspaceDir(projectId, workspaceNumber);+ return new File(workspaceDir, WORK_DIR);+ }++ private static WorkspaceService getWorkspaceService() {+ return OneDev.getInstance(WorkspaceService.class);+ }++ public static String getLogLockName(Long projectId, Long workspaceNumber) {+ return "workspace-log:" + projectId + ":" + workspaceNumber;+ }++ public WorkspaceLoggingSupport getLoggingSupport() {+ return new WorkspaceLoggingSupport(this);+ }++ public WorkspaceReference getReference() {+ return new WorkspaceReference(getProject(), getNumber());+ }++ public static String getLogChangeObservable(Long workspaceId) {+ return "workspace-log:" + workspaceId;+ }++ public String getStatusChangeObservable() {+ return "workspace-status:" + getId();+ }++}diff --git a/server-core/src/main/java/io/onedev/server/model/WorkspaceQueryPersonalization.java b/server-core/src/main/java/io/onedev/server/model/WorkspaceQueryPersonalization.javanew file mode 100644index 0000000000..46d65c60ab--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/model/WorkspaceQueryPersonalization.java@@ -0,0 +1,117 @@+package io.onedev.server.model;++import java.util.ArrayList;+import java.util.LinkedHashSet;++import javax.persistence.Column;+import javax.persistence.Entity;+import javax.persistence.FetchType;+import javax.persistence.Index;+import javax.persistence.JoinColumn;+import javax.persistence.Lob;+import javax.persistence.ManyToOne;+import javax.persistence.Table;+import javax.persistence.UniqueConstraint;++import io.onedev.server.OneDev;+import io.onedev.server.model.support.QueryPersonalization;+import io.onedev.server.model.support.workspace.NamedWorkspaceQuery;+import io.onedev.server.util.watch.QuerySubscriptionSupport;+import io.onedev.server.util.watch.QueryWatchSupport;+import io.onedev.server.workspace.WorkspaceQueryPersonalizationService;++import org.jspecify.annotations.Nullable;++@Entity+@Table(+ indexes={@Index(columnList="o_project_id"), @Index(columnList="o_user_id")},+ uniqueConstraints={@UniqueConstraint(columnNames={"o_project_id", "o_user_id"})}+)+public class WorkspaceQueryPersonalization extends AbstractEntity implements QueryPersonalization<NamedWorkspaceQuery> {++ private static final long serialVersionUID = 1L;++ @ManyToOne(fetch=FetchType.LAZY)+ @JoinColumn(nullable=false)+ private Project project;++ @ManyToOne(fetch=FetchType.LAZY)+ @JoinColumn(nullable=false)+ private User user;++ @Lob+ @Column(nullable=false, length=65535)+ private ArrayList<NamedWorkspaceQuery> queries = new ArrayList<>();++ @Lob+ @Column(nullable=false, length=65535)+ private LinkedHashSet<String> querySubscriptions = new LinkedHashSet<>();++ @Override+ public Project getProject() {+ return project;+ }++ public void setProject(Project project) {+ this.project = project;+ }++ @Override+ public User getUser() {+ return user;+ }++ public void setUser(User user) {+ this.user = user;+ }++ @Override+ public ArrayList<NamedWorkspaceQuery> getQueries() {+ return queries;+ }++ @Override+ public void setQueries(ArrayList<NamedWorkspaceQuery> queries) {+ this.queries = queries;+ }++ @Nullable+ public NamedWorkspaceQuery getQuery(String name) {+ for (NamedWorkspaceQuery query : getQueries()) {+ if (query.getName().equals(name))+ return query;+ }+ return null;+ }++ public LinkedHashSet<String> getQuerySubscriptions() {+ return querySubscriptions;+ }++ public void setQuerySubscriptions(LinkedHashSet<String> querySubscriptions) {+ this.querySubscriptions = querySubscriptions;+ }++ @Override+ public QueryWatchSupport<NamedWorkspaceQuery> getQueryWatchSupport() {+ return null;+ }++ @Override+ public QuerySubscriptionSupport<NamedWorkspaceQuery> getQuerySubscriptionSupport() {+ return new QuerySubscriptionSupport<NamedWorkspaceQuery>() {++ @Override+ public LinkedHashSet<String> getQuerySubscriptions() {+ return querySubscriptions;+ }++ };+ }++ @Override+ public void onUpdated() {+ OneDev.getInstance(WorkspaceQueryPersonalizationService.class).createOrUpdate(this);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/model/support/administration/GlobalWorkspaceSetting.java b/server-core/src/main/java/io/onedev/server/model/support/administration/GlobalWorkspaceSetting.javanew file mode 100644index 0000000000..458aac47e7--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/model/support/administration/GlobalWorkspaceSetting.java@@ -0,0 +1,46 @@+package io.onedev.server.model.support.administration;++import java.io.Serializable;+import java.util.ArrayList;+import java.util.List;++import org.jspecify.annotations.Nullable;+import javax.validation.Valid;++import io.onedev.server.annotation.Editable;+import io.onedev.server.model.support.workspace.NamedWorkspaceQuery;++@Editable+public class GlobalWorkspaceSetting implements Serializable {++ private static final long serialVersionUID = 1L;++ private List<NamedWorkspaceQuery> namedQueries = new ArrayList<>();++ public GlobalWorkspaceSetting() {+ namedQueries.add(new NamedWorkspaceQuery("All", null));+ namedQueries.add(new NamedWorkspaceQuery("Queueing", "queueing"));+ namedQueries.add(new NamedWorkspaceQuery("Started", "started"));+ namedQueries.add(new NamedWorkspaceQuery("Stopped", "stopped"));+ namedQueries.add(new NamedWorkspaceQuery("Created by me", "created by me"));+ }++ @Valid+ public List<NamedWorkspaceQuery> getNamedQueries() {+ return namedQueries;+ }++ public void setNamedQueries(List<NamedWorkspaceQuery> namedQueries) {+ this.namedQueries = namedQueries;+ }++ @Nullable+ public NamedWorkspaceQuery getNamedQuery(String name) {+ for (NamedWorkspaceQuery namedQuery : getNamedQueries()) {+ if (namedQuery.getName().equals(name))+ return namedQuery;+ }+ return null;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/model/support/administration/emailtemplates/EmailTemplates.java b/server-core/src/main/java/io/onedev/server/model/support/administration/emailtemplates/EmailTemplates.javaindex 39cea3d7db..0cf4705aff 100644--- a/server-core/src/main/java/io/onedev/server/model/support/administration/emailtemplates/EmailTemplates.java+++ b/server-core/src/main/java/io/onedev/server/model/support/administration/emailtemplates/EmailTemplates.java@@ -49,6 +49,8 @@ public class EmailTemplates implements Serializable {public static final String PROP_PACK_NOTIFICATION = "packNotification";+ public static final String PROP_DEV_SESSION_NOTIFICATION = "workspaceNotification";+public static final String PROP_COMMIT_NOTIFICATION = "commitNotification";public static final String PROP_ISSUE_NOTIFICATION_UNSUBSCRIBED = "issueNotificationUnsubscribed";@@ -116,6 +118,8 @@ public class EmailTemplates implements Serializable {private String packNotification = DEFAULT_SIMPLE_NOTIFICATION;+ private String workspaceNotification = DEFAULT_SIMPLE_NOTIFICATION;+private String commitNotification = DEFAULT_SIMPLE_NOTIFICATION;private String issueNotificationUnsubscribed = DEFAULT_ISSUE_NOTIFICATION_UNSUBSCRIBED;@@ -232,6 +236,18 @@ public class EmailTemplates implements Serializable {this.packNotification = packNotification;}+ @Editable(order=565)+ @Code(language=Code.GROOVY_TEMPLATE)+ @OmitName+ @NotEmpty+ public String getWorkspaceNotification() {+ return workspaceNotification;+ }++ public void setWorkspaceNotification(String workspaceNotification) {+ this.workspaceNotification = workspaceNotification;+ }+@Editable(order=570)@Code(language=Code.GROOVY_TEMPLATE)@OmitNamediff --git a/server-core/src/main/java/io/onedev/server/model/support/administration/jobexecutor/JobExecutor.java b/server-core/src/main/java/io/onedev/server/model/support/administration/jobexecutor/JobExecutor.javaindex cd9834a8f5..1c61c70006 100644--- a/server-core/src/main/java/io/onedev/server/model/support/administration/jobexecutor/JobExecutor.java+++ b/server-core/src/main/java/io/onedev/server/model/support/administration/jobexecutor/JobExecutor.java@@ -1,13 +1,20 @@package io.onedev.server.model.support.administration.jobexecutor;+import java.io.Serializable;+import java.util.Date;++import javax.validation.constraints.NotEmpty;++import org.eclipse.jetty.http.HttpStatus;+import org.jspecify.annotations.Nullable;+import com.google.common.base.Throwables;+import io.onedev.commons.loader.ExtensionPoint;import io.onedev.commons.utils.TaskLogger;import io.onedev.server.OneDev;import io.onedev.server.annotation.DnsName;import io.onedev.server.annotation.Editable;-import io.onedev.server.service.AgentService;-import io.onedev.server.service.BuildService;import io.onedev.server.event.ListenerRegistry;import io.onedev.server.event.project.build.BuildRunning;import io.onedev.server.exception.ExceptionUtils;@@ -15,14 +22,10 @@ import io.onedev.server.job.JobContext;import io.onedev.server.job.match.JobMatch;import io.onedev.server.model.Build;import io.onedev.server.persistence.TransactionService;+import io.onedev.server.service.AgentService;+import io.onedev.server.service.BuildService;import io.onedev.server.util.usage.Usage;import io.onedev.server.web.util.WicketUtils;-import org.eclipse.jetty.http.HttpStatus;--import org.jspecify.annotations.Nullable;-import javax.validation.constraints.NotEmpty;-import java.io.Serializable;-import java.util.Date;@ExtensionPoint@Editablediff --git a/server-core/src/main/java/io/onedev/server/model/support/administration/workspaceprovisioner/WorkspaceProvisioner.java b/server-core/src/main/java/io/onedev/server/model/support/administration/workspaceprovisioner/WorkspaceProvisioner.javanew file mode 100644index 0000000000..0a588e746a--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/model/support/administration/workspaceprovisioner/WorkspaceProvisioner.java@@ -0,0 +1,104 @@+package io.onedev.server.model.support.administration.workspaceprovisioner;++import java.io.Serializable;+import java.util.List;++import javax.validation.constraints.Min;+import javax.validation.constraints.NotEmpty;++import io.onedev.commons.codeassist.InputSuggestion;+import io.onedev.commons.loader.ExtensionPoint;+import io.onedev.commons.utils.TaskLogger;+import io.onedev.server.OneDev;+import io.onedev.server.annotation.DnsName;+import io.onedev.server.annotation.Editable;+import io.onedev.server.annotation.Patterns;+import io.onedev.server.cluster.ClusterService;+import io.onedev.server.git.location.GitLocation;+import io.onedev.server.persistence.SessionService;+import io.onedev.server.service.ProjectService;+import io.onedev.server.web.util.SuggestionUtils;+import io.onedev.server.workspace.WorkspaceContext;+import io.onedev.server.workspace.WorkspaceRuntime;++@Editable+@ExtensionPoint+public abstract class WorkspaceProvisioner implements Serializable {++ private static final long serialVersionUID = 1L;++ private boolean enabled = true;++ private String name;++ private Integer concurrency;++ @Editable(order=1000, placeholder="CPU cores", description = """+ Specify max number of workspaces this provisioner can handle concurrently+ Leave empty to set as CPU cores""")+ @Min(1)+ public Integer getConcurrency() {+ return concurrency;+ }++ public void setConcurrency(Integer concurrency) {+ this.concurrency = concurrency;+ }++ private String applicableProjects;++ public boolean isEnabled() {+ return enabled;+ }++ public void setEnabled(boolean enabled) {+ this.enabled = enabled;+ }++ @Editable(order=100)+ @DnsName+ @NotEmpty+ public String getName() {+ return name;+ }++ public void setName(String name) {+ this.name = name;+ }++ @Editable(order=200, placeholder="Any project", description="Optionally specify projects applicable for this provider. " ++ "Use '**', '*' or '?' for <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>path wildcard match</a>. " ++ "Multiple projects should be separated by space")+ @Patterns(suggester="suggestProjects", path=true)+ public String getApplicableProjects() {+ return applicableProjects;+ }++ public void setApplicableProjects(String applicableProjects) {+ this.applicableProjects = applicableProjects;+ }++ @SuppressWarnings("unused")+ private static List<InputSuggestion> suggestProjects(String matchWith) {+ return SuggestionUtils.suggestProjectPaths(matchWith);+ }++ protected ClusterService getClusterService() {+ return OneDev.getInstance(ClusterService.class);+ }++ protected SessionService getSessionService() {+ return OneDev.getInstance(SessionService.class);+ }++ protected ProjectService getProjectService() {+ return OneDev.getInstance(ProjectService.class);+ }++ protected GitLocation getGitLocation() {+ return OneDev.getInstance(GitLocation.class);+ }++ public abstract WorkspaceRuntime provision(WorkspaceContext context, TaskLogger logger);++}diff --git a/server-core/src/main/java/io/onedev/server/model/support/workspace/NamedWorkspaceQuery.java b/server-core/src/main/java/io/onedev/server/model/support/workspace/NamedWorkspaceQuery.javanew file mode 100644index 0000000000..d4296bb229--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/model/support/workspace/NamedWorkspaceQuery.java@@ -0,0 +1,48 @@+package io.onedev.server.model.support.workspace;++import javax.validation.constraints.NotEmpty;++import io.onedev.server.annotation.WorkspaceQuery;+import io.onedev.server.annotation.Editable;+import io.onedev.server.model.support.NamedQuery;++@Editable+public class NamedWorkspaceQuery implements NamedQuery {++ private static final long serialVersionUID = 1L;++ private String name;++ private String query;++ public NamedWorkspaceQuery(String name, String query) {+ this.name = name;+ this.query = query;+ }++ public NamedWorkspaceQuery() {+ }++ @Editable+ @NotEmpty+ @Override+ public String getName() {+ return name;+ }++ public void setName(String name) {+ this.name = name;+ }++ @Editable(placeholder="All")+ @WorkspaceQuery(withCurrentUserCriteria=true)+ @Override+ public String getQuery() {+ return query;+ }++ public void setQuery(String query) {+ this.query = query;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/model/support/workspace/ProjectWorkspaceSetting.java b/server-core/src/main/java/io/onedev/server/model/support/workspace/ProjectWorkspaceSetting.javanew file mode 100644index 0000000000..ef2cac2ff6--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/model/support/workspace/ProjectWorkspaceSetting.java@@ -0,0 +1,28 @@+package io.onedev.server.model.support.workspace;++import java.io.Serializable;+import java.util.List;++import org.jspecify.annotations.Nullable;+import javax.validation.Valid;++import io.onedev.server.annotation.Editable;++@Editable+public class ProjectWorkspaceSetting implements Serializable {++ private static final long serialVersionUID = 1L;++ private List<NamedWorkspaceQuery> namedQueries;++ @Nullable+ @Valid+ public List<NamedWorkspaceQuery> getNamedQueries() {+ return namedQueries;+ }++ public void setNamedQueries(@Nullable List<NamedWorkspaceQuery> namedQueries) {+ this.namedQueries = namedQueries;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/EnvVar.java b/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/EnvVar.javanew file mode 100644index 0000000000..346c007df0--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/EnvVar.java@@ -0,0 +1,40 @@+package io.onedev.server.model.support.workspace.spec;++import java.io.Serializable;++import javax.validation.constraints.NotEmpty;++import io.onedev.server.annotation.Editable;+import io.onedev.server.annotation.EnvVarName;++@Editable+public class EnvVar implements Serializable {++ private static final long serialVersionUID = 1L;++ private String name;++ private String value;++ @Editable(order=100, description="Specify name of the environment variable")+ @EnvVarName+ @NotEmpty+ public String getName() {+ return name;+ }++ public void setName(String name) {+ this.name = name;+ }++ @Editable(order=200, description="Specify value of the environment variable")+ @NotEmpty+ public String getValue() {+ return value;+ }++ public void setValue(String value) {+ this.value = value;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/RegistryLogin.java b/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/RegistryLogin.javanew file mode 100644index 0000000000..f6a06d1824--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/RegistryLogin.java@@ -0,0 +1,51 @@+package io.onedev.server.model.support.workspace.spec;++import java.io.Serializable;++import javax.validation.constraints.NotEmpty;++import io.onedev.server.annotation.Editable;+import io.onedev.server.annotation.Password;++@Editable+public class RegistryLogin implements Serializable {++ private static final long serialVersionUID = 1L;++ private String registryUrl;++ private String userName;++ private String password;++ @Editable(order=100, placeholder="Docker Hub", displayPlaceholderAsValue =true, description="Specify registry url. Leave empty for official registry")+ public String getRegistryUrl() {+ return registryUrl;+ }++ public void setRegistryUrl(String registryUrl) {+ this.registryUrl = registryUrl;+ }++ @Editable(order=200, description = "Specify user name of the registry")+ @NotEmpty+ public String getUserName() {+ return userName;+ }++ public void setUserName(String userName) {+ this.userName = userName;+ }++ @Editable(order=300, description = "Specify password or access token of the registry")+ @Password+ @NotEmpty+ public String getPassword() {+ return password;+ }++ public void setPassword(String password) {+ this.password = password;+ }++}\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/UserConfig.java b/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/UserConfig.javanew file mode 100644index 0000000000..80cec0f888--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/UserConfig.java@@ -0,0 +1,42 @@+package io.onedev.server.model.support.workspace.spec;++import java.io.Serializable;++import javax.validation.constraints.NotEmpty;++import io.onedev.server.annotation.Code;+import io.onedev.server.annotation.Editable;+import io.onedev.server.annotation.SubPath;++@Editable+public class UserConfig implements Serializable {++ private static final long serialVersionUID = 1L;++ private String path;++ private String content;++ @Editable(order=100, description="Specify path of the config file relative to home directory")+ @SubPath+ @NotEmpty+ public String getPath() {+ return path;+ }++ public void setPath(String path) {+ this.path = path;+ }++ @Editable(order=200, description="Specify content of the config file")+ @Code(language=Code.PLAIN_TEXT)+ @NotEmpty+ public String getContent() {+ return content;+ }++ public void setContent(String content) {+ this.content = content;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/WorkspaceSpec.java b/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/WorkspaceSpec.javanew file mode 100644index 0000000000..8e42b25a73--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/model/support/workspace/spec/WorkspaceSpec.java@@ -0,0 +1,138 @@+package io.onedev.server.model.support.workspace.spec;++import java.io.Serializable;+import java.util.ArrayList;+import java.util.List;++import javax.validation.Valid;+import javax.validation.constraints.NotEmpty;+import javax.validation.constraints.Pattern;++import io.onedev.server.annotation.DependsOn;+import io.onedev.server.annotation.Editable;+import io.onedev.server.buildspec.job.EnvVar;++@Editable+public class WorkspaceSpec implements Serializable {++ private static final long serialVersionUID = 1L;++ private String name;++ private boolean runInContainer;++ private String image;++ private String shell;++ private ArrayList<EnvVar> envVars = new ArrayList<>();++ private ArrayList<UserConfig> userConfigs = new ArrayList<>();++ private boolean retrieveLfs;++ private String runAs;++ private ArrayList<RegistryLogin> registryLogins = new ArrayList<>();++ @Editable(order = 50, description = "Specify a name to identify this workspace spec")+ @NotEmpty+ public String getName() {+ return name;+ }++ public void setName(String name) {+ this.name = name;+ }++ @Editable(order = 100, description = "Whether or not to run this environment inside container")+ public boolean isRunInContainer() {+ return runInContainer;+ }++ public void setRunInContainer(boolean runInContainer) {+ this.runInContainer = runInContainer;+ }++ @Editable(order = 200, name = "container:image", description = "Specify container image to execute commands inside")+ @DependsOn(property = "runInContainer")+ @NotEmpty+ public String getImage() {+ return image;+ }++ public void setImage(String image) {+ this.image = image;+ }++ @Editable(order = 300, name = "Shell", placeholder = "default", description = "Specify shell to be used. Leave empty to use default shell (cmd for Windows, sh for others)")+ public String getShell() {+ return shell;+ }++ public void setShell(String shell) {+ this.shell = shell;+ }++ @Editable(order = 400, name = "Environment Variables", description = "Optionally specify environment variables")+ @Valid+ public ArrayList<EnvVar> getEnvVars() {+ return envVars;+ }++ public void setEnvVars(ArrayList<EnvVar> envVars) {+ this.envVars = envVars;+ }++ @Editable(order = 500, name = "Config Files", description = """+ In order not to interfere with each other, each workspace has its own user home. \+ This setting populates user home with desired config files""")+ @Valid+ public ArrayList<UserConfig> getUserConfigs() {+ return userConfigs;+ }++ public void setUserConfigs(ArrayList<UserConfig> userConfigs) {+ this.userConfigs = userConfigs;+ }++ @Editable(order = 1100, name = "Retrieve LFS Files", description = "Enable this to retrieve Git LFS files")+ public boolean isRetrieveLfs() {+ return retrieveLfs;+ }++ public void setRetrieveLfs(boolean retrieveLfs) {+ this.retrieveLfs = retrieveLfs;+ }++ @Editable(order = 1400, name = "Run As", group = "More Settings", placeholder = "root", description = """+ Optionally specify uid:gid to run container as. \+ <b class='text-warning'>Note:</b> This setting should be left empty if container runtime is rootless or \+ using user namespace remapping+ """)+ @DependsOn(property = "runInContainer")+ @Pattern(regexp = "(\\d+:\\d+)?", message = "Should be specified in form of <uid>:<gid>")+ public String getRunAs() {+ return runAs;+ }++ public void setRunAs(String runAs) {+ this.runAs = runAs;+ }++ @Editable(order = 1500, group = "More Settings", description = """+ Optionally specify registry logins to override those defined in workspace provisioner. \+ For built-in registry, use <code>@server_url@</code> for registry url, \+ <code>@workspace_token@</code> for user name, and access token for password+ """)+ @DependsOn(property = "runInContainer")+ @Valid+ public List<RegistryLogin> getRegistryLogins() {+ return registryLogins;+ }++ public void setRegistryLogins(ArrayList<RegistryLogin> registryLogins) {+ this.registryLogins = registryLogins;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/notification/NotificationUtils.java b/server-core/src/main/java/io/onedev/server/notification/NotificationUtils.javaindex ff9a13fdd1..d7cfa19d16 100644--- a/server-core/src/main/java/io/onedev/server/notification/NotificationUtils.java+++ b/server-core/src/main/java/io/onedev/server/notification/NotificationUtils.java@@ -5,6 +5,7 @@ import io.onedev.server.service.SettingService;import io.onedev.server.event.Event;import io.onedev.server.event.project.RefUpdated;import io.onedev.server.event.project.build.BuildEvent;+import io.onedev.server.event.project.workspace.WorkspaceEvent;import io.onedev.server.event.project.issue.IssueEvent;import io.onedev.server.event.project.pack.PackEvent;import io.onedev.server.event.project.pullrequest.PullRequestEvent;@@ -49,6 +50,9 @@ public class NotificationUtils {} else if (event instanceof PackEvent) {template = templates.getPackNotification();bindings.put("pack", ((PackEvent) event).getPack());+ } else if (event instanceof WorkspaceEvent) {+ template = templates.getWorkspaceNotification();+ bindings.put("workspace", ((WorkspaceEvent) event).getWorkspace());} else if (event instanceof RefUpdated) {var refUpdated = (RefUpdated) event;template = templates.getCommitNotification();diff --git a/server-core/src/main/java/io/onedev/server/notification/WorkspaceNotificationManager.java b/server-core/src/main/java/io/onedev/server/notification/WorkspaceNotificationManager.javanew file mode 100644index 0000000000..2a036e57e1--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/notification/WorkspaceNotificationManager.java@@ -0,0 +1,191 @@+package io.onedev.server.notification;++import static io.onedev.server.notification.NotificationUtils.getEmailBody;+import static java.util.stream.Collectors.toList;++import java.util.Collection;+import java.util.HashMap;+import java.util.HashSet;+import java.util.Map;++import javax.inject.Inject;+import javax.inject.Singleton;++import org.apache.shiro.authz.Permission;+import org.jspecify.annotations.Nullable;+import org.slf4j.Logger;+import org.slf4j.LoggerFactory;++import com.google.common.collect.Lists;++import io.onedev.server.event.Listen;+import io.onedev.server.event.project.workspace.WorkspaceEvent;+import io.onedev.server.mail.MailService;+import io.onedev.server.model.EmailAddress;+import io.onedev.server.model.Project;+import io.onedev.server.model.User;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.WorkspaceQueryPersonalization;+import io.onedev.server.model.support.NamedQuery;+import io.onedev.server.persistence.annotation.Sessional;+import io.onedev.server.search.entity.workspace.WorkspaceQuery;+import io.onedev.server.security.permission.ProjectPermission;+import io.onedev.server.security.permission.WriteCode;+import io.onedev.server.service.SettingService;+import io.onedev.server.service.UrlService;+import io.onedev.server.service.UserService;++@Singleton+public class WorkspaceNotificationManager {++ private static final Logger logger = LoggerFactory.getLogger(WorkspaceNotificationManager.class);++ @Inject+ private MailService mailService;++ @Inject+ private UrlService urlService;++ @Inject+ private UserService userService;++ @Inject+ private SettingService settingService;++ private void fillSubscribedQueryStrings(Map<User, Collection<String>> subscribedQueryStrings,+ User user, @Nullable NamedQuery query) {+ if (query != null) {+ Collection<String> value = subscribedQueryStrings.get(user);+ if (value == null) {+ value = new HashSet<>();+ subscribedQueryStrings.put(user, value);+ }+ value.add(query.getQuery());+ }+ }++ @Sessional+ public void notify(WorkspaceEvent event, Collection<String> emails) {+ emails = emails.stream().filter(it -> !it.equals(User.SYSTEM_EMAIL_ADDRESS)).collect(toList());++ if (!emails.isEmpty()) {+ Workspace workspace = event.getWorkspace();+ String subject = String.format("[Workspace #%d] %s",+ workspace.getNumber(),+ event.getActivity());++ String summary = String.format("Dev session %s by user %s on branch %s",+ event.getActivity(),+ workspace.getUser().getDisplayName(),+ workspace.getBranch());++ String url = urlService.urlFor(workspace, true);+ String threadingReferences = "<" + workspace.getProject().getPath()+ + "-workspace-" + workspace.getNumber() + "@onedev>";+ String htmlBody = getEmailBody(true, event, summary, null, url, false, null);+ String textBody = getEmailBody(false, event, summary, null, url, false, null);+ mailService.sendMailAsync(Lists.newArrayList(), Lists.newArrayList(), emails, subject, htmlBody,+ textBody, null, null, threadingReferences);+ }+ }++ @Sessional+ @Listen+ public void on(WorkspaceEvent event) {+ if (event.getUser() == null || event.getUser().getType() != User.Type.SERVICE) {+ Project project = event.getProject();+ Map<User, Collection<String>> subscribedQueryStrings = new HashMap<>();+ for (WorkspaceQueryPersonalization personalization : project.getWorkspaceQueryPersonalizations()) {+ for (String name : personalization.getQuerySubscriptionSupport().getQuerySubscriptions()) {+ String commonName = NamedQuery.getCommonName(name);+ if (commonName != null) {+ // Skip common query subscription if a personal query with same name exists+ if (NamedQuery.find(personalization.getQueries(), commonName) == null) {+ fillSubscribedQueryStrings(subscribedQueryStrings, personalization.getUser(),+ NamedQuery.find(project.getNamedWorkspaceQueries(), commonName));+ }+ }+ String personalName = NamedQuery.getPersonalName(name);+ if (personalName != null) {+ fillSubscribedQueryStrings(subscribedQueryStrings, personalization.getUser(),+ NamedQuery.find(personalization.getQueries(), personalName));+ }+ }+ }++ Workspace workspace = event.getWorkspace();+ Collection<String> notifyEmails = new HashSet<>();+ for (Map.Entry<User, Collection<String>> entry : subscribedQueryStrings.entrySet()) {+ User user = entry.getKey();+ Permission permission = new ProjectPermission(workspace.getProject(), new WriteCode());+ if (user.asSubject().isPermitted(permission)) {+ for (String queryString : entry.getValue()) {+ User.push(user);+ try {+ if (WorkspaceQuery.parse(event.getProject(), queryString, true).matches(workspace)) {+ EmailAddress emailAddress = user.getPrimaryEmailAddress();+ if (emailAddress != null && emailAddress.isVerified())+ notifyEmails.add(emailAddress.getValue());+ break;+ }+ } catch (Exception e) {+ String message = String.format(+ "Error processing workspace subscription (user: %s, project: %s, workspace: #%d, query: %s)",+ user.getName(), workspace.getProject().getPath(), workspace.getNumber(), queryString);+ logger.error(message, e);+ } finally {+ User.pop();+ }+ }+ }+ }++ subscribedQueryStrings.clear();+ for (User user : userService.query()) {+ for (String name : user.getWorkspaceQueryPersonalization().getQuerySubscriptionSupport().getQuerySubscriptions()) {+ String globalName = NamedQuery.getCommonName(name);+ if (globalName != null) {+ // Skip common query subscription if a personal query with same name exists+ if (NamedQuery.find(user.getWorkspaceQueryPersonalization().getQueries(), globalName) == null) {+ fillSubscribedQueryStrings(subscribedQueryStrings, user,+ NamedQuery.find(settingService.getWorkspaceSetting().getNamedQueries(), globalName));+ }+ }+ String personalName = NamedQuery.getPersonalName(name);+ if (personalName != null) {+ fillSubscribedQueryStrings(subscribedQueryStrings, user,+ NamedQuery.find(user.getWorkspaceQueryPersonalization().getQueries(), personalName));+ }+ }+ }++ for (Map.Entry<User, Collection<String>> entry : subscribedQueryStrings.entrySet()) {+ User user = entry.getKey();+ Permission permission = new ProjectPermission(workspace.getProject(), new WriteCode());+ if (user.asSubject().isPermitted(permission)) {+ for (String queryString : entry.getValue()) {+ User.push(user);+ try {+ if (WorkspaceQuery.parse(null, queryString, true).matches(workspace)) {+ EmailAddress emailAddress = user.getPrimaryEmailAddress();+ if (emailAddress != null && emailAddress.isVerified())+ notifyEmails.add(emailAddress.getValue());+ break;+ }+ } catch (Exception e) {+ String message = String.format(+ "Error processing workspace subscription (user: %s, project: %s, workspace: #%d, query: %s)",+ user.getName(), workspace.getProject().getPath(), workspace.getNumber(), queryString);+ logger.error(message, e);+ } finally {+ User.pop();+ }+ }+ }+ }++ notify(event, notifyEmails);+ }+ }++}diff --git a/server-core/src/main/java/io/onedev/server/rest/resource/BuildLogStreamResource.java b/server-core/src/main/java/io/onedev/server/rest/resource/BuildLogStreamResource.javaindex c06ec9bc70..a6aab1861f 100644--- a/server-core/src/main/java/io/onedev/server/rest/resource/BuildLogStreamResource.java+++ b/server-core/src/main/java/io/onedev/server/rest/resource/BuildLogStreamResource.java@@ -3,9 +3,11 @@ package io.onedev.server.rest.resource;import com.fasterxml.jackson.databind.ObjectMapper;import io.onedev.server.buildspec.job.log.JobLogEntryEx;import io.onedev.server.service.BuildService;-import io.onedev.server.job.log.LogListener;-import io.onedev.server.job.log.LogService;-import io.onedev.server.job.log.LogSnippet;+import io.onedev.server.logging.BuildLoggingSupport;+import io.onedev.server.logging.LogListener;+import io.onedev.server.logging.LogService;+import io.onedev.server.logging.LogSnippet;+import io.onedev.server.logging.LoggingSupport;import io.onedev.server.model.Build;import io.onedev.server.model.Build.Status;import io.onedev.server.persistence.SessionService;@@ -62,8 +64,7 @@ public class BuildLogStreamResource {if (!SecurityUtils.canAccessLog(build))throw new UnauthorizedException();- var projectId = build.getProject().getId();- var buildNumber = build.getNumber();+ var loggingSupport = build.getLoggingSupport();var buildStatus = build.getStatus();return os -> {@@ -71,8 +72,9 @@ public class BuildLogStreamResource {var logListener = new LogListener() {@Override- public void logged(Long loggedBuildId) {- if (loggedBuildId.equals(buildId)) {+ public void logged(LoggingSupport loggingSupport) {+ if (loggingSupport instanceof BuildLoggingSupport buildLoggingSupport+ && buildLoggingSupport.getBuildId().equals(buildId)) {synchronized (os) {os.notify();}@@ -84,7 +86,7 @@ public class BuildLogStreamResource {sessionService.closeSession();try {var nextOffset = 0;- LogSnippet snippet = logService.readLogSnippetReversely(projectId, buildNumber, MAX_LOG_ENTRIES + 1);+ LogSnippet snippet = logService.readLogSnippetReversely(loggingSupport, MAX_LOG_ENTRIES + 1);nextOffset = snippet.offset + snippet.entries.size();for (var entry : snippet.entries)writeEntry(os, entry);@@ -96,7 +98,7 @@ public class BuildLogStreamResource {} catch (InterruptedException e) {throw new RuntimeException(e);}- var entries = logService.readLogEntries(projectId, buildNumber, nextOffset, 0);+ var entries = logService.readLogEntries(loggingSupport, nextOffset, 0);if (!entries.isEmpty()) {nextOffset += entries.size();for (var entry : entries)diff --git a/server-core/src/main/java/io/onedev/server/rest/resource/ProjectResource.java b/server-core/src/main/java/io/onedev/server/rest/resource/ProjectResource.javaindex 095f8ca447..4ac6fa43aa 100644--- a/server-core/src/main/java/io/onedev/server/rest/resource/ProjectResource.java+++ b/server-core/src/main/java/io/onedev/server/rest/resource/ProjectResource.java@@ -60,6 +60,7 @@ import io.onedev.server.model.support.code.BranchProtection;import io.onedev.server.model.support.code.GitPackConfig;import io.onedev.server.model.support.code.TagProtection;import io.onedev.server.model.support.issue.ProjectIssueSetting;+import io.onedev.server.model.support.workspace.ProjectWorkspaceSetting;import io.onedev.server.model.support.pack.ProjectPackSetting;import io.onedev.server.model.support.pullrequest.ProjectPullRequestSetting;import io.onedev.server.persistence.dao.EntityCriteria;@@ -309,6 +310,7 @@ public class ProjectResource {project.getBuildSetting().setNamedQueries(forkedFrom.getBuildSetting().getNamedQueries());project.setPackSetting(forkedFrom.getPackSetting());project.setPullRequestSetting(forkedFrom.getPullRequestSetting());+ project.setWorkspaceSetting(forkedFrom.getWorkspaceSetting());project.setNamedCommitQueries(forkedFrom.getNamedCommitQueries());project.setIssueSetting(forkedFrom.getIssueSetting());project.setNamedCodeCommentQueries(forkedFrom.getNamedCodeCommentQueries());@@ -675,6 +677,8 @@ public class ProjectResource {private ProjectPackSetting packSetting = new ProjectPackSetting();private ProjectPullRequestSetting pullRequestSetting = new ProjectPullRequestSetting();++ private ProjectWorkspaceSetting workspaceSetting = new ProjectWorkspaceSetting();private ArrayList<NamedCommitQuery> namedCommitQueries = new ArrayList<>();@@ -738,6 +742,15 @@ public class ProjectResource {this.pullRequestSetting = pullRequestSetting;}+ @Valid+ public ProjectWorkspaceSetting getWorkspaceSetting() {+ return workspaceSetting;+ }++ public void setWorkspaceSetting(ProjectWorkspaceSetting workspaceSetting) {+ this.workspaceSetting = workspaceSetting;+ }+@Validpublic ArrayList<NamedCommitQuery> getNamedCommitQueries() {return namedCommitQueries;@@ -783,6 +796,7 @@ public class ProjectResource {project.setNamedCodeCommentQueries(getNamedCodeCommentQueries());project.setNamedCommitQueries(getNamedCommitQueries());project.setPullRequestSetting(getPullRequestSetting());+ project.setWorkspaceSetting(getWorkspaceSetting());project.setWebHooks(getWebHooks());var contributedSettings = new LinkedHashMap<String, ContributedProjectSetting>();for (var contributedSetting: getContributedSettings())@@ -800,6 +814,7 @@ public class ProjectResource {setting.setNamedCodeCommentQueries(project.getNamedCodeCommentQueries());setting.setNamedCommitQueries(project.getNamedCommitQueries());setting.setPullRequestSetting(project.getPullRequestSetting());+ setting.setWorkspaceSetting(project.getWorkspaceSetting());setting.setWebHooks(project.getWebHooks());setting.getContributedSettings().addAll(project.getContributedSettings().values());diff --git a/server-core/src/main/java/io/onedev/server/rest/resource/RepositoryResource.java b/server-core/src/main/java/io/onedev/server/rest/resource/RepositoryResource.javaindex cef2c7285e..f5f3fae2f5 100644--- a/server-core/src/main/java/io/onedev/server/rest/resource/RepositoryResource.java+++ b/server-core/src/main/java/io/onedev/server/rest/resource/RepositoryResource.java@@ -11,7 +11,6 @@ import java.util.List;import java.util.Map;import java.util.Set;-import org.jspecify.annotations.Nullable;import javax.inject.Inject;import javax.inject.Singleton;import javax.validation.constraints.NotEmpty;@@ -33,6 +32,7 @@ import org.apache.shiro.authz.UnauthorizedException;import org.eclipse.jgit.lib.FileMode;import org.eclipse.jgit.lib.ObjectId;import org.eclipse.jgit.lib.PersonIdent;+import org.jspecify.annotations.Nullable;import com.fasterxml.jackson.core.JsonProcessingException;import com.fasterxml.jackson.databind.ObjectMapper;@@ -40,7 +40,6 @@ import com.google.common.base.Splitter;import io.onedev.commons.utils.ExplicitException;import io.onedev.commons.utils.StringUtils;-import io.onedev.server.service.ProjectService;import io.onedev.server.git.Blob;import io.onedev.server.git.BlobContent;import io.onedev.server.git.BlobEdits;@@ -60,7 +59,9 @@ import io.onedev.server.rest.resource.support.FileCreateOrUpdateRequest;import io.onedev.server.rest.resource.support.FileEditRequest;import io.onedev.server.search.commit.CommitQuery;import io.onedev.server.security.SecurityUtils;+import io.onedev.server.service.ProjectService;import io.onedev.server.util.RevisionAndPath;+import io.onedev.server.workspace.WorkspaceService;@Path("/repositories")@Consumes(MediaType.APPLICATION_JSON)@@ -70,19 +71,18 @@ public class RepositoryResource {private static final int MAX_COMMITS = 10000;- private final ProjectService projectService;+ @Inject+ private ProjectService projectService;- private final GitService gitService;-- private final ObjectMapper mapper;-@Inject- public RepositoryResource(ProjectService projectService, GitService gitService, ObjectMapper mapper) {- this.projectService = projectService;- this.gitService = gitService;- this.mapper = mapper;- }+ private GitService gitService;+ @Inject+ private WorkspaceService workspaceService;++ @Inject+ private ObjectMapper objectMapper;+@Api(order=10, description="List all branches")@Path("/{projectId}/branches")@GET@@ -119,7 +119,7 @@ public class RepositoryResource {throw new UnauthorizedException();try {- project.setDefaultBranch(mapper.readValue(defaultBranch, String.class));+ project.setDefaultBranch(objectMapper.readValue(defaultBranch, String.class));} catch (JsonProcessingException e) {throw new RuntimeException(e);}@@ -181,8 +181,11 @@ public class RepositoryResource {public Response deleteBranch(@PathParam("projectId") Long projectId,@PathParam("branch") @Api(example="test-branch") String branchName) {Project project = projectService.load(projectId);- if (!SecurityUtils.canDeleteBranch(project, branchName)) {+ if (!SecurityUtils.canDeleteBranch(project, branchName))throw new UnauthorizedException();++ if (workspaceService.count(project, branchName) > 0) {+ throw new NotAcceptableException("Can not delete branch '" + branchName + "' as there are workspaces on it");}projectService.deleteBranch(project, branchName);diff --git a/server-core/src/main/java/io/onedev/server/rest/resource/SettingResource.java b/server-core/src/main/java/io/onedev/server/rest/resource/SettingResource.javaindex 0a4d9c7811..58c3498ab3 100644--- a/server-core/src/main/java/io/onedev/server/rest/resource/SettingResource.java+++ b/server-core/src/main/java/io/onedev/server/rest/resource/SettingResource.java@@ -27,6 +27,7 @@ import io.onedev.server.service.AuditService;import io.onedev.server.service.SettingService;import io.onedev.server.model.support.administration.BackupSetting;import io.onedev.server.model.support.administration.GlobalBuildSetting;+import io.onedev.server.model.support.administration.GlobalWorkspaceSetting;import io.onedev.server.model.support.administration.GlobalIssueSetting;import io.onedev.server.model.support.administration.GlobalProjectSetting;import io.onedev.server.model.support.administration.GlobalPullRequestSetting;@@ -167,6 +168,16 @@ public class SettingResource {return settingService.getPullRequestSetting();}+ @Api(order=1150)+ @Path("/workspace")+ @GET+ public GlobalWorkspaceSetting getWorkspaceSetting() {+ if (!SecurityUtils.isAdministrator())+ throw new UnauthorizedException();+ return settingService.getWorkspaceSetting();+ }++@Api(order=1200)@Path("/security")@GET@@ -353,7 +364,20 @@ public class SettingResource {oldAuditContent, VersionedXmlDoc.fromBean(pullRequestSetting).toXML());return Response.ok().build();}-++ @Api(order=2450)+ @Path("/workspace")+ @POST+ public Response setWorkspaceSetting(@NotNull @Valid GlobalWorkspaceSetting workspaceSetting) {+ if (!SecurityUtils.isAdministrator())+ throw new UnauthorizedException();+ var oldAuditContent = VersionedXmlDoc.fromBean(settingService.getWorkspaceSetting()).toXML();+ settingService.saveWorkspaceSetting(workspaceSetting);+ auditService.audit(null, "changed workspace settings via RESTful API",+ oldAuditContent, VersionedXmlDoc.fromBean(workspaceSetting).toXML());+ return Response.ok().build();+ }+@Api(order=2500)@Path("/security")@POSTdiff --git a/server-core/src/main/java/io/onedev/server/rest/resource/UserResource.java b/server-core/src/main/java/io/onedev/server/rest/resource/UserResource.javaindex e2742ca98d..2b53d495f1 100644--- a/server-core/src/main/java/io/onedev/server/rest/resource/UserResource.java+++ b/server-core/src/main/java/io/onedev/server/rest/resource/UserResource.java@@ -46,6 +46,7 @@ import io.onedev.server.model.AccessToken;import io.onedev.server.model.BuildQueryPersonalization;import io.onedev.server.model.CodeCommentQueryPersonalization;import io.onedev.server.model.CommitQueryPersonalization;+import io.onedev.server.model.WorkspaceQueryPersonalization;import io.onedev.server.model.EmailAddress;import io.onedev.server.model.IssueQueryPersonalization;import io.onedev.server.model.IssueVote;@@ -60,6 +61,8 @@ import io.onedev.server.model.User;import io.onedev.server.model.UserAuthorization;import io.onedev.server.model.support.NamedProjectQuery;import io.onedev.server.model.support.build.NamedBuildQuery;+import io.onedev.server.model.support.workspace.NamedWorkspaceQuery;+import io.onedev.server.model.support.pack.NamedPackQuery;import io.onedev.server.model.support.issue.NamedIssueQuery;import io.onedev.server.model.support.pullrequest.NamedPullRequestQuery;import io.onedev.server.rest.annotation.Api;@@ -249,7 +252,17 @@ public class UserResource {throw new UnauthorizedException();return user.getPullRequestQueryPersonalizations();}-++ @Api(order=1350)+ @Path("/{userId}/project-workspace-query-personalizations")+ @GET+ public Collection<WorkspaceQueryPersonalization> getProjectWorkspaceQueryPersonalizations(@PathParam("userId") Long userId) {+ User user = userService.load(userId);+ if (!SecurityUtils.isAdministrator() && !user.equals(getAuthUser()))+ throw new UnauthorizedException();+ return user.getWorkspaceQueryPersonalizations();+ }+@Api(order=1400)@Path("/{userId}/pull-request-assignments")@GET@@ -289,6 +302,10 @@ public class UserResource {queriesAndWatches.issueQueries = user.getIssueQueries();queriesAndWatches.projectQueries = user.getProjectQueries();queriesAndWatches.pullRequestQueries = user.getPullRequestQueries();+ queriesAndWatches.packQueries = user.getPackQueries();+ queriesAndWatches.packQuerySubscriptions = user.getPackQuerySubscriptions();+ queriesAndWatches.workspaceQueries = user.getWorkspaceQueries();+ queriesAndWatches.workspaceQuerySubscriptions = user.getWorkspaceQuerySubscriptions();return queriesAndWatches;}@@ -522,9 +539,12 @@ public class UserResource {user.setPullRequestQueryWatches(queriesAndWatches.pullRequestQueryWatches);user.setBuildQueries(queriesAndWatches.buildQueries);user.setIssueQueries(queriesAndWatches.issueQueries);- user.setIssueQueryWatches(queriesAndWatches.issueQueryWatches);user.setProjectQueries(queriesAndWatches.projectQueries);user.setPullRequestQueries(queriesAndWatches.pullRequestQueries);+ user.setPackQueries(queriesAndWatches.packQueries);+ user.setPackQuerySubscriptions(queriesAndWatches.packQuerySubscriptions);+ user.setWorkspaceQueries(queriesAndWatches.workspaceQueries);+ user.setWorkspaceQuerySubscriptions(queriesAndWatches.workspaceQuerySubscriptions);userService.update(user, null);if (!getAuthUser().equals(user)) {@@ -794,6 +814,14 @@ public class UserResource {ArrayList<NamedBuildQuery> buildQueries;LinkedHashSet<String> buildQuerySubscriptions;++ ArrayList<NamedPackQuery> packQueries;++ LinkedHashSet<String> packQuerySubscriptions;++ ArrayList<NamedWorkspaceQuery> workspaceQueries;++ LinkedHashSet<String> workspaceQuerySubscriptions;}}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/ActiveCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/ActiveCriteria.javanew file mode 100644index 0000000000..add662d7f1--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/ActiveCriteria.java@@ -0,0 +1,19 @@+package io.onedev.server.search.entity.workspace;++import io.onedev.server.model.Workspace;++public class ActiveCriteria extends StatusCriteria {++ private static final long serialVersionUID = 1L;++ @Override+ public Workspace.Status getStatus() {+ return Workspace.Status.ACTIVE;+ }++ @Override+ public String toStringWithoutParens() {+ return WorkspaceQuery.getRuleName(WorkspaceQueryLexer.Active);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/ActiveDateCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/ActiveDateCriteria.javanew file mode 100644index 0000000000..c1b738c159--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/ActiveDateCriteria.java@@ -0,0 +1,67 @@+package io.onedev.server.search.entity.workspace;++import java.util.Date;++import org.jspecify.annotations.Nullable;+import javax.persistence.criteria.CriteriaBuilder;+import javax.persistence.criteria.CriteriaQuery;+import javax.persistence.criteria.From;+import javax.persistence.criteria.Path;+import javax.persistence.criteria.Predicate;++import io.onedev.server.model.Workspace;+import io.onedev.server.search.entity.EntityQuery;+import io.onedev.server.util.ProjectScope;+import io.onedev.server.util.criteria.Criteria;++public class ActiveDateCriteria extends Criteria<Workspace> {++ private static final long serialVersionUID = 1L;++ private final int operator;++ private final Date date;++ private final String value;++ public ActiveDateCriteria(String value, int operator) {+ date = EntityQuery.getDateValue(value);+ this.operator = operator;+ this.value = value;+ }++ public int getOperator() {+ return operator;+ }++ public Date getDate() {+ return date;+ }++ @Override+ public Predicate getPredicate(@Nullable ProjectScope projectScope, CriteriaQuery<?> query, From<Workspace, Workspace> from, CriteriaBuilder builder) {+ Path<Date> attribute = from.get(Workspace.PROP_ACTIVE_DATE);+ if (operator == WorkspaceQueryLexer.IsUntil)+ return builder.lessThan(attribute, date);+ else+ return builder.greaterThan(attribute, date);+ }++ @Override+ public boolean matches(Workspace workspace) {+ if (workspace.getActiveDate() == null)+ return false;+ if (operator == WorkspaceQueryLexer.IsUntil)+ return workspace.getActiveDate().before(date);+ else+ return workspace.getActiveDate().after(date);+ }++ @Override+ public String toStringWithoutParens() {+ return quote(Workspace.NAME_ACTIVE_DATE) + " "+ + WorkspaceQuery.getRuleName(operator) + " "+ + quote(value);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/BranchCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/BranchCriteria.javanew file mode 100644index 0000000000..6e9dcca2c5--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/BranchCriteria.java@@ -0,0 +1,53 @@+package io.onedev.server.search.entity.workspace;++import org.jspecify.annotations.Nullable;+import javax.persistence.criteria.CriteriaBuilder;+import javax.persistence.criteria.CriteriaQuery;+import javax.persistence.criteria.From;+import javax.persistence.criteria.Path;+import javax.persistence.criteria.Predicate;++import io.onedev.commons.utils.match.WildcardUtils;+import io.onedev.server.model.Workspace;+import io.onedev.server.util.ProjectScope;+import io.onedev.server.util.criteria.Criteria;++public class BranchCriteria extends Criteria<Workspace> {++ private static final long serialVersionUID = 1L;++ private final String value;++ private final int operator;++ public BranchCriteria(String value, int operator) {+ this.value = value;+ this.operator = operator;+ }++ @Override+ public Predicate getPredicate(@Nullable ProjectScope projectScope, CriteriaQuery<?> query, From<Workspace, Workspace> from, CriteriaBuilder builder) {+ Path<String> attribute = from.get(Workspace.PROP_BRANCH);+ String normalized = value.toLowerCase().replace("*", "%");+ var predicate = builder.like(builder.lower(attribute), normalized);+ if (operator == WorkspaceQueryLexer.IsNot)+ predicate = builder.not(predicate);+ return predicate;+ }++ @Override+ public boolean matches(Workspace workspace) {+ var matches = WildcardUtils.matchString(value.toLowerCase(), workspace.getBranch().toLowerCase());+ if (operator == WorkspaceQueryLexer.IsNot)+ matches = !matches;+ return matches;+ }++ @Override+ public String toStringWithoutParens() {+ return quote(Workspace.NAME_BRANCH) + " "+ + WorkspaceQuery.getRuleName(operator) + " "+ + quote(value);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/CreateDateCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/CreateDateCriteria.javanew file mode 100644index 0000000000..b2aca8407d--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/CreateDateCriteria.java@@ -0,0 +1,65 @@+package io.onedev.server.search.entity.workspace;++import java.util.Date;++import org.jspecify.annotations.Nullable;+import javax.persistence.criteria.CriteriaBuilder;+import javax.persistence.criteria.CriteriaQuery;+import javax.persistence.criteria.From;+import javax.persistence.criteria.Path;+import javax.persistence.criteria.Predicate;++import io.onedev.server.model.Workspace;+import io.onedev.server.search.entity.EntityQuery;+import io.onedev.server.util.ProjectScope;+import io.onedev.server.util.criteria.Criteria;++public class CreateDateCriteria extends Criteria<Workspace> {++ private static final long serialVersionUID = 1L;++ private final int operator;++ private final Date date;++ private final String value;++ public CreateDateCriteria(String value, int operator) {+ date = EntityQuery.getDateValue(value);+ this.operator = operator;+ this.value = value;+ }++ public int getOperator() {+ return operator;+ }++ public Date getDate() {+ return date;+ }++ @Override+ public Predicate getPredicate(@Nullable ProjectScope projectScope, CriteriaQuery<?> query, From<Workspace, Workspace> from, CriteriaBuilder builder) {+ Path<Date> attribute = from.get(Workspace.PROP_CREATE_DATE);+ if (operator == WorkspaceQueryLexer.IsUntil)+ return builder.lessThan(attribute, date);+ else+ return builder.greaterThan(attribute, date);+ }++ @Override+ public boolean matches(Workspace workspace) {+ if (operator == WorkspaceQueryLexer.IsUntil)+ return workspace.getCreateDate().before(date);+ else+ return workspace.getCreateDate().after(date);+ }++ @Override+ public String toStringWithoutParens() {+ return quote(Workspace.NAME_CREATE_DATE) + " "+ + WorkspaceQuery.getRuleName(operator) + " "+ + quote(value);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/CreatedByCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/CreatedByCriteria.javanew file mode 100644index 0000000000..202d1a4c5a--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/CreatedByCriteria.java@@ -0,0 +1,14 @@+package io.onedev.server.search.entity.workspace;++import org.jspecify.annotations.Nullable;++import io.onedev.server.model.Workspace;+import io.onedev.server.model.User;+import io.onedev.server.util.criteria.Criteria;++public abstract class CreatedByCriteria extends Criteria<Workspace> {++ @Nullable+ public abstract User getCreator();++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/CreatedByMeCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/CreatedByMeCriteria.javanew file mode 100644index 0000000000..5721a1ed86--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/CreatedByMeCriteria.java@@ -0,0 +1,50 @@+package io.onedev.server.search.entity.workspace;++import static io.onedev.server.web.translation.Translation._T;++import org.jspecify.annotations.Nullable;+import javax.persistence.criteria.CriteriaBuilder;+import javax.persistence.criteria.CriteriaQuery;+import javax.persistence.criteria.From;+import javax.persistence.criteria.Path;+import javax.persistence.criteria.Predicate;++import io.onedev.commons.utils.ExplicitException;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.User;+import io.onedev.server.security.SecurityUtils;+import io.onedev.server.util.ProjectScope;++public class CreatedByMeCriteria extends CreatedByCriteria {++ private static final long serialVersionUID = 1L;++ @Override+ public Predicate getPredicate(@Nullable ProjectScope projectScope, CriteriaQuery<?> query, From<Workspace, Workspace> from, CriteriaBuilder builder) {+ if (User.get() != null) {+ Path<User> attribute = from.get(Workspace.PROP_USER);+ return builder.equal(attribute, User.get());+ } else {+ throw new ExplicitException(_T("Please login to perform this query"));+ }+ }++ @Override+ public User getCreator() {+ return SecurityUtils.getUser();+ }++ @Override+ public boolean matches(Workspace workspace) {+ if (User.get() != null)+ return User.get().equals(workspace.getUser());+ else+ throw new ExplicitException(_T("Please login to perform this query"));+ }++ @Override+ public String toStringWithoutParens() {+ return WorkspaceQuery.getRuleName(WorkspaceQueryLexer.CreatedByMe);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/CreatedByUserCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/CreatedByUserCriteria.javanew file mode 100644index 0000000000..ede8f9dd0a--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/CreatedByUserCriteria.java@@ -0,0 +1,47 @@+package io.onedev.server.search.entity.workspace;++import java.util.Objects;++import org.jspecify.annotations.Nullable;+import javax.persistence.criteria.CriteriaBuilder;+import javax.persistence.criteria.CriteriaQuery;+import javax.persistence.criteria.From;+import javax.persistence.criteria.Path;+import javax.persistence.criteria.Predicate;++import io.onedev.server.model.Workspace;+import io.onedev.server.model.User;+import io.onedev.server.util.ProjectScope;++public class CreatedByUserCriteria extends CreatedByCriteria {++ private static final long serialVersionUID = 1L;++ private final User user;++ public CreatedByUserCriteria(User user) {+ this.user = user;+ }++ @Override+ public User getCreator() {+ return user;+ }++ @Override+ public Predicate getPredicate(@Nullable ProjectScope projectScope, CriteriaQuery<?> query, From<Workspace, Workspace> from, CriteriaBuilder builder) {+ Path<User> attribute = from.get(Workspace.PROP_USER);+ return builder.equal(attribute, user);+ }++ @Override+ public boolean matches(Workspace workspace) {+ return Objects.equals(workspace.getUser(), user);+ }++ @Override+ public String toStringWithoutParens() {+ return WorkspaceQuery.getRuleName(WorkspaceQueryLexer.CreatedBy) + " " + quote(user.getName());+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/ErrorCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/ErrorCriteria.javanew file mode 100644index 0000000000..f40f75c6c6--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/ErrorCriteria.java@@ -0,0 +1,19 @@+package io.onedev.server.search.entity.workspace;++import io.onedev.server.model.Workspace;++public class ErrorCriteria extends StatusCriteria {++ private static final long serialVersionUID = 1L;++ @Override+ public Workspace.Status getStatus() {+ return Workspace.Status.ERROR;+ }++ @Override+ public String toStringWithoutParens() {+ return WorkspaceQuery.getRuleName(WorkspaceQueryLexer.Error);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/FuzzyCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/FuzzyCriteria.javanew file mode 100644index 0000000000..75e948838b--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/FuzzyCriteria.java@@ -0,0 +1,49 @@+package io.onedev.server.search.entity.workspace;++import javax.persistence.criteria.CriteriaBuilder;+import javax.persistence.criteria.CriteriaQuery;+import javax.persistence.criteria.From;+import javax.persistence.criteria.Predicate;++import org.jspecify.annotations.Nullable;++import io.onedev.commons.utils.StringUtils;+import io.onedev.server.model.Workspace;+import io.onedev.server.util.ProjectScope;+import io.onedev.server.util.criteria.Criteria;+import io.onedev.server.util.criteria.OrCriteria;++public class FuzzyCriteria extends Criteria<Workspace> {++ private static final long serialVersionUID = 1L;++ private final String value;++ public FuzzyCriteria(String value) {+ this.value = value;+ }++ @Override+ public Predicate getPredicate(@Nullable ProjectScope projectScope, CriteriaQuery<?> query,+ From<Workspace, Workspace> from, CriteriaBuilder builder) {+ return parse(value).getPredicate(projectScope, query, from, builder);+ }++ @Override+ public boolean matches(Workspace workspace) {+ return parse(value).matches(workspace);+ }++ @SuppressWarnings("unchecked")+ private Criteria<Workspace> parse(String value) {+ return new OrCriteria<>(+ new BranchCriteria("*" + value + "*", WorkspaceQueryLexer.Is),+ new SpecCriteria("*" + value + "*", WorkspaceQueryLexer.Is));+ }++ @Override+ public String toStringWithoutParens() {+ return "~" + StringUtils.escape(value, "~") + "~";+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/NumberCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/NumberCriteria.javanew file mode 100644index 0000000000..9b36bee2d4--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/NumberCriteria.java@@ -0,0 +1,80 @@+package io.onedev.server.search.entity.workspace;++import org.jspecify.annotations.Nullable;+import javax.persistence.criteria.CriteriaBuilder;+import javax.persistence.criteria.CriteriaQuery;+import javax.persistence.criteria.From;+import javax.persistence.criteria.Path;+import javax.persistence.criteria.Predicate;++import io.onedev.server.model.AbstractEntity;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.Project;+import io.onedev.server.util.ProjectScope;+import io.onedev.server.util.criteria.Criteria;++public class NumberCriteria extends Criteria<Workspace> {++ private static final long serialVersionUID = 1L;++ private final int operator;++ private final String value;++ private final long number;++ @Nullable+ private final Project project;++ public NumberCriteria(@Nullable Project project, String value, int operator) {+ this.operator = operator;+ this.value = value;+ this.project = project;+ var index = value.indexOf('#');+ if (index != -1)+ this.number = Long.parseLong(value.substring(index + 1));+ else+ this.number = Long.parseLong(value);+ }++ @Override+ public Predicate getPredicate(@Nullable ProjectScope projectScope, CriteriaQuery<?> query,+ From<Workspace, Workspace> from, CriteriaBuilder builder) {+ Path<Long> attribute = from.get(Workspace.PROP_NUMBER);+ Predicate numberPredicate;+ if (operator == WorkspaceQueryLexer.Is)+ numberPredicate = builder.equal(attribute, number);+ else if (operator == WorkspaceQueryLexer.IsNot)+ numberPredicate = builder.not(builder.equal(attribute, number));+ else if (operator == WorkspaceQueryLexer.IsGreaterThan)+ numberPredicate = builder.greaterThan(attribute, number);+ else+ numberPredicate = builder.lessThan(attribute, number);+ if (project != null)+ return builder.and(builder.equal(from.get(Workspace.PROP_PROJECT), project), numberPredicate);+ else+ return numberPredicate;+ }++ @Override+ public boolean matches(Workspace workspace) {+ if (project != null && !workspace.getProject().equals(project))+ return false;+ if (operator == WorkspaceQueryLexer.Is)+ return workspace.getNumber() == number;+ else if (operator == WorkspaceQueryLexer.IsNot)+ return workspace.getNumber() != number;+ else if (operator == WorkspaceQueryLexer.IsGreaterThan)+ return workspace.getNumber() > number;+ else+ return workspace.getNumber() < number;+ }++ @Override+ public String toStringWithoutParens() {+ return quote(AbstractEntity.NAME_NUMBER) + " "+ + WorkspaceQuery.getRuleName(operator) + " "+ + quote(value);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/PendingCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/PendingCriteria.javanew file mode 100644index 0000000000..9e50e45949--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/PendingCriteria.java@@ -0,0 +1,19 @@+package io.onedev.server.search.entity.workspace;++import io.onedev.server.model.Workspace;++public class PendingCriteria extends StatusCriteria {++ private static final long serialVersionUID = 1L;++ @Override+ public Workspace.Status getStatus() {+ return Workspace.Status.PENDING;+ }++ @Override+ public String toStringWithoutParens() {+ return WorkspaceQuery.getRuleName(WorkspaceQueryLexer.Pending);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/ProjectCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/ProjectCriteria.javanew file mode 100644index 0000000000..568f3ff445--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/ProjectCriteria.java@@ -0,0 +1,54 @@+package io.onedev.server.search.entity.workspace;++import org.jspecify.annotations.Nullable;+import javax.persistence.criteria.CriteriaBuilder;+import javax.persistence.criteria.CriteriaQuery;+import javax.persistence.criteria.From;+import javax.persistence.criteria.JoinType;+import javax.persistence.criteria.Predicate;++import io.onedev.commons.utils.match.WildcardUtils;+import io.onedev.server.OneDev;+import io.onedev.server.service.ProjectService;+import io.onedev.server.model.Workspace;+import io.onedev.server.util.ProjectScope;+import io.onedev.server.util.criteria.Criteria;++public class ProjectCriteria extends Criteria<Workspace> {++ private static final long serialVersionUID = 1L;++ private final String projectPath;++ private final int operator;++ public ProjectCriteria(String projectPath, int operator) {+ this.projectPath = projectPath;+ this.operator = operator;+ }++ @Override+ public Predicate getPredicate(@Nullable ProjectScope projectScope, CriteriaQuery<?> query, From<Workspace, Workspace> from, CriteriaBuilder builder) {+ var predicate = OneDev.getInstance(ProjectService.class).getPathMatchPredicate(+ builder, from.join(Workspace.PROP_PROJECT, JoinType.INNER), projectPath);+ if (operator == WorkspaceQueryLexer.IsNot)+ predicate = builder.not(predicate);+ return predicate;+ }++ @Override+ public boolean matches(Workspace workspace) {+ var matches = WildcardUtils.matchPath(projectPath, workspace.getProject().getPath());+ if (operator == WorkspaceQueryLexer.IsNot)+ matches = !matches;+ return matches;+ }++ @Override+ public String toStringWithoutParens() {+ return quote(Workspace.NAME_PROJECT) + " "+ + WorkspaceQuery.getRuleName(operator) + " "+ + quote(projectPath);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/SpecCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/SpecCriteria.javanew file mode 100644index 0000000000..f6bf147839--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/SpecCriteria.java@@ -0,0 +1,61 @@+package io.onedev.server.search.entity.workspace;++import org.jspecify.annotations.Nullable;+import javax.persistence.criteria.CriteriaBuilder;+import javax.persistence.criteria.CriteriaQuery;+import javax.persistence.criteria.From;+import javax.persistence.criteria.Path;+import javax.persistence.criteria.Predicate;++import io.onedev.commons.utils.match.WildcardUtils;+import io.onedev.server.model.Workspace;+import io.onedev.server.util.ProjectScope;+import io.onedev.server.util.criteria.Criteria;++public class SpecCriteria extends Criteria<Workspace> {++ private static final long serialVersionUID = 1L;++ private final String value;++ private final int operator;++ public SpecCriteria(String value, int operator) {+ this.value = value;+ this.operator = operator;+ }++ public String getValue() {+ return value;+ }++ public int getOperator() {+ return operator;+ }++ @Override+ public Predicate getPredicate(@Nullable ProjectScope projectScope, CriteriaQuery<?> query, From<Workspace, Workspace> from, CriteriaBuilder builder) {+ Path<String> attribute = from.get(Workspace.PROP_SPEC);+ String normalized = value.toLowerCase().replace("*", "%");+ var predicate = builder.like(builder.lower(attribute), normalized);+ if (operator == WorkspaceQueryLexer.IsNot)+ predicate = builder.not(predicate);+ return predicate;+ }++ @Override+ public boolean matches(Workspace workspace) {+ var matches = WildcardUtils.matchString(value.toLowerCase(), workspace.getSpecName().toLowerCase());+ if (operator == WorkspaceQueryLexer.IsNot)+ matches = !matches;+ return matches;+ }++ @Override+ public String toStringWithoutParens() {+ return quote(Workspace.NAME_SPEC) + " "+ + WorkspaceQuery.getRuleName(operator) + " "+ + quote(value);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/StatusCriteria.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/StatusCriteria.javanew file mode 100644index 0000000000..7ef6d965e8--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/StatusCriteria.java@@ -0,0 +1,31 @@+package io.onedev.server.search.entity.workspace;++import org.jspecify.annotations.Nullable;+import javax.persistence.criteria.CriteriaBuilder;+import javax.persistence.criteria.CriteriaQuery;+import javax.persistence.criteria.From;+import javax.persistence.criteria.Path;+import javax.persistence.criteria.Predicate;++import io.onedev.server.model.Workspace;+import io.onedev.server.util.ProjectScope;+import io.onedev.server.util.criteria.Criteria;++public abstract class StatusCriteria extends Criteria<Workspace> {++ private static final long serialVersionUID = 1L;++ public abstract Workspace.Status getStatus();++ @Override+ public Predicate getPredicate(@Nullable ProjectScope projectScope, CriteriaQuery<?> query, From<Workspace, Workspace> from, CriteriaBuilder builder) {+ Path<Workspace.Status> attribute = from.get(Workspace.PROP_STATUS);+ return builder.equal(attribute, getStatus());+ }++ @Override+ public boolean matches(Workspace workspace) {+ return workspace.getStatus() == getStatus();+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/WorkspaceQuery.g4 b/server-core/src/main/java/io/onedev/server/search/entity/workspace/WorkspaceQuery.g4new file mode 100644index 0000000000..99ee5bfe04--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/WorkspaceQuery.g4@@ -0,0 +1,128 @@+grammar WorkspaceQuery;++query+ : WS* criteria WS* (WS OrderBy WS+ order (WS* orderOperator=Comma WS* order)* WS*)? EOF+ | WS* OrderBy WS+ order (WS* orderOperator=Comma WS* order)* WS* EOF+ | WS* EOF+ ;++criteria+ : operator=(Pending|Active|Error|CreatedByMe) #OperatorCriteria+ | operator=CreatedBy WS+ criteriaValue=multipleQuoted #OperatorValueCriteria+ | criteriaField=Quoted WS+ operator=(Is|IsNot|IsGreaterThan|IsLessThan) WS+ criteriaValue=multipleQuoted #FieldOperatorValueCriteria+ | criteriaField=Quoted WS+ operator=(IsSince|IsUntil) WS+ criteriaValue=multipleQuoted #FieldOperatorValueCriteria+ | Reference #ReferenceCriteria+ | criteria WS+ And WS+ criteria #AndCriteria+ | criteria WS+ Or WS+ criteria #OrCriteria+ | Not WS* LParens WS* criteria WS* RParens #NotCriteria+ | LParens WS* criteria WS* RParens #ParensCriteria+ | Fuzzy #FuzzyCriteria+ ;++order+ : orderField=Quoted WS* (WS+ direction=(Asc|Desc))?+ ;++multipleQuoted+ : Quoted(WS* Comma WS* Quoted)*+ ;++Pending+ : 'pending'+ ;++Active+ : 'active'+ ;++Error+ : 'error'+ ;++CreatedByMe+ : 'created' WS+ 'by' WS+ 'me'+ ;++CreatedBy+ : 'created' WS+ 'by'+ ;++OrderBy+ : 'order' WS+ 'by'+ ;++Is+ : 'is'+ ;++IsNot+ : 'is' WS+ 'not'+ ;++IsGreaterThan+ : 'is' WS+ 'greater' WS+ 'than'+ ;++IsLessThan+ : 'is' WS+ 'less' WS+ 'than'+ ;++IsSince+ : 'is' WS+ 'since'+ ;++IsUntil+ : 'is' WS+ 'until'+ ;++And+ : 'and'+ ;++Or+ : 'or'+ ;++Not+ : 'not'+ ;++Asc+ : 'asc'+ ;++Desc+ : 'desc'+ ;++LParens+ : '('+ ;++RParens+ : ')'+ ;++Quoted+ : '"' ('\\'.|~[\\"])+? '"'+ ;++Reference+ : ([a-zA-Z0-9_]([a-zA-Z0-9_\-/.]*[a-zA-Z0-9_])?)? '#' [0-9]+ | [A-Z][A-Z]+ '-' [0-9]++ ;++Comma+ : ','+ ;++WS+ : ' '+ ;++Fuzzy+ : '~' ('\\'.|~[~])+? '~'+ ;++Identifier+ : [a-zA-Z0-9:_/\\+\-;]++ ;diff --git a/server-core/src/main/java/io/onedev/server/search/entity/workspace/WorkspaceQuery.java b/server-core/src/main/java/io/onedev/server/search/entity/workspace/WorkspaceQuery.javanew file mode 100644index 0000000000..9e14e83590--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/search/entity/workspace/WorkspaceQuery.java@@ -0,0 +1,289 @@+package io.onedev.server.search.entity.workspace;++import static io.onedev.server.model.AbstractEntity.NAME_NUMBER;+import static io.onedev.server.model.Workspace.NAME_ACTIVE_DATE;+import static io.onedev.server.model.Workspace.NAME_BRANCH;+import static io.onedev.server.model.Workspace.NAME_CREATE_DATE;+import static io.onedev.server.model.Workspace.NAME_PROJECT;+import static io.onedev.server.model.Workspace.NAME_SPEC;+import static io.onedev.server.model.Workspace.QUERY_FIELDS;+import static io.onedev.server.model.Workspace.SORT_FIELDS;+import static io.onedev.server.search.entity.EntitySort.Direction.ASCENDING;+import static io.onedev.server.search.entity.EntitySort.Direction.DESCENDING;+import static io.onedev.server.search.entity.workspace.WorkspaceQueryParser.Active;+import static io.onedev.server.search.entity.workspace.WorkspaceQueryParser.Error;+import static io.onedev.server.search.entity.workspace.WorkspaceQueryParser.Is;+import static io.onedev.server.search.entity.workspace.WorkspaceQueryParser.IsGreaterThan;+import static io.onedev.server.search.entity.workspace.WorkspaceQueryParser.IsLessThan;+import static io.onedev.server.search.entity.workspace.WorkspaceQueryParser.IsNot;+import static io.onedev.server.search.entity.workspace.WorkspaceQueryParser.IsSince;+import static io.onedev.server.search.entity.workspace.WorkspaceQueryParser.IsUntil;+import static io.onedev.server.search.entity.workspace.WorkspaceQueryParser.Pending;++import java.util.ArrayList;+import java.util.List;++import org.antlr.v4.runtime.BailErrorStrategy;+import org.antlr.v4.runtime.BaseErrorListener;+import org.antlr.v4.runtime.CharStream;+import org.antlr.v4.runtime.CharStreams;+import org.antlr.v4.runtime.CommonTokenStream;+import org.antlr.v4.runtime.RecognitionException;+import org.antlr.v4.runtime.Recognizer;+import org.jspecify.annotations.Nullable;++import io.onedev.commons.codeassist.AntlrUtils;+import io.onedev.commons.utils.ExplicitException;+import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;+import io.onedev.server.search.entity.EntityQuery;+import io.onedev.server.search.entity.EntitySort;+import io.onedev.server.search.entity.workspace.WorkspaceQueryParser.AndCriteriaContext;+import io.onedev.server.search.entity.workspace.WorkspaceQueryParser.CriteriaContext;+import io.onedev.server.search.entity.workspace.WorkspaceQueryParser.FieldOperatorValueCriteriaContext;+import io.onedev.server.search.entity.workspace.WorkspaceQueryParser.FuzzyCriteriaContext;+import io.onedev.server.search.entity.workspace.WorkspaceQueryParser.NotCriteriaContext;+import io.onedev.server.search.entity.workspace.WorkspaceQueryParser.OperatorCriteriaContext;+import io.onedev.server.search.entity.workspace.WorkspaceQueryParser.OperatorValueCriteriaContext;+import io.onedev.server.search.entity.workspace.WorkspaceQueryParser.OrCriteriaContext;+import io.onedev.server.search.entity.workspace.WorkspaceQueryParser.OrderContext;+import io.onedev.server.search.entity.workspace.WorkspaceQueryParser.ParensCriteriaContext;+import io.onedev.server.search.entity.workspace.WorkspaceQueryParser.QueryContext;+import io.onedev.server.search.entity.workspace.WorkspaceQueryParser.ReferenceCriteriaContext;+import io.onedev.server.util.criteria.AndCriteria;+import io.onedev.server.util.criteria.Criteria;+import io.onedev.server.util.criteria.NotCriteria;+import io.onedev.server.util.criteria.OrCriteria;++public class WorkspaceQuery extends EntityQuery<Workspace> {++ private static final long serialVersionUID = 1L;++ public WorkspaceQuery(@Nullable Criteria<Workspace> criteria, List<EntitySort> sorts) {+ super(criteria, sorts);+ }++ public WorkspaceQuery(@Nullable Criteria<Workspace> criteria) {+ super(criteria, new ArrayList<>());+ }++ public WorkspaceQuery() {+ super(null, new ArrayList<>());+ }++ public static WorkspaceQuery parse(@Nullable String queryString) {+ return parse(null, queryString, false);+ }++ public static WorkspaceQuery parse(@Nullable Project project, @Nullable String queryString) {+ return parse(project, queryString, false);+ }++ public static WorkspaceQuery parse(@Nullable Project project, @Nullable String queryString, boolean withCurrentUserCriteria) {+ if (queryString != null) {+ CharStream is = CharStreams.fromString(queryString);+ WorkspaceQueryLexer lexer = new WorkspaceQueryLexer(is);+ lexer.removeErrorListeners();+ lexer.addErrorListener(new BaseErrorListener() {++ @Override+ public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line,+ int charPositionInLine, String msg, RecognitionException e) {+ throw new RuntimeException("Malformed query", e);+ }++ });+ CommonTokenStream tokens = new CommonTokenStream(lexer);+ WorkspaceQueryParser parser = new WorkspaceQueryParser(tokens);+ parser.removeErrorListeners();+ parser.setErrorHandler(new BailErrorStrategy());+ QueryContext queryContext = parser.query();+ CriteriaContext criteriaContext = queryContext.criteria();+ Criteria<Workspace> workspaceCriteria;+ if (criteriaContext != null) {+ workspaceCriteria = new WorkspaceQueryBaseVisitor<Criteria<Workspace>>() {++ @Override+ public Criteria<Workspace> visitOperatorCriteria(OperatorCriteriaContext ctx) {+ switch (ctx.operator.getType()) {+ case Pending:+ return new PendingCriteria();+ case Active:+ return new ActiveCriteria();+ case Error:+ return new ErrorCriteria();+ case WorkspaceQueryLexer.CreatedByMe:+ if (!withCurrentUserCriteria)+ throw new ExplicitException("Criteria '" + ctx.operator.getText() + "' is not supported here");+ return new CreatedByMeCriteria();+ default:+ throw new ExplicitException("Unexpected operator: " + ctx.operator.getText());+ }+ }++ @Override+ public Criteria<Workspace> visitOperatorValueCriteria(OperatorValueCriteriaContext ctx) {+ var criterias = new ArrayList<Criteria<Workspace>>();+ for (var quoted : ctx.criteriaValue.Quoted()) {+ String value = getValue(quoted.getText());+ if (ctx.CreatedBy() != null)+ criterias.add(new CreatedByUserCriteria(getUser(value)));+ else+ throw new ExplicitException("Unexpected operator: " + ctx.operator.getText());+ }+ return Criteria.orCriterias(criterias);+ }++ @Override+ public Criteria<Workspace> visitFuzzyCriteria(FuzzyCriteriaContext ctx) {+ return new FuzzyCriteria(getValue(ctx.getText()));+ }++ @Override+ public Criteria<Workspace> visitReferenceCriteria(ReferenceCriteriaContext ctx) {+ return new NumberCriteria(project, ctx.getText(), WorkspaceQueryParser.Is);+ }++ @Override+ public Criteria<Workspace> visitFieldOperatorValueCriteria(FieldOperatorValueCriteriaContext ctx) {+ String fieldName = getValue(ctx.criteriaField.getText());+ int operator = ctx.operator.getType();+ checkField(fieldName, operator);++ var criterias = new ArrayList<Criteria<Workspace>>();+ for (var quoted : ctx.criteriaValue.Quoted()) {+ String value = getValue(quoted.getText());+ switch (fieldName) {+ case NAME_NUMBER:+ criterias.add(new NumberCriteria(project, value, operator));+ break;+ case NAME_PROJECT:+ criterias.add(new ProjectCriteria(value, operator));+ break;+ case NAME_BRANCH:+ criterias.add(new BranchCriteria(value, operator));+ break;+ case NAME_SPEC:+ criterias.add(new SpecCriteria(value, operator));+ break;+ case NAME_CREATE_DATE:+ criterias.add(new CreateDateCriteria(value, operator));+ break;+ case NAME_ACTIVE_DATE:+ criterias.add(new ActiveDateCriteria(value, operator));+ break;+ default:+ throw new ExplicitException("Unexpected field: " + fieldName);+ }+ }+ return operator == IsNot ? Criteria.andCriterias(criterias) : Criteria.orCriterias(criterias);+ }++ @Override+ public Criteria<Workspace> visitParensCriteria(ParensCriteriaContext ctx) {+ return visit(ctx.criteria()).withParens(true);+ }++ @Override+ public Criteria<Workspace> visitOrCriteria(OrCriteriaContext ctx) {+ List<Criteria<Workspace>> childCriterias = new ArrayList<>();+ for (CriteriaContext childCtx : ctx.criteria())+ childCriterias.add(visit(childCtx));+ return new OrCriteria<>(childCriterias);+ }++ @Override+ public Criteria<Workspace> visitAndCriteria(AndCriteriaContext ctx) {+ List<Criteria<Workspace>> childCriterias = new ArrayList<>();+ for (CriteriaContext childCtx : ctx.criteria())+ childCriterias.add(visit(childCtx));+ return new AndCriteria<>(childCriterias);+ }++ @Override+ public Criteria<Workspace> visitNotCriteria(NotCriteriaContext ctx) {+ return new NotCriteria<>(visit(ctx.criteria()));+ }++ }.visit(criteriaContext);+ } else {+ workspaceCriteria = null;+ }++ List<EntitySort> workspaceSorts = new ArrayList<>();+ for (OrderContext order : queryContext.order()) {+ var fieldName = getValue(order.Quoted().getText());+ var sortField = SORT_FIELDS.get(fieldName);+ if (sortField == null)+ throw new ExplicitException("Can not order by field: " + fieldName);++ EntitySort workspaceSort = new EntitySort();+ workspaceSort.setField(fieldName);+ if (order.direction != null) {+ if (order.direction.getText().equals("desc"))+ workspaceSort.setDirection(DESCENDING);+ else+ workspaceSort.setDirection(ASCENDING);+ } else {+ workspaceSort.setDirection(sortField.getDefaultDirection());+ }+ workspaceSorts.add(workspaceSort);+ }++ return new WorkspaceQuery(workspaceCriteria, workspaceSorts);+ } else {+ return new WorkspaceQuery();+ }+ }++ public static void checkField(String fieldName, int operator) {+ if (!QUERY_FIELDS.contains(fieldName))+ throw new ExplicitException("Field not found: " + fieldName);+ switch (operator) {+ case Is:+ case IsNot:+ if (!fieldName.equals(NAME_NUMBER) && !fieldName.equals(NAME_PROJECT)+ && !fieldName.equals(NAME_BRANCH) && !fieldName.equals(NAME_SPEC)) {+ throw newOperatorException(fieldName, operator);+ }+ break;+ case IsGreaterThan:+ case IsLessThan:+ if (!fieldName.equals(NAME_NUMBER))+ throw newOperatorException(fieldName, operator);+ break;+ case IsSince:+ case IsUntil:+ if (!fieldName.equals(NAME_CREATE_DATE) && !fieldName.equals(NAME_ACTIVE_DATE))+ throw newOperatorException(fieldName, operator);+ break;+ default:+ throw newOperatorException(fieldName, operator);+ }+ }++ private static ExplicitException newOperatorException(String fieldName, int operator) {+ return new ExplicitException("Field '" + fieldName + "' is not applicable for operator '" + getRuleName(operator) + "'");+ }++ public static String getRuleName(int rule) {+ return AntlrUtils.getLexerRuleName(WorkspaceQueryLexer.ruleNames, rule);+ }++ public static int getOperator(String operatorName) {+ return AntlrUtils.getLexerRule(WorkspaceQueryLexer.ruleNames, operatorName);+ }++ public static WorkspaceQuery merge(WorkspaceQuery baseQuery, WorkspaceQuery query) {+ List<Criteria<Workspace>> criterias = new ArrayList<>();+ if (baseQuery.getCriteria() != null)+ criterias.add(baseQuery.getCriteria());+ if (query.getCriteria() != null)+ criterias.add(query.getCriteria());+ List<EntitySort> sorts = new ArrayList<>();+ sorts.addAll(query.getSorts());+ sorts.addAll(baseQuery.getSorts());+ return new WorkspaceQuery(Criteria.andCriterias(criterias), sorts);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/search/entitytext/EntityTextService.java b/server-core/src/main/java/io/onedev/server/search/entitytext/EntityTextService.javaindex 35de12ea17..67bb68e567 100644--- a/server-core/src/main/java/io/onedev/server/search/entitytext/EntityTextService.java+++ b/server-core/src/main/java/io/onedev/server/search/entitytext/EntityTextService.java@@ -220,13 +220,17 @@ public abstract class EntityTextService<T extends ProjectBelonging> implements Spublic void on(ProjectDeleted event) {Long projectId = event.getProjectId();clusterService.submitToAllServers(() -> {- callWithWriter(writer -> {- try {- return writer.deleteDocuments(newExactQuery(FIELD_PROJECT_ID, projectId));- } catch (IOException e) {- throw new RuntimeException(e);- }- });+ try {+ callWithWriter(writer -> {+ try {+ return writer.deleteDocuments(newExactQuery(FIELD_PROJECT_ID, projectId));+ } catch (IOException e) {+ throw new RuntimeException(e);+ }+ });+ } catch (Throwable t) {+ logger.error("Error deleting lucene documents", t);+ }return null;});}diff --git a/server-core/src/main/java/io/onedev/server/security/BearerAuthenticationFilter.java b/server-core/src/main/java/io/onedev/server/security/BearerAuthenticationFilter.javaindex 550d4b0106..5a2898cd1d 100644--- a/server-core/src/main/java/io/onedev/server/security/BearerAuthenticationFilter.java+++ b/server-core/src/main/java/io/onedev/server/security/BearerAuthenticationFilter.java@@ -4,6 +4,7 @@ import io.onedev.server.cluster.ClusterService;import io.onedev.server.service.AccessTokenService;import io.onedev.server.service.AgentTokenService;import io.onedev.server.service.UserService;+import io.onedev.server.workspace.WorkspaceService;import io.onedev.server.job.JobService;import io.onedev.server.persistence.annotation.Sessional;import org.apache.shiro.authc.IncorrectCredentialsException;@@ -19,26 +20,24 @@ import javax.servlet.http.HttpServletRequest;@Singletonpublic class BearerAuthenticationFilter extends ExceptionHandleFilter {- private final UserService userService;-- private final AccessTokenService accessTokenService;-- private final AgentTokenService agentTokenService;+ @Inject+ private UserService userService;- private final JobService jobService;+ @Inject+ private AccessTokenService accessTokenService;- private final ClusterService clusterService;+ @Inject+ private AgentTokenService agentTokenService;@Inject- public BearerAuthenticationFilter(AccessTokenService accessTokenService, AgentTokenService agentTokenService,- JobService jobService, UserService userService, ClusterService clusterService) {- this.accessTokenService = accessTokenService;- this.agentTokenService = agentTokenService;- this.jobService = jobService;- this.userService = userService;- this.clusterService = clusterService;- }+ private JobService jobService;+ @Inject+ private WorkspaceService workspaceService;++ @Inject+ private ClusterService clusterService;+@Sessional@Overrideprotected boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) {@@ -52,9 +51,15 @@ public class BearerAuthenticationFilter extends ExceptionHandleFilter {var accessToken = accessTokenService.findByValue(bearerToken);if (accessToken != null) {ThreadContext.bind(accessToken.asSubject());- } else if (agentTokenService.find(bearerToken) == null- && jobService.getJobContext(bearerToken, false) == null) {- throw new IncorrectCredentialsException("Invalid or expired access token");+ } else {+ var workspaceContext = workspaceService.getWorkspaceContext(bearerToken, false);+ if (workspaceContext != null) {+ var workspace = workspaceService.load(workspaceContext.getWorkspaceId());+ ThreadContext.bind(workspace.getUser().asSubject());+ } else if (agentTokenService.find(bearerToken) == null+ && jobService.getJobContext(bearerToken, false) == null) {+ throw new IncorrectCredentialsException("Invalid or expired access token");+ }}}}diff --git a/server-core/src/main/java/io/onedev/server/security/CodePushAuthorizationSource.java b/server-core/src/main/java/io/onedev/server/security/CodePushAuthorizationSource.javanew file mode 100644index 0000000000..375bed6a08--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/security/CodePushAuthorizationSource.java@@ -0,0 +1,11 @@+package io.onedev.server.security;++import javax.servlet.http.HttpServletRequest;++import io.onedev.server.model.Project;++public interface CodePushAuthorizationSource {++ boolean canPushCode(HttpServletRequest request, Project project);++}diff --git a/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java b/server-core/src/main/java/io/onedev/server/security/SecurityUtils.javaindex 8280305973..2641e4bb41 100644--- a/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java+++ b/server-core/src/main/java/io/onedev/server/security/SecurityUtils.java@@ -9,7 +9,6 @@ import java.util.HashSet;import java.util.Map;import java.util.concurrent.Callable;-import org.jspecify.annotations.Nullable;import javax.servlet.http.HttpServletRequest;import javax.ws.rs.core.HttpHeaders;@@ -20,18 +19,13 @@ import org.apache.shiro.subject.SimplePrincipalCollection;import org.apache.shiro.subject.Subject;import org.apache.shiro.util.ThreadContext;import org.apache.shiro.web.mgt.WebSecurityManager;+import org.jspecify.annotations.Nullable;import com.google.common.collect.Sets;import io.onedev.commons.loader.AppLoader;import io.onedev.k8shelper.KubernetesHelper;import io.onedev.server.OneDev;-import io.onedev.server.service.AccessTokenService;-import io.onedev.server.service.BaseAuthorizationService;-import io.onedev.server.service.GroupService;-import io.onedev.server.service.ProjectService;-import io.onedev.server.service.SettingService;-import io.onedev.server.service.UserService;import io.onedev.server.model.AccessToken;import io.onedev.server.model.Build;import io.onedev.server.model.CodeComment;@@ -53,6 +47,7 @@ import io.onedev.server.model.PullRequestWatch;import io.onedev.server.model.Role;import io.onedev.server.model.User;import io.onedev.server.model.UserAuthorization;+import io.onedev.server.model.Workspace;import io.onedev.server.security.permission.AccessBuild;import io.onedev.server.security.permission.AccessBuildLog;import io.onedev.server.security.permission.AccessBuildPipeline;@@ -73,6 +68,7 @@ import io.onedev.server.security.permission.ManageIssues;import io.onedev.server.security.permission.ManageJob;import io.onedev.server.security.permission.ManageProject;import io.onedev.server.security.permission.ManagePullRequests;+import io.onedev.server.security.permission.ManageWorkspaces;import io.onedev.server.security.permission.ProjectPermission;import io.onedev.server.security.permission.ReadCode;import io.onedev.server.security.permission.ReadPack;@@ -82,6 +78,12 @@ import io.onedev.server.security.permission.SystemAdministration;import io.onedev.server.security.permission.UploadCache;import io.onedev.server.security.permission.WriteCode;import io.onedev.server.security.permission.WritePack;+import io.onedev.server.service.AccessTokenService;+import io.onedev.server.service.BaseAuthorizationService;+import io.onedev.server.service.GroupService;+import io.onedev.server.service.ProjectService;+import io.onedev.server.service.SettingService;+import io.onedev.server.service.UserService;import io.onedev.server.util.facade.ProjectCache;import io.onedev.server.util.facade.UserCache;import io.onedev.server.util.facade.UserFacade;@@ -465,6 +467,14 @@ public class SecurityUtils extends org.apache.shiro.SecurityUtils {public static boolean canManagePullRequests(Subject subject, Project project) {return subject.isPermitted(new ProjectPermission(project, new ManagePullRequests()));}++ public static boolean canManageWorkspaces(Project project) {+ return canManageWorkspaces(getSubject(), project);+ }++ public static boolean canManageWorkspaces(Subject subject, Project project) {+ return subject.isPermitted(new ProjectPermission(project, new ManageWorkspaces()));+ }public static boolean canManageCodeComments(Project project) {return canManageCodeComments(getSubject(), project);@@ -539,6 +549,15 @@ public class SecurityUtils extends org.apache.shiro.SecurityUtils {public static boolean isAdministrator(Subject subject) {return subject.isPermitted(new SystemAdministration());}++ public static boolean canModifyOrDelete(Workspace workspace) {+ return canModifyOrDelete(getSubject(), workspace);+ }++ public static boolean canModifyOrDelete(Subject subject, Workspace workspace) {+ return canManageWorkspaces(subject, workspace.getProject())+ || workspace.getUser().equals(getAuthUser(subject));+ }public static boolean canModifyOrDelete(CodeComment comment) {return canModifyOrDelete(getSubject(), comment);diff --git a/server-core/src/main/java/io/onedev/server/security/permission/ManageWorkspaces.java b/server-core/src/main/java/io/onedev/server/security/permission/ManageWorkspaces.javanew file mode 100644index 0000000000..be4839f123--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/security/permission/ManageWorkspaces.java@@ -0,0 +1,19 @@+package io.onedev.server.security.permission;++import io.onedev.server.util.facade.UserFacade;+import org.apache.shiro.authz.Permission;+import org.jetbrains.annotations.Nullable;++public class ManageWorkspaces implements BasePermission {++ @Override+ public boolean implies(Permission p) {+ return p instanceof ManageWorkspaces || new WriteCode().implies(p);+ }++ @Override+ public boolean isApplicable(@Nullable UserFacade user) {+ return user != null;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/service/AgentService.java b/server-core/src/main/java/io/onedev/server/service/AgentService.javaindex f3dce65bc9..7fe9c0eed7 100644--- a/server-core/src/main/java/io/onedev/server/service/AgentService.java+++ b/server-core/src/main/java/io/onedev/server/service/AgentService.java@@ -38,9 +38,9 @@ public interface AgentService extends EntityService<Agent> {Collection<String> getOsArchs();- List<Agent> query(EntityQuery<Agent> agentQuery, int firstResult, int maxResults);+ List<Agent> query(EntityQuery<Agent> query, int firstResult, int maxResults);- int count(@Nullable Criteria<Agent> agentCriteria);+ int count(@Nullable Criteria<Agent> criteria);void restart(Agent agent);diff --git a/server-core/src/main/java/io/onedev/server/service/BuildService.java b/server-core/src/main/java/io/onedev/server/service/BuildService.javaindex e9c9cd11c3..31a7739c59 100644--- a/server-core/src/main/java/io/onedev/server/service/BuildService.java+++ b/server-core/src/main/java/io/onedev/server/service/BuildService.java@@ -67,10 +67,10 @@ public interface BuildService extends EntityService<Build> {List<Build> query(Subject subject, Project project, String fuzzyQuery, int count);- List<Build> query(Subject subject, @Nullable Project project, EntityQuery<Build> buildQuery,+ List<Build> query(Subject subject, @Nullable Project project, EntityQuery<Build> query,boolean loadLabels, int firstResult, int maxResults);- int count(Subject subject, @Nullable Project project, Criteria<Build> buildCriteria);+ int count(Subject subject, @Nullable Project project, @Nullable Criteria<Build> criteria);Collection<Long> getNumbers(Long projectId);diff --git a/server-core/src/main/java/io/onedev/server/service/IssueService.java b/server-core/src/main/java/io/onedev/server/service/IssueService.javaindex 2a897d0d40..3f9b35ac0a 100644--- a/server-core/src/main/java/io/onedev/server/service/IssueService.java+++ b/server-core/src/main/java/io/onedev/server/service/IssueService.java@@ -48,19 +48,19 @@ public interface IssueService extends EntityService<Issue> {List<Issue> queryPinned(Subject subject, Project project);- Predicate[] buildPredicates(Subject subject, @Nullable ProjectScope projectScope, @Nullable Criteria<Issue> issueCriteria,- CriteriaQuery<?> query, CriteriaBuilder builder, From<Issue, Issue> issue);+ Predicate[] buildPredicates(Subject subject, @Nullable ProjectScope projectScope,+ @Nullable Criteria<Issue> criteria, CriteriaQuery<?> query, CriteriaBuilder builder,+ From<Issue, Issue> issue);List<javax.persistence.criteria.Order> buildOrders(EntityQuery<Issue> query, CriteriaBuilder builder,- From<Issue, Issue> issue,- List<javax.persistence.criteria.Order> preferOrders);+ From<Issue, Issue> issue, List<javax.persistence.criteria.Order> preferOrders);- List<Issue> query(Subject subject, @Nullable ProjectScope projectScope, EntityQuery<Issue> issueQuery,+ List<Issue> query(Subject subject, @Nullable ProjectScope projectScope, EntityQuery<Issue> query,boolean loadExtraInfo, int firstResult, int maxResults);- int count(Subject subject, @Nullable ProjectScope projectScope, @Nullable Criteria<Issue> issueCriteria);+ int count(Subject subject, @Nullable ProjectScope projectScope, @Nullable Criteria<Issue> criteria);- IssueTimes queryTimes(Subject subject, ProjectScope projectScope, @Nullable Criteria<Issue> issueCriteria);+ IssueTimes queryTimes(Subject subject, ProjectScope projectScope, @Nullable Criteria<Issue> criteria);Collection<String> getUndefinedStates();diff --git a/server-core/src/main/java/io/onedev/server/service/JobCacheService.java b/server-core/src/main/java/io/onedev/server/service/JobCacheService.javadeleted file mode 100644index 8715bfe63f..0000000000--- a/server-core/src/main/java/io/onedev/server/service/JobCacheService.java+++ /dev/null@@ -1,36 +0,0 @@-package io.onedev.server.service;--import io.onedev.server.model.JobCache;-import org.apache.commons.lang3.tuple.Pair;--import org.jspecify.annotations.Nullable;-import java.io.InputStream;-import java.io.OutputStream;-import java.util.List;-import java.util.function.Consumer;--public interface JobCacheService extends EntityService<JobCache> {-- @Nullable- Pair<Long, Long> getCacheInfoForDownload(Long projectId, String cacheKey);-- @Nullable- Pair<Long, Long> getCacheInfoForDownload(Long projectId, List<String> loadKeys);-- @Nullable Long getCacheIdForUpload(Long projectId, String cacheKey);-- boolean downloadCache(Long projectId, Long cacheId, List<String> cachePaths,- Consumer<InputStream> cacheStreamHandler);-- void downloadCache(Long projectId, Long cacheId, List<String> cachePaths,- OutputStream cacheStream);-- void uploadCache(Long projectId, Long cacheId, List<String> cachePaths, InputStream cacheStream);-- void uploadCache(Long projectId, Long cacheId, List<String> cachePaths,- Consumer<OutputStream> cacheStreamHandler);-- @Nullable- Long getCacheSize(Long projectId, Long cacheId);--}diff --git a/server-core/src/main/java/io/onedev/server/service/PackService.java b/server-core/src/main/java/io/onedev/server/service/PackService.javaindex e08b1f0f65..f0deb0213f 100644--- a/server-core/src/main/java/io/onedev/server/service/PackService.java+++ b/server-core/src/main/java/io/onedev/server/service/PackService.java@@ -21,7 +21,7 @@ public interface PackService extends EntityService<Pack> {List<Pack> query(Subject subject, @Nullable Project project, EntityQuery<Pack> packQuery,boolean loadLabelsAndBlobs, int firstResult, int maxResults);- int count(Subject subject, @Nullable Project project, Criteria<Pack> packCriteria);+ int count(Subject subject, @Nullable Project project, @Nullable Criteria<Pack> criteria);List<Pack> queryPrevComparables(Pack compareWith, String fuzzyQuery, int count);diff --git a/server-core/src/main/java/io/onedev/server/service/ProjectService.java b/server-core/src/main/java/io/onedev/server/service/ProjectService.javaindex d01447d863..d2ca2efebb 100644--- a/server-core/src/main/java/io/onedev/server/service/ProjectService.java+++ b/server-core/src/main/java/io/onedev/server/service/ProjectService.java@@ -82,7 +82,7 @@ public interface ProjectService extends EntityService<Project> {List<Project> query(Subject subject, EntityQuery<Project> query, boolean loadLabels, int firstResult, int maxResults);- int count(Subject subject, Criteria<Project> criteria);+ int count(Subject subject, @Nullable Criteria<Project> criteria);Predicate getPathMatchPredicate(CriteriaBuilder builder, Path<Project> path, String pathPattern);diff --git a/server-core/src/main/java/io/onedev/server/service/PullRequestService.java b/server-core/src/main/java/io/onedev/server/service/PullRequestService.javaindex 2ab6329c25..576bf00131 100644--- a/server-core/src/main/java/io/onedev/server/service/PullRequestService.java+++ b/server-core/src/main/java/io/onedev/server/service/PullRequestService.java@@ -61,22 +61,22 @@ public interface PullRequestService extends EntityService<PullRequest> {void checkAutoMerge(PullRequest request);List<PullRequest> query(Subject subject, @Nullable Project targetProject,- EntityQuery<PullRequest> requestQuery, boolean loadExtraInfo,+ EntityQuery<PullRequest> query, boolean loadExtraInfo,int firstResult, int maxResults);- int count(Subject subject, @Nullable Project targetProject,- @Nullable Criteria<PullRequest> requestCriteria);+ int count(Subject subject, @Nullable Project targetProject, @Nullable Criteria<PullRequest> criteria);void delete(Collection<PullRequest> requests, Project project);List<ProjectPullRequestStatusStat> queryStatusStats(Collection<Project> projects);- Map<Integer, Integer> queryDurationStats(Subject subject, Project project, @Nullable Criteria<PullRequest> pullRequestCriteria,- @Nullable Date startDate, @Nullable Date endDate, StatsGroup statsGroup);+ Map<Integer, Integer> queryDurationStats(Subject subject, Project project,+ @Nullable Criteria<PullRequest> criteria, @Nullable Date startDate, @Nullable Date endDate,+ StatsGroup statsGroup);Map<Integer, Pair<Integer, Integer>> queryFrequencyStats(Subject subject, Project project,- @Nullable Criteria<PullRequest> pullRequestCriteria,- @Nullable Date startDate, @Nullable Date endDate, StatsGroup statsGroup);+ @Nullable Criteria<PullRequest> criteria, @Nullable Date startDate, @Nullable Date endDate,+ StatsGroup statsGroup);/*** When compare oldCommitId and newCommitId in context of pull request, assume below scenario:diff --git a/server-core/src/main/java/io/onedev/server/service/ResourceService.java b/server-core/src/main/java/io/onedev/server/service/ResourceService.javanew file mode 100644index 0000000000..dd3358f422--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/service/ResourceService.java@@ -0,0 +1,17 @@+package io.onedev.server.service;++import io.onedev.server.cluster.ClusterTask;+import io.onedev.server.search.entity.agent.AgentQuery;+import io.onedev.server.service.support.AgentRunnable;++public interface ResourceService {++ <T> T runServerJob(String resourceName, int totalConcurrency,+ int requiredConcurrency, ClusterTask<T> runnable);++ <T> T runAgentJob(AgentQuery agentQuery, String resourceName, int totalConcurrency,+ int requiredConcurrency, AgentRunnable<T> runnable);++ void agentDisconnecting(Long agentId);++}diff --git a/server-core/src/main/java/io/onedev/server/service/RunCacheService.java b/server-core/src/main/java/io/onedev/server/service/RunCacheService.javanew file mode 100644index 0000000000..53114d88b6--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/service/RunCacheService.java@@ -0,0 +1,33 @@+package io.onedev.server.service;++import java.io.InputStream;+import java.io.OutputStream;+import java.util.function.Consumer;++import org.jspecify.annotations.Nullable;++import io.onedev.k8shelper.CacheAvailability;+import io.onedev.server.model.RunCache;+import io.onedev.server.service.support.CacheQueryResult;++public interface RunCacheService extends EntityService<RunCache> {++ @Nullable+ CacheQueryResult queryCache(Long projectId, String key, @Nullable String checksum);++ @Nullable Long createCache(Long projectId, String key, @Nullable String checksum);++ CacheAvailability downloadCache(CacheQueryResult cacheQueryResult, String cachePathsString,+ Consumer<InputStream> cacheStreamHandler);++ void downloadCache(CacheQueryResult cacheQueryResult, String cachePathsString, OutputStream cacheStream);++ void uploadCache(Long projectId, Long cacheId, String cachePathsString, InputStream cacheStream);++ void uploadCache(Long projectId, Long cacheId, String cachePathsString,+ Consumer<OutputStream> cacheStreamHandler);++ @Nullable+ Long getCacheSize(Long projectId, Long cacheId);++}diff --git a/server-core/src/main/java/io/onedev/server/service/SettingService.java b/server-core/src/main/java/io/onedev/server/service/SettingService.javaindex f451c78ead..3ce3624dc9 100644--- a/server-core/src/main/java/io/onedev/server/service/SettingService.java+++ b/server-core/src/main/java/io/onedev/server/service/SettingService.java@@ -17,6 +17,7 @@ import io.onedev.server.model.support.administration.BackupSetting;import io.onedev.server.model.support.administration.BrandingSetting;import io.onedev.server.model.support.administration.ClusterSetting;import io.onedev.server.model.support.administration.GlobalBuildSetting;+import io.onedev.server.model.support.administration.GlobalWorkspaceSetting;import io.onedev.server.model.support.administration.GlobalIssueSetting;import io.onedev.server.model.support.administration.GlobalPackSetting;import io.onedev.server.model.support.administration.GlobalProjectSetting;@@ -32,6 +33,7 @@ import io.onedev.server.model.support.administration.authenticator.Authenticatorimport io.onedev.server.model.support.administration.emailtemplates.EmailTemplates;import io.onedev.server.model.support.administration.jobexecutor.JobExecutor;import io.onedev.server.model.support.administration.mailservice.MailConnector;+import io.onedev.server.model.support.administration.workspaceprovisioner.WorkspaceProvisioner;import io.onedev.server.util.usage.Usage;import io.onedev.server.web.component.issue.workflowreconcile.UndefinedFieldResolution;import io.onedev.server.web.component.issue.workflowreconcile.UndefinedFieldValue;@@ -130,6 +132,10 @@ public interface SettingService extends EntityService<Setting> {void saveJobExecutors(List<JobExecutor> jobExecutors);+ List<WorkspaceProvisioner> getWorkspaceProvisioners();++ void saveWorkspaceProvisioners(List<WorkspaceProvisioner> workspaceProvisioners);+EmailTemplates getEmailTemplates();void saveEmailTemplates(EmailTemplates emailTemplates);@@ -150,6 +156,10 @@ public interface SettingService extends EntityService<Setting> {GlobalBuildSetting getBuildSetting();void saveBuildSetting(GlobalBuildSetting buildSetting);++ GlobalWorkspaceSetting getWorkspaceSetting();++ void saveWorkspaceSetting(GlobalWorkspaceSetting workspaceSetting);GlobalPackSetting getPackSetting();diff --git a/server-core/src/main/java/io/onedev/server/service/UrlService.java b/server-core/src/main/java/io/onedev/server/service/UrlService.javaindex 4d54e16464..dfc2818449 100644--- a/server-core/src/main/java/io/onedev/server/service/UrlService.java+++ b/server-core/src/main/java/io/onedev/server/service/UrlService.java@@ -37,6 +37,10 @@ public interface UrlService {String urlFor(CodeComment comment, boolean withRootUrl);String urlFor(Pack pack, boolean withRootUrl);++ String urlFor(Workspace workspace, boolean withRootUrl);++ String urlForWorkspace(Project project, Long workspaceNumber, boolean withRootUrl);String urlFor(CodeCommentReply reply, boolean withRootUrl);diff --git a/server-core/src/main/java/io/onedev/server/service/impl/BaseEntityService.java b/server-core/src/main/java/io/onedev/server/service/impl/BaseEntityService.javaindex 6e974e3855..08296b5467 100644--- a/server-core/src/main/java/io/onedev/server/service/impl/BaseEntityService.java+++ b/server-core/src/main/java/io/onedev/server/service/impl/BaseEntityService.java@@ -41,8 +41,8 @@ public abstract class BaseEntityService<T extends AbstractEntity> implements Ent}@Override- public void delete(T iteration) {- dao.remove(iteration);+ public void delete(T entity) {+ dao.remove(entity);}@Overridediff --git a/server-core/src/main/java/io/onedev/server/service/impl/DefaultAgentService.java b/server-core/src/main/java/io/onedev/server/service/impl/DefaultAgentService.javaindex 52645e6e99..b0a7a1c0e0 100644--- a/server-core/src/main/java/io/onedev/server/service/impl/DefaultAgentService.java+++ b/server-core/src/main/java/io/onedev/server/service/impl/DefaultAgentService.java@@ -240,9 +240,13 @@ public class DefaultAgentService extends BaseEntityService<Agent> implements Age}private void removeReferences(Agent agent) {- Query<?> query = getSession().createQuery("update Build set agent=null where agent=:agent");- query.setParameter("agent", agent);- query.executeUpdate();+ Query<?> query = getSession().createQuery("update Build set agent=null where agent=:agent");+ query.setParameter("agent", agent);+ query.executeUpdate();++ query = getSession().createQuery("update Workspace set agent=null where agent=:agent");+ query.setParameter("agent", agent);+ query.executeUpdate();}@Sessional@@ -290,17 +294,17 @@ public class DefaultAgentService extends BaseEntityService<Agent> implements Agereturn osArchs.keySet();}- private CriteriaQuery<Agent> buildCriteriaQuery(org.hibernate.Session session, EntityQuery<Agent> agentQuery) {+ private CriteriaQuery<Agent> buildCriteriaQuery(org.hibernate.Session session, EntityQuery<Agent> query) {CriteriaBuilder builder = session.getCriteriaBuilder();- CriteriaQuery<Agent> query = builder.createQuery(Agent.class);- Root<Agent> root = query.from(Agent.class);- query.select(root);+ CriteriaQuery<Agent> criteriaQuery = builder.createQuery(Agent.class);+ Root<Agent> root = criteriaQuery.from(Agent.class);+ criteriaQuery.select(root);- if (agentQuery.getCriteria() != null)- query.where(agentQuery.getCriteria().getPredicate(null, query, root, builder));+ if (query.getCriteria() != null)+ criteriaQuery.where(query.getCriteria().getPredicate(null, criteriaQuery, root, builder));List<javax.persistence.criteria.Order> orders = new ArrayList<>();- for (EntitySort sort: agentQuery.getSorts()) {+ for (EntitySort sort: query.getSorts()) {if (sort.getDirection() == ASCENDING)orders.add(builder.asc(AgentQuery.getPath(root, SORT_FIELDS.get(sort.getField()).getProperty())));else@@ -309,31 +313,31 @@ public class DefaultAgentService extends BaseEntityService<Agent> implements Ageif (orders.isEmpty())orders.add(builder.asc(AgentQuery.getPath(root, Agent.PROP_NAME)));- query.orderBy(orders);+ criteriaQuery.orderBy(orders);- return query;+ return criteriaQuery;}@Sessional@Override- public List<Agent> query(EntityQuery<Agent> agentQuery, int firstResult, int maxResults) {- CriteriaQuery<Agent> criteriaQuery = buildCriteriaQuery(getSession(), agentQuery);- Query<Agent> query = getSession().createQuery(criteriaQuery);- query.setFirstResult(firstResult);- query.setMaxResults(maxResults);- query.setCacheable(true);- return query.getResultList();+ public List<Agent> query(EntityQuery<Agent> query, int firstResult, int maxResults) {+ CriteriaQuery<Agent> criteriaQuery = buildCriteriaQuery(getSession(), query);+ Query<Agent> hibernateQuery = getSession().createQuery(criteriaQuery);+ hibernateQuery.setFirstResult(firstResult);+ hibernateQuery.setMaxResults(maxResults);+ hibernateQuery.setCacheable(true);+ return hibernateQuery.getResultList();}@Sessional@Override- public int count(Criteria<Agent> agentCriteria) {+ public int count(Criteria<Agent> criteria) {CriteriaBuilder builder = getSession().getCriteriaBuilder();CriteriaQuery<Long> criteriaQuery = builder.createQuery(Long.class);Root<Agent> root = criteriaQuery.from(Agent.class);- if (agentCriteria != null)- criteriaQuery.where(agentCriteria.getPredicate(null, criteriaQuery, root, builder));+ if (criteria != null)+ criteriaQuery.where(criteria.getPredicate(null, criteriaQuery, root, builder));criteriaQuery.select(builder.count(root));return getSession().createQuery(criteriaQuery).uniqueResult().intValue();@@ -351,7 +355,7 @@ public class DefaultAgentService extends BaseEntityService<Agent> implements AgeSession session = agentSessions.get(agentId);if (session != null)new Message(MessageTypes.RESTART, new byte[0]).sendBy(session);- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error restarting agent '" + agentName + "'", e);}return null;@@ -368,7 +372,7 @@ public class DefaultAgentService extends BaseEntityService<Agent> implements AgeSession session = agentSessions.get(agentId);if (session != null)session.disconnect();- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error disconnecting agent with id '" + agentId + "'", e);}return null;@@ -397,7 +401,7 @@ public class DefaultAgentService extends BaseEntityService<Agent> implements Agenew Message(MessageTypes.STOP, new byte[0]).sendBy(prevSession);prevSession.disconnect();}- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error disconnecting agent '" + agentName + "'", e);}return null;@@ -435,7 +439,7 @@ public class DefaultAgentService extends BaseEntityService<Agent> implements Agebyte[] attributeBytes = SerializationUtils.serialize((Serializable) attributes);new Message(MessageTypes.UPDATE_ATTRIBUTES, attributeBytes).sendBy(session);}- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error updating attributes of agent '" + agentName + "'", e);}return null;diff --git a/server-core/src/main/java/io/onedev/server/service/impl/DefaultAlertService.java b/server-core/src/main/java/io/onedev/server/service/impl/DefaultAlertService.javaindex a6165393ef..c49cc46ee9 100644--- a/server-core/src/main/java/io/onedev/server/service/impl/DefaultAlertService.java+++ b/server-core/src/main/java/io/onedev/server/service/impl/DefaultAlertService.java@@ -16,7 +16,7 @@ import com.google.common.collect.Sets;import io.onedev.server.cluster.ClusterService;import io.onedev.server.event.Listen;-import io.onedev.server.event.cluster.ConnectionLost;+import io.onedev.server.event.cluster.NodeDisconnected;import io.onedev.server.event.entity.EntityPersisted;import io.onedev.server.mail.MailService;import io.onedev.server.model.Alert;@@ -61,7 +61,7 @@ public class DefaultAlertService extends BaseEntityService<Alert> implements Alecriteria.add(Restrictions.eq(PROP_SUBJECT, subject));var alert = find(criteria);if (alert == null) {- alert = new Alert();+ alert = new Alert();alert.setSubject(subject);alert.setDetail(detail);alert.setMailError(mailError);@@ -76,8 +76,8 @@ public class DefaultAlertService extends BaseEntityService<Alert> implements Ale}@Listen- public void on(ConnectionLost event) {- if (clusterService.isLeaderServer()) {+ public void on(NodeDisconnected event) {+ if (clusterService.isLeaderServer() && event.isAbnormal()) {var server = event.getServer() + " (" + clusterService.getServerName(event.getServer()) + ")";alert("Server '" + server + "' can not be reached","Server '" + server + "' is part of OneDev cluster, but can not be reached for some reason",diff --git a/server-core/src/main/java/io/onedev/server/service/impl/DefaultBuildService.java b/server-core/src/main/java/io/onedev/server/service/impl/DefaultBuildService.javaindex a9d65d3d0d..a6c6e11a05 100644--- a/server-core/src/main/java/io/onedev/server/service/impl/DefaultBuildService.java+++ b/server-core/src/main/java/io/onedev/server/service/impl/DefaultBuildService.java@@ -79,9 +79,11 @@ import io.onedev.server.cluster.ClusterService;import io.onedev.server.event.Listen;import io.onedev.server.event.entity.EntityPersisted;import io.onedev.server.event.entity.EntityRemoved;+import io.onedev.server.event.project.build.BuildFinished;import io.onedev.server.event.system.SystemStarting;import io.onedev.server.event.system.SystemStopping;import io.onedev.server.git.service.GitService;+import io.onedev.server.logging.LogService;import io.onedev.server.model.Agent;import io.onedev.server.model.Build;import io.onedev.server.model.Build.Status;@@ -149,6 +151,9 @@ public class DefaultBuildService extends BaseEntityService<Build> implements Bui@Injectprivate BuildLabelService labelService;++ @Inject+ private LogService logService;@Injectprivate ClusterService clusterService;@@ -259,7 +264,7 @@ public class DefaultBuildService extends BaseEntityService<Build> implements Buivar buildDir = getBuildDir(projectId, buildNumber);FileUtils.deleteDir(buildDir);projectService.directoryModified(projectId, buildDir.getParentFile());- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error deleting storage directory of build id '" + buildId + "'", e);}return null;@@ -270,6 +275,11 @@ public class DefaultBuildService extends BaseEntityService<Build> implements Bui}}+ @Listen+ public void on(BuildFinished event) {+ logService.flush(event.getBuild().getLoggingSupport());+ }+@Sessional@Overridepublic Collection<Build> query(Project project, ObjectId commitId) {@@ -649,28 +659,28 @@ public class DefaultBuildService extends BaseEntityService<Build> implements Bui}private CriteriaQuery<Build> buildCriteriaQuery(Subject subject, @Nullable Project project,- Session session, EntityQuery<Build> buildQuery) {+ Session session, EntityQuery<Build> query) {CriteriaBuilder builder = session.getCriteriaBuilder();- CriteriaQuery<Build> query = builder.createQuery(Build.class);- Root<Build> root = query.from(Build.class);- query.select(root);+ CriteriaQuery<Build> criteriaQuery = builder.createQuery(Build.class);+ Root<Build> root = criteriaQuery.from(Build.class);+ criteriaQuery.select(root);- query.where(getPredicates(subject, project, buildQuery.getCriteria(), query, root, builder));+ criteriaQuery.where(getPredicates(subject, project, query.getCriteria(), criteriaQuery, root, builder));- applyOrders(root, query, builder, buildQuery);+ applyOrders(root, criteriaQuery, builder, query);- return query;+ return criteriaQuery;}@Sessional@Override- public List<Build> query(Subject subject, Project project, EntityQuery<Build> buildQuery,+ public List<Build> query(Subject subject, Project project, EntityQuery<Build> query,boolean loadLabels, int firstResult, int maxResults) {- CriteriaQuery<Build> criteriaQuery = buildCriteriaQuery(subject, project, getSession(), buildQuery);- Query<Build> query = getSession().createQuery(criteriaQuery);- query.setFirstResult(firstResult);- query.setMaxResults(maxResults);- var builds = query.getResultList();+ CriteriaQuery<Build> criteriaQuery = buildCriteriaQuery(subject, project, getSession(), query);+ Query<Build> hibernateQuery = getSession().createQuery(criteriaQuery);+ hibernateQuery.setFirstResult(firstResult);+ hibernateQuery.setMaxResults(maxResults);+ var builds = hibernateQuery.getResultList();if (!builds.isEmpty() && loadLabels)labelService.populateLabels(builds);return builds;@@ -678,9 +688,9 @@ public class DefaultBuildService extends BaseEntityService<Build> implements Bui@SuppressWarnings("rawtypes")private void applyOrders(From<Build, Build> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder builder,- EntityQuery<Build> buildQuery) {+ EntityQuery<Build> query) {List<javax.persistence.criteria.Order> orders = new ArrayList<>();- for (EntitySort sort: buildQuery.getSorts()) {+ for (EntitySort sort: query.getSorts()) {if (sort.getDirection() == ASCENDING)orders.add(builder.asc(BuildQuery.getPath(root, SORT_FIELDS.get(sort.getField()).getProperty())));else@@ -702,33 +712,32 @@ public class DefaultBuildService extends BaseEntityService<Build> implements Bui}@Sessional- protected Collection<Long> queryIds(Project project, EntityQuery<Build> buildQuery,- int firstResult, int maxResults) {+ protected Collection<Long> queryIds(Project project, EntityQuery<Build> query, int firstResult, int maxResults) {CriteriaBuilder builder = getSession().getCriteriaBuilder();CriteriaQuery<Long> criteriaQuery = builder.createQuery(Long.class);Root<Build> root = criteriaQuery.from(Build.class);criteriaQuery.select(root.get(Build.PROP_ID));var subject = userService.getSystem().asSubject();- criteriaQuery.where(getPredicates(subject, project, buildQuery.getCriteria(), criteriaQuery, root, builder));+ criteriaQuery.where(getPredicates(subject, project, query.getCriteria(), criteriaQuery, root, builder));- applyOrders(root, criteriaQuery, builder, buildQuery);+ applyOrders(root, criteriaQuery, builder, query);- Query<Long> query = getSession().createQuery(criteriaQuery);- query.setFirstResult(firstResult);- query.setMaxResults(maxResults);+ Query<Long> hibernateQuery = getSession().createQuery(criteriaQuery);+ hibernateQuery.setFirstResult(firstResult);+ hibernateQuery.setMaxResults(maxResults);- return query.list();+ return hibernateQuery.list();}@Sessional@Override- public int count(Subject subject, Project project, Criteria<Build> buildCriteria) {+ public int count(Subject subject, Project project, Criteria<Build> criteria) {CriteriaBuilder builder = getSession().getCriteriaBuilder();CriteriaQuery<Long> criteriaQuery = builder.createQuery(Long.class);Root<Build> root = criteriaQuery.from(Build.class);- criteriaQuery.where(getPredicates(subject, project, buildCriteria, criteriaQuery, root, builder));+ criteriaQuery.where(getPredicates(subject, project, criteria, criteriaQuery, root, builder));criteriaQuery.select(builder.count(root));return getSession().createQuery(criteriaQuery).uniqueResult().intValue();diff --git a/server-core/src/main/java/io/onedev/server/service/impl/DefaultIssueService.java b/server-core/src/main/java/io/onedev/server/service/impl/DefaultIssueService.javaindex 46c81a4eb2..562fb58ca0 100644--- a/server-core/src/main/java/io/onedev/server/service/impl/DefaultIssueService.java+++ b/server-core/src/main/java/io/onedev/server/service/impl/DefaultIssueService.java@@ -324,23 +324,23 @@ public class DefaultIssueService extends BaseEntityService<Issue> implements Iss@Sessional@Override- public List<Issue> query(Subject subject, ProjectScope projectScope, EntityQuery<Issue> issueQuery,+ public List<Issue> query(Subject subject, ProjectScope projectScope, EntityQuery<Issue> query,boolean loadExtraInfo, int firstResult, int maxResults) {CriteriaBuilder builder = getSession().getCriteriaBuilder();CriteriaQuery<Issue> criteriaQuery = builder.createQuery(Issue.class);Root<Issue> root = criteriaQuery.from(Issue.class);- criteriaQuery.where(buildPredicates(subject, projectScope, issueQuery.getCriteria(), criteriaQuery, builder, root));- var criteria = issueQuery.getCriteria();+ criteriaQuery.where(buildPredicates(subject, projectScope, query.getCriteria(), criteriaQuery, builder, root));+ var criteria = query.getCriteria();List<javax.persistence.criteria.Order> preferOrders = new ArrayList<>();if (criteria != null)preferOrders.addAll(criteria.getPreferOrders(builder, root));- criteriaQuery.orderBy(buildOrders(issueQuery, builder, root, preferOrders));+ criteriaQuery.orderBy(buildOrders(query, builder, root, preferOrders));- Query<Issue> query = getSession().createQuery(criteriaQuery);- query.setFirstResult(firstResult);- query.setMaxResults(maxResults);- List<Issue> issues = query.getResultList();+ Query<Issue> hibernateQuery = getSession().createQuery(criteriaQuery);+ hibernateQuery.setFirstResult(firstResult);+ hibernateQuery.setMaxResults(maxResults);+ List<Issue> issues = hibernateQuery.getResultList();if (loadExtraInfo && !issues.isEmpty()) {fieldService.populateFields(issues);linkService.populateLinks(issues);@@ -358,12 +358,12 @@ public class DefaultIssueService extends BaseEntityService<Issue> implements Iss@Sessional@Override- public int count(Subject subject, ProjectScope projectScope, Criteria<Issue> issueCriteria) {+ public int count(Subject subject, ProjectScope projectScope, Criteria<Issue> criteria) {CriteriaBuilder builder = getSession().getCriteriaBuilder();CriteriaQuery<Long> criteriaQuery = builder.createQuery(Long.class);Root<Issue> root = criteriaQuery.from(Issue.class);- criteriaQuery.where(buildPredicates(subject, projectScope, issueCriteria, criteriaQuery, builder, root));+ criteriaQuery.where(buildPredicates(subject, projectScope, criteria, criteriaQuery, builder, root));criteriaQuery.select(builder.count(root));return getSession().createQuery(criteriaQuery).uniqueResult().intValue();@@ -371,12 +371,12 @@ public class DefaultIssueService extends BaseEntityService<Issue> implements Iss@Sessional@Override- public IssueTimes queryTimes(Subject subject, ProjectScope projectScope, Criteria<Issue> issueCriteria) {+ public IssueTimes queryTimes(Subject subject, ProjectScope projectScope, Criteria<Issue> criteria) {CriteriaBuilder builder = getSession().getCriteriaBuilder();CriteriaQuery<IssueTimes> criteriaQuery = builder.createQuery(IssueTimes.class);Root<Issue> root = criteriaQuery.from(Issue.class);- criteriaQuery.where(buildPredicates(subject, projectScope, issueCriteria, criteriaQuery, builder, root));+ criteriaQuery.where(buildPredicates(subject, projectScope, criteria, criteriaQuery, builder, root));criteriaQuery.multiselect(builder.sum(root.get(PROP_OWN_ESTIMATED_TIME)),@@ -385,7 +385,7 @@ public class DefaultIssueService extends BaseEntityService<Issue> implements Iss}@Override- public Predicate[] buildPredicates(Subject subject, ProjectScope projectScope, Criteria<Issue> issueCriteria,+ public Predicate[] buildPredicates(Subject subject, ProjectScope projectScope, Criteria<Issue> criteria,CriteriaQuery<?> query, CriteriaBuilder builder, From<Issue, Issue> issue) {List<Predicate> predicates = new ArrayList<>();if (projectScope != null) {@@ -424,8 +424,8 @@ public class DefaultIssueService extends BaseEntityService<Issue> implements Isspredicates.add(builder.disjunction());}}- if (issueCriteria != null)- predicates.add(issueCriteria.getPredicate(projectScope, query, issue, builder));+ if (criteria != null)+ predicates.add(criteria.getPredicate(projectScope, query, issue, builder));return predicates.toArray(new Predicate[predicates.size()]);}@@ -936,8 +936,7 @@ public class DefaultIssueService extends BaseEntityService<Issue> implements Isspublic void on(EntityRemoved event) {if (event.getEntity() instanceof Issue) {var cacheKey = getCacheKey((Issue) event.getEntity());- transactionService.runAfterCommit(() -> idCache.remove(cacheKey));-+ transactionService.runAfterCommit(() -> idCache.remove(cacheKey));} else if (event.getEntity() instanceof Project) {Project project = (Project) event.getEntity();if (project.getForkRoot().equals(project))diff --git a/server-core/src/main/java/io/onedev/server/service/impl/DefaultPackService.java b/server-core/src/main/java/io/onedev/server/service/impl/DefaultPackService.javaindex a654e68ee1..21588c321c 100644--- a/server-core/src/main/java/io/onedev/server/service/impl/DefaultPackService.java+++ b/server-core/src/main/java/io/onedev/server/service/impl/DefaultPackService.java@@ -84,18 +84,17 @@ public class DefaultPackService extends BaseEntityService<Pack>@Injectprivate ListenerRegistry listenerRegistry;- private CriteriaQuery<Pack> buildCriteriaQuery(Subject subject, Project project,- Session session, EntityQuery<Pack> packQuery) {+ private CriteriaQuery<Pack> buildCriteriaQuery(Subject subject, Project project, Session session, EntityQuery<Pack> query) {CriteriaBuilder builder = session.getCriteriaBuilder();- CriteriaQuery<Pack> query = builder.createQuery(Pack.class);- Root<Pack> root = query.from(Pack.class);- query.select(root);+ CriteriaQuery<Pack> criteriaQuery = builder.createQuery(Pack.class);+ Root<Pack> root = criteriaQuery.from(Pack.class);+ criteriaQuery.select(root);- query.where(getPredicates(subject, project, packQuery.getCriteria(), query, root, builder));+ criteriaQuery.where(getPredicates(subject, project, query.getCriteria(), criteriaQuery, root, builder));- applyOrders(root, query, builder, packQuery.getSorts());+ applyOrders(root, criteriaQuery, builder, query.getSorts());- return query;+ return criteriaQuery;}private void applyOrders(From<Pack, Pack> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder builder,@@ -115,13 +114,13 @@ public class DefaultPackService extends BaseEntityService<Pack>@Sessional@Override- public List<Pack> query(Subject subject, Project project, EntityQuery<Pack> packQuery,+ public List<Pack> query(Subject subject, Project project, EntityQuery<Pack> query,boolean loadLabelsAndBlobs, int firstResult, int maxResults) {- CriteriaQuery<Pack> criteriaQuery = buildCriteriaQuery(subject, project, getSession(), packQuery);- Query<Pack> query = getSession().createQuery(criteriaQuery);- query.setFirstResult(firstResult);- query.setMaxResults(maxResults);- var packs = query.getResultList();+ CriteriaQuery<Pack> criteriaQuery = buildCriteriaQuery(subject, project, getSession(), query);+ Query<Pack> hibernateQuery = getSession().createQuery(criteriaQuery);+ hibernateQuery.setFirstResult(firstResult);+ hibernateQuery.setMaxResults(maxResults);+ var packs = hibernateQuery.getResultList();if (!packs.isEmpty() && loadLabelsAndBlobs) {labelService.populateLabels(packs);@@ -164,12 +163,12 @@ public class DefaultPackService extends BaseEntityService<Pack>@Sessional@Override- public int count(Subject subject, Project project, Criteria<Pack> packCriteria) {+ public int count(Subject subject, Project project, Criteria<Pack> criteria) {CriteriaBuilder builder = getSession().getCriteriaBuilder();CriteriaQuery<Long> criteriaQuery = builder.createQuery(Long.class);Root<Pack> root = criteriaQuery.from(Pack.class);- criteriaQuery.where(getPredicates(subject, project, packCriteria, criteriaQuery, root, builder));+ criteriaQuery.where(getPredicates(subject, project, criteria, criteriaQuery, root, builder));criteriaQuery.select(builder.count(root));return getSession().createQuery(criteriaQuery).uniqueResult().intValue();diff --git a/server-core/src/main/java/io/onedev/server/service/impl/DefaultProjectService.java b/server-core/src/main/java/io/onedev/server/service/impl/DefaultProjectService.javaindex 19b60d8612..587fff387b 100644--- a/server-core/src/main/java/io/onedev/server/service/impl/DefaultProjectService.java+++ b/server-core/src/main/java/io/onedev/server/service/impl/DefaultProjectService.java@@ -58,7 +58,6 @@ import java.util.concurrent.Future;import java.util.concurrent.locks.Lock;import java.util.function.Consumer;-import org.jspecify.annotations.Nullable;import javax.inject.Inject;import javax.inject.Singleton;import javax.persistence.criteria.CriteriaBuilder;@@ -91,6 +90,7 @@ import org.hibernate.Session;import org.hibernate.criterion.Restrictions;import org.hibernate.query.Query;import org.hibernate.query.criteria.internal.path.SingularAttributePath;+import org.jspecify.annotations.Nullable;import org.quartz.CronScheduleBuilder;import org.quartz.ScheduleBuilder;import org.slf4j.Logger;@@ -119,7 +119,9 @@ import io.onedev.server.cluster.ClusterTask;import io.onedev.server.data.migration.VersionedXmlDoc;import io.onedev.server.event.Listen;import io.onedev.server.event.ListenerRegistry;-import io.onedev.server.event.cluster.ConnectionEvent;+import io.onedev.server.event.cluster.NodeConnected;+import io.onedev.server.event.cluster.NodeDisconnected;+import io.onedev.server.event.cluster.NodeEvent;import io.onedev.server.event.entity.EntityPersisted;import io.onedev.server.event.entity.EntityRemoved;import io.onedev.server.event.project.ActiveServerChanged;@@ -196,6 +198,7 @@ import io.onedev.server.util.facade.ProjectFacade;import io.onedev.server.util.patternset.PatternSet;import io.onedev.server.util.usage.Usage;import io.onedev.server.web.avatar.AvatarService;+import io.onedev.server.workspace.WorkspaceService;import io.onedev.server.xodus.CommitInfoService;import io.onedev.server.xodus.VisitInfoService;@@ -282,6 +285,9 @@ public class DefaultProjectService extends BaseEntityService<Project>@Injectprivate PackBlobService packBlobService;+ @Inject+ private WorkspaceService workspaceService;+@Injectprivate ProjectLabelService labelService;@@ -424,7 +430,11 @@ public class DefaultProjectService extends BaseEntityService<Project>if (replicasOfProject != null) {for (var server: replicasOfProject.keySet()) {clusterService.submitToServer(server, () -> {- markStorageForDelete(projectId);+ try {+ markStorageForDelete(projectId);+ } catch (Throwable e) {+ logger.error("Error marking project storage for delete", e);+ }return null;});}@@ -659,7 +669,7 @@ public class DefaultProjectService extends BaseEntityService<Project>}}- HookUtils.checkHooks(toGitDir);+ HookUtils.checkReceiveHooks(toGitDir);checkGitConfig(toId, gitPackConfig);commitInfoService.cloneInfo(fromId, toId);avatarService.copyProjectAvatar(fromId, toId);@@ -679,7 +689,7 @@ public class DefaultProjectService extends BaseEntityService<Project>new CloneCommand(gitDir, repositoryUrl).mirror(true).noLfs(true).run();storageService.initLfsDir(projectId);new LfsFetchAllCommand(gitDir, repositoryUrl).run();- HookUtils.checkHooks(gitDir);+ HookUtils.checkReceiveHooks(gitDir);checkGitConfig(projectId, project.getGitPackConfig());return null;});@@ -703,8 +713,8 @@ public class DefaultProjectService extends BaseEntityService<Project>}}});- } catch (Exception e) {- logger.error("Error posting ref updated event", e);+ } catch (Throwable t) {+ logger.error("Error posting ref updated event", t);}return null;});@@ -826,7 +836,7 @@ public class DefaultProjectService extends BaseEntityService<Project>if (project != null) {logger.debug("Checking project (path: {})...", project.getPath());checkGitDir(projectId);- HookUtils.checkHooks(getGitDir(projectId));+ HookUtils.checkReceiveHooks(getGitDir(projectId));checkGitConfig(projectId, project.getGitPackConfig());LinkedHashMap<String, ProjectReplica> newReplicasOfProject;@@ -859,8 +869,8 @@ public class DefaultProjectService extends BaseEntityService<Project>}@Listen- public void on(ConnectionEvent event) {- if (clusterService.isLeaderServer()) {+ public void on(NodeEvent event) {+ if (clusterService.isLeaderServer() && (event instanceof NodeConnected nodeConnected && nodeConnected.isRecovered() || event instanceof NodeDisconnected nodeDisconnected && nodeDisconnected.isAbnormal())) {logger.info("Updating active servers upon cluster member change...");updateActiveServers();}@@ -1015,23 +1025,23 @@ public class DefaultProjectService extends BaseEntityService<Project>}@SuppressWarnings("rawtypes")- private CriteriaQuery<Project> buildCriteriaQuery(Subject subject, Session session, EntityQuery<Project> projectQuery) {+ private CriteriaQuery<Project> buildCriteriaQuery(Subject subject, Session session, EntityQuery<Project> query) {CriteriaBuilder builder = session.getCriteriaBuilder();- CriteriaQuery<Project> query = builder.createQuery(Project.class);- Root<Project> root = query.from(Project.class);- query.select(root);+ CriteriaQuery<Project> criteriaQuery = builder.createQuery(Project.class);+ Root<Project> root = criteriaQuery.from(Project.class);+ criteriaQuery.select(root);- query.where(getPredicates(subject, projectQuery.getCriteria(), query, root, builder));+ criteriaQuery.where(getPredicates(subject, query.getCriteria(), criteriaQuery, root, builder));List<Order> orders = new ArrayList<>();- for (EntitySort sort : projectQuery.getSorts())+ for (EntitySort sort : query.getSorts())orders.add(getOrder(sort, builder, root));- if (projectQuery.getCriteria() != null)- orders.addAll(projectQuery.getCriteria().getPreferOrders(builder, root));+ if (query.getCriteria() != null)+ orders.addAll(query.getCriteria().getPreferOrders(builder, root));- for (EntitySort sort : projectQuery.getBaseSorts())+ for (EntitySort sort : query.getBaseSorts())orders.add(getOrder(sort, builder, root));var found = false;@@ -1049,9 +1059,9 @@ public class DefaultProjectService extends BaseEntityService<Project>if (!found)orders.add(builder.desc(ProjectQuery.getPath(root, Project.PROP_LAST_ACTIVITY_DATE + "." + ProjectLastActivityDate.PROP_VALUE)));- query.orderBy(orders);+ criteriaQuery.orderBy(orders);- return query;+ return criteriaQuery;}private Predicate[] getPredicates(Subject subject, @Nullable Criteria<Project> criteria, CriteriaQuery<?> query,@@ -1075,10 +1085,10 @@ public class DefaultProjectService extends BaseEntityService<Project>@Overridepublic List<Project> query(Subject subject, EntityQuery<Project> query, boolean loadLabels, int firstResult, int maxResults) {CriteriaQuery<Project> criteriaQuery = buildCriteriaQuery(subject, getSession(), query);- Query<Project> projectQuery = getSession().createQuery(criteriaQuery);- projectQuery.setFirstResult(firstResult);- projectQuery.setMaxResults(maxResults);- var projects = projectQuery.getResultList();+ Query<Project> hibernateQuery = getSession().createQuery(criteriaQuery);+ hibernateQuery.setFirstResult(firstResult);+ hibernateQuery.setMaxResults(maxResults);+ var projects = hibernateQuery.getResultList();if (!projects.isEmpty() && loadLabels)labelService.populateLabels(projects);@@ -1088,12 +1098,12 @@ public class DefaultProjectService extends BaseEntityService<Project>@Sessional@Override- public int count(Subject subject, Criteria<Project> projectCriteria) {+ public int count(Subject subject, Criteria<Project> criteria) {CriteriaBuilder builder = getSession().getCriteriaBuilder();CriteriaQuery<Long> criteriaQuery = builder.createQuery(Long.class);Root<Project> root = criteriaQuery.from(Project.class);- criteriaQuery.where(getPredicates(subject, projectCriteria, criteriaQuery, root, builder));+ criteriaQuery.where(getPredicates(subject, criteria, criteriaQuery, root, builder));criteriaQuery.select(builder.count(root));return getSession().createQuery(criteriaQuery).uniqueResult().intValue();@@ -1385,7 +1395,7 @@ public class DefaultProjectService extends BaseEntityService<Project>private void initGit(Long projectId, GitPackConfig gitPackConfig) {checkGitDir(projectId);var gitDir = getGitDir(projectId);- HookUtils.checkHooks(gitDir);+ HookUtils.checkReceiveHooks(gitDir);checkGitConfig(projectId, gitPackConfig);}@@ -1539,7 +1549,7 @@ public class DefaultProjectService extends BaseEntityService<Project>clusterService.submitToServer(server, () -> {try {requestToSyncReplica(projectId, syncWithServer);- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error requesting replica sync of project with id '" + projectId + "'", e);}return null;@@ -1711,6 +1721,7 @@ public class DefaultProjectService extends BaseEntityService<Project>if (version < remoteVersion) {logger.debug("Syncing project (project: {}, server: {})...", project.getPath(), syncWithServer);syncGit(projectId, syncWithServer);+ workspaceService.syncWorkspaces(projectId, syncWithServer);attachmentService.syncAttachments(projectId, syncWithServer);buildService.syncBuilds(projectId, syncWithServer);visitInfoService.syncVisitInfo(projectId, syncWithServer);@@ -1907,7 +1918,11 @@ public class DefaultProjectService extends BaseEntityService<Project>if (!newReplicasOfProject.equals(replicasOfProject)) {if (replicas.replace(projectId, replicasOfProject, newReplicasOfProject)) {redundantServers.forEach(it -> clusterService.submitToServer(it, () -> {- markStorageForDelete(projectId);+ try {+ markStorageForDelete(projectId);+ } catch (Throwable e) {+ logger.error("Error marking project storage directory for deletion", e);+ }return null;}));break;diff --git a/server-core/src/main/java/io/onedev/server/service/impl/DefaultPullRequestService.java b/server-core/src/main/java/io/onedev/server/service/impl/DefaultPullRequestService.javaindex 97a3d997f8..2e4747d1af 100644--- a/server-core/src/main/java/io/onedev/server/service/impl/DefaultPullRequestService.java+++ b/server-core/src/main/java/io/onedev/server/service/impl/DefaultPullRequestService.java@@ -365,7 +365,7 @@ public class DefaultPullRequestService extends BaseEntityService<PullRequest>if (project.findDeleteBranchAfterPullRequestMerge()&& request.checkDeleteSourceBranchCondition() == null&& SecurityUtils.canDeleteBranch(user.asSubject(), request.getSourceProject(), request.getSourceBranch())) {- gitService.deleteBranch(request.getSourceProject(), request.getSourceBranch());+ projectService.deleteBranch(request.getSourceProject(), request.getSourceBranch());}}@@ -730,7 +730,7 @@ public class DefaultPullRequestService extends BaseEntityService<PullRequest>}});- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error checking pull request", e);}return null;@@ -866,7 +866,7 @@ public class DefaultPullRequestService extends BaseEntityService<PullRequest>}}- private Predicate[] getPredicates(Subject subject, Project targetProject, Criteria<PullRequest> criteria,+ private Predicate[] getPredicates(Subject subject, Project targetProject, @Nullable Criteria<PullRequest> criteria,CriteriaQuery<?> query, From<PullRequest, PullRequest> from, CriteriaBuilder builder) {List<Predicate> predicates = new ArrayList<>();if (targetProject != null) {@@ -899,21 +899,21 @@ public class DefaultPullRequestService extends BaseEntityService<PullRequest>@SuppressWarnings("rawtypes")private CriteriaQuery<PullRequest> buildCriteriaQuery(Subject subject, Session session,- @Nullable Project targetProject, EntityQuery<PullRequest> requestQuery) {+ @Nullable Project targetProject, EntityQuery<PullRequest> query) {CriteriaBuilder builder = session.getCriteriaBuilder();- CriteriaQuery<PullRequest> query = builder.createQuery(PullRequest.class);- Root<PullRequest> root = query.from(PullRequest.class);+ CriteriaQuery<PullRequest> criteriaQuery = builder.createQuery(PullRequest.class);+ Root<PullRequest> root = criteriaQuery.from(PullRequest.class);- query.where(getPredicates(subject, targetProject, requestQuery.getCriteria(), query, root, builder));+ criteriaQuery.where(getPredicates(subject, targetProject, query.getCriteria(), criteriaQuery, root, builder));List<Order> orders = new ArrayList<>();- for (EntitySort sort: requestQuery.getSorts())+ for (EntitySort sort: query.getSorts())orders.add(getOrder(sort, builder, root));- if (requestQuery.getCriteria() != null)- orders.addAll(requestQuery.getCriteria().getPreferOrders(builder, root));+ if (query.getCriteria() != null)+ orders.addAll(query.getCriteria().getPreferOrders(builder, root));- for (EntitySort sort: requestQuery.getBaseSorts())+ for (EntitySort sort: query.getBaseSorts())orders.add(getOrder(sort, builder, root));var found = false;@@ -931,22 +931,22 @@ public class DefaultPullRequestService extends BaseEntityService<PullRequest>if (!found)orders.add(builder.desc(PullRequestQuery.getPath(root, PullRequest.PROP_LAST_ACTIVITY + "." + LastActivity.PROP_DATE)));- query.orderBy(orders);+ criteriaQuery.orderBy(orders);- return query;+ return criteriaQuery;}@Sessional@Overridepublic List<PullRequest> query(Subject subject, Project targetProject,- EntityQuery<PullRequest> requestQuery, boolean loadExtraInfo,+ EntityQuery<PullRequest> query, boolean loadExtraInfo,int firstResult, int maxResults) {- CriteriaQuery<PullRequest> criteriaQuery = buildCriteriaQuery(subject, getSession(), targetProject, requestQuery);- Query<PullRequest> query = getSession().createQuery(criteriaQuery);- query.setFirstResult(firstResult);- query.setMaxResults(maxResults);+ CriteriaQuery<PullRequest> criteriaQuery = buildCriteriaQuery(subject, getSession(), targetProject, query);+ Query<PullRequest> hibernateQuery = getSession().createQuery(criteriaQuery);+ hibernateQuery.setFirstResult(firstResult);+ hibernateQuery.setMaxResults(maxResults);- List<PullRequest> requests = query.getResultList();+ List<PullRequest> requests = hibernateQuery.getResultList();if (!requests.isEmpty() && loadExtraInfo) {reviewService.populateReviews(requests);buildService.populateBuilds(requests);@@ -958,12 +958,12 @@ public class DefaultPullRequestService extends BaseEntityService<PullRequest>@Sessional@Override- public int count(Subject subject, Project targetProject, Criteria<PullRequest> requestCriteria) {+ public int count(Subject subject, Project targetProject, Criteria<PullRequest> criteria) {CriteriaBuilder builder = getSession().getCriteriaBuilder();CriteriaQuery<Long> criteriaQuery = builder.createQuery(Long.class);Root<PullRequest> root = criteriaQuery.from(PullRequest.class);- criteriaQuery.where(getPredicates(subject, targetProject, requestCriteria, criteriaQuery, root, builder));+ criteriaQuery.where(getPredicates(subject, targetProject, criteria, criteriaQuery, root, builder));criteriaQuery.select(builder.count(root));return getSession().createQuery(criteriaQuery).uniqueResult().intValue();@@ -1026,13 +1026,13 @@ public class DefaultPullRequestService extends BaseEntityService<PullRequest>@Sessional@Overridepublic Map<Integer, Integer> queryDurationStats(Subject subject, Project project,- Criteria<PullRequest> pullRequestCriteria, Date startDate, Date endDate,+ Criteria<PullRequest> criteria, Date startDate, Date endDate,StatsGroup statsGroup) {CriteriaBuilder builder = dao.getSession().getCriteriaBuilder();CriteriaQuery<Object[]> criteriaQuery = builder.createQuery(Object[].class);Root<PullRequest> root = criteriaQuery.from(PullRequest.class);- var predicates = new ArrayList<Predicate>(asList(getPredicates(subject, project, pullRequestCriteria, criteriaQuery, root, builder)));+ var predicates = new ArrayList<Predicate>(asList(getPredicates(subject, project, criteria, criteriaQuery, root, builder)));predicates.add(builder.equal(root.get(PROP_STATUS), MERGED));predicates.add(builder.isNotNull(root.get(PROP_DURATION)));if (startDate != null)@@ -1058,13 +1058,13 @@ public class DefaultPullRequestService extends BaseEntityService<PullRequest>@Sessional@Overridepublic Map<Integer, Pair<Integer, Integer>> queryFrequencyStats(Subject subject,- Project project, Criteria<PullRequest> pullRequestCriteria, Date startDate,+ Project project, Criteria<PullRequest> criteria, Date startDate,Date endDate, StatsGroup statsGroup) {CriteriaBuilder builder = dao.getSession().getCriteriaBuilder();CriteriaQuery<Object[]> criteriaQuery = builder.createQuery(Object[].class);Root<PullRequest> root = criteriaQuery.from(PullRequest.class);- var pullRequestPredicates = asList(getPredicates(subject, project, pullRequestCriteria, criteriaQuery, root, builder));+ var pullRequestPredicates = asList(getPredicates(subject, project, criteria, criteriaQuery, root, builder));var predicates = new ArrayList<>(pullRequestPredicates);predicates.add(builder.equal(root.get(PROP_STATUS), OPEN));diff --git a/server-core/src/main/java/io/onedev/server/job/DefaultResourceAllocator.java b/server-core/src/main/java/io/onedev/server/service/impl/DefaultResourceService.javasimilarity index 86%rename from server-core/src/main/java/io/onedev/server/job/DefaultResourceAllocator.javarename to server-core/src/main/java/io/onedev/server/service/impl/DefaultResourceService.javaindex 52c382633f..a97c945e36 100644--- a/server-core/src/main/java/io/onedev/server/job/DefaultResourceAllocator.java+++ b/server-core/src/main/java/io/onedev/server/service/impl/DefaultResourceService.java@@ -1,4 +1,4 @@-package io.onedev.server.job;+package io.onedev.server.service.impl;import static java.lang.Integer.MAX_VALUE;import static java.util.stream.Collectors.toList;@@ -29,10 +29,12 @@ import io.onedev.commons.utils.ExplicitException;import io.onedev.server.cluster.ClusterService;import io.onedev.server.cluster.ClusterTask;import io.onedev.server.service.AgentService;+import io.onedev.server.service.ResourceService;+import io.onedev.server.service.support.AgentRunnable;import io.onedev.server.event.Listen;import io.onedev.server.event.agent.AgentConnected;import io.onedev.server.event.agent.AgentDisconnected;-import io.onedev.server.event.cluster.ConnectionRestored;+import io.onedev.server.event.cluster.NodeConnected;import io.onedev.server.event.system.SystemStarted;import io.onedev.server.event.system.SystemStarting;import io.onedev.server.event.system.SystemStopped;@@ -46,9 +48,9 @@ import io.onedev.server.taskschedule.TaskScheduler;import oshi.SystemInfo;@Singleton-public class DefaultResourceAllocator implements ResourceAllocator, Serializable, SchedulableTask {+public class DefaultResourceService implements ResourceService, Serializable, SchedulableTask {- private static final Logger logger = LoggerFactory.getLogger(DefaultResourceAllocator.class);+ private static final Logger logger = LoggerFactory.getLogger(DefaultResourceService.class);private final AgentService agentService;@@ -56,8 +58,6 @@ public class DefaultResourceAllocator implements ResourceAllocator, Serializableprivate final TransactionService transactionService;- private final JobService jobService;-private final TaskScheduler taskScheduler;private volatile Map<String, Integer> cpuCounts;@@ -71,18 +71,16 @@ public class DefaultResourceAllocator implements ResourceAllocator, Serializableprivate volatile String taskId;@Inject- public DefaultResourceAllocator(AgentService agentService, TransactionService transactionService,- ClusterService clusterService, JobService jobService,- TaskScheduler taskScheduler) {+ public DefaultResourceService(AgentService agentService, TransactionService transactionService,+ ClusterService clusterService, TaskScheduler taskScheduler) {this.agentService = agentService;this.transactionService = transactionService;this.clusterService = clusterService;- this.jobService = jobService;this.taskScheduler = taskScheduler;}public Object writeReplace() throws ObjectStreamException {- return new ManagedSerializedForm(ResourceAllocator.class);+ return new ManagedSerializedForm(ResourceService.class);}@Listen@@ -122,8 +120,8 @@ public class DefaultResourceAllocator implements ResourceAllocator, Serializable}@Listen- public void on(ConnectionRestored event) {- if (clusterService.isLeaderServer()) {+ public void on(NodeConnected event) {+ if (clusterService.isLeaderServer() && event.isRecovered()) {clusterService.submitToServer(event.getServer(), () -> {try {while (true) {@@ -135,7 +133,7 @@ public class DefaultResourceAllocator implements ResourceAllocator, Serializable}Thread.sleep(100);}- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error syncing concurrency usages cache", e);}return null;@@ -228,7 +226,7 @@ public class DefaultResourceAllocator implements ResourceAllocator, Serializable}@Nullable- private String allocateNode(Collection<String> nodes, String executorName,+ private String allocateNode(Collection<String> nodes, String resourceName,int totalConcurrency, int requiredConcurrency) {String allocatedNode = null;var maxScore = 0;@@ -236,7 +234,7 @@ public class DefaultResourceAllocator implements ResourceAllocator, SerializableCollections.shuffle(nodeList);for (var node: nodeList) {var effectiveTotalConcurrency = getEffectiveTotalConcurrency(node, totalConcurrency);- var usedConcurrency = concurrencyUsagesCache.get(node + ":" + executorName);+ var usedConcurrency = concurrencyUsagesCache.get(node + ":" + resourceName);if (usedConcurrency == null)usedConcurrency = 0;var score = getAllocationScore(effectiveTotalConcurrency, usedConcurrency, requiredConcurrency);@@ -280,19 +278,19 @@ public class DefaultResourceAllocator implements ResourceAllocator, Serializable}@Override- public boolean runServerJob(String executorName, int totalConcurrency,- int requiredConcurrency, ClusterTask<Boolean> runnable) {+ public <T> T runServerJob(String resourceName, int totalConcurrency,+ int requiredConcurrency, ClusterTask<T> runnable) {while (true) {var servers = clusterService.getServerAddresses();servers.retainAll(clusterService.getOnlineServers());- var server = allocateNode(servers, executorName, totalConcurrency, requiredConcurrency);- if (server != null) {- return jobService.runJob(server, () -> {- int effectiveTotalConcurrency = getEffectiveTotalConcurrency(server, totalConcurrency);- var concurrencyKey = server + ":" + executorName;+ var allocatedServer = allocateNode(servers, resourceName, totalConcurrency, requiredConcurrency);+ if (allocatedServer != null) {+ return clusterService.runOnServer(allocatedServer, () -> {+ int effectiveTotalConcurrency = getEffectiveTotalConcurrency(allocatedServer, totalConcurrency);+ var concurrencyKey = allocatedServer + ":" + resourceName;acquireConcurrency(concurrencyKey, effectiveTotalConcurrency, requiredConcurrency);try {- return jobService.runJob(server, runnable);+ return clusterService.runOnServer(allocatedServer, runnable);} finally {releaseConcurrency(concurrencyKey, requiredConcurrency);}@@ -307,9 +305,9 @@ public class DefaultResourceAllocator implements ResourceAllocator, Serializable}@Override- public boolean runAgentJob(AgentQuery agentQuery, String executorName,+ public <T> T runAgentJob(AgentQuery agentQuery, String resourceName,int totalConcurrency, int requiredConcurrency,- AgentRunnable runnable) {+ AgentRunnable<T> runnable) {while (true) {var agentIds = agentService.query(agentQuery, 0, MAX_VALUE).stream().filter(it -> it.isOnline() && !it.isPaused())@@ -318,16 +316,16 @@ public class DefaultResourceAllocator implements ResourceAllocator, SerializableagentIds.removeAll(disconnectingAgents.keySet());var agentIdString = allocateNode(agentIds.stream().map(Object::toString).collect(toList()),- executorName, totalConcurrency, requiredConcurrency);+ resourceName, totalConcurrency, requiredConcurrency);var agentId = agentIdString != null? Long.valueOf(agentIdString): null;if (agentId != null) {var server = agentService.getAgentServer(agentId);if (server == null)throw new ExplicitException("Can not find server managing allocated agent, please retry later");- return jobService.runJob(server, () -> {+ return clusterService.runOnServer(server, () -> {var effectiveTotalConcurrency = getEffectiveTotalConcurrency(agentIdString, totalConcurrency);- var concurrencyKey = agentId + ":" + executorName;+ var concurrencyKey = agentId + ":" + resourceName;acquireConcurrency(concurrencyKey, effectiveTotalConcurrency, requiredConcurrency);try {updateLastUsedDate(agentId);diff --git a/server-core/src/main/java/io/onedev/server/service/impl/DefaultJobCacheService.java b/server-core/src/main/java/io/onedev/server/service/impl/DefaultRunCacheService.javasimilarity index 73%rename from server-core/src/main/java/io/onedev/server/service/impl/DefaultJobCacheService.javarename to server-core/src/main/java/io/onedev/server/service/impl/DefaultRunCacheService.javaindex 9854baa4c0..39dea35054 100644--- a/server-core/src/main/java/io/onedev/server/service/impl/DefaultJobCacheService.java+++ b/server-core/src/main/java/io/onedev/server/service/impl/DefaultRunCacheService.java@@ -2,9 +2,10 @@ package io.onedev.server.service.impl;import static io.onedev.commons.utils.LockUtils.read;import static io.onedev.commons.utils.LockUtils.write;-import static io.onedev.server.model.JobCache.PROP_ACCESS_DATE;-import static io.onedev.server.model.JobCache.PROP_KEY;-import static io.onedev.server.model.JobCache.PROP_PROJECT;+import static io.onedev.server.model.RunCache.PROP_ACCESS_DATE;+import static io.onedev.server.model.RunCache.PROP_CHECKSUM;+import static io.onedev.server.model.RunCache.PROP_KEY;+import static io.onedev.server.model.RunCache.PROP_PROJECT;import static io.onedev.server.util.IOUtils.BUFFER_SIZE;import static java.nio.charset.StandardCharsets.UTF_8;import static java.util.Comparator.comparing;@@ -24,9 +25,9 @@ import java.io.SequenceInputStream;import java.io.Serializable;import java.util.Date;import java.util.List;+import java.util.Objects;import java.util.function.Consumer;-import org.jspecify.annotations.Nullable;import javax.inject.Inject;import javax.inject.Singleton;@@ -35,26 +36,27 @@ import org.apache.commons.lang3.tuple.Pair;import org.hibernate.criterion.Restrictions;import org.hibernate.exception.ConstraintViolationException;import org.joda.time.DateTime;+import org.jspecify.annotations.Nullable;import org.quartz.CronScheduleBuilder;import org.quartz.ScheduleBuilder;import org.slf4j.Logger;import org.slf4j.LoggerFactory;-import com.google.common.base.Joiner;-import io.onedev.commons.loader.ManagedSerializedForm;import io.onedev.commons.utils.ExceptionUtils;import io.onedev.commons.utils.FileUtils;+import io.onedev.k8shelper.CacheAvailability;import io.onedev.k8shelper.CacheHelper;import io.onedev.server.event.Listen;import io.onedev.server.event.system.SystemStarted;import io.onedev.server.event.system.SystemStopping;-import io.onedev.server.model.JobCache;import io.onedev.server.model.Project;+import io.onedev.server.model.RunCache;import io.onedev.server.persistence.TransactionService;import io.onedev.server.persistence.annotation.Transactional;-import io.onedev.server.service.JobCacheService;import io.onedev.server.service.ProjectService;+import io.onedev.server.service.RunCacheService;+import io.onedev.server.service.support.CacheQueryResult;import io.onedev.server.taskschedule.SchedulableTask;import io.onedev.server.taskschedule.TaskScheduler;import io.onedev.server.util.IOUtils;@@ -63,14 +65,14 @@ import io.onedev.server.util.concurrent.BatchWorker;import io.onedev.server.util.concurrent.Prioritized;@Singleton-public class DefaultJobCacheService extends BaseEntityService<JobCache>- implements JobCacheService, Serializable, SchedulableTask {+public class DefaultRunCacheService extends BaseEntityService<RunCache>+ implements RunCacheService, Serializable, SchedulableTask {- private static final int CACHE_VERSION = 2;+ private static final int CACHE_VERSION = 3;private static final int HOUSE_KEEPING_PRIORITY = 50;- private static final Logger logger = LoggerFactory.getLogger(DefaultJobCacheService.class);+ private static final Logger logger = LoggerFactory.getLogger(DefaultRunCacheService.class);@Injectprivate ProjectService projectService;@@ -87,10 +89,12 @@ public class DefaultJobCacheService extends BaseEntityService<JobCache>private volatile String taskId;@Nullable- private JobCache find(Project project, String cacheKey) {+ private RunCache find(Project project, String key, String checksum) {var criteria = newCriteria();criteria.add(Restrictions.eq(PROP_PROJECT, project));- criteria.add(Restrictions.eq(PROP_KEY, cacheKey));+ criteria.add(Restrictions.eq(PROP_KEY, key));+ if (checksum != null)+ criteria.add(Restrictions.eq(PROP_CHECKSUM, checksum));return find(criteria);}@@ -120,80 +124,75 @@ public class DefaultJobCacheService extends BaseEntityService<JobCache>@Transactional@Override- public Pair<Long, Long> getCacheInfoForDownload(Long projectId, String cacheKey) {- var project = projectService.load(projectId);- do {- var cache = find(project, cacheKey);- if (cache != null) {- cache.setAccessDate(new Date());- return new ImmutablePair<>(project.getId(), cache.getId());- }- project = project.getParent();- } while (project != null);- return null;- }-- @Transactional- @Override- public Pair<Long, Long> getCacheInfoForDownload(Long projectId, List<String> loadKeys) {+ public CacheQueryResult queryCache(Long projectId, String key, @Nullable String checksum) {var project = projectService.load(projectId);do {- for (var loadKey: loadKeys) {- var cache = project.getJobCaches().stream()- .filter(it->it.getKey().startsWith(loadKey))- .max(comparing(JobCache::getAccessDate));+ var cache = project.getJobCaches().stream()+ .filter(it -> it.getKey().equals(key) && Objects.equals(it.getChecksum(), checksum))+ .max(comparing(RunCache::getAccessDate));+ if (cache.isPresent()) {+ cache.get().setAccessDate(new Date());+ return new CacheQueryResult(project.getId(), cache.get().getId(), true);+ } else {+ cache = project.getJobCaches().stream()+ .filter(it -> it.getKey().equals(key))+ .max(comparing(RunCache::getAccessDate));if (cache.isPresent()) {cache.get().setAccessDate(new Date());- return new ImmutablePair<>(project.getId(), cache.get().getId());- }+ return new CacheQueryResult(project.getId(), cache.get().getId(), false);+ }}project = project.getParent();} while (project != null);+return null;}@Override- public boolean downloadCache(Long projectId, Long cacheId, List<String> cachePaths,+ public CacheAvailability downloadCache(CacheQueryResult cacheQueryResult, String cachePathsString,Consumer<InputStream> cacheStreamHandler) {- return read(JobCache.getLockName(projectId, cacheId), () -> {- var is = openCacheInputStream(projectId, cacheId, cachePaths);+ var projectId = cacheQueryResult.getProjectId();+ var cacheId = cacheQueryResult.getCacheId();+ return read(RunCache.getLockName(projectId, cacheId), () -> {+ var is = openCacheInputStream(projectId, cacheId, cachePathsString);if (is != null) try (is) {cacheStreamHandler.accept(is);- return true;+ return cacheQueryResult.getCacheAvailability();} else {- return false;+ return CacheAvailability.NOT_FOUND;}});}@Override- public void downloadCache(Long projectId, Long cacheId, List<String> cachePaths,- OutputStream cacheStream) {- read(JobCache.getLockName(projectId, cacheId), () -> {- var is = openCacheInputStream(projectId, cacheId, cachePaths);+ public void downloadCache(CacheQueryResult cacheQueryResult, String cachePathsString, OutputStream cacheStream) {+ var projectId = cacheQueryResult.getProjectId();+ var cacheId = cacheQueryResult.getCacheId();+ read(RunCache.getLockName(projectId, cacheId), () -> {+ var is = openCacheInputStream(projectId, cacheId, cachePathsString);if (is != null) {try (is) {- writeStream(cacheStream, 1);+ writeStream(cacheStream, cacheQueryResult.getCacheAvailability().ordinal());IOUtils.copy(is, cacheStream, BUFFER_SIZE);} catch (IOException e) {throw new RuntimeException(e);}} else {- writeStream(cacheStream, 0);+ writeStream(cacheStream, CacheAvailability.NOT_FOUND.ordinal());}});}@SuppressWarnings("resource")@Nullable- private InputStream openCacheInputStream(Long projectId, Long cacheId, List<String> cachePaths) {+ private InputStream openCacheInputStream(Long projectId, Long cacheId, String cachePathsString) {var cacheHome = projectService.getCacheDir(projectId);var cacheDir = new File(cacheHome, String.valueOf(cacheId));if (cacheDir.exists()) {var stampFile = new File(cacheDir, "stamp");if (stampFile.exists()) {var stamp = readString(stampFile);- if (stamp.equals(CACHE_VERSION + ":" + Joiner.on('\n').join(cachePaths))) {+ if (stamp.equals(CACHE_VERSION + ":" + cachePathsString)) {try {var marks = FileUtils.readFileToByteArray(new File(cacheDir, "marks"));return new SequenceInputStream(@@ -209,17 +208,18 @@ public class DefaultJobCacheService extends BaseEntityService<JobCache>}@Override- public Long getCacheIdForUpload(Long projectId, String cacheKey) {+ public Long createCache(Long projectId, String key, @Nullable String checksum) {Long cacheId;while (true) {try {cacheId = transactionService.call(() -> {var project = projectService.load(projectId);- var cache = find(project, cacheKey);+ var cache = find(project, key, checksum);if (cache == null) {- cache = new JobCache();+ cache = new RunCache();cache.setProject(project);- cache.setKey(cacheKey);+ cache.setKey(key);+ cache.setChecksum(checksum);}cache.setAccessDate(new Date());dao.persist(cache);@@ -241,8 +241,8 @@ public class DefaultJobCacheService extends BaseEntityService<JobCache>return cacheId;}- private void writeStamp(File cacheDir, List<String> cachePaths) {- writeString(new File(cacheDir, "stamp"), CACHE_VERSION + ":" + Joiner.on('\n').join(cachePaths));+ private void writeStamp(File cacheDir, String cachePathsString) {+ writeString(new File(cacheDir, "stamp"), CACHE_VERSION + ":" + cachePathsString);}private Pair<File, OutputStream> openCacheOutputStream(Long projectId, Long cacheId) {@@ -302,23 +302,23 @@ public class DefaultJobCacheService extends BaseEntityService<JobCache>}@Override- public void uploadCache(Long projectId, Long cacheId, List<String> cachePaths,+ public void uploadCache(Long projectId, Long cacheId, String cachePathsString,Consumer<OutputStream> cacheStreamHandler) {- write(JobCache.getLockName(projectId, cacheId), () -> {+ write(RunCache.getLockName(projectId, cacheId), () -> {var result = openCacheOutputStream(projectId, cacheId);try {cacheStreamHandler.accept(result.getRight());} finally {IOUtils.closeQuietly(result.getRight());}- writeStamp(result.getLeft(), cachePaths);+ writeStamp(result.getLeft(), cachePathsString);});}@Override- public void uploadCache(Long projectId, Long cacheId, List<String> cachePaths,+ public void uploadCache(Long projectId, Long cacheId, String cachePathsString,InputStream cacheStream) {- write(JobCache.getLockName(projectId, cacheId), () -> {+ write(RunCache.getLockName(projectId, cacheId), () -> {var result = openCacheOutputStream(projectId, cacheId);try {IOUtils.copy(cacheStream, result.getRight(), BUFFER_SIZE);@@ -327,17 +327,17 @@ public class DefaultJobCacheService extends BaseEntityService<JobCache>} finally {IOUtils.closeQuietly(result.getRight());}- writeStamp(result.getLeft(), cachePaths);+ writeStamp(result.getLeft(), cachePathsString);});}@Transactional@Override- public void delete(JobCache cache) {+ public void delete(RunCache cache) {var projectId = cache.getProject().getId();var cacheId = cache.getId();dao.remove(cache);- projectService.runOnActiveServer(projectId, () -> write(JobCache.getLockName(projectId, cacheId), () -> {+ projectService.runOnActiveServer(projectId, () -> write(RunCache.getLockName(projectId, cacheId), () -> {FileUtils.deleteDir(new File(projectService.getCacheDir(projectId), String.valueOf(cacheId)));return null;}));@@ -346,7 +346,7 @@ public class DefaultJobCacheService extends BaseEntityService<JobCache>@Nullable@Overridepublic Long getCacheSize(Long projectId, Long cacheId) {- return projectService.runOnActiveServer(projectId, () -> read(JobCache.getLockName(projectId, cacheId), () -> {+ return projectService.runOnActiveServer(projectId, () -> read(RunCache.getLockName(projectId, cacheId), () -> {var cacheDir = new File(projectService.getCacheDir(projectId), String.valueOf(cacheId));if (cacheDir.exists()) {var stampFile = new File(cacheDir, "stamp");@@ -364,7 +364,7 @@ public class DefaultJobCacheService extends BaseEntityService<JobCache>}public Object writeReplace() throws ObjectStreamException {- return new ManagedSerializedForm(JobCacheService.class);+ return new ManagedSerializedForm(RunCacheService.class);}@Listendiff --git a/server-core/src/main/java/io/onedev/server/service/impl/DefaultSettingService.java b/server-core/src/main/java/io/onedev/server/service/impl/DefaultSettingService.javaindex 17c4176d70..b453f58ae7 100644--- a/server-core/src/main/java/io/onedev/server/service/impl/DefaultSettingService.java+++ b/server-core/src/main/java/io/onedev/server/service/impl/DefaultSettingService.java@@ -38,6 +38,7 @@ import io.onedev.server.model.support.administration.BackupSetting;import io.onedev.server.model.support.administration.BrandingSetting;import io.onedev.server.model.support.administration.ClusterSetting;import io.onedev.server.model.support.administration.GlobalBuildSetting;+import io.onedev.server.model.support.administration.GlobalWorkspaceSetting;import io.onedev.server.model.support.administration.GlobalIssueSetting;import io.onedev.server.model.support.administration.GlobalPackSetting;import io.onedev.server.model.support.administration.GlobalProjectSetting;@@ -53,6 +54,7 @@ import io.onedev.server.model.support.administration.authenticator.Authenticatorimport io.onedev.server.model.support.administration.emailtemplates.EmailTemplates;import io.onedev.server.model.support.administration.jobexecutor.JobExecutor;import io.onedev.server.model.support.administration.mailservice.MailConnector;+import io.onedev.server.model.support.administration.workspaceprovisioner.WorkspaceProvisioner;import io.onedev.server.persistence.annotation.Sessional;import io.onedev.server.persistence.annotation.Transactional;import io.onedev.server.service.SettingService;@@ -86,9 +88,8 @@ public class DefaultSettingService extends BaseEntityService<Setting> implements@Sessional@Listenpublic void on(SystemStarting event) {- for (var setting: query()) {+ for (var setting: query())cache.put(setting.getKey(), Optional.ofNullable(setting.getValue()));- }}@Sessional@@ -198,6 +199,12 @@ public class DefaultSettingService extends BaseEntityService<Setting> implementsreturn (List<JobExecutor>) getSettingValue(Key.JOB_EXECUTORS);}+ @SuppressWarnings("unchecked")+ @Override+ public List<WorkspaceProvisioner> getWorkspaceProvisioners() {+ return (List<WorkspaceProvisioner>) getSettingValue(Key.WORKSPACE_PROVISIONERS);+ }+@Overridepublic EmailTemplates getEmailTemplates() {return (EmailTemplates) getSettingValue(Key.EMAIL_TEMPLATES);@@ -219,6 +226,11 @@ public class DefaultSettingService extends BaseEntityService<Setting> implementsreturn (GlobalBuildSetting) getSettingValue(Key.BUILD);}+ @Override+ public GlobalWorkspaceSetting getWorkspaceSetting() {+ return (GlobalWorkspaceSetting) getSettingValue(Key.WORKSPACE);+ }+@Overridepublic GlobalPackSetting getPackSetting() {return (GlobalPackSetting) getSettingValue(Key.PACK);@@ -338,6 +350,12 @@ public class DefaultSettingService extends BaseEntityService<Setting> implementssaveSetting(Key.JOB_EXECUTORS, (Serializable) jobExecutors);}+ @Transactional+ @Override+ public void saveWorkspaceProvisioners(List<WorkspaceProvisioner> workspaceProvisioners) {+ saveSetting(Key.WORKSPACE_PROVISIONERS, (Serializable) workspaceProvisioners);+ }+@Transactional@Overridepublic void saveEmailTemplates(EmailTemplates emailTemplates) {@@ -368,6 +386,12 @@ public class DefaultSettingService extends BaseEntityService<Setting> implementssaveSetting(Key.BUILD, buildSetting);}+ @Transactional+ @Override+ public void saveWorkspaceSetting(GlobalWorkspaceSetting workspaceSetting) {+ saveSetting(Key.WORKSPACE, workspaceSetting);+ }+@Transactional@Overridepublic void savePackSetting(GlobalPackSetting packSetting) {diff --git a/server-core/src/main/java/io/onedev/server/service/impl/DefaultUrlService.java b/server-core/src/main/java/io/onedev/server/service/impl/DefaultUrlService.javaindex 102a3077b5..2d65de5467 100644--- a/server-core/src/main/java/io/onedev/server/service/impl/DefaultUrlService.java+++ b/server-core/src/main/java/io/onedev/server/service/impl/DefaultUrlService.java@@ -203,6 +203,16 @@ public class DefaultUrlService implements UrlService {public String urlFor(Pack pack, boolean withRootUrl) {return urlFor(pack.getProject(), withRootUrl) + "/~packages/" + pack.getId();}++ @Override+ public String urlFor(Workspace workspace, boolean withRootUrl) {+ return urlForWorkspace(workspace.getProject(), workspace.getNumber(), withRootUrl);+ }++ @Override+ public String urlForWorkspace(Project project, Long workspaceNumber, boolean withRootUrl) {+ return urlFor(project, withRootUrl) + "/~workspaces/" + workspaceNumber;+ }@Overridepublic String urlFor(IssueComment comment, boolean withRootUrl) {diff --git a/server-core/src/main/java/io/onedev/server/service/support/AgentRunnable.java b/server-core/src/main/java/io/onedev/server/service/support/AgentRunnable.javanew file mode 100644index 0000000000..4472aa391e--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/service/support/AgentRunnable.java@@ -0,0 +1,9 @@+package io.onedev.server.service.support;++import java.io.Serializable;++public interface AgentRunnable<T> extends Serializable {++ T run(Long agentId);++}diff --git a/server-core/src/main/java/io/onedev/server/service/support/CacheQueryResult.java b/server-core/src/main/java/io/onedev/server/service/support/CacheQueryResult.javanew file mode 100644index 0000000000..a108fe3727--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/service/support/CacheQueryResult.java@@ -0,0 +1,37 @@+package io.onedev.server.service.support;++import java.io.Serializable;++import io.onedev.k8shelper.CacheAvailability;++public class CacheQueryResult implements Serializable {++ private final Long projectId;++ private final Long cacheId;++ private final boolean exactMatch;++ public CacheQueryResult(Long projectId, Long cacheId, boolean exactMatch) {+ this.projectId = projectId;+ this.cacheId = cacheId;+ this.exactMatch = exactMatch;+ }++ public Long getProjectId() {+ return projectId;+ }++ public Long getCacheId() {+ return cacheId;+ }++ public boolean isExactMatch() {+ return exactMatch;+ }++ public CacheAvailability getCacheAvailability() {+ return exactMatch ? CacheAvailability.EXACT_MATCH : CacheAvailability.PARTIAL_MATCH;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/ssh/DefaultSshService.java b/server-core/src/main/java/io/onedev/server/ssh/DefaultSshService.javaindex a795d1ee94..ed8d9ab0db 100644--- a/server-core/src/main/java/io/onedev/server/ssh/DefaultSshService.java+++ b/server-core/src/main/java/io/onedev/server/ssh/DefaultSshService.java@@ -23,11 +23,12 @@ import org.apache.sshd.server.SshServer;import org.apache.sshd.server.auth.pubkey.CachingPublicKeyAuthenticator;import org.apache.sshd.server.command.Command;import org.apache.sshd.server.shell.UnknownCommand;+import org.slf4j.Logger;+import org.slf4j.LoggerFactory;import io.onedev.commons.loader.ManagedSerializedForm;import io.onedev.server.ServerConfig;import io.onedev.server.cluster.ClusterService;-import io.onedev.server.service.SettingService;import io.onedev.server.event.Listen;import io.onedev.server.event.entity.EntityPersisted;import io.onedev.server.event.system.SystemStarted;@@ -35,10 +36,13 @@ import io.onedev.server.event.system.SystemStopping;import io.onedev.server.model.Setting;import io.onedev.server.model.User;import io.onedev.server.persistence.TransactionService;+import io.onedev.server.service.SettingService;@Singletonpublic class DefaultSshService implements SshService, Serializable {+ private static final Logger logger = LoggerFactory.getLogger(DefaultSshService.class);+private static final int CLIENT_VERIFY_TIMEOUT = 5000;private static final int CLIENT_AUTH_TIMEOUT = 5000;@@ -191,8 +195,12 @@ public class DefaultSshService implements SshService, Serializable {var setting = (Setting) event.getEntity();if (setting.getKey() == Setting.Key.SSH) {transactionService.runAfterCommit(() -> clusterService.submitToAllServers(() -> {- stop();- start();+ try {+ stop();+ start();+ } catch (Throwable t) {+ logger.error("Error restarting SSH server", t);+ }return null;}));}diff --git a/server-core/src/main/java/io/onedev/server/terminal/AgentShell.java b/server-core/src/main/java/io/onedev/server/terminal/AgentShell.javadeleted file mode 100644index d0756aa408..0000000000--- a/server-core/src/main/java/io/onedev/server/terminal/AgentShell.java+++ /dev/null@@ -1,39 +0,0 @@-package io.onedev.server.terminal;--import org.eclipse.jetty.websocket.api.Session;--import io.onedev.agent.Message;--public class AgentShell implements Shell {-- private final Terminal terminal;-- private final Session agent;-- public AgentShell(Terminal terminal, Session agent, String jobToken) {- this.terminal = terminal;- this.agent = agent;- new Message(io.onedev.agent.MessageTypes.SHELL_OPEN, terminal.getSessionId() + ":" + jobToken).sendBy(agent);- }-- public Terminal getTerminal() {- return terminal;- }-- @Override- public void sendInput(String input) {- new Message(io.onedev.agent.MessageTypes.SHELL_INPUT, terminal.getSessionId() + ":" + input).sendBy(agent);- }-- @Override- public void resize(int rows, int cols) {- new Message(io.onedev.agent.MessageTypes.SHELL_RESIZE, terminal.getSessionId() + ":" + rows + ":" + cols).sendBy(agent);- }-- @Override- public void exit() {- terminal.sendError("Shell exited");- new Message(io.onedev.agent.MessageTypes.SHELL_EXIT, terminal.getSessionId()).sendBy(agent);- }--}diff --git a/server-core/src/main/java/io/onedev/server/terminal/CommandlineShell.java b/server-core/src/main/java/io/onedev/server/terminal/CommandlineShell.javaindex ff7c75fefc..c266c76859 100644--- a/server-core/src/main/java/io/onedev/server/terminal/CommandlineShell.java+++ b/server-core/src/main/java/io/onedev/server/terminal/CommandlineShell.java@@ -1,24 +1,30 @@package io.onedev.server.terminal;-import io.onedev.commons.utils.ExceptionUtils;-import io.onedev.commons.utils.ExplicitException;-import io.onedev.commons.utils.ImmediateFuture;-import io.onedev.commons.utils.command.*;-import io.onedev.commons.utils.command.PtyMode.ResizeSupport;-import io.onedev.server.OneDev;-import org.slf4j.Logger;-import org.slf4j.LoggerFactory;+import static java.nio.charset.StandardCharsets.UTF_8;+import static org.apache.commons.io.IOUtils.closeQuietly;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;-import java.nio.charset.StandardCharsets;+import java.util.Arrays;+import java.util.Base64;+import java.util.concurrent.CompletableFuture;import java.util.concurrent.ExecutorService;import java.util.concurrent.Future;import java.util.concurrent.atomic.AtomicReference;import java.util.function.Function;-import static org.apache.commons.io.IOUtils.closeQuietly;+import org.slf4j.Logger;+import org.slf4j.LoggerFactory;++import io.onedev.commons.utils.ExceptionUtils;+import io.onedev.commons.utils.ExplicitException;+import io.onedev.commons.utils.command.Commandline;+import io.onedev.commons.utils.command.ProcessTreeKiller;+import io.onedev.commons.utils.command.PtyMode;+import io.onedev.commons.utils.command.PtyMode.ResizeSupport;+import io.onedev.commons.utils.command.StreamPumper;+import io.onedev.server.OneDev;public class CommandlineShell implements Shell {@@ -26,15 +32,31 @@ public class CommandlineShell implements Shell {private final PtyMode ptyMode;- private volatile OutputStream shellStdin;+ private volatile OutputStream stdin;- private final Future<?> execution;+ private final Future<?> future;public CommandlineShell(Terminal terminal, Commandline cmdline) {ptyMode = new PtyMode();cmdline.ptyMode(ptyMode);- execution = OneDev.getInstance(ExecutorService.class).submit(new Runnable() {+ future = OneDev.getInstance(ExecutorService.class).submit(new Runnable() {++ private Future<?> pump(InputStream is, Terminal terminal) {+ return StreamPumper.pump(is, new OutputStream() {++ @Override+ public void write(byte[] b, int off, int len) {+ terminal.onShellOutput(Base64.getEncoder().encodeToString(Arrays.copyOfRange(b, off, off + len)));+ }++ @Override+ public void write(int b) {+ throw new UnsupportedOperationException();+ }++ });+ }@Overridepublic void run() {@@ -42,37 +64,13 @@ public class CommandlineShell implements Shell {var stdoutHolder = new AtomicReference<InputStream>(null);Function<InputStream, Future<?>> stdoutHandler = is -> {stdoutHolder.set(is);- return StreamPumper.pump(is, new OutputStream() {-- @Override- public void write(byte[] b, int off, int len) {- terminal.sendOutput(new String(b, off, len, StandardCharsets.UTF_8));- }-- @Override- public void write(int b) {- throw new UnsupportedOperationException();- }-- });+ return pump(is, terminal);};var stderrHolder = new AtomicReference<InputStream>(null);Function<InputStream, Future<?>> stderrHandler = is -> {stderrHolder.set(is);- return StreamPumper.pump(is, new OutputStream() {-- @Override- public void write(byte[] b, int off, int len) {- terminal.sendError(new String(b, off, len, StandardCharsets.UTF_8));- }-- @Override- public void write(int b) {- throw new UnsupportedOperationException();- }-- });+ return pump(is, terminal);};cmdline.processKiller(new ProcessTreeKiller() {@@ -85,29 +83,25 @@ public class CommandlineShell implements Shell {}});- ExecutionResult result = cmdline.execute(stdoutHandler, stderrHandler, os -> {- shellStdin = os;- return new ImmediateFuture<Void>(null);+ var result = cmdline.execute(stdoutHandler, stderrHandler, os -> {+ stdin = os;+ return CompletableFuture.completedFuture(null);});if (result.getReturnCode() != 0)- terminal.sendError("Shell exited");+ terminal.onShellError("Shell exited with return code: " + result.getReturnCode());else- terminal.close();- } catch (ExplicitException e) {- terminal.sendError(e.getMessage());+ terminal.onShellExit();} catch (Throwable e) {ExplicitException explicitException = ExceptionUtils.find(e, ExplicitException.class);if (explicitException != null) {- terminal.sendError(explicitException.getMessage());- } else if (ExceptionUtils.find(e, InterruptedException.class) != null) {- terminal.sendError("Shell exited");- } else {+ terminal.onShellError("Shell exited with error: " + explicitException.getMessage());+ } else if (ExceptionUtils.find(e, InterruptedException.class) == null) {logger.error("Error running shell", e);- terminal.sendError("Error running shell, check server log for details");- }+ terminal.onShellError("Error running shell, check server log for details");+ }} finally {- closeQuietly(shellStdin);- shellStdin = null;+ closeQuietly(stdin);+ stdin = null;}}@@ -116,11 +110,11 @@ public class CommandlineShell implements Shell {}@Override- public void sendInput(String input) {- var shellStdinCopy = shellStdin;- if (shellStdinCopy != null) {+ public void writeToStdin(String data) {+ var stdinCopy = stdin;+ if (stdinCopy != null) {try {- shellStdinCopy.write(input.getBytes(StandardCharsets.UTF_8));+ stdinCopy.write(data.getBytes(UTF_8));} catch (IOException e) {throw new RuntimeException(e);}@@ -135,9 +129,8 @@ public class CommandlineShell implements Shell {}@Override- public void exit() {- sendInput("exit\n");- execution.cancel(true);+ public void terminate() {+ future.cancel(true);}}diff --git a/server-core/src/main/java/io/onedev/server/terminal/MessageTypes.java b/server-core/src/main/java/io/onedev/server/terminal/MessageTypes.javadeleted file mode 100644index 9baf754d7c..0000000000--- a/server-core/src/main/java/io/onedev/server/terminal/MessageTypes.java+++ /dev/null@@ -1,8 +0,0 @@-package io.onedev.server.terminal;--public enum MessageTypes {-- TERMINAL_OPEN, TERMINAL_CLOSE, TERMINAL_READY,- TERMINAL_INPUT, TERMINAL_OUTPUT, TERMINAL_RESIZE--}diff --git a/server-core/src/main/java/io/onedev/server/terminal/Shell.java b/server-core/src/main/java/io/onedev/server/terminal/Shell.javaindex 7117299199..885903d5e2 100644--- a/server-core/src/main/java/io/onedev/server/terminal/Shell.java+++ b/server-core/src/main/java/io/onedev/server/terminal/Shell.java@@ -2,10 +2,10 @@ package io.onedev.server.terminal;public interface Shell {- void sendInput(String input);+ void writeToStdin(String data);void resize(int rows, int cols);- void exit();+ void terminate();}diff --git a/server-core/src/main/java/io/onedev/server/terminal/Terminal.java b/server-core/src/main/java/io/onedev/server/terminal/Terminal.javaindex a1d0f24c66..e0e2d877cf 100644--- a/server-core/src/main/java/io/onedev/server/terminal/Terminal.java+++ b/server-core/src/main/java/io/onedev/server/terminal/Terminal.java@@ -1,13 +1,15 @@package io.onedev.server.terminal;+import io.onedev.agent.AgentUtils;+public interface Terminal {-- String getSessionId();-- void sendOutput(String output);-- void sendError(String error);-- void close();++ void onShellOutput(String base64Data);++ void onShellExit();+ default void onShellError(String error) {+ onShellOutput(AgentUtils.encodeBase64Error(error));+ }+}diff --git a/server-core/src/main/java/io/onedev/server/util/FileData.java b/server-core/src/main/java/io/onedev/server/util/FileData.javanew file mode 100644index 0000000000..d2f83aa923--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/util/FileData.java@@ -0,0 +1,57 @@+package io.onedev.server.util;++import java.io.File;+import java.io.FileInputStream;+import java.io.IOException;+import java.io.Serializable;++import org.apache.commons.io.IOUtils;++public class FileData implements Serializable {++ private static final long serialVersionUID = 1L;++ private static final int MAX_READ_SIZE = 5*1024*1024;++ private final String name;++ private final byte[] content;++ private final long size;++ public FileData(String name, byte[] content, long size) {+ this.name = name;+ this.content = content;+ this.size = size;+ }++ public static FileData from(File file) throws IOException {+ String name = file.getName();+ long length = file.length();+ long toRead = Math.min(length, MAX_READ_SIZE);+ byte[] content = new byte[(int) toRead];+ if (toRead > 0) {+ try (var is = new FileInputStream(file)) {+ IOUtils.readFully(is, content);+ }+ }+ return new FileData(name, content, length);+ }++ public String getName() {+ return name;+ }++ public byte[] getContent() {+ return content;+ }++ public long getSize() {+ return size;+ }++ public boolean isPartial() {+ return size > content.length;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/util/ProjectWorkspaceStatusStat.java b/server-core/src/main/java/io/onedev/server/util/ProjectWorkspaceStatusStat.javanew file mode 100644index 0000000000..87c8b9d257--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/util/ProjectWorkspaceStatusStat.java@@ -0,0 +1,35 @@+package io.onedev.server.util;++import java.io.Serializable;++import io.onedev.server.model.Workspace.Status;++public class ProjectWorkspaceStatusStat implements Serializable {++ private static final long serialVersionUID = 1L;++ private final Long projectId;++ private final Status workspaceStatus;++ private final long statusCount;++ public ProjectWorkspaceStatusStat(Long projectId, Status workspaceStatus, long statusCount) {+ this.projectId = projectId;+ this.workspaceStatus = workspaceStatus;+ this.statusCount = statusCount;+ }++ public Long getProjectId() {+ return projectId;+ }++ public Status getWorkspaceStatus() {+ return workspaceStatus;+ }++ public long getStatusCount() {+ return statusCount;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/util/concurrent/DynamicSemaphore.java b/server-core/src/main/java/io/onedev/server/util/concurrent/DynamicSemaphore.javanew file mode 100644index 0000000000..956391014a--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/util/concurrent/DynamicSemaphore.java@@ -0,0 +1,29 @@+package io.onedev.server.util.concurrent;++public class DynamicSemaphore {++ private int maxPermits;++ private int usedPermits;++ public DynamicSemaphore() {+ maxPermits = 0;+ }++ public synchronized void setMaxPermits(int maxPermits) {+ this.maxPermits = maxPermits;+ notifyAll();+ }++ public synchronized void acquire() throws InterruptedException {+ while (usedPermits >= maxPermits)+ wait();+ usedPermits++;+ }++ public synchronized void release() {+ usedPermits--;+ notifyAll();+ }++}diff --git a/server-core/src/main/java/io/onedev/server/util/interpolative/VariableInterpolator.java b/server-core/src/main/java/io/onedev/server/util/interpolative/VariableInterpolator.javaindex fc1a88d538..bcc1eea50f 100644--- a/server-core/src/main/java/io/onedev/server/util/interpolative/VariableInterpolator.java+++ b/server-core/src/main/java/io/onedev/server/util/interpolative/VariableInterpolator.java@@ -4,7 +4,7 @@ import static io.onedev.k8shelper.KubernetesHelper.ATTRIBUTES;import static io.onedev.k8shelper.KubernetesHelper.PAUSE;import static io.onedev.k8shelper.KubernetesHelper.PLACEHOLDER_PREFIX;import static io.onedev.k8shelper.KubernetesHelper.PLACEHOLDER_SUFFIX;-import static io.onedev.k8shelper.KubernetesHelper.WORKSPACE;+import static io.onedev.k8shelper.KubernetesHelper.WORKDIR;import static io.onedev.server.web.translation.Translation._T;import java.util.ArrayList;@@ -114,7 +114,7 @@ public class VariableInterpolator {elsereturn "";} else if (t.startsWith(PREFIX_FILE)) {- return PLACEHOLDER_PREFIX + WORKSPACE + "/" + t.substring(PREFIX_FILE.length()) + PLACEHOLDER_SUFFIX;+ return PLACEHOLDER_PREFIX + WORKDIR + "/" + t.substring(PREFIX_FILE.length()) + PLACEHOLDER_SUFFIX;} else if (t.startsWith(PREFIX_ATTRIBUTE)) {return PLACEHOLDER_PREFIX + ATTRIBUTES + "/" + t.substring(PREFIX_ATTRIBUTE.length()) + PLACEHOLDER_SUFFIX;} else if (t.equals(PAUSE)) {diff --git a/server-core/src/main/java/io/onedev/server/validation/validator/EnvironmentNameValidator.java b/server-core/src/main/java/io/onedev/server/validation/validator/EnvironmentNameValidator.javaindex 1cab9f777d..6c3887d36a 100644--- a/server-core/src/main/java/io/onedev/server/validation/validator/EnvironmentNameValidator.java+++ b/server-core/src/main/java/io/onedev/server/validation/validator/EnvironmentNameValidator.java@@ -4,14 +4,14 @@ import javax.lang.model.SourceVersion;import javax.validation.ConstraintValidator;import javax.validation.ConstraintValidatorContext;-import io.onedev.server.annotation.EnvironmentName;+import io.onedev.server.annotation.EnvVarName;-public class EnvironmentNameValidator implements ConstraintValidator<EnvironmentName, String> {+public class EnvironmentNameValidator implements ConstraintValidator<EnvVarName, String> {private String message;@Override- public void initialize(EnvironmentName constaintAnnotation) {+ public void initialize(EnvVarName constaintAnnotation) {message = constaintAnnotation.message();}diff --git a/server-core/src/main/java/io/onedev/server/validation/validator/WorkspaceQueryValidator.java b/server-core/src/main/java/io/onedev/server/validation/validator/WorkspaceQueryValidator.javanew file mode 100644index 0000000000..4d2a1a58bf--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/validation/validator/WorkspaceQueryValidator.java@@ -0,0 +1,46 @@+package io.onedev.server.validation.validator;++import javax.validation.ConstraintValidator;+import javax.validation.ConstraintValidatorContext;++import io.onedev.commons.utils.StringUtils;+import io.onedev.server.annotation.WorkspaceQuery;+import io.onedev.server.model.Project;++public class WorkspaceQueryValidator implements ConstraintValidator<WorkspaceQuery, String> {++ private String message;++ private boolean withCurrentUserCriteria;++ @Override+ public void initialize(WorkspaceQuery constraintAnnotation) {+ message = constraintAnnotation.message();+ withCurrentUserCriteria = constraintAnnotation.withCurrentUserCriteria();+ }++ @Override+ public boolean isValid(String value, ConstraintValidatorContext constraintContext) {+ if (value == null) {+ return true;+ } else {+ Project project = Project.get();+ try {+ io.onedev.server.search.entity.workspace.WorkspaceQuery.parse(project, value, withCurrentUserCriteria);+ return true;+ } catch (Exception e) {+ constraintContext.disableDefaultConstraintViolation();+ String message = this.message;+ if (message.length() == 0) {+ if (StringUtils.isNotBlank(e.getMessage()))+ message = e.getMessage();+ else+ message = "Malformed query";+ }+ constraintContext.buildConstraintViolationWithTemplate(message).addConstraintViolation();+ return false;+ }+ }+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/WebSession.java b/server-core/src/main/java/io/onedev/server/web/WebSession.javaindex c93c379456..37767dbd7a 100644--- a/server-core/src/main/java/io/onedev/server/web/WebSession.java+++ b/server-core/src/main/java/io/onedev/server/web/WebSession.java@@ -27,6 +27,8 @@ public class WebSession extends org.apache.wicket.protocol.http.WebSession {private volatile Cursor pullRequestCursor;+ private volatile Cursor workspaceCursor;+private volatile ZoneId zoneId;private Map<Class<?>, String> redirectUrlsAfterDelete = new ConcurrentHashMap<>();@@ -59,6 +61,7 @@ public class WebSession extends org.apache.wicket.protocol.http.WebSession {buildCursor = null;packCursor = null;pullRequestCursor = null;+ workspaceCursor = null;zoneId = null;redirectUrlsAfterDelete.clear();chatVisible = false;@@ -101,6 +104,15 @@ public class WebSession extends org.apache.wicket.protocol.http.WebSession {public void setPullRequestCursor(@Nullable Cursor pullRequestCursor) {this.pullRequestCursor = pullRequestCursor;}++ @Nullable+ public Cursor getWorkspaceCursor() {+ return workspaceCursor;+ }++ public void setWorkspaceCursor(@Nullable Cursor workspaceCursor) {+ this.workspaceCursor = workspaceCursor;+ }@Nullablepublic String getRedirectUrlAfterDelete(Class<?> clazz) {diff --git a/server-core/src/main/java/io/onedev/server/web/asset/bootstrap/css/bootstrap-custom.css b/server-core/src/main/java/io/onedev/server/web/asset/bootstrap/css/bootstrap-custom.cssindex 69d4cf54c7..b3d41ba0a6 100644--- a/server-core/src/main/java/io/onedev/server/web/asset/bootstrap/css/bootstrap-custom.css+++ b/server-core/src/main/java/io/onedev/server/web/asset/bootstrap/css/bootstrap-custom.css@@ -1254,6 +1254,16 @@ input[type="radio"], input[type="checkbox"] {border-color: #187DE4;}+/* Hide the internal seam when a split button is disabled as a pair */+.btn-group>.btn:first-child:disabled {+ border-right-color: transparent;+}++.btn-group>.btn:first-child:disabled+.dropdown-toggle:disabled {+ margin-left: 0;+ border-left-color: transparent;+}+.btn.btn-secondary {color: var(--gray-dark);background-color: var(--secondary);diff --git a/server-core/src/main/java/io/onedev/server/web/asset/codemirror/codemirror-custom.css b/server-core/src/main/java/io/onedev/server/web/asset/codemirror/codemirror-custom.cssindex 60b82667cd..d92ed29cc2 100644--- a/server-core/src/main/java/io/onedev/server/web/asset/codemirror/codemirror-custom.css+++ b/server-core/src/main/java/io/onedev/server/web/asset/codemirror/codemirror-custom.css@@ -115,3 +115,13 @@.dark-mode .cm-s-eclipse .CodeMirror-matchingbracket {background: var(--primary);}++.cm-conflict-marker {+ color: #9c6500 !important;+ background: #fff3cd;+ font-weight: bold;+}+.dark-mode .cm-conflict-marker {+ color: #d4a857 !important;+ background: #3d3520;+}diff --git a/server-core/src/main/java/io/onedev/server/web/asset/codemirror/codemirror-integration.js b/server-core/src/main/java/io/onedev/server/web/asset/codemirror/codemirror-integration.jsindex a1b7000d05..0a53bf279e 100644--- a/server-core/src/main/java/io/onedev/server/web/asset/codemirror/codemirror-integration.js+++ b/server-core/src/main/java/io/onedev/server/web/asset/codemirror/codemirror-integration.js@@ -71,6 +71,19 @@ onedev.server.codemirror = {if (modeInfo)onedev.server.codemirror.setMode(cm, modeInfo);},+ setConflictAwareModeByFileName: function(cm, fileName) {+ var modeInfo = onedev.server.codemirror.findModeByFileName(fileName);+ if (modeInfo) {+ var modeMime = onedev.server.codemirror.getModeMime(modeInfo);+ if (!CodeMirror.modes.hasOwnProperty(modeInfo.mode)) {+ CodeMirror.requireMode(modeInfo.mode, function() {+ cm.setOption("mode", {name: "conflict-aware", inner: modeMime});+ });+ } else {+ cm.setOption("mode", {name: "conflict-aware", inner: modeMime});+ }+ }+ },getModeMime: function(modeInfo) {if (modeInfo.mode === "gfm")return "gfm";@@ -210,6 +223,70 @@ onedev.server.codemirror = {}};+CodeMirror.defineMode("conflict-aware", function(config, parserConfig) {+ var innerMode = CodeMirror.getMode(config, parserConfig.inner || "text/plain");+ return {+ startState: function() {+ return {+ innerState: CodeMirror.startState(innerMode),+ rightState: null,+ conflictRegion: null+ };+ },+ copyState: function(state) {+ return {+ innerState: CodeMirror.copyState(innerMode, state.innerState),+ rightState: state.rightState ? CodeMirror.copyState(innerMode, state.rightState) : null,+ conflictRegion: state.conflictRegion+ };+ },+ token: function(stream, state) {+ if (stream.sol()) {+ if (stream.match(/^<{7}(\s|$)/)) {+ state.conflictRegion = "left";+ state.rightState = CodeMirror.copyState(innerMode, state.innerState);+ stream.skipToEnd();+ return "conflict-marker";+ }+ if (stream.match(/^\|{7}(\s|$)/) || stream.match(/^={7}(\s|$)/)) {+ state.conflictRegion = "right";+ stream.skipToEnd();+ return "conflict-marker";+ }+ if (stream.match(/^>{7}(\s|$)/)) {+ state.conflictRegion = null;+ state.rightState = null;+ stream.skipToEnd();+ return "conflict-marker";+ }+ }+ if (state.conflictRegion === "right") {+ return innerMode.token(stream, state.rightState);+ }+ return innerMode.token(stream, state.innerState);+ },+ blankLine: function(state) {+ if (innerMode.blankLine) {+ if (state.conflictRegion === "right") {+ innerMode.blankLine(state.rightState);+ } else {+ innerMode.blankLine(state.innerState);+ }+ }+ },+ indent: function(state, textAfter, line) {+ if (innerMode.indent) {+ return innerMode.indent(state.innerState, textAfter, line);+ }+ return CodeMirror.Pass;+ },+ electricChars: innerMode.electricChars,+ innerMode: function(state) {+ return {state: state.innerState, mode: innerMode};+ }+ };+});+$(document).on("beforeElementReplace", function(event, componentId) {var $component = $("#" + componentId);$component.find(".CodeMirror").each(function() {diff --git a/server-core/src/main/java/io/onedev/server/web/asset/icon/reset.svg b/server-core/src/main/java/io/onedev/server/web/asset/icon/reset.svgnew file mode 100644index 0000000000..6378cee645--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/asset/icon/reset.svg@@ -0,0 +1 @@+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1773286686946" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4800" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M924.373333 174.293333a25.173333 25.173333 0 0 0-27.306666 0l-64 55.466667A424.746667 424.746667 0 0 0 519.253333 85.333333a426.666667 426.666667 0 1 0 385.493334 592.426667A42.666667 42.666667 0 0 0 865.066667 618.666667a42.666667 42.666667 0 0 0-38.613334 25.386666A341.333333 341.333333 0 1 1 768 286.08l-75.52 64a24.746667 24.746667 0 0 0-4.906667 26.88 28.16 28.16 0 0 0 21.333334 17.92L914.133333 426.666667a21.333333 21.333333 0 0 0 17.066667-4.48 21.333333 21.333333 0 0 0 7.04-16.213334V197.973333a28.586667 28.586667 0 0 0-13.866667-23.68z" p-id="4801"></path></svg>\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/asset/icon/terminal2.svg b/server-core/src/main/java/io/onedev/server/web/asset/icon/terminal2.svgnew file mode 100644index 0000000000..f22d513b63--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/asset/icon/terminal2.svg@@ -0,0 +1 @@+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1772545939412" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4745" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M128 128h768a85.333333 85.333333 0 0 1 85.333333 85.333333v597.333334a85.333333 85.333333 0 0 1-85.333333 85.333333H128a85.333333 85.333333 0 0 1-85.333333-85.333333V213.333333a85.333333 85.333333 0 0 1 85.333333-85.333333z m0 85.333333v597.333334h768V213.333333H128z m227.541333 298.666667L230.4 418.133333l51.2-68.266666 216.192 162.133333L281.6 674.133333l-51.2-68.266666L355.541333 512zM512 682.666667v-85.333334h213.333333v85.333334h-213.333333z" p-id="4746"></path></svg>\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/asset/icon/undo2.svg b/server-core/src/main/java/io/onedev/server/web/asset/icon/undo2.svgnew file mode 100644index 0000000000..398a97f688--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/asset/icon/undo2.svg@@ -0,0 +1,58 @@+<?xml version="1.0" encoding="UTF-8" standalone="no"?>+<svg+ inkscape:version="1.3.2 (091e20e, 2023-11-25)"+ sodipodi:docname="undo2.svg"+ id="svg42"+ version="1.1"+ viewBox="0 0 1024 1024"+ height="200.00px"+ width="200px"+ class="icon"+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"+ xmlns="http://www.w3.org/2000/svg"+ xmlns:svg="http://www.w3.org/2000/svg"+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"+ xmlns:cc="http://creativecommons.org/ns#"+ xmlns:dc="http://purl.org/dc/elements/1.1/">+ <metadata+ id="metadata48">+ <rdf:RDF>+ <cc:Work+ rdf:about="">+ <dc:format>image/svg+xml</dc:format>+ <dc:type+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />+ </cc:Work>+ </rdf:RDF>+ </metadata>+ <defs+ id="defs46" />+ <sodipodi:namedview+ inkscape:current-layer="svg42"+ inkscape:window-maximized="1"+ inkscape:window-y="25"+ inkscape:window-x="60"+ inkscape:cy="153.80895"+ inkscape:cx="99.758162"+ inkscape:zoom="4.135"+ showgrid="false"+ id="namedview44"+ inkscape:window-height="1027"+ inkscape:window-width="1864"+ inkscape:pageshadow="2"+ inkscape:pageopacity="0"+ guidetolerance="10"+ gridtolerance="10"+ objecttolerance="10"+ borderopacity="1"+ bordercolor="#666666"+ pagecolor="#ffffff"+ inkscape:showpageshadow="2"+ inkscape:pagecheckerboard="0"+ inkscape:deskcolor="#d1d1d1" />+ <path+ id="path40"+ d="m 337.45727,276.09695 h -12.77754 c -18.2536,0 -18.2536,-11.72221 -7.30143,-21.7698 l 89.4427,-82.05541 c 10.95216,-8.37301 10.95216,-25.11901 0,-35.1666 l -38.33259,-35.16661 c -9.1268,-10.047603 -27.38041,-10.047603 -38.33257,0 L 94.684227,317.96195 c -9.126807,8.373 -9.126807,21.76981 0,30.14281 L 331.98119,565.80278 c 10.95216,8.37301 23.72969,8.37301 34.68187,-1.6746 l 40.15794,-36.8412 c 10.95216,-10.0476 12.77752,-25.119 1.82537,-35.16661 l -89.44272,-82.0554 c -12.77752,-11.72221 -16.42824,-21.76981 -1.82535,-28.46821 5.47608,-1.67461 20.07897,-1.67461 20.07897,-1.67461 H 591.1825 c 129.60063,0 233.64622,95.45222 233.64622,214.34883 0,118.89662 -104.04559,214.34884 -233.64622,214.34884 H 443.32822 c -14.60289,0 -25.55506,11.72219 -25.55506,25.11899 v 53.58721 c 0,13.3968 9.12682,23.4444 23.7297,23.4444 H 591.1825 c 189.83755,0 344.99326,-140.66642 344.99326,-316.49944 0,-175.83302 -155.15571,-316.49943 -344.99326,-316.49943 z"+ style="stroke-width:0.887838" />+</svg>diff --git a/server-core/src/main/java/io/onedev/server/web/asset/icon/workspace.svg b/server-core/src/main/java/io/onedev/server/web/asset/icon/workspace.svgnew file mode 100644index 0000000000..ac09c88abb--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/asset/icon/workspace.svg@@ -0,0 +1,42 @@+<?xml version="1.0" encoding="UTF-8" standalone="no"?>+<svg+ t="1772258918388"+ class="icon"+ viewBox="0 0 1024 1024"+ version="1.1"+ p-id="1653"+ width="200"+ height="200"+ id="svg1"+ sodipodi:docname="workspace.svg"+ inkscape:version="1.3.2 (091e20e, 2023-11-25)"+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"+ xmlns="http://www.w3.org/2000/svg"+ xmlns:svg="http://www.w3.org/2000/svg">+ <defs+ id="defs1" />+ <sodipodi:namedview+ id="namedview1"+ pagecolor="#ffffff"+ bordercolor="#666666"+ borderopacity="1.0"+ inkscape:showpageshadow="2"+ inkscape:pageopacity="0.0"+ inkscape:pagecheckerboard="0"+ inkscape:deskcolor="#d1d1d1"+ inkscape:zoom="3.075"+ inkscape:cx="100"+ inkscape:cy="99.837398"+ inkscape:window-width="1864"+ inkscape:window-height="1027"+ inkscape:window-x="60"+ inkscape:window-y="25"+ inkscape:window-maximized="1"+ inkscape:current-layer="svg1" />+ <path+ d="M 107.95899,299.83665 512.83252,501.91812 917.70604,299.83569 512.83252,104.72416 Z m 56.82412,313.57378 -85.236172,-41.80819 c -28.414,-13.93797 -42.618572,-34.84302 -42.618572,-62.71609 0,-27.87308 14.205543,-48.77812 42.618572,-62.71513 L 164.78311,404.36187 79.546938,362.55179 C 44.031137,348.61477 29.825595,306.80563 44.031137,271.96357 51.133909,258.02751 65.340424,244.0905 72.443196,244.0905 L 477.31769,48.978011 c 21.30831,-6.968031 42.61761,-6.968031 63.92689,0 L 946.1181,244.0905 c 35.51581,13.93701 49.72137,55.74615 28.41303,90.58821 -7.10374,13.93606 -21.30928,27.87308 -28.41303,27.87308 l -85.23617,41.81008 78.1334,34.84111 c 35.5158,13.93701 49.72134,34.84207 49.72134,69.68317 0,27.87307 -14.20554,55.74615 -49.72134,69.68317 l -78.1334,34.84111 78.1334,34.84205 c 35.5158,13.93607 49.72134,34.84111 49.72134,69.68317 0,27.87308 -14.20554,55.74616 -49.72134,69.68221 L 548.34735,975.76235 c -7.10277,6.968 -21.30832,6.968 -35.51483,6.968 -14.20652,0 -21.30928,0 -35.51483,-6.968 L 72.443196,780.64983 c -28.412059,-13.93606 -35.51483,-34.8411 -35.51483,-62.71418 0,-27.87307 14.205543,-48.77812 42.618572,-62.71514 z M 242.91652,655.22051 107.95899,717.93565 512.83252,920.01616 917.70604,724.90368 782.74853,662.18855 548.34638,773.68181 c -7.10277,6.96802 -21.30832,6.96802 -35.51483,6.96802 -14.20651,0 -21.30929,0 -35.51483,-6.96802 z M 782.74853,446.17102 548.34638,557.66427 c -21.30832,6.96803 -42.61761,6.96803 -63.92689,0 L 242.91652,446.17102 107.95899,508.88615 512.83252,710.96667 917.70604,508.88615 Z"+ p-id="1654"+ id="path1"+ style="stroke-width:0.961865" />+</svg>diff --git a/server-core/src/main/java/io/onedev/server/web/asset/xterm/XtermResourceReference.java b/server-core/src/main/java/io/onedev/server/web/asset/xterm/XtermResourceReference.javaindex 852765f26c..35091ec9b8 100644--- a/server-core/src/main/java/io/onedev/server/web/asset/xterm/XtermResourceReference.java+++ b/server-core/src/main/java/io/onedev/server/web/asset/xterm/XtermResourceReference.java@@ -22,6 +22,8 @@ public class XtermResourceReference extends BaseDependentResourceReference {List<HeaderItem> dependencies = super.getDependencies();dependencies.add(JavaScriptHeaderItem.forReference(new BaseDependentResourceReference(XtermResourceReference.class, "xterm-addon-fit.js")));+ dependencies.add(JavaScriptHeaderItem.forReference(new BaseDependentResourceReference(+ XtermResourceReference.class, "xterm-addon-webgl.js")));dependencies.add(CssHeaderItem.forReference(new BaseDependentCssResourceReference(XtermResourceReference.class, "xterm.css")));return dependencies;diff --git a/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm-addon-fit.js b/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm-addon-fit.jsindex 2b0397c2da..9b25be35bb 100644--- a/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm-addon-fit.js+++ b/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm-addon-fit.js@@ -1,2 +1,2 @@-!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FitAddon=t():e.FitAddon=t()}(self,(function(){return(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{constructor(){}activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const 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(){if(!this._terminal)return;if(!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core;if(0===e._renderService.dimensions.actualCellWidth||0===e._renderService.dimensions.actualCellHeight)return;const t=0===this._terminal.options.scrollback?0:e.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue("height")),n=Math.max(0,parseInt(r.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),s=i-(parseInt(o.getPropertyValue("padding-top"))+parseInt(o.getPropertyValue("padding-bottom"))),a=n-(parseInt(o.getPropertyValue("padding-right"))+parseInt(o.getPropertyValue("padding-left")))-t;return{cols:Math.max(2,Math.floor(a/e._renderService.dimensions.actualCellWidth)),rows:Math.max(1,Math.floor(s/e._renderService.dimensions.actualCellHeight))}}}})(),e})()}));-//# sourceMappingURL=xterm-addon-fit.js.map\ No newline at end of file+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FitAddon=t():e.FitAddon=t()}(globalThis,(()=>(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const 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(){if(!this._terminal)return;if(!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core._renderService.dimensions;if(0===e.css.cell.width||0===e.css.cell.height)return;const t=0===this._terminal.options.scrollback?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue("height")),o=Math.max(0,parseInt(r.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),n=i-(parseInt(s.getPropertyValue("padding-top"))+parseInt(s.getPropertyValue("padding-bottom"))),l=o-(parseInt(s.getPropertyValue("padding-right"))+parseInt(s.getPropertyValue("padding-left")))-t;return{cols:Math.max(2,Math.floor(l/e.css.cell.width)),rows:Math.max(1,Math.floor(n/e.css.cell.height))}}}})(),e})()));+//# sourceMappingURL=addon-fit.js.map\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm-addon-webgl.js b/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm-addon-webgl.jsnew file mode 100644index 0000000000..515d940e1f--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm-addon-webgl.js@@ -0,0 +1,2 @@+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WebglAddon=t():e.WebglAddon=t()}(self,(()=>(()=>{"use strict";var e={965:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlyphRenderer=void 0;const s=i(374),r=i(509),o=i(855),n=i(859),a=i(381),h=11,l=h*Float32Array.BYTES_PER_ELEMENT;let c,d=0,_=0,u=0;class g extends n.Disposable{constructor(e,t,i,o){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._optionsService=o,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const h=this._gl;void 0===r.TextureAtlas.maxAtlasPages&&(r.TextureAtlas.maxAtlasPages=Math.min(32,(0,s.throwIfFalsy)(h.getParameter(h.MAX_TEXTURE_IMAGE_UNITS))),r.TextureAtlas.maxTextureSize=(0,s.throwIfFalsy)(h.getParameter(h.MAX_TEXTURE_SIZE))),this._program=(0,s.throwIfFalsy)((0,a.createProgram)(h,"#version 300 es\nlayout (location = 0) in vec2 a_unitquad;\nlayout (location = 1) in vec2 a_cellpos;\nlayout (location = 2) in vec2 a_offset;\nlayout (location = 3) in vec2 a_size;\nlayout (location = 4) in float a_texpage;\nlayout (location = 5) in vec2 a_texcoord;\nlayout (location = 6) in vec2 a_texsize;\n\nuniform mat4 u_projection;\nuniform vec2 u_resolution;\n\nout vec2 v_texcoord;\nflat out int v_texpage;\n\nvoid main() {\n vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_texpage = int(a_texpage);\n v_texcoord = a_texcoord + a_unitquad * a_texsize;\n}",function(e){let t="";for(let i=1;i<e;i++)t+=` else if (v_texpage == ${i}) { outColor = texture(u_texture[${i}], v_texcoord); }`;return`#version 300 es\nprecision lowp float;\n\nin vec2 v_texcoord;\nflat in int v_texpage;\n\nuniform sampler2D u_texture[${e}];\n\nout vec4 outColor;\n\nvoid main() {\n if (v_texpage == 0) {\n outColor = texture(u_texture[0], v_texcoord);\n } ${t}\n}`}(r.TextureAtlas.maxAtlasPages))),this.register((0,n.toDisposable)((()=>h.deleteProgram(this._program)))),this._projectionLocation=(0,s.throwIfFalsy)(h.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,s.throwIfFalsy)(h.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,s.throwIfFalsy)(h.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=h.createVertexArray(),h.bindVertexArray(this._vertexArrayObject);const c=new Float32Array([0,0,1,0,0,1,1,1]),d=h.createBuffer();this.register((0,n.toDisposable)((()=>h.deleteBuffer(d)))),h.bindBuffer(h.ARRAY_BUFFER,d),h.bufferData(h.ARRAY_BUFFER,c,h.STATIC_DRAW),h.enableVertexAttribArray(0),h.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const _=new Uint8Array([0,1,2,3]),u=h.createBuffer();this.register((0,n.toDisposable)((()=>h.deleteBuffer(u)))),h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,u),h.bufferData(h.ELEMENT_ARRAY_BUFFER,_,h.STATIC_DRAW),this._attributesBuffer=(0,s.throwIfFalsy)(h.createBuffer()),this.register((0,n.toDisposable)((()=>h.deleteBuffer(this._attributesBuffer)))),h.bindBuffer(h.ARRAY_BUFFER,this._attributesBuffer),h.enableVertexAttribArray(2),h.vertexAttribPointer(2,2,h.FLOAT,!1,l,0),h.vertexAttribDivisor(2,1),h.enableVertexAttribArray(3),h.vertexAttribPointer(3,2,h.FLOAT,!1,l,2*Float32Array.BYTES_PER_ELEMENT),h.vertexAttribDivisor(3,1),h.enableVertexAttribArray(4),h.vertexAttribPointer(4,1,h.FLOAT,!1,l,4*Float32Array.BYTES_PER_ELEMENT),h.vertexAttribDivisor(4,1),h.enableVertexAttribArray(5),h.vertexAttribPointer(5,2,h.FLOAT,!1,l,5*Float32Array.BYTES_PER_ELEMENT),h.vertexAttribDivisor(5,1),h.enableVertexAttribArray(6),h.vertexAttribPointer(6,2,h.FLOAT,!1,l,7*Float32Array.BYTES_PER_ELEMENT),h.vertexAttribDivisor(6,1),h.enableVertexAttribArray(1),h.vertexAttribPointer(1,2,h.FLOAT,!1,l,9*Float32Array.BYTES_PER_ELEMENT),h.vertexAttribDivisor(1,1),h.useProgram(this._program);const g=new Int32Array(r.TextureAtlas.maxAtlasPages);for(let e=0;e<r.TextureAtlas.maxAtlasPages;e++)g[e]=e;h.uniform1iv(this._textureLocation,g),h.uniformMatrix4fv(this._projectionLocation,!1,a.PROJECTION_MATRIX),this._atlasTextures=[];for(let e=0;e<r.TextureAtlas.maxAtlasPages;e++){const t=new a.GLTexture((0,s.throwIfFalsy)(h.createTexture()));this.register((0,n.toDisposable)((()=>h.deleteTexture(t.texture)))),h.activeTexture(h.TEXTURE0+e),h.bindTexture(h.TEXTURE_2D,t.texture),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,1,1,0,h.RGBA,h.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[e]=t}h.enable(h.BLEND),h.blendFunc(h.SRC_ALPHA,h.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(e,t,i,s,r,o,n,a,h){this._updateCell(this._vertices.attributes,e,t,i,s,r,o,n,a,h)}_updateCell(e,t,i,r,n,a,l,g,v,f){d=(i*this._terminal.cols+t)*h,r!==o.NULL_CELL_CODE&&void 0!==r?this._atlas&&(c=g&&g.length>1?this._atlas.getRasterizedGlyphCombinedChar(g,n,a,l,!1):this._atlas.getRasterizedGlyph(r,n,a,l,!1),_=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),n!==f&&c.offset.x>_?(u=c.offset.x-_,e[d]=-(c.offset.x-u)+this._dimensions.device.char.left,e[d+1]=-c.offset.y+this._dimensions.device.char.top,e[d+2]=(c.size.x-u)/this._dimensions.device.canvas.width,e[d+3]=c.size.y/this._dimensions.device.canvas.height,e[d+4]=c.texturePage,e[d+5]=c.texturePositionClipSpace.x+u/this._atlas.pages[c.texturePage].canvas.width,e[d+6]=c.texturePositionClipSpace.y,e[d+7]=c.sizeClipSpace.x-u/this._atlas.pages[c.texturePage].canvas.width,e[d+8]=c.sizeClipSpace.y):(e[d]=-c.offset.x+this._dimensions.device.char.left,e[d+1]=-c.offset.y+this._dimensions.device.char.top,e[d+2]=c.size.x/this._dimensions.device.canvas.width,e[d+3]=c.size.y/this._dimensions.device.canvas.height,e[d+4]=c.texturePage,e[d+5]=c.texturePositionClipSpace.x,e[d+6]=c.texturePositionClipSpace.y,e[d+7]=c.sizeClipSpace.x,e[d+8]=c.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,s.allowRescaling)(r,v,c.size.x,this._dimensions.device.cell.width)&&(e[d+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):e.fill(0,d,d+h-1-2)}clear(){const e=this._terminal,t=e.cols*e.rows*h;this._vertices.count!==t?this._vertices.attributes=new Float32Array(t):this._vertices.attributes.fill(0);let i=0;for(;i<this._vertices.attributesBuffers.length;i++)this._vertices.count!==t?this._vertices.attributesBuffers[i]=new Float32Array(t):this._vertices.attributesBuffers[i].fill(0);this._vertices.count=t,i=0;for(let t=0;t<e.rows;t++)for(let s=0;s<e.cols;s++)this._vertices.attributes[i+9]=s/e.cols,this._vertices.attributes[i+10]=t/e.rows,i+=h}handleResize(){const e=this._gl;e.useProgram(this._program),e.viewport(0,0,e.canvas.width,e.canvas.height),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),this.clear()}render(e){if(!this._atlas)return;const t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const i=this._vertices.attributesBuffers[this._activeBuffer];let s=0;for(let t=0;t<e.lineLengths.length;t++){const r=t*this._terminal.cols*h,o=this._vertices.attributes.subarray(r,r+e.lineLengths[t]*h);i.set(o,s),s+=o.length}t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,i.subarray(0,s),t.STREAM_DRAW);for(let e=0;e<this._atlas.pages.length;e++)this._atlas.pages[e].version!==this._atlasTextures[e].version&&this._bindAtlasPageTexture(t,this._atlas,e);t.drawElementsInstanced(t.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,s/h)}setAtlas(e){this._atlas=e;for(const e of this._atlasTextures)e.version=-1}_bindAtlasPageTexture(e,t,i){e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,this._atlasTextures[i].texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.pages[i].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[i].version=t.pages[i].version}setDimensions(e){this._dimensions=e}}t.GlyphRenderer=g},742:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RectangleRenderer=void 0;const s=i(374),r=i(859),o=i(310),n=i(381),a=8*Float32Array.BYTES_PER_ELEMENT;class h{constructor(){this.attributes=new Float32Array(160),this.count=0}}let l=0,c=0,d=0,_=0,u=0,g=0,v=0;class f extends r.Disposable{constructor(e,t,i,o){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._themeService=o,this._vertices=new h,this._verticesCursor=new h;const l=this._gl;this._program=(0,s.throwIfFalsy)((0,n.createProgram)(l,"#version 300 es\nlayout (location = 0) in vec2 a_position;\nlayout (location = 1) in vec2 a_size;\nlayout (location = 2) in vec4 a_color;\nlayout (location = 3) in vec2 a_unitquad;\n\nuniform mat4 u_projection;\n\nout vec4 v_color;\n\nvoid main() {\n vec2 zeroToOne = a_position + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_color = a_color;\n}","#version 300 es\nprecision lowp float;\n\nin vec4 v_color;\n\nout vec4 outColor;\n\nvoid main() {\n outColor = v_color;\n}")),this.register((0,r.toDisposable)((()=>l.deleteProgram(this._program)))),this._projectionLocation=(0,s.throwIfFalsy)(l.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=l.createVertexArray(),l.bindVertexArray(this._vertexArrayObject);const c=new Float32Array([0,0,1,0,0,1,1,1]),d=l.createBuffer();this.register((0,r.toDisposable)((()=>l.deleteBuffer(d)))),l.bindBuffer(l.ARRAY_BUFFER,d),l.bufferData(l.ARRAY_BUFFER,c,l.STATIC_DRAW),l.enableVertexAttribArray(3),l.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const _=new Uint8Array([0,1,2,3]),u=l.createBuffer();this.register((0,r.toDisposable)((()=>l.deleteBuffer(u)))),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u),l.bufferData(l.ELEMENT_ARRAY_BUFFER,_,l.STATIC_DRAW),this._attributesBuffer=(0,s.throwIfFalsy)(l.createBuffer()),this.register((0,r.toDisposable)((()=>l.deleteBuffer(this._attributesBuffer)))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(0),l.vertexAttribPointer(0,2,l.FLOAT,!1,a,0),l.vertexAttribDivisor(0,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,a,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,4,l.FLOAT,!1,a,4*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(2,1),this._updateCachedColors(o.colors),this.register(this._themeService.onChangeColors((e=>{this._updateCachedColors(e),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){const t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,n.PROJECTION_MATRIX),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){const t=this._terminal,i=this._vertices;let s,r,n,a,h,l,c,d,_,u,g,v=1;for(s=0;s<t.rows;s++){for(n=-1,a=0,h=0,l=!1,r=0;r<t.cols;r++)c=(s*t.cols+r)*o.RENDER_MODEL_INDICIES_PER_CELL,d=e.cells[c+o.RENDER_MODEL_BG_OFFSET],_=e.cells[c+o.RENDER_MODEL_FG_OFFSET],u=!!(67108864&_),(d!==a||_!==h&&(l||u))&&((0!==a||l&&0!==h)&&(g=8*v++,this._updateRectangle(i,g,h,a,n,r,s)),n=r,a=d,h=_,l=u);(0!==a||l&&0!==h)&&(g=8*v++,this._updateRectangle(i,g,h,a,n,t.cols,s))}i.count=v}updateCursor(e){const t=this._verticesCursor,i=e.cursor;if(!i||"block"===i.style)return void(t.count=0);let s,r=0;"bar"!==i.style&&"outline"!==i.style||(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,"bar"===i.style?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),"underline"!==i.style&&"outline"!==i.style||(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),"outline"===i.style&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=8*r++,this._addRectangleFloat(t.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=r}_updateRectangle(e,t,i,s,r,o,a){if(67108864&i)switch(50331648&i){case 16777216:case 33554432:l=this._themeService.colors.ansi[255&i].rgba;break;case 50331648:l=(16777215&i)<<8;break;default:l=this._themeService.colors.foreground.rgba}else switch(50331648&s){case 16777216:case 33554432:l=this._themeService.colors.ansi[255&s].rgba;break;case 50331648:l=(16777215&s)<<8;break;default:l=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=(0,n.expandFloat32Array)(e.attributes,this._terminal.rows*this._terminal.cols*8)),c=r*this._dimensions.device.cell.width,d=a*this._dimensions.device.cell.height,_=(l>>24&255)/255,u=(l>>16&255)/255,g=(l>>8&255)/255,v=1,this._addRectangle(e.attributes,t,c,d,(o-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,_,u,g,v)}_addRectangle(e,t,i,s,r,o,n,a,h,l){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=o/this._dimensions.device.canvas.height,e[t+4]=n,e[t+5]=a,e[t+6]=h,e[t+7]=l}_addRectangleFloat(e,t,i,s,r,o,n){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=o/this._dimensions.device.canvas.height,e[t+4]=n[0],e[t+5]=n[1],e[t+6]=n[2],e[t+7]=n[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(255&e.rgba)/255])}}t.RectangleRenderer=f},310:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderModel=t.COMBINED_CHAR_BIT_MASK=t.RENDER_MODEL_EXT_OFFSET=t.RENDER_MODEL_FG_OFFSET=t.RENDER_MODEL_BG_OFFSET=t.RENDER_MODEL_INDICIES_PER_CELL=void 0;const s=i(296);t.RENDER_MODEL_INDICIES_PER_CELL=4,t.RENDER_MODEL_BG_OFFSET=1,t.RENDER_MODEL_FG_OFFSET=2,t.RENDER_MODEL_EXT_OFFSET=3,t.COMBINED_CHAR_BIT_MASK=2147483648,t.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,s.createSelectionRenderModel)()}resize(e,i){const s=e*i*t.RENDER_MODEL_INDICIES_PER_CELL;s!==this.cells.length&&(this.cells=new Uint32Array(s),this.lineLengths=new Uint32Array(i))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JoinedCellData=t.WebglRenderer=void 0;const s=i(820),r=i(274),o=i(627),n=i(457),a=i(56),h=i(374),l=i(345),c=i(859),d=i(147),_=i(782),u=i(855),g=i(965),v=i(742),f=i(310),p=i(733);class C extends c.Disposable{constructor(e,t,i,n,d,u,g,v,C){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=i,this._coreBrowserService=n,this._coreService=d,this._decorationService=u,this._optionsService=g,this._themeService=v,this._cursorBlinkStateManager=new c.MutableDisposable,this._charAtlasDisposable=this.register(new c.MutableDisposable),this._observerDisposable=this.register(new c.MutableDisposable),this._model=new f.RenderModel,this._workCell=new _.CellData,this._workCell2=new _.CellData,this._rectangleRenderer=this.register(new c.MutableDisposable),this._glyphRenderer=this.register(new c.MutableDisposable),this._onChangeTextureAtlas=this.register(new l.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new l.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new l.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new l.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new l.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new r.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new p.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,g,this._themeService)],this.dimensions=(0,h.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(g.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const m={antialias:!1,depth:!1,preserveDrawingBuffer:C};if(this._gl=this._canvas.getContext("webgl2",m),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,s.addDisposableDomListener)(this._canvas,"webglcontextlost",(e=>{console.log("webglcontextlost event received"),e.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(e)}),3e3)}))),this.register((0,s.addDisposableDomListener)(this._canvas,"webglcontextrestored",(e=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,o.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,a.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((e,t)=>this._setCanvasDevicePixelDimensions(e,t))),this.register(this._coreBrowserService.onWindowChange((e=>{this._observerDisposable.value=(0,a.observeDevicePixelDimensions)(this._canvas,e,((e,t)=>this._setCanvasDevicePixelDimensions(e,t)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,c.toDisposable)((()=>{for(const e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),(0,o.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const e of this._renderLayers)e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(const e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(const e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,i){for(const s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,t,i);this._model.selection.update(this._core,e,t,i),this._requestRedrawViewport()}handleCursorMove(){for(const e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new v.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new g.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const e=(0,o.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=(0,c.getDisposeArrayDisposable)([(0,l.forwardEvent)(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,l.forwardEvent)(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(const e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(e){return-1}deregisterCharacterJoiner(e){return!1}renderRows(e,t){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const i of this._renderLayers)i.handleGridChanged(this._terminal,e,t);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new n.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){const i=this._core;let s,r,o,n,a,h,l,c,d,_,g,v,p,C,x=this._workCell;e=L(e,i.rows-1,0),t=L(t,i.rows-1,0);const w=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,b=w-i.buffer.ydisp,M=Math.min(this._terminal.buffer.active.cursorX,i.cols-1);let R=-1;const y=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let A=!1;for(r=e;r<=t;r++)for(o=r+i.buffer.ydisp,n=i.buffer.lines.get(o),this._model.lineLengths[r]=0,a=this._characterJoinerService.getJoinedCharacters(o),p=0;p<i.cols;p++)if(s=this._cellColorResolver.result.bg,n.loadCell(p,x),0===p&&(s=this._cellColorResolver.result.bg),h=!1,l=p,a.length>0&&p===a[0][0]&&(h=!0,c=a.shift(),x=new m(x,n.translateToString(!0,c[0],c[1]),c[1]-c[0]),l=c[1]-1),d=x.getChars(),_=x.getCode(),v=(r*i.cols+p)*f.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(x,p,o,this.dimensions.device.cell.width),y&&o===w&&(p===M&&(this._model.cursor={x:M,y:b,width:x.getWidth(),style:this._coreBrowserService.isFocused?i.options.cursorStyle||"block":i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},R=M+x.getWidth()-1),p>=M&&p<=R&&(this._coreBrowserService.isFocused&&"block"===(i.options.cursorStyle||"block")||!1===this._coreBrowserService.isFocused&&"block"===i.options.cursorInactiveStyle)&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),_!==u.NULL_CELL_CODE&&(this._model.lineLengths[r]=p+1),(this._model.cells[v]!==_||this._model.cells[v+f.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[v+f.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[v+f.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(A=!0,d.length>1&&(_|=f.COMBINED_CHAR_BIT_MASK),this._model.cells[v]=_,this._model.cells[v+f.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[v+f.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[v+f.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,g=x.getWidth(),this._glyphRenderer.value.updateCell(p,r,_,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,d,g,s),h))for(x=this._workCell,p++;p<l;p++)C=(r*i.cols+p)*f.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(p,r,u.NULL_CELL_CODE,0,0,0,u.NULL_CELL_CHAR,0,0),this._model.cells[C]=u.NULL_CELL_CODE,this._model.cells[C+f.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[C+f.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[C+f.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;A&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=1===this._optionsService.rawOptions.lineHeight?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}}t.WebglRenderer=C;class m extends d.AttributeData{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}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()]}}function L(e,t,i=0){return Math.max(Math.min(e,t),i)}t.JoinedCellData=m},381:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GLTexture=t.expandFloat32Array=t.createShader=t.createProgram=t.PROJECTION_MATRIX=void 0;const s=i(374);function r(e,t,i){const r=(0,s.throwIfFalsy)(e.createShader(t));if(e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))return r;console.error(e.getShaderInfoLog(r)),e.deleteShader(r)}t.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),t.createProgram=function(e,t,i){const o=(0,s.throwIfFalsy)(e.createProgram());if(e.attachShader(o,(0,s.throwIfFalsy)(r(e,e.VERTEX_SHADER,t))),e.attachShader(o,(0,s.throwIfFalsy)(r(e,e.FRAGMENT_SHADER,i))),e.linkProgram(o),e.getProgramParameter(o,e.LINK_STATUS))return o;console.error(e.getProgramInfoLog(o)),e.deleteProgram(o)},t.createShader=r,t.expandFloat32Array=function(e,t){const i=Math.min(2*e.length,t),s=new Float32Array(i);for(let t=0;t<e.length;t++)s[t]=e[t];return s},t.GLTexture=class{constructor(e){this.texture=e,this.version=-1}}},592:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;const s=i(627),r=i(237),o=i(374),n=i(859);class a extends n.Disposable{constructor(e,t,i,s,r,o,a,h){super(),this._container=t,this._alpha=r,this._coreBrowserService=o,this._optionsService=a,this._themeService=h,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((t=>{this._refreshCharAtlas(e,t),this.reset(e)}))),this.register((0,n.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,o.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,i){}handleSelectionChanged(e,t,i,s=!1){}_setTransparency(e,t){if(t===this._alpha)return;const i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,s.acquireTextureAtlas)(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=r.TEXT_BASELINE,this._clipCell(i,s,t.getWidth()),this._ctx.fillText(t.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,i){return`${i?"italic":""} ${t?e.options.fontWeightBold:e.options.fontWeight} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}}t.BaseRenderLayer=a},733:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;const s=i(197),r=i(237),o=i(592);class n extends o.BaseRenderLayer{constructor(e,t,i,s,r,o,n){super(i,e,"link",t,!0,r,o,n),this.register(s.onShowLinkUnderline((e=>this._handleShowLinkUnderline(e)))),this.register(s.onHideLinkUnderline((e=>this._handleHideLinkUnderline(e))))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===r.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:void 0!==e.fg&&(0,s.is256Color)(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}}t.LinkRenderLayer=n},820:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,i,s){e.addEventListener(t,i,s);let r=!1;return{dispose:()=>{r||(r=!0,e.removeEventListener(t,i,s))}}}},274:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;const s=i(855),r=i(160),o=i(374);let n,a=0,h=0,l=!1,c=!1,d=!1,_=0;t.CellColorResolver=class{constructor(e,t,i,s,r,o){this._terminal=e,this._optionService=t,this._selectionRenderModel=i,this._decorationService=s,this._coreBrowserService=r,this._themeService=o,this.result={fg:0,bg:0,ext:0}}resolve(e,t,i,u){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=268435456&e.bg?e.extended.ext:0,h=0,a=0,c=!1,l=!1,d=!1,n=this._themeService.colors,_=0,e.getCode()!==s.NULL_CELL_CODE&&4===e.extended.underlineStyle){const e=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));_=t*u%(2*Math.round(e))}if(this._decorationService.forEachDecorationAtCell(t,i,"bottom",(e=>{e.backgroundColorRGB&&(h=e.backgroundColorRGB.rgba>>8&16777215,c=!0),e.foregroundColorRGB&&(a=e.foregroundColorRGB.rgba>>8&16777215,l=!0)})),d=this._selectionRenderModel.isCellSelected(this._terminal,t,i),d){if(67108864&this.result.fg||0!=(50331648&this.result.bg)){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:h=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:h=(16777215&this.result.fg)<<8|255;break;default:h=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:h=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:h=(16777215&this.result.bg)<<8|255}h=r.rgba.blend(h,4294967040&(this._coreBrowserService.isFocused?n.selectionBackgroundOpaque:n.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else h=(this._coreBrowserService.isFocused?n.selectionBackgroundOpaque:n.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(c=!0,n.selectionForeground&&(a=n.selectionForeground.rgba>>8&16777215,l=!0),(0,o.treatGlyphAsBackgroundColor)(e.getCode())){if(67108864&this.result.fg&&0==(50331648&this.result.bg))a=(this._coreBrowserService.isFocused?n.selectionBackgroundOpaque:n.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:a=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:a=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:a=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:a=(16777215&this.result.fg)<<8|255;break;default:a=this._themeService.colors.foreground.rgba}a=r.rgba.blend(a,4294967040&(this._coreBrowserService.isFocused?n.selectionBackgroundOpaque:n.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}l=!0}}this._decorationService.forEachDecorationAtCell(t,i,"top",(e=>{e.backgroundColorRGB&&(h=e.backgroundColorRGB.rgba>>8&16777215,c=!0),e.foregroundColorRGB&&(a=e.foregroundColorRGB.rgba>>8&16777215,l=!0)})),c&&(h=d?-16777216&e.bg&-134217729|h|50331648:-16777216&e.bg|h|50331648),l&&(a=-16777216&e.fg&-67108865|a|50331648),67108864&this.result.fg&&(c&&!l&&(a=0==(50331648&this.result.bg)?-134217728&this.result.fg|16777215&n.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,l=!0),!c&&l&&(h=0==(50331648&this.result.fg)?-67108864&this.result.bg|16777215&n.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,c=!0)),n=void 0,this.result.bg=c?h:this.result.bg,this.result.fg=l?a:this.result.fg,this.result.ext&=536870911,this.result.ext|=_<<29&3758096384}}},627:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;const s=i(509),r=i(197),o=[];t.acquireTextureAtlas=function(e,t,i,n,a,h,l,c){const d=(0,r.generateConfig)(n,a,h,l,t,i,c);for(let t=0;t<o.length;t++){const i=o[t],s=i.ownedBy.indexOf(e);if(s>=0){if((0,r.configEquals)(i.config,d))return i.atlas;1===i.ownedBy.length?(i.atlas.dispose(),o.splice(t,1)):i.ownedBy.splice(s,1);break}}for(let t=0;t<o.length;t++){const i=o[t];if((0,r.configEquals)(i.config,d))return i.ownedBy.push(e),i.atlas}const _=e._core,u={atlas:new s.TextureAtlas(document,d,_.unicodeService),config:d,ownedBy:[e]};return o.push(u),u.atlas},t.removeTerminalFromCache=function(e){for(let t=0;t<o.length;t++){const i=o[t].ownedBy.indexOf(e);if(-1!==i){1===o[t].ownedBy.length?(o[t].atlas.dispose(),o.splice(t,1)):o[t].ownedBy.splice(i,1);break}}}},197:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;const s=i(160);t.generateConfig=function(e,t,i,r,o,n,a){const h={foreground:n.foreground,background:n.background,cursor:s.NULL_COLOR,cursorAccent:s.NULL_COLOR,selectionForeground:s.NULL_COLOR,selectionBackgroundTransparent:s.NULL_COLOR,selectionBackgroundOpaque:s.NULL_COLOR,selectionInactiveBackgroundTransparent:s.NULL_COLOR,selectionInactiveBackgroundOpaque:s.NULL_COLOR,ansi:n.ansi.slice(),contrastCache:n.contrastCache,halfContrastCache:n.halfContrastCache};return{customGlyphs:o.customGlyphs,devicePixelRatio:a,letterSpacing:o.letterSpacing,lineHeight:o.lineHeight,deviceCellWidth:e,deviceCellHeight:t,deviceCharWidth:i,deviceCharHeight:r,fontFamily:o.fontFamily,fontSize:o.fontSize,fontWeight:o.fontWeight,fontWeightBold:o.fontWeightBold,allowTransparency:o.allowTransparency,drawBoldTextInBrightColors:o.drawBoldTextInBrightColors,minimumContrastRatio:o.minimumContrastRatio,colors:h}},t.configEquals=function(e,t){for(let i=0;i<e.colors.ansi.length;i++)if(e.colors.ansi[i].rgba!==t.colors.ansi[i].rgba)return!1;return e.devicePixelRatio===t.devicePixelRatio&&e.customGlyphs===t.customGlyphs&&e.lineHeight===t.lineHeight&&e.letterSpacing===t.letterSpacing&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.deviceCharWidth===t.deviceCharWidth&&e.deviceCharHeight===t.deviceCharHeight&&e.drawBoldTextInBrightColors===t.drawBoldTextInBrightColors&&e.minimumContrastRatio===t.minimumContrastRatio&&e.colors.foreground.rgba===t.colors.foreground.rgba&&e.colors.background.rgba===t.colors.background.rgba},t.is256Color=function(e){return 16777216==(50331648&e)||33554432==(50331648&e)}},237:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const s=i(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=s.isFirefox||s.isLegacyEdge?"bottom":"ideographic"},457:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorBlinkStateManager=void 0;t.CursorBlinkStateManager=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(e=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const e=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0)return void this._restartInterval(e)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const e=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(e)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;const s=i(374);t.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const r={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};t.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"║":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,t)=>`M.5,1 L.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╓":{1:(e,t)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,t)=>`M1,${.5-t} L${.5-e},${.5-t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╕":{1:(e,t)=>`M0,${.5-t} L.5,${.5-t} L.5,1 M0,${.5+t} L.5,${.5+t}`},"╖":{1:(e,t)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5+e},${.5-t} L${.5+e},1`},"╘":{1:(e,t)=>`M.5,0 L.5,${.5+t} L1,${.5+t} M.5,${.5-t} L1,${.5-t}`},"╙":{1:(e,t)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,t)=>`M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0 M1,${.5+t} L${.5-e},${.5+t} L${.5-e},0`},"╛":{1:(e,t)=>`M0,${.5+t} L.5,${.5+t} L.5,0 M0,${.5-t} L.5,${.5-t}`},"╜":{1:(e,t)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,t)=>`M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M0,${.5+t} L${.5+e},${.5+t} L${.5+e},0`},"╞":{1:(e,t)=>`M.5,0 L.5,1 M.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╟":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╡":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L.5,${.5-t} M0,${.5+t} L.5,${.5+t}`},"╢":{1:(e,t)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,t)=>`M${.5+e},0 L${.5+e},1 M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0`},"╤":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t} M.5,${.5+t} L.5,1`},"╥":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╧":{1:(e,t)=>`M.5,0 L.5,${.5-t} M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╨":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,t)=>`M0,${.5+t} L1,${.5+t} M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╪":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╫":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,1,.5`},"╮":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,0,.5`},"╯":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,0,.5`},"╰":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.tryDrawCustomChar=function(e,i,n,l,c,d,_,u){const g=t.blockElementDefinitions[i];if(g)return function(e,t,i,s,r,o){for(let n=0;n<t.length;n++){const a=t[n],h=r/8,l=o/8;e.fillRect(i+a.x*h,s+a.y*l,a.w*h,a.h*l)}}(e,g,n,l,c,d),!0;const v=r[i];if(v)return function(e,t,i,r,n,a){let h=o.get(t);h||(h=new Map,o.set(t,h));const l=e.fillStyle;if("string"!=typeof l)throw new Error(`Unexpected fillStyle type "${l}"`);let c=h.get(l);if(!c){const i=t[0].length,r=t.length,o=e.canvas.ownerDocument.createElement("canvas");o.width=i,o.height=r;const n=(0,s.throwIfFalsy)(o.getContext("2d")),a=new ImageData(i,r);let d,_,u,g;if(l.startsWith("#"))d=parseInt(l.slice(1,3),16),_=parseInt(l.slice(3,5),16),u=parseInt(l.slice(5,7),16),g=l.length>7&&parseInt(l.slice(7,9),16)||1;else{if(!l.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${l}" when drawing pattern glyph`);[d,_,u,g]=l.substring(5,l.length-1).split(",").map((e=>parseFloat(e)))}for(let e=0;e<r;e++)for(let s=0;s<i;s++)a.data[4*(e*i+s)]=d,a.data[4*(e*i+s)+1]=_,a.data[4*(e*i+s)+2]=u,a.data[4*(e*i+s)+3]=t[e][s]*(255*g);n.putImageData(a,0,0),c=(0,s.throwIfFalsy)(e.createPattern(o,null)),h.set(l,c)}e.fillStyle=c,e.fillRect(i,r,n,a)}(e,v,n,l,c,d),!0;const f=t.boxDrawingDefinitions[i];if(f)return function(e,t,i,s,r,o,n){e.strokeStyle=e.fillStyle;for(const[l,c]of Object.entries(t)){let t;e.beginPath(),e.lineWidth=n*Number.parseInt(l),t="function"==typeof c?c(.15,.15/o*r):c;for(const l of t.split(" ")){const t=l[0],c=a[t];if(!c){console.error(`Could not find drawing instructions for "${t}"`);continue}const d=l.substring(1).split(",");d[0]&&d[1]&&c(e,h(d,r,o,i,s,!0,n))}e.stroke(),e.closePath()}}(e,f,n,l,c,d,u),!0;const p=t.powerlineDefinitions[i];return!!p&&(function(e,t,i,s,r,o,n,l){const c=new Path2D;c.rect(i,s,r,o),e.clip(c),e.beginPath();const d=n/12;e.lineWidth=l*d;for(const n of t.d.split(" ")){const c=n[0],_=a[c];if(!_){console.error(`Could not find drawing instructions for "${c}"`);continue}const u=n.substring(1).split(",");u[0]&&u[1]&&_(e,h(u,r,o,i,s,!1,l,(t.leftPadding??0)*(d/2),(t.rightPadding??0)*(d/2)))}1===t.type?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}(e,p,n,l,c,d,_,u),!0)};const o=new Map;function n(e,t,i=0){return Math.max(Math.min(e,t),i)}const a={C:(e,t)=>e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(e,t)=>e.lineTo(t[0],t[1]),M:(e,t)=>e.moveTo(t[0],t[1])};function h(e,t,i,s,r,o,a,h=0,l=0){const c=e.map((e=>parseFloat(e)||parseInt(e)));if(c.length<2)throw new Error("Too few arguments for instruction");for(let e=0;e<c.length;e+=2)c[e]*=t-h*a-l*a,o&&0!==c[e]&&(c[e]=n(Math.round(c[e]+.5)-.5,t,0)),c[e]+=s+h*a;for(let e=1;e<c.length;e+=2)c[e]*=i,o&&0!==c[e]&&(c[e]=n(Math.round(c[e]+.5)-.5,i,0)),c[e]+=r;return c}},56:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;const s=i(859);t.observeDevicePixelDimensions=function(e,t,i){let r=new t.ResizeObserver((t=>{const s=t.find((t=>t.target===e));if(!s)return;if(!("devicePixelContentBoxSize"in s))return r?.disconnect(),void(r=void 0);const o=s.devicePixelContentBoxSize[0].inlineSize,n=s.devicePixelContentBoxSize[0].blockSize;o>0&&n>0&&i(o,n)}));try{r.observe(e,{box:["device-pixel-content-box"]})}catch{r.disconnect(),r=void 0}return(0,s.toDisposable)((()=>r?.disconnect()))}},374:(e,t)=>{function i(e){return 57508<=e&&e<=57558}function s(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e},t.isPowerlineGlyph=i,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.isEmoji=s,t.allowRescaling=function(e,t,r,o){return 1===t&&r>Math.ceil(1.5*o)&&void 0!==e&&e>255&&!s(e)&&!i(e)&&!function(e){return 57344<=e&&e<=63743}(e)},t.treatGlyphAsBackgroundColor=function(e){return i(e)||function(e){return 9472<=e&&e<=9631}(e)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},t.computeNextVariantOffset=function(e,t,i=0){return(e-(2*Math.round(t)-i))%(2*Math.round(t))}},296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class i{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,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1])return void this.clear();const r=e.buffers.active.ydisp,o=t[1]-r,n=i[1]-r,a=Math.max(o,0),h=Math.min(n,e.rows-1);a>=e.rows||h<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=o,this.viewportEndRow=n,this.viewportCappedStartRow=a,this.viewportCappedEndRow=h,this.startCol=t[0],this.endCol=i[0])}isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol)}}t.createSelectionRenderModel=function(){return new i}},509:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;const s=i(237),r=i(860),o=i(374),n=i(160),a=i(345),h=i(485),l=i(385),c=i(147),d=i(855),_={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let u;class g{get pages(){return this._pages}constructor(e,t,i){this._document=e,this._config=t,this._unicodeService=i,this._didWarmUp=!1,this._cacheMap=new h.FourKeyMap,this._cacheMapCombined=new h.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new c.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new a.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new a.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=p(e,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,o.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const e=new l.IdleTaskQueue;for(let t=33;t<126;t++)e.enqueue((()=>{if(!this._cacheMap.get(t,d.DEFAULT_COLOR,d.DEFAULT_COLOR,d.DEFAULT_EXT)){const e=this._drawToCache(t,d.DEFAULT_COLOR,d.DEFAULT_COLOR,d.DEFAULT_EXT);this._cacheMap.set(t,d.DEFAULT_COLOR,d.DEFAULT_COLOR,d.DEFAULT_EXT,e)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(0!==this._pages[0].currentRow.x||0!==this._pages[0].currentRow.y){for(const e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(g.maxAtlasPages&&this._pages.length>=Math.max(4,g.maxAtlasPages)){const e=this._pages.filter((e=>2*e.canvas.width<=(g.maxTextureSize||4096))).sort(((e,t)=>t.canvas.width!==e.canvas.width?t.canvas.width-e.canvas.width:t.percentageUsed-e.percentageUsed));let t=-1,i=0;for(let s=0;s<e.length;s++)if(e[s].canvas.width!==i)t=s,i=e[s].canvas.width;else if(s-t==3)break;const s=e.slice(t,t+4),r=s.map((e=>e.glyphs[0].texturePage)).sort(((e,t)=>e>t?1:-1)),o=this.pages.length-s.length,n=this._mergePages(s,o);n.version++;for(let e=r.length-1;e>=0;e--)this._deletePage(r[e]);this.pages.push(n),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(n.canvas)}const e=new v(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,t){const i=2*e[0].canvas.width,s=new v(this._document,i,e);for(const[r,o]of e.entries()){const e=r*o.canvas.width%i,n=Math.floor(r/2)*o.canvas.height;s.ctx.drawImage(o.canvas,e,n);for(const s of o.glyphs)s.texturePage=t,s.sizeClipSpace.x=s.size.x/i,s.sizeClipSpace.y=s.size.y/i,s.texturePosition.x+=e,s.texturePosition.y+=n,s.texturePositionClipSpace.x=s.texturePosition.x/i,s.texturePositionClipSpace.y=s.texturePosition.y/i;this._onRemoveTextureAtlasCanvas.fire(o.canvas);const a=this._activePages.indexOf(o);-1!==a&&this._activePages.splice(a,1)}return s}_deletePage(e){this._pages.splice(e,1);for(let t=e;t<this._pages.length;t++){const e=this._pages[t];for(const t of e.glyphs)t.texturePage--;e.version++}}getRasterizedGlyphCombinedChar(e,t,i,s,r){return this._getFromCacheMap(this._cacheMapCombined,e,t,i,s,r)}getRasterizedGlyph(e,t,i,s,r){return this._getFromCacheMap(this._cacheMap,e,t,i,s,r)}_getFromCacheMap(e,t,i,s,r,o=!1){return u=e.get(t,i,s,r),u||(u=this._drawToCache(t,i,s,r,o),e.set(t,i,s,r,u)),u}_getColorFromAnsiIndex(e){if(e>=this._config.colors.ansi.length)throw new Error("No color found for idx "+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,t,i,s){if(this._config.allowTransparency)return n.NULL_COLOR;let r;switch(e){case 16777216:case 33554432:r=this._getColorFromAnsiIndex(t);break;case 50331648:const e=c.AttributeData.toColorRGB(t);r=n.channels.toColor(e[0],e[1],e[2]);break;default:r=i?n.color.opaque(this._config.colors.foreground):this._config.colors.background}return r}_getForegroundColor(e,t,i,r,o,a,h,l,d,_){const u=this._getMinimumContrastColor(e,t,i,r,o,a,h,d,l,_);if(u)return u;let g;switch(o){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&a<8&&(a+=8),g=this._getColorFromAnsiIndex(a);break;case 50331648:const e=c.AttributeData.toColorRGB(a);g=n.channels.toColor(e[0],e[1],e[2]);break;default:g=h?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(g=n.color.opaque(g)),l&&(g=n.color.multiplyOpacity(g,s.DIM_OPACITY)),g}_resolveBackgroundRgba(e,t,i){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return i?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,t,i,s){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&s&&t<8&&(t+=8),this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return i?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,t,i,s,r,o,a,h,l,c){if(1===this._config.minimumContrastRatio||c)return;const d=this._getContrastCache(l),_=d.getColor(e,s);if(void 0!==_)return _||void 0;const u=this._resolveBackgroundRgba(t,i,a),g=this._resolveForegroundRgba(r,o,a,h),v=n.rgba.ensureContrastRatio(u,g,this._config.minimumContrastRatio/(l?2:1));if(!v)return void d.setColor(e,s,null);const f=n.channels.toColor(v>>24&255,v>>16&255,v>>8&255);return d.setColor(e,s,f),f}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(e,t,i,n,a=!1){const h="number"==typeof e?String.fromCharCode(e):e,l=Math.min(this._config.deviceCellWidth*Math.max(h.length,2)+4,this._textureSize);this._tmpCanvas.width<l&&(this._tmpCanvas.width=l);const d=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<d&&(this._tmpCanvas.height=d),this._tmpCtx.save(),this._workAttributeData.fg=i,this._workAttributeData.bg=t,this._workAttributeData.extended.ext=n,this._workAttributeData.isInvisible())return _;const u=!!this._workAttributeData.isBold(),v=!!this._workAttributeData.isInverse(),p=!!this._workAttributeData.isDim(),C=!!this._workAttributeData.isItalic(),m=!!this._workAttributeData.isUnderline(),L=!!this._workAttributeData.isStrikethrough(),x=!!this._workAttributeData.isOverline();let w=this._workAttributeData.getFgColor(),b=this._workAttributeData.getFgColorMode(),M=this._workAttributeData.getBgColor(),R=this._workAttributeData.getBgColorMode();if(v){const e=w;w=M,M=e;const t=b;b=R,R=t}const y=this._getBackgroundColor(R,M,v,p);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=y.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const A=u?this._config.fontWeightBold:this._config.fontWeight,E=C?"italic":"";this._tmpCtx.font=`${E} ${A} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=s.TEXT_BASELINE;const S=1===h.length&&(0,o.isPowerlineGlyph)(h.charCodeAt(0)),T=1===h.length&&(0,o.isRestrictedPowerlineGlyph)(h.charCodeAt(0)),D=this._getForegroundColor(t,R,M,i,b,w,v,p,u,(0,o.treatGlyphAsBackgroundColor)(h.charCodeAt(0)));this._tmpCtx.fillStyle=D.css;const B=T?0:4;let F=!1;!1!==this._config.customGlyphs&&(F=(0,r.tryDrawCustomChar)(this._tmpCtx,h,B,B,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let P,I=!S;if(P="number"==typeof e?this._unicodeService.wcwidth(e):this._unicodeService.getStringCellWidth(e),m){this._tmpCtx.save();const e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),t=e%2==1?.5:0;if(this._tmpCtx.lineWidth=e,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())I=!1,this._tmpCtx.strokeStyle=`rgb(${c.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{I=!1;let e=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&e<8&&(e+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(e).css}this._tmpCtx.beginPath();const i=B,s=Math.ceil(B+this._config.deviceCharHeight)-t-(a?2*e:0),r=s+e,n=s+2*e;let l=this._workAttributeData.getUnderlineVariantOffset();for(let a=0;a<P;a++){this._tmpCtx.save();const h=i+a*this._config.deviceCellWidth,c=i+(a+1)*this._config.deviceCellWidth,d=h+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(h,s),this._tmpCtx.lineTo(c,s),this._tmpCtx.moveTo(h,n),this._tmpCtx.lineTo(c,n);break;case 3:const i=e<=1?n:Math.ceil(B+this._config.deviceCharHeight-e/2)-t,a=e<=1?s:Math.ceil(B+this._config.deviceCharHeight+e/2)-t,_=new Path2D;_.rect(h,s,this._config.deviceCellWidth,n-s),this._tmpCtx.clip(_),this._tmpCtx.moveTo(h-this._config.deviceCellWidth/2,r),this._tmpCtx.bezierCurveTo(h-this._config.deviceCellWidth/2,a,h,a,h,r),this._tmpCtx.bezierCurveTo(h,i,d,i,d,r),this._tmpCtx.bezierCurveTo(d,a,c,a,c,r),this._tmpCtx.bezierCurveTo(c,i,c+this._config.deviceCellWidth/2,i,c+this._config.deviceCellWidth/2,r);break;case 4:const u=0===l?0:l>=e?2*e-l:e-l;!1==!(l>=e)||0===u?(this._tmpCtx.setLineDash([Math.round(e),Math.round(e)]),this._tmpCtx.moveTo(h+u,s),this._tmpCtx.lineTo(c,s)):(this._tmpCtx.setLineDash([Math.round(e),Math.round(e)]),this._tmpCtx.moveTo(h,s),this._tmpCtx.lineTo(h+u,s),this._tmpCtx.moveTo(h+u+e,s),this._tmpCtx.lineTo(c,s)),l=(0,o.computeNextVariantOffset)(c-h,e,l);break;case 5:const g=.6,v=.3,f=c-h,p=Math.floor(g*f),C=Math.floor(v*f),m=f-p-C;this._tmpCtx.setLineDash([p,C,m]),this._tmpCtx.moveTo(h,s),this._tmpCtx.lineTo(c,s);break;default:this._tmpCtx.moveTo(h,s),this._tmpCtx.lineTo(c,s)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!F&&this._config.fontSize>=12&&!this._config.allowTransparency&&" "!==h){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const t=this._tmpCtx.measureText(h);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in t&&t.actualBoundingBoxDescent>0){this._tmpCtx.save();const t=new Path2D;t.rect(i,s-Math.ceil(e/2),this._config.deviceCellWidth*P,n-s+Math.ceil(e/2)),this._tmpCtx.clip(t),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=y.css,this._tmpCtx.strokeText(h,B,B+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(x){const e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),t=e%2==1?.5:0;this._tmpCtx.lineWidth=e,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(B,B+t),this._tmpCtx.lineTo(B+this._config.deviceCharWidth*P,B+t),this._tmpCtx.stroke()}if(F||this._tmpCtx.fillText(h,B,B+this._config.deviceCharHeight),"_"===h&&!this._config.allowTransparency){let e=f(this._tmpCtx.getImageData(B,B,this._config.deviceCellWidth,this._config.deviceCellHeight),y,D,I);if(e)for(let t=1;t<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=y.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(h,B,B+this._config.deviceCharHeight-t),e=f(this._tmpCtx.getImageData(B,B,this._config.deviceCellWidth,this._config.deviceCellHeight),y,D,I),e);t++);}if(L){const e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),t=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=e,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(B,B+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.lineTo(B+this._config.deviceCharWidth*P,B+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.stroke()}this._tmpCtx.restore();const O=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let k;if(k=this._config.allowTransparency?function(e){for(let t=0;t<e.data.length;t+=4)if(e.data[t+3]>0)return!1;return!0}(O):f(O,y,D,I),k)return _;const $=this._findGlyphBoundingBox(O,this._workBoundingBox,l,T,F,B);let U,N;for(;;){if(0===this._activePages.length){const e=this._createNewPage();U=e,N=e.currentRow,N.height=$.size.y;break}U=this._activePages[this._activePages.length-1],N=U.currentRow;for(const e of this._activePages)$.size.y<=e.currentRow.height&&(U=e,N=e.currentRow);for(let e=this._activePages.length-1;e>=0;e--)for(const t of this._activePages[e].fixedRows)t.height<=N.height&&$.size.y<=t.height&&(U=this._activePages[e],N=t);if(N.y+$.size.y>=U.canvas.height||N.height>$.size.y+2){let e=!1;if(U.currentRow.y+U.currentRow.height+$.size.y>=U.canvas.height){let t;for(const e of this._activePages)if(e.currentRow.y+e.currentRow.height+$.size.y<e.canvas.height){t=e;break}if(t)U=t;else if(g.maxAtlasPages&&this._pages.length>=g.maxAtlasPages&&N.y+$.size.y<=U.canvas.height&&N.height>=$.size.y&&N.x+$.size.x<=U.canvas.width)e=!0;else{const t=this._createNewPage();U=t,N=t.currentRow,N.height=$.size.y,e=!0}}e||(U.currentRow.height>0&&U.fixedRows.push(U.currentRow),N={x:0,y:U.currentRow.y+U.currentRow.height,height:$.size.y},U.fixedRows.push(N),U.currentRow={x:0,y:N.y+N.height,height:0})}if(N.x+$.size.x<=U.canvas.width)break;N===U.currentRow?(N.x=0,N.y+=N.height,N.height=0):U.fixedRows.splice(U.fixedRows.indexOf(N),1)}return $.texturePage=this._pages.indexOf(U),$.texturePosition.x=N.x,$.texturePosition.y=N.y,$.texturePositionClipSpace.x=N.x/U.canvas.width,$.texturePositionClipSpace.y=N.y/U.canvas.height,$.sizeClipSpace.x/=U.canvas.width,$.sizeClipSpace.y/=U.canvas.height,N.height=Math.max(N.height,$.size.y),N.x+=$.size.x,U.ctx.putImageData(O,$.texturePosition.x-this._workBoundingBox.left,$.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,$.size.x,$.size.y),U.addGlyph($),U.version++,$}_findGlyphBoundingBox(e,t,i,s,r,o){t.top=0;const n=s?this._config.deviceCellHeight:this._tmpCanvas.height,a=s?this._config.deviceCellWidth:i;let h=!1;for(let i=0;i<n;i++){for(let s=0;s<a;s++){const r=i*this._tmpCanvas.width*4+4*s+3;if(0!==e.data[r]){t.top=i,h=!0;break}}if(h)break}t.left=0,h=!1;for(let i=0;i<o+a;i++){for(let s=0;s<n;s++){const r=s*this._tmpCanvas.width*4+4*i+3;if(0!==e.data[r]){t.left=i,h=!0;break}}if(h)break}t.right=a,h=!1;for(let i=o+a-1;i>=o;i--){for(let s=0;s<n;s++){const r=s*this._tmpCanvas.width*4+4*i+3;if(0!==e.data[r]){t.right=i,h=!0;break}}if(h)break}t.bottom=n,h=!1;for(let i=n-1;i>=0;i--){for(let s=0;s<a;s++){const r=i*this._tmpCanvas.width*4+4*s+3;if(0!==e.data[r]){t.bottom=i,h=!0;break}}if(h)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:t.right-t.left+1,y:t.bottom-t.top+1},sizeClipSpace:{x:t.right-t.left+1,y:t.bottom-t.top+1},offset:{x:-t.left+o+(s||r?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-t.top+o+(s||r?1===this._config.lineHeight?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}t.TextureAtlas=g;class v{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(e){this._glyphs.push(e),this._usedPixels+=e.size.x*e.size.y}constructor(e,t,i){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],i)for(const e of i)this._glyphs.push(...e.glyphs),this._usedPixels+=e._usedPixels;this.canvas=p(e,t,t),this.ctx=(0,o.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function f(e,t,i,s){const r=t.rgba>>>24,o=t.rgba>>>16&255,n=t.rgba>>>8&255,a=i.rgba>>>24,h=i.rgba>>>16&255,l=i.rgba>>>8&255,c=Math.floor((Math.abs(r-a)+Math.abs(o-h)+Math.abs(n-l))/12);let d=!0;for(let t=0;t<e.data.length;t+=4)e.data[t]===r&&e.data[t+1]===o&&e.data[t+2]===n||s&&Math.abs(e.data[t]-r)+Math.abs(e.data[t+1]-o)+Math.abs(e.data[t+2]-n)<c?e.data[t+3]=0:d=!1;return d}function p(e,t,i){const s=e.createElement("canvas");return s.width=t,s.height=i,s}},160:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let i=0,s=0,r=0,o=0;var n,a,h,l,c;function d(e){const t=e.toString(16);return t.length<2?"0"+t:t}function _(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},function(e){e.toCss=function(e,t,i,s){return void 0!==s?`#${d(e)}${d(t)}${d(i)}${d(s)}`:`#${d(e)}${d(t)}${d(i)}`},e.toRgba=function(e,t,i,s=255){return(e<<24|t<<16|i<<8|s)>>>0},e.toColor=function(t,i,s,r){return{css:e.toCss(t,i,s,r),rgba:e.toRgba(t,i,s,r)}}}(n||(t.channels=n={})),function(e){function t(e,t){return o=Math.round(255*t),[i,s,r]=c.toChannels(e.rgba),{css:n.toCss(i,s,r,o),rgba:n.toRgba(i,s,r,o)}}e.blend=function(e,t){if(o=(255&t.rgba)/255,1===o)return{css:t.css,rgba:t.rgba};const a=t.rgba>>24&255,h=t.rgba>>16&255,l=t.rgba>>8&255,c=e.rgba>>24&255,d=e.rgba>>16&255,_=e.rgba>>8&255;return i=c+Math.round((a-c)*o),s=d+Math.round((h-d)*o),r=_+Math.round((l-_)*o),{css:n.toCss(i,s,r),rgba:n.toRgba(i,s,r)}},e.isOpaque=function(e){return 255==(255&e.rgba)},e.ensureContrastRatio=function(e,t,i){const s=c.ensureContrastRatio(e.rgba,t.rgba,i);if(s)return n.toColor(s>>24&255,s>>16&255,s>>8&255)},e.opaque=function(e){const t=(255|e.rgba)>>>0;return[i,s,r]=c.toChannels(t),{css:n.toCss(i,s,r),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,i){return o=255&e.rgba,t(e,o*i/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(a||(t.color=a={})),function(e){let t,a;try{const e=document.createElement("canvas");e.width=1,e.height=1;const i=e.getContext("2d",{willReadFrequently:!0});i&&(t=i,t.globalCompositeOperation="copy",a=t.createLinearGradient(0,0,1,1))}catch{}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return i=parseInt(e.slice(1,2).repeat(2),16),s=parseInt(e.slice(2,3).repeat(2),16),r=parseInt(e.slice(3,4).repeat(2),16),n.toColor(i,s,r);case 5:return i=parseInt(e.slice(1,2).repeat(2),16),s=parseInt(e.slice(2,3).repeat(2),16),r=parseInt(e.slice(3,4).repeat(2),16),o=parseInt(e.slice(4,5).repeat(2),16),n.toColor(i,s,r,o);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}const h=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(h)return i=parseInt(h[1]),s=parseInt(h[2]),r=parseInt(h[3]),o=Math.round(255*(void 0===h[5]?1:parseFloat(h[5]))),n.toColor(i,s,r,o);if(!t||!a)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=a,t.fillStyle=e,"string"!=typeof t.fillStyle)throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[i,s,r,o]=t.getImageData(0,0,1,1).data,255!==o)throw new Error("css.toColor: Unsupported css format");return{rgba:n.toRgba(i,s,r,o),css:e}}}(h||(t.css=h={})),function(e){function t(e,t,i){const s=e/255,r=t/255,o=i/255;return.2126*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(l||(t.rgb=l={})),function(e){function t(e,t,i){const s=e>>24&255,r=e>>16&255,o=e>>8&255;let n=t>>24&255,a=t>>16&255,h=t>>8&255,c=_(l.relativeLuminance2(n,a,h),l.relativeLuminance2(s,r,o));for(;c<i&&(n>0||a>0||h>0);)n-=Math.max(0,Math.ceil(.1*n)),a-=Math.max(0,Math.ceil(.1*a)),h-=Math.max(0,Math.ceil(.1*h)),c=_(l.relativeLuminance2(n,a,h),l.relativeLuminance2(s,r,o));return(n<<24|a<<16|h<<8|255)>>>0}function a(e,t,i){const s=e>>24&255,r=e>>16&255,o=e>>8&255;let n=t>>24&255,a=t>>16&255,h=t>>8&255,c=_(l.relativeLuminance2(n,a,h),l.relativeLuminance2(s,r,o));for(;c<i&&(n<255||a<255||h<255);)n=Math.min(255,n+Math.ceil(.1*(255-n))),a=Math.min(255,a+Math.ceil(.1*(255-a))),h=Math.min(255,h+Math.ceil(.1*(255-h))),c=_(l.relativeLuminance2(n,a,h),l.relativeLuminance2(s,r,o));return(n<<24|a<<16|h<<8|255)>>>0}e.blend=function(e,t){if(o=(255&t)/255,1===o)return t;const a=t>>24&255,h=t>>16&255,l=t>>8&255,c=e>>24&255,d=e>>16&255,_=e>>8&255;return i=c+Math.round((a-c)*o),s=d+Math.round((h-d)*o),r=_+Math.round((l-_)*o),n.toRgba(i,s,r)},e.ensureContrastRatio=function(e,i,s){const r=l.relativeLuminance(e>>8),o=l.relativeLuminance(i>>8);if(_(r,o)<s){if(o<r){const o=t(e,i,s),n=_(r,l.relativeLuminance(o>>8));if(n<s){const t=a(e,i,s);return n>_(r,l.relativeLuminance(t>>8))?o:t}return o}const n=a(e,i,s),h=_(r,l.relativeLuminance(n>>8));if(h<s){const o=t(e,i,s);return h>_(r,l.relativeLuminance(o>>8))?n:o}return n}},e.reduceLuminance=t,e.increaseLuminance=a,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]}}(c||(t.rgba=c={})),t.toPaddedHex=d,t.contrastRatio=_},345:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed)for(let t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)}})),this._event}fire(e,t){const i=[];for(let e=0;e<this._listeners.length;e++)i.push(this._listeners[e]);for(let s=0;s<i.length;s++)i[s].call(void 0,e,t)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(e,t){return e((e=>t.fire(e)))},t.runAndSubscribe=function(e,t){return t(void 0),e((e=>t(e)))}},859:(e,t)=>{function i(e){for(const t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){const t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=i,t.getDisposeArrayDisposable=function(e){return{dispose:()=>i(e)}}},485:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class i{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=i,t.FourKeyMap=class{constructor(){this._data=new i}set(e,t,s,r,o){this._data.get(e,t)||this._data.set(e,t,new i),this._data.get(e,t).set(s,r,o)}get(e,t,i,s){return this._data.get(e,t)?.get(i,s)}clear(){this._data.clear()}}},399:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode="undefined"!=typeof process&&"title"in process;const i=t.isNode?"node":navigator.userAgent,s=t.isNode?"node":navigator.platform;t.isFirefox=i.includes("Firefox"),t.isLegacyEdge=i.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(i),t.getSafariVersion=function(){if(!t.isSafari)return 0;const e=i.match(/Version\/(\d+)/);return null===e||e.length<2?0:parseInt(e[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(s),t.isIpad="iPad"===s,t.isIphone="iPhone"===s,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(s),t.isLinux=s.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(i)},385:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const s=i(399);class r{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,i=0,s=e.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(t=Date.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,Date.now()-t),i=Math.max(t,i),r=e.timeRemaining(),1.5*i>r)return s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),void this._start();s=r}this.clear()}}class o extends r{_requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){const t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}}t.PriorityTaskQueue=o,t.IdleTaskQueue=!s.isNode&&"requestIdleCallback"in window?class extends r{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}}:o,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}}},147:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class i{constructor(){this.fg=0,this.bg=0,this.extended=new s}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return 50331648==(50331648&this.fg)}isBgRGB(){return 50331648==(50331648&this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return 0==(50331648&this.fg)}isBgDefault(){return 0==(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=i;class s{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){const e=(3758096384&this._ext)>>29;return e<0?4294967288^e:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}clone(){return new s(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}t.ExtendedAttrs=s},782:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const s=i(133),r=i(855),o=i(147);class n extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(e){const t=new n;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,s.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[r.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[r.CHAR_DATA_CHAR_INDEX].length){const i=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|e[r.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[r.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[r.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[r.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=n},855:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let t=e[r];t>65535?(t-=65536,s+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):s+=String.fromCharCode(t)}return s},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){const i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){const i=e.charCodeAt(r++);56320<=i&&i<=57343?t[s++]=1024*(this._interim-55296)+i-56320+65536:(t[s++]=this._interim,t[s++]=i),this._interim=0}for(let o=r;o<i;++o){const r=e.charCodeAt(o);if(55296<=r&&r<=56319){if(++o>=i)return this._interim=r,s;const n=e.charCodeAt(o);56320<=n&&n<=57343?t[s++]=1024*(r-55296)+n-56320+65536:(t[s++]=r,t[s++]=n)}else 65279!==r&&(t[s++]=r)}return s}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){const i=e.length;if(!i)return 0;let s,r,o,n,a=0,h=0,l=0;if(this.interim[0]){let s=!1,r=this.interim[0];r&=192==(224&r)?31:224==(240&r)?15:7;let o,n=0;for(;(o=63&this.interim[++n])&&n<4;)r<<=6,r|=o;const h=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,c=h-n;for(;l<c;){if(l>=i)return 0;if(o=e[l++],128!=(192&o)){l--,s=!0;break}this.interim[n++]=o,r<<=6,r|=63&o}s||(2===h?r<128?l--:t[a++]=r:3===h?r<2048||r>=55296&&r<=57343||65279===r||(t[a++]=r):r<65536||r>1114111||(t[a++]=r)),this.interim.fill(0)}const c=i-4;let d=l;for(;d<i;){for(;!(!(d<c)||128&(s=e[d])||128&(r=e[d+1])||128&(o=e[d+2])||128&(n=e[d+3]));)t[a++]=s,t[a++]=r,t[a++]=o,t[a++]=n,d+=4;if(s=e[d++],s<128)t[a++]=s;else if(192==(224&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(h=(31&s)<<6|63&r,h<128){d--;continue}t[a++]=h}else if(224==(240&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(o=e[d++],128!=(192&o)){d--;continue}if(h=(15&s)<<12|(63&r)<<6|63&o,h<2048||h>=55296&&h<=57343||65279===h)continue;t[a++]=h}else if(240==(248&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(o=e[d++],128!=(192&o)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,this.interim[2]=o,a;if(n=e[d++],128!=(192&n)){d--;continue}if(h=(7&s)<<18|(63&r)<<12|(63&o)<<6|63&n,h<65536||h>1114111)continue;t[a++]=h}}return a}}},776:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,o=arguments.length,n=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const o=i(859),n=i(97),a={trace:n.LogLevelEnum.TRACE,debug:n.LogLevelEnum.DEBUG,info:n.LogLevelEnum.INFO,warn:n.LogLevelEnum.WARN,error:n.LogLevelEnum.ERROR,off:n.LogLevelEnum.OFF};let h,l=t.LogService=class extends o.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=n.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),h=this}_updateLogLevel(){this._logLevel=a[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+t,...i)}trace(e,...t){this._logLevel<=n.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=n.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=n.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=n.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=n.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};t.LogService=l=s([r(0,n.IOptionsService)],l),t.setTraceLogger=function(e){h=e},t.traceCall=function(e,t,i){if("function"!=typeof i.value)throw new Error("not supported");const s=i.value;i.value=function(...e){if(h.logLevel!==n.LogLevelEnum.TRACE)return s.apply(this,e);h.trace(`GlyphRenderer#${s.name}(${e.map((e=>JSON.stringify(e))).join(", ")})`);const t=s.apply(this,e);return h.trace(`GlyphRenderer#${s.name} return`,t),t}}},726:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const i="di$target",s="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e[s]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);const r=function(e,t,o){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,r){t[i]===t?t[s].push({id:e,index:r}):(t[s]=[{id:e,index:r}],t[i]=t)}(r,e,o)};return r.toString=()=>e,t.serviceRegistry.set(e,r),r}},97:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const s=i(726);var r;t.IBufferService=(0,s.createDecorator)("BufferService"),t.ICoreMouseService=(0,s.createDecorator)("CoreMouseService"),t.ICoreService=(0,s.createDecorator)("CoreService"),t.ICharsetService=(0,s.createDecorator)("CharsetService"),t.IInstantiationService=(0,s.createDecorator)("InstantiationService"),function(e){e[e.TRACE=0]="TRACE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.OFF=5]="OFF"}(r||(t.LogLevelEnum=r={})),t.ILogService=(0,s.createDecorator)("LogService"),t.IOptionsService=(0,s.createDecorator)("OptionsService"),t.IOscLinkService=(0,s.createDecorator)("OscLinkService"),t.IUnicodeService=(0,s.createDecorator)("UnicodeService"),t.IDecorationService=(0,s.createDecorator)("DecorationService")}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var o=t[s]={exports:{}};return e[s].call(o.exports,o,o.exports,i),o.exports}var s={};return(()=>{var e=s;Object.defineProperty(e,"__esModule",{value:!0}),e.WebglAddon=void 0;const t=i(345),r=i(859),o=i(399),n=i(666),a=i(776);class h extends r.Disposable{constructor(e){if(o.isSafari&&(0,o.getSafariVersion)()<16){const e={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",e))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new t.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new t.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new t.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(e){const i=e._core;if(!e.element)return void this.register(i.onWillOpen((()=>this.activate(e))));this._terminal=e;const s=i.coreService,o=i.optionsService,h=i,l=h._renderService,c=h._characterJoinerService,d=h._charSizeService,_=h._coreBrowserService,u=h._decorationService,g=h._logService,v=h._themeService;(0,a.setTraceLogger)(g),this._renderer=this.register(new n.WebglRenderer(e,c,d,_,s,u,o,v,this._preserveDrawingBuffer)),this.register((0,t.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,t.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),l.setRenderer(this._renderer),this.register((0,r.toDisposable)((()=>{const t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)})))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}}e.WebglAddon=h})(),s})()));+//# sourceMappingURL=addon-webgl.js.map\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm.css b/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm.cssindex e9fd8153f0..819654e453 100644--- a/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm.css+++ b/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm.css@@ -112,10 +112,6 @@top: 0;}-.xterm .xterm-scroll-area {- visibility: hidden;-}-.xterm-char-measure-element {display: inline-block;visibility: hidden;@@ -140,7 +136,7 @@cursor: crosshair;}-.xterm .xterm-accessibility,+.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message {position: absolute;left: 0;@@ -149,6 +145,22 @@right: 0;z-index: 10;color: transparent;+ pointer-events: none;+}++.xterm .xterm-accessibility-tree:not(.debug) *::selection {+ color: transparent;+}++.xterm .xterm-accessibility-tree {+ font-family: monospace;+ user-select: text;+ white-space: pre;+}++.xterm .xterm-accessibility-tree > div {+ transform-origin: left;+ width: fit-content;}.xterm .live-region {@@ -160,7 +172,9 @@}.xterm-dim {- opacity: 0.5;+ /* Dim should not apply to background, so the opacity of the foreground color is applied+ * explicitly in the generated class and reset to 1 here */+ opacity: 1 !important;}.xterm-underline-1 { text-decoration: underline; }@@ -169,6 +183,16 @@.xterm-underline-4 { text-decoration: dotted underline; }.xterm-underline-5 { text-decoration: dashed underline; }+.xterm-overline {+ text-decoration: overline;+}++.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }+.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }+.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }+.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }+.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }+.xterm-strikethrough {text-decoration: line-through;}@@ -178,8 +202,12 @@position: absolute;}+.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {+ z-index: 7;+}+.xterm-decoration-overview-ruler {- z-index: 7;+ z-index: 8;position: absolute;top: 0;right: 0;@@ -190,3 +218,68 @@z-index: 2;position: relative;}++++/* Derived from vs/base/browser/ui/scrollbar/media/scrollbar.css */++/* xterm.js customization: Override xterm's cursor style */+.xterm .xterm-scrollable-element > .scrollbar {+ cursor: default;+}++/* Arrows */+.xterm .xterm-scrollable-element > .scrollbar > .scra {+ cursor: pointer;+ font-size: 11px !important;+}++.xterm .xterm-scrollable-element > .visible {+ opacity: 1;++ /* Background rule added for IE9 - to allow clicks on dom node */+ background:rgba(0,0,0,0);++ transition: opacity 100ms linear;+ /* In front of peek view */+ z-index: 11;+}+.xterm .xterm-scrollable-element > .invisible {+ opacity: 0;+ pointer-events: none;+}+.xterm .xterm-scrollable-element > .invisible.fade {+ transition: opacity 800ms linear;+}++/* Scrollable Content Inset Shadow */+.xterm .xterm-scrollable-element > .shadow {+ position: absolute;+ display: none;+}+.xterm .xterm-scrollable-element > .shadow.top {+ display: block;+ top: 0;+ left: 3px;+ height: 3px;+ width: 100%;+ box-shadow: var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset;+}+.xterm .xterm-scrollable-element > .shadow.left {+ display: block;+ top: 3px;+ left: 0;+ height: 100%;+ width: 3px;+ box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;+}+.xterm .xterm-scrollable-element > .shadow.top-left-corner {+ display: block;+ top: 0;+ left: 0;+ height: 3px;+ width: 3px;+}+.xterm .xterm-scrollable-element > .shadow.top.left {+ box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;+}diff --git a/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm.js b/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm.jsindex 61b303309b..e47e2ddd2c 100644--- a/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm.js+++ b/server-core/src/main/java/io/onedev/server/web/asset/xterm/xterm.js@@ -1,2 +1,2 @@-!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(function(){return(()=>{"use strict";var e={4567:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const s=i(9042),r=i(6114),n=i(9924),o=i(3656),a=i(844),h=i(5596),c=i(9631);class l extends a.Disposable{constructor(e,t){super(),this._terminal=e,this._renderService=t,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityTreeRoot=document.createElement("div"),this._accessibilityTreeRoot.classList.add("xterm-accessibility"),this._accessibilityTreeRoot.tabIndex=0,this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._onBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._onBoundaryFocus(e,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityTreeRoot.appendChild(this._rowContainer),this._renderRowsDebouncer=new n.TimeBasedDebouncer(this._renderRows.bind(this)),this._refreshRows(),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityTreeRoot.appendChild(this._liveRegion),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityTreeRoot),this.register(this._renderRowsDebouncer),this.register(this._terminal.onResize((e=>this._onResize(e.rows)))),this.register(this._terminal.onRender((e=>this._refreshRows(e.start,e.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((e=>this._onChar(e)))),this.register(this._terminal.onLineFeed((()=>this._onChar("\n")))),this.register(this._terminal.onA11yTab((e=>this._onTab(e)))),this.register(this._terminal.onKey((e=>this._onKey(e.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._screenDprMonitor=new h.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener((()=>this._refreshRowsDimensions())),this.register((0,o.addDisposableDomListener)(window,"resize",(()=>this._refreshRowsDimensions())))}dispose(){super.dispose(),(0,c.removeElementFromParent)(this._accessibilityTreeRoot),this._rowElements.length=0}_onBoundaryFocus(e,t){const i=e.target,s=this._rowElements[0===t?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")===(0===t?"1":`${this._terminal.buffer.lines.length}`))return;if(e.relatedTarget!==s)return;let r,n;if(0===t?(r=i,n=this._rowElements.pop(),this._rowContainer.removeChild(n)):(r=this._rowElements.shift(),n=i,this._rowContainer.removeChild(r)),r.removeEventListener("focus",this._topBoundaryFocusListener),n.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){const e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement("afterbegin",e)}else{const e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_onResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_onTab(e){for(let t=0;t<e;t++)this._onChar(" ")}_onChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=s.tooMuchOutput)),r.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout((()=>{this._accessibilityTreeRoot.appendChild(this._liveRegion)}),0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,r.isMac&&(0,c.removeElementFromParent)(this._liveRegion)}_onKey(e){this._clearLiveRegion(),this._charsToConsume.push(e)}_refreshRows(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){const e=i.translateBufferLineToString(i.ydisp+r,!0),t=(i.ydisp+r+1).toString(),n=this._rowElements[r];n&&(0===e.length?n.innerText=" ":n.textContent=e,n.setAttribute("aria-posinset",t),n.setAttribute("aria-setsize",s))}this._announceCharacters()}_refreshRowsDimensions(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.actualCellHeight}px`}_announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}}t.AccessibilityManager=l},3614:(e,t)=>{function i(e){return e.replace(/\r?\n/g,"\r")}function s(e,t){return t?"[200~"+e+"[201~":e}function r(e,t,r){e=s(e=i(e),r.decPrivateModes.bracketedPasteMode),r.triggerDataEvent(e,!0),t.value=""}function n(e,t,i){const s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=i,t.bracketTextForPaste=s,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,i){e.stopPropagation(),e.clipboardData&&r(e.clipboardData.getData("text/plain"),t,i)},t.paste=r,t.moveTextAreaUnderMouseCursor=n,t.rightClickHandler=function(e,t,i,s,r){n(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}},7239:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const s=i(1505);t.ColorContrastCache=class{constructor(){this._color=new s.TwoKeyMap,this._css=new s.TwoKeyMap}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},5680:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorManager=t.DEFAULT_ANSI_COLORS=void 0;const s=i(8055),r=i(7239),n=s.css.toColor("#ffffff"),o=s.css.toColor("#000000"),a=s.css.toColor("#ffffff"),h=s.css.toColor("#000000"),c={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const e=[s.css.toColor("#2e3436"),s.css.toColor("#cc0000"),s.css.toColor("#4e9a06"),s.css.toColor("#c4a000"),s.css.toColor("#3465a4"),s.css.toColor("#75507b"),s.css.toColor("#06989a"),s.css.toColor("#d3d7cf"),s.css.toColor("#555753"),s.css.toColor("#ef2929"),s.css.toColor("#8ae234"),s.css.toColor("#fce94f"),s.css.toColor("#729fcf"),s.css.toColor("#ad7fa8"),s.css.toColor("#34e2e2"),s.css.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){const r=t[i/36%6|0],n=t[i/6%6|0],o=t[i%6];e.push({css:s.channels.toCss(r,n,o),rgba:s.channels.toRgba(r,n,o)})}for(let t=0;t<24;t++){const i=8+10*t;e.push({css:s.channels.toCss(i,i,i),rgba:s.channels.toRgba(i,i,i)})}return e})()),t.ColorManager=class{constructor(e,i){this.allowTransparency=i;const l=e.createElement("canvas");l.width=1,l.height=1;const d=l.getContext("2d");if(!d)throw new Error("Could not get rendering context");this._ctx=d,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new r.ColorContrastCache,this.colors={foreground:n,background:o,cursor:a,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:c,selectionBackgroundOpaque:s.color.blend(o,c),selectionInactiveBackgroundTransparent:c,selectionInactiveBackgroundOpaque:s.color.blend(o,c),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},this._updateRestoreColors()}onOptionsChange(e,t){switch(e){case"minimumContrastRatio":this._contrastCache.clear();break;case"allowTransparency":this.allowTransparency=t}}setTheme(e={}){this.colors.foreground=this._parseColor(e.foreground,n),this.colors.background=this._parseColor(e.background,o),this.colors.cursor=this._parseColor(e.cursor,a,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,h,!0),this.colors.selectionBackgroundTransparent=this._parseColor(e.selectionBackground,c,!0),this.colors.selectionBackgroundOpaque=s.color.blend(this.colors.background,this.colors.selectionBackgroundTransparent),this.colors.selectionInactiveBackgroundTransparent=this._parseColor(e.selectionInactiveBackground,this.colors.selectionBackgroundTransparent,!0),this.colors.selectionInactiveBackgroundOpaque=s.color.blend(this.colors.background,this.colors.selectionInactiveBackgroundTransparent);const i={css:"",rgba:0};if(this.colors.selectionForeground=e.selectionForeground?this._parseColor(e.selectionForeground,i):void 0,this.colors.selectionForeground===i&&(this.colors.selectionForeground=void 0),s.color.isOpaque(this.colors.selectionBackgroundTransparent)){const e=.3;this.colors.selectionBackgroundTransparent=s.color.opacity(this.colors.selectionBackgroundTransparent,e)}if(s.color.isOpaque(this.colors.selectionInactiveBackgroundTransparent)){const e=.3;this.colors.selectionInactiveBackgroundTransparent=s.color.opacity(this.colors.selectionInactiveBackgroundTransparent,e)}if(this.colors.ansi=t.DEFAULT_ANSI_COLORS.slice(),this.colors.ansi[0]=this._parseColor(e.black,t.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,t.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,t.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,t.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,t.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,t.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,t.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,t.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,t.DEFAULT_ANSI_COLORS[15]),e.extendedAnsi){const i=Math.min(this.colors.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<i;s++)this.colors.ansi[s+16]=this._parseColor(e.extendedAnsi[s],t.DEFAULT_ANSI_COLORS[s+16])}this._contrastCache.clear(),this._updateRestoreColors()}restoreColor(e){if(void 0!==e)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]}else for(let e=0;e<this._restoreColors.ansi.length;++e)this.colors.ansi[e]=this._restoreColors.ansi[e]}_updateRestoreColors(){this._restoreColors={foreground:this.colors.foreground,background:this.colors.background,cursor:this.colors.cursor,ansi:this.colors.ansi.slice()}}_parseColor(e,t,i=this.allowTransparency){if(void 0===e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn(`Color: ${e} is invalid using fallback ${t.css}`),t;this._ctx.fillRect(0,0,1,1);const r=this._ctx.getImageData(0,0,1,1).data;if(255!==r[3]){if(!i)return console.warn(`Color: ${e} is using transparency, but allowTransparency is false. Using fallback ${t.css}.`),t;const[r,n,o,a]=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map((e=>Number(e))),h=Math.round(255*a);return{rgba:s.channels.toRgba(r,n,o,h),css:e}}return{css:this._ctx.fillStyle,rgba:s.channels.toRgba(r[0],r[1],r[2],r[3])}}}},9631:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementFromParent=void 0,t.removeElementFromParent=function(...e){var t;for(const i of e)null===(t=null==i?void 0:i.parentElement)||void 0===t||t.removeChild(i)}},3656:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,i,s){e.addEventListener(t,i,s);let r=!1;return{dispose:()=>{r||(r=!0,e.removeEventListener(t,i,s))}}}},6465:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier2=void 0;const n=i(2585),o=i(8460),a=i(844),h=i(3656);let c=class extends a.Disposable{constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this._onHideLinkUnderline=this.register(new o.EventEmitter),this.register((0,a.getDisposeArrayDisposable)(this._linkCacheDisposables))}get currentLink(){return this._currentLink}get onShowLinkUnderline(){return this._onShowLinkUnderline.event}get onHideLinkUnderline(){return this._onHideLinkUnderline.event}dispose(){super.dispose(),this._lastMouseEvent=void 0}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const t=this._linkProviders.indexOf(e);-1!==t&&this._linkProviders.splice(t,1)}}}attachToDom(e,t,i){this._element=e,this._mouseService=t,this._renderService=i,this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._onMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_onMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;const i=e.composedPath();for(let e=0;e<i.length;e++){const t=i[e];if(t.classList.contains("xterm"))break;if(t.classList.contains("xterm-hover"))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._onHover(t),this._lastBufferCell=t)}_onHover(e){if(this._activeLine!==e.y)return this._clearCurrentLink(),void this._askForLink(e,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var i,s;this._activeProviderReplies&&t||(null===(i=this._activeProviderReplies)||void 0===i||i.forEach((e=>{null==e||e.forEach((e=>{e.link.dispose&&e.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(const[i,n]of this._linkProviders.entries())t?(null===(s=this._activeProviderReplies)||void 0===s?void 0:s.get(i))&&(r=this._checkLinkProviderResult(i,e,r)):n.provideLinks(e.y,(t=>{var s,n;if(this._isMouseOut)return;const o=null==t?void 0:t.map((e=>({link:e})));null===(s=this._activeProviderReplies)||void 0===s||s.set(i,o),r=this._checkLinkProviderResult(i,e,r),(null===(n=this._activeProviderReplies)||void 0===n?void 0:n.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,t){const i=new Set;for(let s=0;s<t.size;s++){const r=t.get(s);if(r)for(let t=0;t<r.length;t++){const s=r[t],n=s.link.range.start.y<e?0:s.link.range.start.x,o=s.link.range.end.y>e?this._bufferService.cols:s.link.range.end.x;for(let e=n;e<=o;e++){if(i.has(e)){r.splice(t--,1);break}i.add(e)}}}}_checkLinkProviderResult(e,t,i){var s;if(!this._activeProviderReplies)return i;const r=this._activeProviderReplies.get(e);let n=!1;for(let t=0;t<e;t++)this._activeProviderReplies.has(t)&&!this._activeProviderReplies.get(t)||(n=!0);if(!n&&r){const e=r.find((e=>this._linkAtPosition(e.link,t)));e&&(i=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviders.length&&!i)for(let e=0;e<this._activeProviderReplies.size;e++){const r=null===(s=this._activeProviderReplies.get(e))||void 0===s?void 0:s.find((e=>this._linkAtPosition(e.link,t)));if(r){i=!0,this._handleNewLink(r);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._element&&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,(0,a.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||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 e,t;return null===(t=null===(e=this._currentLink)||void 0===e?void 0:e.state)||void 0===t?void 0:t.decorations.pointerCursor},set:e=>{var t,i;(null===(t=this._currentLink)||void 0===t?void 0:t.state)&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&(null===(i=this._element)||void 0===i||i.classList.toggle("xterm-cursor-pointer",e)))}},underline:{get:()=>{var e,t;return null===(t=null===(e=this._currentLink)||void 0===e?void 0:e.state)||void 0===t?void 0:t.decorations.underline},set:t=>{var i,s,r;(null===(i=this._currentLink)||void 0===i?void 0:i.state)&&(null===(r=null===(s=this._currentLink)||void 0===s?void 0:s.state)||void 0===r?void 0:r.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{const t=0===e.start?0:e.start+1+this._bufferService.buffer.ydisp;this._clearCurrentLink(t,e.end+1+this._bufferService.buffer.ydisp)}))))}_linkHover(e,t,i){var s;(null===(s=this._currentLink)||void 0===s?void 0:s.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(i,t.text)}_fireUnderlineEvent(e,t){const i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){var s;(null===(s=this._currentLink)||void 0===s?void 0:s.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(i,t.text)}_linkAtPosition(e,t){const i=e.range.start.y===e.range.end.y,s=e.range.start.y<t.y,r=e.range.end.y>t.y;return(i&&e.range.start.x<=t.x&&e.range.end.x>=t.x||s&&e.range.end.x>=t.x||r&&e.range.start.x<=t.x||s&&r)&&e.range.start.y<=t.y&&e.range.end.y>=t.y}_positionFromMouseEvent(e,t,i){const s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};c=s([r(0,n.IBufferService)],c),t.Linkifier2=c},9042:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},2962:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const n=i(511),o=i(2585);let a=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){var i;const s=this._bufferService.buffer.lines.get(e-1);if(!s)return void t(void 0);const r=[],o=this._optionsService.rawOptions.linkHandler,a=new n.CellData,c=s.getTrimmedLength();let l=-1,d=-1,_=!1;for(let t=0;t<c;t++)if(-1!==d||s.hasContent(t)){if(s.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(-1===d){d=t,l=a.extended.urlId;continue}_=a.extended.urlId!==l}else-1!==d&&(_=!0);if(_||-1!==d&&t===c-1){const s=null===(i=this._oscLinkService.getLinkData(l))||void 0===i?void 0:i.uri;if(s){const i={start:{x:d+1,y:e},end:{x:t+(_||t!==c-1?0:1),y:e}};r.push({text:s,range:i,activate:(e,t)=>o?o.activate(e,t,i):h(0,t),hover:(e,t)=>{var s;return null===(s=null==o?void 0:o.hover)||void 0===s?void 0:s.call(o,e,t,i)},leave:(e,t)=>{var s;return null===(s=null==o?void 0:o.leave)||void 0===s?void 0:s.call(o,e,t,i)}})}_=!1,a.hasExtendedAttrs()&&a.extended.urlId?(d=t,l=a.extended.urlId):(d=-1,l=-1)}}t(r)}};function h(e,t){if(confirm(`Do you want to navigate to ${t}?`)){const e=window.open();if(e){try{e.opener=null}catch(e){}e.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}a=s([r(0,o.IBufferService),r(1,o.IOptionsService),r(2,o.IOscLinkService)],a),t.OscLinkProvider=a},6193:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._parentWindow=e,this._renderCallback=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return void this._runRefreshCallbacks();const 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(const e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},5596:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenDprMonitor=void 0;const s=i(844);class r extends s.Disposable{constructor(e){super(),this._parentWindow=e,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio}setListener(e){this._listener&&this.clearListener(),this._listener=e,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}dispose(){super.dispose(),this.clearListener()}_updateDpr(){var e;this._outerListener&&(null===(e=this._resolutionMediaMatchList)||void 0===e||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._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}t.ScreenDprMonitor=r},3236:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;const s=i(2950),r=i(1680),n=i(3614),o=i(2584),a=i(5435),h=i(9312),c=i(6114),l=i(3656),d=i(9042),_=i(4567),u=i(1296),f=i(7399),v=i(8460),g=i(8437),p=i(5680),S=i(3230),m=i(4725),C=i(428),b=i(8934),y=i(6465),w=i(5114),E=i(8969),L=i(8055),R=i(4269),k=i(5941),D=i(3107),A=i(5744),x=i(9074),B=i(2585),T=i(2962),M="undefined"!=typeof window?window.document:null;class O extends E.CoreTerminal{constructor(e={}){super(e),this.browser=c,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._onCursorMove=new v.EventEmitter,this._onKey=new v.EventEmitter,this._onRender=new v.EventEmitter,this._onSelectionChange=new v.EventEmitter,this._onTitleChange=new v.EventEmitter,this._onBell=new v.EventEmitter,this._onFocus=new v.EventEmitter,this._onBlur=new v.EventEmitter,this._onA11yCharEmitter=new v.EventEmitter,this._onA11yTabEmitter=new v.EventEmitter,this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(y.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(T.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(x.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((e,t)=>this.refresh(e,t)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((e=>this._reportWindowsOptions(e)))),this.register(this._inputHandler.onColor((e=>this._handleColorEvent(e)))),this.register((0,v.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,v.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((e=>this._afterResize(e.cols,e.rows))))}get onCursorMove(){return this._onCursorMove.event}get onKey(){return this._onKey.event}get onRender(){return this._onRender.event}get onSelectionChange(){return this._onSelectionChange.event}get onTitleChange(){return this._onTitleChange.event}get onBell(){return this._onBell.event}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}_handleColorEvent(e){var t,i;if(this._colorManager){for(const t of e){let e,i="";switch(t.index){case 256:e="foreground",i="10";break;case 257:e="background",i="11";break;case 258:e="cursor",i="12";break;default:e="ansi",i="4;"+t.index}switch(t.type){case 0:const s=L.color.toColorRGB("ansi"===e?this._colorManager.colors.ansi[t.index]:this._colorManager.colors[e]);this.coreService.triggerDataEvent(`${o.C0.ESC}]${i};${(0,k.toRgbString)(s)}${o.C1_ESCAPED.ST}`);break;case 1:"ansi"===e?this._colorManager.colors.ansi[t.index]=L.rgba.toColor(...t.color):this._colorManager.colors[e]=L.rgba.toColor(...t.color);break;case 2:this._colorManager.restoreColor(t.index)}}null===(t=this._renderService)||void 0===t||t.setColors(this._colorManager.colors),null===(i=this.viewport)||void 0===i||i.onThemeChange(this._colorManager.colors)}}dispose(){var e,t,i;this._isDisposed||(super.dispose(),null===(e=this._renderService)||void 0===e||e.dispose(),this._customKeyEventHandler=void 0,this.write=()=>{},null===(i=null===(t=this.element)||void 0===t?void 0:t.parentNode)||void 0===i||i.removeChild(this.element))}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_updateOptions(e){var t,i,s,r;switch(super._updateOptions(e),e){case"fontFamily":case"fontSize":null===(t=this._renderService)||void 0===t||t.clear(),null===(i=this._charSizeService)||void 0===i||i.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"customGlyphs":case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"scrollback":null===(s=this.viewport)||void 0===s||s.syncScrollArea();break;case"screenReaderMode":this.optionsService.rawOptions.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new _.AccessibilityManager(this,this._renderService)):(null===(r=this._accessibilityManager)||void 0===r||r.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.rawOptions.theme)}}_onTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(o.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return null===(e=this.textarea)||void 0===e?void 0:e.blur()}_onTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(o.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;const i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.actualCellHeight,r=t.getWidth(i),n=this._renderService.dimensions.actualCellWidth*r,o=this.buffer.y*this._renderService.dimensions.actualCellHeight,a=i*this._renderService.dimensions.actualCellWidth;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,l.addDisposableDomListener)(this.element,"copy",(e=>{this.hasSelection()&&(0,n.copyHandler)(e,this._selectionService)})));const e=e=>(0,n.handlePasteEvent)(e,this.textarea,this.coreService);this.register((0,l.addDisposableDomListener)(this.textarea,"paste",e)),this.register((0,l.addDisposableDomListener)(this.element,"paste",e)),c.isFirefox?this.register((0,l.addDisposableDomListener)(this.element,"mousedown",(e=>{2===e.button&&(0,n.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,l.addDisposableDomListener)(this.element,"contextmenu",(e=>{(0,n.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),c.isLinux&&this.register((0,l.addDisposableDomListener)(this.element,"auxclick",(e=>{1===e.button&&(0,n.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,l.addDisposableDomListener)(this.textarea,"keyup",(e=>this._keyUp(e)),!0)),this.register((0,l.addDisposableDomListener)(this.textarea,"keydown",(e=>this._keyDown(e)),!0)),this.register((0,l.addDisposableDomListener)(this.textarea,"keypress",(e=>this._keyPress(e)),!0)),this.register((0,l.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,l.addDisposableDomListener)(this.textarea,"compositionupdate",(e=>this._compositionHelper.compositionupdate(e)))),this.register((0,l.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,l.addDisposableDomListener)(this.textarea,"input",(e=>this._inputEvent(e)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(e){var t;if(!e)throw new Error("Terminal requires a parent element.");e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=e.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),e.appendChild(this.element);const i=M.createDocumentFragment();this._viewportElement=M.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this._viewportScrollArea=M.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=M.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=M.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement),this.textarea=M.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),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((0,l.addDisposableDomListener)(this.textarea,"focus",(e=>this._onTextAreaFocus(e)))),this.register((0,l.addDisposableDomListener)(this.textarea,"blur",(()=>this._onTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._coreBrowserService=this._instantiationService.createInstance(w.CoreBrowserService,this.textarea,null!==(t=this._document.defaultView)&&void 0!==t?t:window),this._instantiationService.setService(m.ICoreBrowserService,this._coreBrowserService),this._charSizeService=this._instantiationService.createInstance(C.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(m.ICharSizeService,this._charSizeService),this._theme=this.options.theme||this._theme,this._colorManager=new p.ColorManager(M,this.options.allowTransparency),this.register(this.optionsService.onOptionChange((e=>this._colorManager.onOptionsChange(e,this.optionsService.rawOptions[e])))),this._colorManager.setTheme(this._theme),this._characterJoinerService=this._instantiationService.createInstance(R.CharacterJoinerService),this._instantiationService.setService(m.ICharacterJoinerService,this._characterJoinerService);const n=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(S.RenderService,n,this.rows,this.screenElement)),this._instantiationService.setService(m.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((e=>this._onRender.fire(e)))),this.onResize((e=>this._renderService.resize(e.cols,e.rows))),this._compositionView=M.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(i),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(m.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(r.Viewport,(e=>this.scrollLines(e,!0,1)),this._viewportElement,this._viewportScrollArea,this.element),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.onCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.onResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.onBlur()))),this.register(this.onFocus((()=>this._renderService.onFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(h.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(m.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((e=>this._renderService.onSelectionChanged(e.start,e.end,e.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(D.BufferDecorationRenderer,this.screenElement)),this.register((0,l.addDisposableDomListener)(this.element,"mousedown",(e=>this._selectionService.onMouseDown(e)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new _.AccessibilityManager(this,this._renderService)),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onOptionChange((()=>{!this._overviewRulerRenderer&&this.options.overviewRulerWidth&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(u.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier2)}_setTheme(e){var t,i,s;this._theme=e,null===(t=this._colorManager)||void 0===t||t.setTheme(e),null===(i=this._renderService)||void 0===i||i.setColors(this._colorManager.colors),null===(s=this.viewport)||void 0===s||s.onThemeChange(this._colorManager.colors)}bindMouse(){const e=this,t=this.element;function i(t){const i=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!i)return!1;let s,r;switch(t.overrideType||t.type){case"mousemove":r=32,void 0===t.buttons?(s=3,void 0!==t.button&&(s=t.button<3?t.button:3)):s=1&t.buttons?0:4&t.buttons?1:2&t.buttons?2:3;break;case"mouseup":r=0,s=t.button<3?t.button:3;break;case"mousedown":r=1,s=t.button<3?t.button:3;break;case"wheel":if(0===e.viewport.getLinesScrolled(t))return!1;r=t.deltaY<0?0:1,s=4;break;default:return!1}return!(void 0===r||void 0===s||s>4)&&e.coreMouseService.triggerMouseEvent({col:i.col,row:i.row,x:i.x,y:i.y,button:s,action:r,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}const s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:e=>(i(e),e.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(e)),wheel:e=>(i(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&i(e)},mousemove:e=>{e.buttons||i(e)}};this.register(this.coreMouseService.onProtocolChange((e=>{e?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(e)),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()),8&e?s.mousemove||(t.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),16&e?s.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),2&e?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),4&e?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,l.addDisposableDomListener)(t,"mousedown",(e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return i(e),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(e)}))),this.register((0,l.addDisposableDomListener)(t,"wheel",(e=>{if(!s.wheel){if(!this.buffer.hasScrollback){const t=this.viewport.getLinesScrolled(e);if(0===t)return;const i=o.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(e.deltaY<0?"A":"B");let s="";for(let e=0;e<Math.abs(t);e++)s+=i;return this.coreService.triggerDataEvent(s,!0),this.cancel(e,!0)}return this.viewport.onWheel(e)?this.cancel(e):void 0}}),{passive:!1})),this.register((0,l.addDisposableDomListener)(t,"touchstart",(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.onTouchStart(e),this.cancel(e)}),{passive:!0})),this.register((0,l.addDisposableDomListener)(t,"touchmove",(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.onTouchMove(e)?void 0:this.cancel(e)}),{passive:!1}))}refresh(e,t){var i;null===(i=this._renderService)||void 0===i||i.refreshRows(e,t)}updateCursorStyle(e){var t;(null===(t=this._selectionService)||void 0===t?void 0: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,i=0){super.scrollLines(e,t,i),this.refresh(0,this.rows-1)}paste(e){(0,n.paste)(e,this.textarea,this.coreService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}registerLinkProvider(e){return this.linkifier2.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const 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}addMarker(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}select(e,t,i){this._selectionService.setSelection(e,t,i)}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;null===(e=this._selectionService)||void 0===e||e.clearSelection()}selectAll(){var e;null===(e=this._selectionService)||void 0===e||e.selectAll()}selectLines(e,t){var i;null===(i=this._selectionService)||void 0===i||i.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;const t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.buffer.ybase!==this.buffer.ydisp&&this._bufferService.scrollToBottom(),!1;t||"Dead"!==e.key&&"AltGraph"!==e.key||(this._unprocessedDeadKey=!0);const i=(0,f.evaluateKeyboardEvent)(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===i.type||2===i.type){const t=this.rows-1;return this.scrollLines(2===i.type?-t:t),this.cancel(e,!0)}return 1===i.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key||!!(e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&1===e.key.length&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(i.key!==o.C0.ETX&&i.key!==o.C0.CR||(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),this.optionsService.rawOptions.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(e,!0))))}_isThirdLevelShift(e,t){const i=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"keypress"===t.type?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(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&&"insertText"===e.inputType&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){var i,s;null===(i=this._charSizeService)||void 0===i||i.measure(),null===(s=this.viewport)||void 0===s||s.syncScrollArea(!0)}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){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(g.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire({position:this.buffer.ydisp,source:0})}}reset(){var e,t;this.options.rows=this.rows,this.options.cols=this.cols;const i=this._customKeyEventHandler;this._setup(),super.reset(),null===(e=this._selectionService)||void 0===e||e.reset(),this._decorationService.reset(),this._customKeyEventHandler=i,this.refresh(0,this.rows-1),null===(t=this.viewport)||void 0===t||t.syncScrollArea()}clearTextureAtlas(){var e;null===(e=this._renderService)||void 0===e||e.clearTextureAtlas()}_reportFocus(){var e;(null===(e=this.element)||void 0===e?void 0:e.classList.contains("focus"))?this.coreService.triggerDataEvent(o.C0.ESC+"[I"):this.coreService.triggerDataEvent(o.C0.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case a.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const e=this._renderService.dimensions.canvasWidth.toFixed(0),t=this._renderService.dimensions.canvasHeight.toFixed(0);this.coreService.triggerDataEvent(`${o.C0.ESC}[4;${t};${e}t`);break;case a.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const i=this._renderService.dimensions.actualCellWidth.toFixed(0),s=this._renderService.dimensions.actualCellHeight.toFixed(0);this.coreService.triggerDataEvent(`${o.C0.ESC}[6;${s};${i}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}}t.Terminal=O},9924:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t;const s=Date.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){const e=s-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),t)}}_innerRefresh(){if(void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return;const 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)}}},1680:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;const n=i(844),o=i(3656),a=i(4725),h=i(2585);let c=class extends n.Disposable{constructor(e,t,i,s,r,n,a,h,c){super(),this._scrollLines=e,this._viewportElement=t,this._scrollArea=i,this._element=s,this._bufferService=r,this._optionsService=n,this._charSizeService=a,this._renderService=h,this._coreBrowserService=c,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentScaledCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,o.addDisposableDomListener)(this._viewportElement,"scroll",this._onScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((e=>this._renderDimensions=e))),setTimeout((()=>this.syncScrollArea()),0)}onThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}_refresh(e){if(e)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/this._coreBrowserService.dpr,this._currentScaledCellHeight=this._renderService.dimensions.scaledCellHeight,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.scaledCellHeight===this._currentScaledCellHeight||this._refresh(e)}_onScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._scrollLines(0);const t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(t)}_smoothScroll(){if(this._isDisposed||-1===this._smoothScrollState.origin||-1===this._smoothScrollState.target)return;const e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&0!==this._viewportElement.scrollTop||t>0&&i<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}onWheel(e){const t=this._getPixelsScrolled(e);return 0!==t&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,-1===this._smoothScrollState.target?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}_getPixelsScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getLinesScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){const i=this._optionsService.rawOptions.fastScrollModifier;return"alt"===i&&t.altKey||"ctrl"===i&&t.ctrlKey||"shift"===i&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}onTouchStart(e){this._lastTouchY=e.touches[0].pageY}onTouchMove(e){const t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}};c=s([r(4,h.IBufferService),r(5,h.IOptionsService),r(6,a.ICharSizeService),r(7,a.IRenderService),r(8,a.ICoreBrowserService)],c),t.Viewport=c},3107:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;const n=i(3656),o=i(4725),a=i(844),h=i(2585);let c=class extends a.Disposable{constructor(e,t,i,s){super(),this._screenElement=e,this._bufferService=t,this._decorationService=i,this._renderService=s,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._queueRefresh()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register((0,n.addDisposableDomListener)(window,"resize",(()=>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((e=>this._removeDecoration(e))))}dispose(){this._container.remove(),this._decorationElements.clear(),super.dispose()}_queueRefresh(){void 0===this._animationFrame&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this.refreshDecorations(),this._animationFrame=void 0})))}refreshDecorations(){for(const e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var t;const i=document.createElement("div");i.classList.add("xterm-decoration"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.actualCellWidth)}px`,i.style.height=(e.options.height||1)*this._renderService.dimensions.actualCellHeight+"px",i.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.actualCellHeight+"px",i.style.lineHeight=`${this._renderService.dimensions.actualCellHeight}px`;const s=null!==(t=e.options.x)&&void 0!==t?t:0;return s&&s>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){const 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 i=this._decorationElements.get(e);i||(e.onDispose((()=>this._removeDecoration(e))),i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i)),i.style.top=t*this._renderService.dimensions.actualCellHeight+"px",i.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){var i;if(!t)return;const s=null!==(i=e.options.x)&&void 0!==i?i:0;"right"===(e.options.anchor||"left")?t.style.right=s?s*this._renderService.dimensions.actualCellWidth+"px":"":t.style.left=s?s*this._renderService.dimensions.actualCellWidth+"px":""}_removeDecoration(e){var t;null===(t=this._decorationElements.get(e))||void 0===t||t.remove(),this._decorationElements.delete(e)}};c=s([r(1,h.IBufferService),r(2,h.IDecorationService),r(3,o.IRenderService)],c),t.BufferDecorationRenderer=c},5871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=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(const 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))return void this._addLineToZone(t,e.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return 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,void this._zones.push(this._zonePool[this._zonePoolIndex++]);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,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;const n=i(5871),o=i(3656),a=i(4725),h=i(844),c=i(2585),l={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let u=class extends h.Disposable{constructor(e,t,i,s,r,o,a){var h;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=r,this._optionsService=o,this._coreBrowseService=a,this._colorZoneStore=new n.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),null===(h=this._viewportElement.parentElement)||void 0===h||h.insertBefore(this._canvas,this._viewportElement);const c=this._canvas.getContext("2d");if(!c)throw new Error("Ctx cannot be null");this._ctx=c,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners()}get _width(){return this._optionsService.options.overviewRulerWidth||0}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){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())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onOptionChange((e=>{"overviewRulerWidth"===e&&this._queueRefresh(!0)}))),this.register((0,o.addDisposableDomListener)(this._coreBrowseService.window,"resize",(()=>{this._queueRefresh(!0)}))),this._queueRefresh(!0)}dispose(){var e;null===(e=this._canvas)||void 0===e||e.remove(),super.dispose()}_refreshDrawConstants(){const e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=e,d.center=t,d.right=e,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=d.left,_.right=d.left+d.center}_refreshDrawHeightConstants(){l.full=Math.round(2*this._coreBrowseService.dpr);const e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowseService.dpr);l.left=t,l.center=t,l.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.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._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.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(const e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1;const e=this._colorZoneStore.zones;for(const t of e)"full"!==t.position&&this._renderColorZone(t);for(const t of e)"full"===t.position&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(_[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-l[e.position||"full"]/2),d[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+l[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,void 0===this._animationFrame&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};u=s([r(2,c.IBufferService),r(3,c.IDecorationService),r(4,a.IRenderService),r(5,c.IOptionsService),r(6,a.ICoreBrowserService)],u),t.OverviewRulerRenderer=u},2950:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;const n=i(4725),o=i(2585),a=i(2584);let h=class{constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=n,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(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let t;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}}),0)}else{this._isSendingComposition=!1;const e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){const e=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${a.C0.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}}),0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.actualCellHeight,i=this._bufferService.buffer.y*this._renderService.dimensions.actualCellHeight,s=e*this._renderService.dimensions.actualCellWidth;this._compositionView.style.left=s+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=t+"px",this._compositionView.style.lineHeight=t+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const r=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(r.width,1)+"px",this._textarea.style.height=Math.max(r.height,1)+"px",this._textarea.style.lineHeight=r.height+"px"}e||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};h=s([r(2,o.IBufferService),r(3,o.IOptionsService),r(4,o.ICoreService),r(5,n.IRenderService)],h),t.CompositionHelper=h},9806:(e,t)=>{function i(e,t,i){const s=i.getBoundingClientRect(),r=e.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),o=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-s.left-n,t.clientY-s.top-o]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=i,t.getCoords=function(e,t,s,r,n,o,a,h,c){if(!o)return;const l=i(e,t,s);return l?(l[0]=Math.ceil((l[0]+(c?a/2:0))/a),l[1]=Math.ceil(l[1]/h),l[0]=Math.min(Math.max(l[0],1),r+(c?1:0)),l[1]=Math.min(Math.max(l[1],1),n),l):void 0}},9504:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;const s=i(2584);function r(e,t,i,s){const r=e-n(i,e),a=t-n(i,t),l=Math.abs(r-a)-function(e,t,i){let s=0;const r=e-n(i,e),a=t-n(i,t);for(let n=0;n<Math.abs(r-a);n++){const a="A"===o(e,t)?-1:1,h=i.buffer.lines.get(r+a*n);(null==h?void 0:h.isWrapped)&&s++}return s}(e,t,i);return c(l,h(o(e,t),s))}function n(e,t){let i=0,s=e.buffer.lines.get(t),r=null==s?void 0:s.isWrapped;for(;r&&t>=0&&t<e.rows;)i++,s=e.buffer.lines.get(--t),r=null==s?void 0:s.isWrapped;return i}function o(e,t){return e>t?"A":"B"}function a(e,t,i,s,r,n){let o=e,a=t,h="";for(;o!==i||a!==s;)o+=r?1:-1,r&&o>n.cols-1?(h+=n.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!r&&o<0&&(h+=n.buffer.translateBufferLineToString(a,!1,0,e+1),o=n.cols-1,e=o,a--);return h+n.buffer.translateBufferLineToString(a,!1,e,o)}function h(e,t){const i=t?"O":"[";return s.C0.ESC+i+e}function c(e,t){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=t;return i}t.moveToCellSequence=function(e,t,i,s){const o=i.buffer.x,l=i.buffer.y;if(!i.buffer.hasScrollback)return function(e,t,i,s,o,l){return 0===r(t,s,o,l).length?"":c(a(e,t,e,t-n(o,t),!1,o).length,h("D",l))}(o,l,0,t,i,s)+r(l,t,i,s)+function(e,t,i,s,o,l){let d;d=r(t,s,o,l).length>0?s-n(o,s):t;const _=s,u=function(e,t,i,s,o,a){let h;return h=r(i,s,o,a).length>0?s-n(o,s):t,e<i&&h<=s||e>=i&&h<s?"C":"D"}(e,t,i,s,o,l);return c(a(e,d,i,_,"C"===u,o).length,h(u,l))}(o,l,e,t,i,s);let d;if(l===t)return d=o>e?"D":"C",c(Math.abs(o-e),h(d,s));d=l>t?"D":"C";const _=Math.abs(l-t);return c(function(e,t){return t.cols-e}(l>t?e:o,i)+(_-1)*i.cols+1+((l>t?o:e)-1),h(d,s))}},8036:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const s=i(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=s.isFirefox||s.isLegacyEdge?"bottom":"ideographic"},1752:(e,t)=>{function i(e){return 57508<=e&&e<=57558}Object.defineProperty(t,"__esModule",{value:!0}),t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e},t.isPowerlineGlyph=i,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.excludeFromContrastRatioDemands=function(e){return i(e)||function(e){return 9472<=e&&e<=9631}(e)}},1296:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;const n=i(3787),o=i(8036),a=i(844),h=i(4725),c=i(2585),l=i(8460),d=i(8055),_=i(9631),u="xterm-dom-renderer-owner-",f="xterm-focus";let v=1,g=class extends a.Disposable{constructor(e,t,i,s,r,o,a,h,c,l){super(),this._colors=e,this._element=t,this._screenElement=i,this._viewportElement=s,this._linkifier2=r,this._charSizeService=a,this._optionsService=h,this._bufferService=c,this._coreBrowserService=l,this._terminalClass=v++,this._rowElements=[],this._rowContainer=document.createElement("div"),this._rowContainer.classList.add("xterm-rows"),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add("xterm-selection"),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},this._updateDimensions(),this._injectCss(),this._rowFactory=o.createInstance(n.DomRendererRowFactory,document,this._colors),this._element.classList.add(u+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((e=>this._onLinkHover(e)))),this.register(this._linkifier2.onHideLinkUnderline((e=>this._onLinkLeave(e))))}get onRequestRedraw(){return(new l.EventEmitter).event}dispose(){this._element.classList.remove(u+this._terminalClass),(0,_.removeElementFromParent)(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),super.dispose()}_updateDimensions(){const e=this._coreBrowserService.dpr;this.dimensions.scaledCharWidth=this._charSizeService.width*e,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*e),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.rawOptions.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/e),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/e),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(const e of this._rowElements)e.style.width=`${this.dimensions.canvasWidth}px`,e.style.height=`${this.dimensions.actualCellHeight}px`,e.style.lineHeight=`${this.dimensions.actualCellHeight}px`,e.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const t=`${this._terminalSelector} .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: ${this.dimensions.actualCellWidth}px}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.canvasWidth}px`,this._screenElement.style.height=`${this.dimensions.canvasHeight}px`}setColors(e){this._colors=e,this._injectCss()}_injectCss(){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let e=`${this._terminalSelector} .xterm-rows { color: ${this._colors.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px;}`;e+=`${this._terminalSelector} span:not(.${n.BOLD_CLASS}) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.${n.BOLD_CLASS} { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.${n.ITALIC_CLASS} { font-style: italic;}`,e+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",e+="@keyframes blink_block_"+this._terminalClass+" { 0% {"+` background-color: ${this._colors.cursor.css};`+` color: ${this._colors.cursorAccent.css}; } 50% {`+` background-color: ${this._colors.cursorAccent.css};`+` color: ${this._colors.cursor.css}; }}`,e+=`${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${n.CURSOR_CLASS}.${n.CURSOR_STYLE_BLOCK_CLASS} { outline: 1px solid ${this._colors.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .xterm-rows.xterm-focus .${n.CURSOR_CLASS}.${n.CURSOR_BLINK_CLASS}:not(.${n.CURSOR_STYLE_BLOCK_CLASS}) { animation: blink_box_shadow_`+this._terminalClass+" 1s step-end infinite;}"+`${this._terminalSelector} .xterm-rows.xterm-focus .${n.CURSOR_CLASS}.${n.CURSOR_BLINK_CLASS}.${n.CURSOR_STYLE_BLOCK_CLASS} { animation: blink_block_`+this._terminalClass+" 1s step-end infinite;}"+`${this._terminalSelector} .xterm-rows.xterm-focus .${n.CURSOR_CLASS}.${n.CURSOR_STYLE_BLOCK_CLASS} {`+` background-color: ${this._colors.cursor.css};`+` color: ${this._colors.cursorAccent.css};}`+`${this._terminalSelector} .xterm-rows .${n.CURSOR_CLASS}.${n.CURSOR_STYLE_BAR_CLASS} {`+` box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${this._colors.cursor.css} inset;}`+`${this._terminalSelector} .xterm-rows .${n.CURSOR_CLASS}.${n.CURSOR_STYLE_UNDERLINE_CLASS} {`+` box-shadow: 0 -1px 0 ${this._colors.cursor.css} inset;}`,e+=`${this._terminalSelector} .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .xterm-selection div { position: absolute; background-color: ${this._colors.selectionBackgroundOpaque.css};}${this._terminalSelector} .xterm-selection div { position: absolute; background-color: ${this._colors.selectionInactiveBackgroundOpaque.css};}`,this._colors.ansi.forEach(((t,i)=>{e+=`${this._terminalSelector} .xterm-fg-${i} { color: ${t.css}; }${this._terminalSelector} .xterm-bg-${i} { background-color: ${t.css}; }`})),e+=`${this._terminalSelector} .xterm-fg-${o.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(this._colors.background).css}; }${this._terminalSelector} .xterm-bg-${o.INVERTED_DEFAULT_COLOR} { background-color: ${this._colors.foreground.css}; }`,this._themeStyleElement.textContent=e}onDevicePixelRatioChange(){this._updateDimensions()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){const e=document.createElement("div");this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}onResize(e,t){this._refreshRowElements(e,t),this._updateDimensions()}onCharSizeChanged(){this._updateDimensions()}onBlur(){this._rowContainer.classList.remove(f)}onFocus(){this._rowContainer.classList.add(f)}onSelectionChanged(e,t,i){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(this._rowFactory.onSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t)return;const s=e[1]-this._bufferService.buffer.ydisp,r=t[1]-this._bufferService.buffer.ydisp,n=Math.max(s,0),o=Math.min(r,this._bufferService.rows-1);if(n>=this._bufferService.rows||o<0)return;const a=document.createDocumentFragment();if(i){const i=e[0]>t[0];a.appendChild(this._createSelectionElement(n,i?t[0]:e[0],i?e[0]:t[0],o-n+1))}else{const i=s===n?e[0]:0,h=n===r?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(n,i,h));const c=o-n-1;if(a.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,c)),n!==o){const e=r===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,i,s=1){const r=document.createElement("div");return r.style.height=s*this.dimensions.actualCellHeight+"px",r.style.top=e*this.dimensions.actualCellHeight+"px",r.style.left=t*this.dimensions.actualCellWidth+"px",r.style.width=this.dimensions.actualCellWidth*(i-t)+"px",r}onCursorMove(){}onOptionsChanged(){this._updateDimensions(),this._injectCss()}clear(){for(const e of this._rowElements)e.innerText=""}renderRows(e,t){const i=this._bufferService.buffer.ybase+this._bufferService.buffer.y,s=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._optionsService.rawOptions.cursorBlink;for(let n=e;n<=t;n++){const e=this._rowElements[n];e.innerText="";const t=n+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.lines.get(t),a=this._optionsService.rawOptions.cursorStyle;e.appendChild(this._rowFactory.createRow(o,t,t===i,a,s,r,this.dimensions.actualCellWidth,this._bufferService.cols))}}get _terminalSelector(){return`.${u}${this._terminalClass}`}_onLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_onLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,s,r,n){for(;e!==t||i!==s;){const t=this._rowElements[i];if(!t)return;const s=t.children[e];s&&(s.style.textDecoration=n?"underline":"none"),++e>=r&&(e=0,i++)}}};g=s([r(5,c.IInstantiationService),r(6,h.ICharSizeService),r(7,c.IOptionsService),r(8,c.IBufferService),r(9,h.ICoreBrowserService)],g),t.DomRenderer=g},3787:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=t.CURSOR_STYLE_UNDERLINE_CLASS=t.CURSOR_STYLE_BAR_CLASS=t.CURSOR_STYLE_BLOCK_CLASS=t.CURSOR_BLINK_CLASS=t.CURSOR_CLASS=t.STRIKETHROUGH_CLASS=t.UNDERLINE_CLASS=t.ITALIC_CLASS=t.DIM_CLASS=t.BOLD_CLASS=void 0;const n=i(8036),o=i(643),a=i(511),h=i(2585),c=i(8055),l=i(4725),d=i(4269),_=i(1752),u=i(3734);t.BOLD_CLASS="xterm-bold",t.DIM_CLASS="xterm-dim",t.ITALIC_CLASS="xterm-italic",t.UNDERLINE_CLASS="xterm-underline",t.STRIKETHROUGH_CLASS="xterm-strikethrough",t.CURSOR_CLASS="xterm-cursor",t.CURSOR_BLINK_CLASS="xterm-cursor-blink",t.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",t.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",t.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";let f=class{constructor(e,t,i,s,r,n,o){this._document=e,this._colors=t,this._characterJoinerService=i,this._optionsService=s,this._coreBrowserService=r,this._coreService=n,this._decorationService=o,this._workCell=new a.CellData,this._columnSelectMode=!1}setColors(e){this._colors=e}onSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,i,s,r,a,h,l,_){const f=this._document.createDocumentFragment(),g=this._characterJoinerService.getJoinedCharacters(i);let p=0;for(let t=Math.min(e.length,_)-1;t>=0;t--)if(e.loadCell(t,this._workCell).getCode()!==o.NULL_CELL_CODE||s&&t===a){p=t+1;break}for(let _=0;_<p;_++){e.loadCell(_,this._workCell);let p=this._workCell.getWidth();if(0===p)continue;let S=!1,m=_,C=this._workCell;if(g.length>0&&_===g[0][0]){S=!0;const t=g.shift();C=new d.JoinedCellData(this._workCell,e.translateToString(!0,t[0],t[1]),t[1]-t[0]),m=t[1]-1,p=C.getWidth()}const b=this._document.createElement("span");if(p>1&&(b.style.width=l*p+"px"),S&&(b.style.display="inline",a>=_&&a<=m&&(a=_)),!this._coreService.isCursorHidden&&s&&_===a)switch(b.classList.add(t.CURSOR_CLASS),h&&b.classList.add(t.CURSOR_BLINK_CLASS),r){case"bar":b.classList.add(t.CURSOR_STYLE_BAR_CLASS);break;case"underline":b.classList.add(t.CURSOR_STYLE_UNDERLINE_CLASS);break;default:b.classList.add(t.CURSOR_STYLE_BLOCK_CLASS)}if(C.isBold()&&b.classList.add(t.BOLD_CLASS),C.isItalic()&&b.classList.add(t.ITALIC_CLASS),C.isDim()&&b.classList.add(t.DIM_CLASS),C.isInvisible()?b.textContent=o.WHITESPACE_CELL_CHAR:b.textContent=C.getChars()||o.WHITESPACE_CELL_CHAR,C.isUnderline()&&(b.classList.add(`${t.UNDERLINE_CLASS}-${C.extended.underlineStyle}`)," "===b.textContent&&(b.innerHTML=" "),!C.isUnderlineColorDefault()))if(C.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${u.AttributeData.toColorRGB(C.getUnderlineColor()).join(",")})`;else{let e=C.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&C.isBold()&&e<8&&(e+=8),b.style.textDecorationColor=this._colors.ansi[e].css}C.isStrikethrough()&&b.classList.add(t.STRIKETHROUGH_CLASS);let y=C.getFgColor(),w=C.getFgColorMode(),E=C.getBgColor(),L=C.getBgColorMode();const R=!!C.isInverse();if(R){const e=y;y=E,E=e;const t=w;w=L,L=t}let k,D,A=!1;this._decorationService.forEachDecorationAtCell(_,i,void 0,(e=>{"top"!==e.options.layer&&A||(e.backgroundColorRGB&&(L=50331648,E=e.backgroundColorRGB.rgba>>8&16777215,k=e.backgroundColorRGB),e.foregroundColorRGB&&(w=50331648,y=e.foregroundColorRGB.rgba>>8&16777215,D=e.foregroundColorRGB),A="top"===e.options.layer)}));const x=this._isCellInSelection(_,i);let B;switch(A||this._colors.selectionForeground&&x&&(w=50331648,y=this._colors.selectionForeground.rgba>>8&16777215,D=this._colors.selectionForeground),x&&(k=this._coreBrowserService.isFocused?this._colors.selectionBackgroundOpaque:this._colors.selectionInactiveBackgroundOpaque,A=!0),A&&b.classList.add("xterm-decoration-top"),L){case 16777216:case 33554432:B=this._colors.ansi[E],b.classList.add(`xterm-bg-${E}`);break;case 50331648:B=c.rgba.toColor(E>>16,E>>8&255,255&E),this._addStyle(b,`background-color:#${v((E>>>0).toString(16),"0",6)}`);break;default:R?(B=this._colors.foreground,b.classList.add(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):B=this._colors.background}switch(k||C.isDim()&&(k=c.color.multiplyOpacity(B,.5)),w){case 16777216:case 33554432:C.isBold()&&y<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(y+=8),this._applyMinimumContrast(b,B,this._colors.ansi[y],C,k,void 0)||b.classList.add(`xterm-fg-${y}`);break;case 50331648:const e=c.rgba.toColor(y>>16&255,y>>8&255,255&y);this._applyMinimumContrast(b,B,e,C,k,D)||this._addStyle(b,`color:#${v(y.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(b,B,this._colors.foreground,C,k,void 0)||R&&b.classList.add(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}f.appendChild(b),_=m}return f}_applyMinimumContrast(e,t,i,s,r,n){if(1===this._optionsService.rawOptions.minimumContrastRatio||(0,_.excludeFromContrastRatioDemands)(s.getCode()))return!1;let o;return r||n||(o=this._colors.contrastCache.getColor(t.rgba,i.rgba)),void 0===o&&(o=c.color.ensureContrastRatio(r||t,n||i,this._optionsService.rawOptions.minimumContrastRatio),this._colors.contrastCache.setColor((r||t).rgba,(n||i).rgba,null!=o?o:null)),!!o&&(this._addStyle(e,`color:${o.css}`),!0)}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){const i=this._selectionStart,s=this._selectionEnd;return!(!i||!s)&&(this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e<s[0]&&t<=s[1]:e<i[0]&&t>=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t<s[1]||i[1]===s[1]&&t===i[1]&&e>=i[0]&&e<s[0]||i[1]<s[1]&&t===s[1]&&e<s[0]||i[1]<s[1]&&t===i[1]&&e>=i[0])}};function v(e,t,i){for(;e.length<i;)e=t+e;return e}f=s([r(2,l.ICharacterJoinerService),r(3,h.IOptionsService),r(4,l.ICoreBrowserService),r(5,h.ICoreService),r(6,h.IDecorationService)],f),t.DomRendererRowFactory=f},456:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,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.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()){const e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])}onTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;const n=i(2585),o=i(8460);let a=class{constructor(e,t,i){this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=new o.EventEmitter,this._measureStrategy=new h(e,t,this._optionsService)}get hasValidSize(){return this.width>0&&this.height>0}get onCharSizeChange(){return this._onCharSizeChange.event}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};a=s([r(2,n.IOptionsService)],a),t.CharSizeService=a;class h{constructor(e,t,i){this._document=e,this._parentElement=t,this._optionsService=i,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const e=this._measureElement.getBoundingClientRect();return 0!==e.width&&0!==e.height&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result}}},4269:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const n=i(3734),o=i(643),a=i(511),h=i(2585);class c extends n.AttributeData{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}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()]}}t.JoinedCellData=c;let l=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new a.CellData}register(e){const 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(0===this._characterJoiners.length)return[];const t=this._bufferService.buffer.lines.get(e);if(!t||0===t.length)return[];const i=[],s=t.translateToString(!0);let r=0,n=0,a=0,h=t.getFg(0),c=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==h||this._workCell.bg!==c){if(e-r>1){const e=this._getJoinedRanges(s,a,n,t,r);for(let t=0;t<e.length;t++)i.push(e[t])}r=e,a=n,h=this._workCell.fg,c=this._workCell.bg}n+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-r>1){const e=this._getJoinedRanges(s,a,n,t,r);for(let t=0;t<e.length;t++)i.push(e[t])}return i}_getJoinedRanges(t,i,s,r,n){const o=t.substring(i,s);let a=[];try{a=this._characterJoiners[0].handler(o)}catch(e){console.error(e)}for(let t=1;t<this._characterJoiners.length;t++)try{const i=this._characterJoiners[t].handler(o);for(let t=0;t<i.length;t++)e._mergeRanges(a,i[t])}catch(e){console.error(e)}return this._stringRangesToCellRanges(a,r,n),a}_stringRangesToCellRanges(e,t,i){let s=0,r=!1,n=0,a=e[s];if(a){for(let h=i;h<this._bufferService.cols;h++){const i=t.getWidth(h),c=t.getString(h).length||o.WHITESPACE_CELL_CHAR.length;if(0!==i){if(!r&&a[0]<=n&&(a[0]=h,r=!0),a[1]<=n){if(a[1]=h,a=e[++s],!a)break;a[0]<=n?(a[0]=h,r=!0):r=!1}n+=c}}a&&(a[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let s=0;s<e.length;s++){const r=e[s];if(i){if(t[1]<=r[0])return e[s-1][1]=t[1],e;if(t[1]<=r[1])return e[s-1][1]=Math.max(t[1],r[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=r[0])return e.splice(s,0,t),e;if(t[1]<=r[1])return r[0]=Math.min(t[0],r[0]),e;t[0]<r[1]&&(r[0]=Math.min(t[0],r[0]),i=!0)}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};l=s([r(0,h.IBufferService)],l),t.CharacterJoinerService=l},5114:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0,t.CoreBrowserService=class{constructor(e,t){this._textarea=e,this.window=t}get dpr(){return this.window.devicePixelRatio}get isFocused(){return(this._textarea.getRootNode?this._textarea.getRootNode():this._textarea.ownerDocument).activeElement===this._textarea&&this._textarea.ownerDocument.hasFocus()}}},8934:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;const n=i(4725),o=i(9806);let a=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,r){return(0,o.getCoords)(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,r)}getMouseReportCoords(e,t){const i=(0,o.getCoordsRelativeToElement)(window,e,t);if(!(!this._charSizeService.hasValidSize||i[0]<0||i[1]<0||i[0]>=this._renderService.dimensions.canvasWidth||i[1]>=this._renderService.dimensions.canvasHeight))return{col:Math.floor(i[0]/this._renderService.dimensions.actualCellWidth),row:Math.floor(i[1]/this._renderService.dimensions.actualCellHeight),x:Math.floor(i[0]),y:Math.floor(i[1])}}};a=s([r(0,n.IRenderService),r(1,n.ICharSizeService)],a),t.MouseService=a},3230:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;const n=i(6193),o=i(8460),a=i(844),h=i(5596),c=i(3656),l=i(2585),d=i(4725);let _=class extends a.Disposable{constructor(e,t,i,s,r,a,l,d){if(super(),this._renderer=e,this._rowCount=t,this._charSizeService=r,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=new o.EventEmitter,this._onRenderedViewportChange=new o.EventEmitter,this._onRender=new o.EventEmitter,this._onRefreshRequest=new o.EventEmitter,this.register({dispose:()=>this._renderer.dispose()}),this._renderDebouncer=new n.RenderDebouncer(d.window,((e,t)=>this._renderRows(e,t))),this.register(this._renderDebouncer),this._screenDprMonitor=new h.ScreenDprMonitor(d.window),this._screenDprMonitor.setListener((()=>this.onDevicePixelRatioChange())),this.register(this._screenDprMonitor),this.register(l.onResize((()=>this._fullRefresh()))),this.register(l.buffers.onBufferActivate((()=>{var e;return null===(e=this._renderer)||void 0===e?void 0:e.clear()}))),this.register(s.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.onCharSizeChanged()))),this.register(a.onDecorationRegistered((()=>this._fullRefresh()))),this.register(a.onDecorationRemoved((()=>this._fullRefresh()))),this._renderer.onRequestRedraw((e=>this.refreshRows(e.start,e.end,!0))),this.register((0,c.addDisposableDomListener)(d.window,"resize",(()=>this.onDevicePixelRatioChange()))),"IntersectionObserver"in d.window){const e=new d.window.IntersectionObserver((e=>this._onIntersectionChange(e[e.length-1])),{threshold:0});e.observe(i),this.register({dispose:()=>e.disconnect()})}}get onDimensionsChange(){return this._onDimensionsChange.event}get onRenderedViewportChange(){return this._onRenderedViewportChange.event}get onRender(){return this._onRender.event}get onRefreshRequest(){return this._onRefreshRequest.event}get dimensions(){return this._renderer.dimensions}_onIntersectionChange(e){this._isPaused=void 0===e.isIntersecting?0===e.intersectionRatio:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){this._isPaused?this._needsFullRefresh=!0:(i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(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.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()}_fireOnCanvasResize(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)}dispose(){super.dispose()}setRenderer(e){this._renderer.dispose(),this._renderer=e,this._renderer.onRequestRedraw((e=>this.refreshRows(e.start,e.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;null===(t=null===(e=this._renderer)||void 0===e?void 0:e.clearTextureAtlas)||void 0===t||t.call(e),this._fullRefresh()}setColors(e){this._renderer.setColors(e),this._fullRefresh()}onDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)}onResize(e,t){this._renderer.onResize(e,t),this._fullRefresh()}onCharSizeChanged(){this._renderer.onCharSizeChanged()}onBlur(){this._renderer.onBlur()}onFocus(){this._renderer.onFocus()}onSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.onSelectionChanged(e,t,i)}onCursorMove(){this._renderer.onCursorMove()}clear(){this._renderer.clear()}};_=s([r(3,l.IOptionsService),r(4,d.ICharSizeService),r(5,l.IDecorationService),r(6,l.IBufferService),r(7,d.ICoreBrowserService)],_),t.RenderService=_},9312:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;const n=i(6114),o=i(456),a=i(511),h=i(8460),c=i(4725),l=i(2585),d=i(9806),_=i(9504),u=i(844),f=i(4841),v=String.fromCharCode(160),g=new RegExp(v,"g");let p=class extends u.Disposable{constructor(e,t,i,s,r,n,c,l,d){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=r,this._mouseService=n,this._optionsService=c,this._renderService=l,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new a.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new h.EventEmitter),this._onRedrawRequest=this.register(new h.EventEmitter),this._onSelectionChange=this.register(new h.EventEmitter),this._onRequestScrollLines=this.register(new h.EventEmitter),this._mouseMoveListener=e=>this._onMouseMove(e),this._mouseUpListener=e=>this._onMouseUp(e),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((e=>this._onTrim(e))),this.register(this._bufferService.buffers.onBufferActivate((e=>this._onBufferActivate(e)))),this.enable(),this._model=new o.SelectionModel(this._bufferService),this._activeSelectionMode=0}get onLinuxMouseSelection(){return this._onLinuxMouseSelection.event}get onRequestRedraw(){return this._onRedrawRequest.event}get onSelectionChange(){return this._onSelectionChange.event}get onRequestScrollLines(){return this._onRequestScrollLines.event}dispose(){this._removeMouseDownListeners()}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(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";const i=this._bufferService.buffer,s=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";const r=e[0]<t[0]?e[0]:t[0],n=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){const e=i.translateBufferLineToString(o,!0,r,n);s.push(e)}}else{const r=e[1]===t[1]?t[0]:void 0;s.push(i.translateBufferLineToString(e[1],!0,e[0],r));for(let r=e[1]+1;r<=t[1]-1;r++){const e=i.lines.get(r),t=i.translateBufferLineToString(r,!0);(null==e?void 0:e.isWrapped)?s[s.length-1]+=t:s.push(t)}if(e[1]!==t[1]){const e=i.lines.get(t[1]),r=i.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?s[s.length-1]+=r:s.push(r)}}return s.map((e=>e.replace(g," "))).join(n.isWindows?"\r\n":"\n")}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),n.isLinux&&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:3===this._activeSelectionMode})}_isClickInSelection(e){const t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!!(i&&s&&t)&&this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){const i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!(!i||!s)&&this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var i,s;const r=null===(s=null===(i=this._linkifier.currentLink)||void 0===i?void 0:i.link)||void 0===s?void 0:s.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const n=this._getMouseBufferCoords(e);return!!n&&(this._selectWordAt(n,t),this._model.selectionEnd=void 0,!0)}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()}_onTrim(e){this._model.onTrim(e)&&this.refresh()}_getMouseBufferCoords(e){const 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=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,e,this._screenElement)[1];const i=this._renderService.dimensions.canvasHeight;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-50),50),t/=50,t/Math.abs(t)+Math.round(14*t))}shouldForceSelection(e){return n.isMac?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}onMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(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()),50)}_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}_onIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_onSingleClick(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;const t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}_onDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_onTripleClick(e){const t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(n.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_onMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;const t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd)return void this.refresh(!0);2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){const e=i.lines.get(this._model.selectionEnd[1]);e&&0===e.hasWidth(this._model.selectionEnd[0])&&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});const e=this._bufferService.buffer;this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_onMouseUp(e){const t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&void 0!==t[0]&&void 0!==t[1]){const e=(0,_.moveToCellSequence)(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);i?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,i)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_onBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim((e=>this._onTrim(e)))}_convertViewportColToCharacterIndex(e,t){let i=t[0];for(let s=0;t[0]>=s;s++){const r=e.loadCell(s,this._workCell).getChars().length;0===this._workCell.getWidth()?i--:r>1&&t[0]!==s&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;const r=this._bufferService.buffer,n=r.lines.get(e[1]);if(!n)return;const o=r.translateBufferLineToString(e[1],!1);let a=this._convertViewportColToCharacterIndex(n,e),h=a;const c=e[0]-a;let l=0,d=0,_=0,u=0;if(" "===o.charAt(a)){for(;a>0&&" "===o.charAt(a-1);)a--;for(;h<o.length&&" "===o.charAt(h+1);)h++}else{let t=e[0],i=e[0];0===n.getWidth(t)&&(l++,t--),2===n.getWidth(i)&&(d++,i++);const s=n.getString(i).length;for(s>1&&(u+=s-1,h+=s-1);t>0&&a>0&&!this._isCharWordSeparator(n.loadCell(t-1,this._workCell));){n.loadCell(t-1,this._workCell);const e=this._workCell.getChars().length;0===this._workCell.getWidth()?(l++,t--):e>1&&(_+=e-1,a-=e-1),a--,t--}for(;i<n.length&&h+1<o.length&&!this._isCharWordSeparator(n.loadCell(i+1,this._workCell));){n.loadCell(i+1,this._workCell);const e=this._workCell.getChars().length;2===this._workCell.getWidth()?(d++,i++):e>1&&(u+=e-1,h+=e-1),h++,i++}}h++;let f=a+c-l+_,v=Math.min(this._bufferService.cols,h-a+l+d-_-u);if(t||""!==o.slice(a,h).trim()){if(i&&0===f&&32!==n.getCodePoint(0)){const t=r.lines.get(e[1]-1);if(t&&n.isWrapped&&32!==t.getCodePoint(this._bufferService.cols-1)){const t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){const e=this._bufferService.cols-t.start;f-=e,v+=e}}}if(s&&f+v===this._bufferService.cols&&32!==n.getCodePoint(this._bufferService.cols-1)){const t=r.lines.get(e[1]+1);if((null==t?void 0:t.isWrapped)&&32!==t.getCodePoint(0)){const t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(v+=t.length)}}return{start:f,length:v}}}_selectWordAt(e,t){const i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){const t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return 0!==e.getWidth()&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){const t=this._bufferService.buffer.getWrappedRangeForLine(e),i={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=(0,f.getRangeLength)(i,this._bufferService.cols)}};p=s([r(3,l.IBufferService),r(4,l.ICoreService),r(5,c.IMouseService),r(6,l.IOptionsService),r(7,c.IRenderService),r(8,c.ICoreBrowserService)],p),t.SelectionService=p},4725:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;const s=i(8343);t.ICharSizeService=(0,s.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,s.createDecorator)("CoreBrowserService"),t.IMouseService=(0,s.createDecorator)("MouseService"),t.IRenderService=(0,s.createDecorator)("RenderService"),t.ISelectionService=(0,s.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,s.createDecorator)("CharacterJoinerService")},6349:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;const s=i(8460);t.CircularList=class{constructor(e){this._maxLength=e,this.onDeleteEmitter=new s.EventEmitter,this.onInsertEmitter=new s.EventEmitter,this.onTrimEmitter=new s.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get onDelete(){return this.onDeleteEmitter.event}get onInsert(){return this.onInsertEmitter.event}get onTrim(){return this.onTrimEmitter.event}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;const t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];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,...i){if(t){for(let i=e;i<this._length-t;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let t=this._length-1;t>=e;t--)this._array[this._getCyclicIndex(t+i.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<i.length;t++)this._array[this._getCyclicIndex(e+t)]=i[t];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){const e=this._length+i.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let s=t-1;s>=0;s--)this.set(e+s+i,this.get(e+s));const s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+i,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}}},1439:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function e(t,i=5){if("object"!=typeof t)return t;const s=Array.isArray(t)?[]:{};for(const r in t)s[r]=i<=1?t[r]:t[r]&&e(t[r],i-1);return s}},8055:(e,t)=>{var i,s,r;function n(e){const t=e.toString(16);return t.length<2?"0"+t:t}function o(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=void 0,function(e){e.toCss=function(e,t,i,s){return void 0!==s?`#${n(e)}${n(t)}${n(i)}${n(s)}`:`#${n(e)}${n(t)}${n(i)}`},e.toRgba=function(e,t,i,s=255){return(e<<24|t<<16|i<<8|s)>>>0}}(i=t.channels||(t.channels={})),function(e){function t(e,t){const s=Math.round(255*t),[n,o,a]=r.toChannels(e.rgba);return{css:i.toCss(n,o,a,s),rgba:i.toRgba(n,o,a,s)}}e.blend=function(e,t){const s=(255&t.rgba)/255;if(1===s)return{css:t.css,rgba:t.rgba};const r=t.rgba>>24&255,n=t.rgba>>16&255,o=t.rgba>>8&255,a=e.rgba>>24&255,h=e.rgba>>16&255,c=e.rgba>>8&255,l=a+Math.round((r-a)*s),d=h+Math.round((n-h)*s),_=c+Math.round((o-c)*s);return{css:i.toCss(l,d,_),rgba:i.toRgba(l,d,_)}},e.isOpaque=function(e){return 255==(255&e.rgba)},e.ensureContrastRatio=function(e,t,i){const s=r.ensureContrastRatio(e.rgba,t.rgba,i);if(s)return r.toColor(s>>24&255,s>>16&255,s>>8&255)},e.opaque=function(e){const t=(255|e.rgba)>>>0,[s,n,o]=r.toChannels(t);return{css:i.toCss(s,n,o),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,i){return t(e,(255&e.rgba)*i/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(t.color||(t.color={})),(t.css||(t.css={})).toColor=function(e){if(e.match(/#[0-9a-f]{3,8}/i))switch(e.length){case 4:{const t=parseInt(e.slice(1,2).repeat(2),16),i=parseInt(e.slice(2,3).repeat(2),16),s=parseInt(e.slice(3,4).repeat(2),16);return r.toColor(t,i,s)}case 5:{const t=parseInt(e.slice(1,2).repeat(2),16),i=parseInt(e.slice(2,3).repeat(2),16),s=parseInt(e.slice(3,4).repeat(2),16),n=parseInt(e.slice(4,5).repeat(2),16);return r.toColor(t,i,s,n)}case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}const t=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(t){const e=parseInt(t[1]),i=parseInt(t[2]),s=parseInt(t[3]),n=Math.round(255*(void 0===t[5]?1:parseFloat(t[5])));return r.toColor(e,i,s,n)}throw new Error("css.toColor: Unsupported css format")},function(e){function t(e,t,i){const s=e/255,r=t/255,n=i/255;return.2126*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(s=t.rgb||(t.rgb={})),function(e){function t(e,t,i){const r=e>>24&255,n=e>>16&255,a=e>>8&255;let h=t>>24&255,c=t>>16&255,l=t>>8&255,d=o(s.relativeLuminance2(h,c,l),s.relativeLuminance2(r,n,a));for(;d<i&&(h>0||c>0||l>0);)h-=Math.max(0,Math.ceil(.1*h)),c-=Math.max(0,Math.ceil(.1*c)),l-=Math.max(0,Math.ceil(.1*l)),d=o(s.relativeLuminance2(h,c,l),s.relativeLuminance2(r,n,a));return(h<<24|c<<16|l<<8|255)>>>0}function r(e,t,i){const r=e>>24&255,n=e>>16&255,a=e>>8&255;let h=t>>24&255,c=t>>16&255,l=t>>8&255,d=o(s.relativeLuminance2(h,c,l),s.relativeLuminance2(r,n,a));for(;d<i&&(h<255||c<255||l<255);)h=Math.min(255,h+Math.ceil(.1*(255-h))),c=Math.min(255,c+Math.ceil(.1*(255-c))),l=Math.min(255,l+Math.ceil(.1*(255-l))),d=o(s.relativeLuminance2(h,c,l),s.relativeLuminance2(r,n,a));return(h<<24|c<<16|l<<8|255)>>>0}e.ensureContrastRatio=function(e,i,n){const a=s.relativeLuminance(e>>8),h=s.relativeLuminance(i>>8);if(o(a,h)<n){if(h<a){const h=t(e,i,n),c=o(a,s.relativeLuminance(h>>8));if(c<n){const t=r(e,i,n);return c>o(a,s.relativeLuminance(t>>8))?h:t}return h}const c=r(e,i,n),l=o(a,s.relativeLuminance(c>>8));if(l<n){const r=t(e,i,n);return l>o(a,s.relativeLuminance(r>>8))?c:r}return c}},e.reduceLuminance=t,e.increaseLuminance=r,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,s,r){return{css:i.toCss(e,t,s,r),rgba:i.toRgba(e,t,s,r)}}}(r=t.rgba||(t.rgba={})),t.toPaddedHex=n,t.contrastRatio=o},8969:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;const s=i(844),r=i(2585),n=i(4348),o=i(7866),a=i(744),h=i(7302),c=i(6975),l=i(8460),d=i(1753),_=i(3730),u=i(1480),f=i(7994),v=i(9282),g=i(5435),p=i(5981),S=i(2660);let m=!1;class C extends s.Disposable{constructor(e){super(),this._onBinary=new l.EventEmitter,this._onData=new l.EventEmitter,this._onLineFeed=new l.EventEmitter,this._onResize=new l.EventEmitter,this._onScroll=new l.EventEmitter,this._onWriteParsed=new l.EventEmitter,this._instantiationService=new n.InstantiationService,this.optionsService=new h.OptionsService(e),this._instantiationService.setService(r.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(a.BufferService)),this._instantiationService.setService(r.IBufferService,this._bufferService),this._logService=this._instantiationService.createInstance(o.LogService),this._instantiationService.setService(r.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(c.CoreService,(()=>this.scrollToBottom()))),this._instantiationService.setService(r.ICoreService,this.coreService),this.coreMouseService=this._instantiationService.createInstance(d.CoreMouseService),this._instantiationService.setService(r.ICoreMouseService,this.coreMouseService),this._dirtyRowService=this._instantiationService.createInstance(_.DirtyRowService),this._instantiationService.setService(r.IDirtyRowService,this._dirtyRowService),this.unicodeService=this._instantiationService.createInstance(u.UnicodeService),this._instantiationService.setService(r.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(f.CharsetService),this._instantiationService.setService(r.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(S.OscLinkService),this._instantiationService.setService(r.IOscLinkService,this._oscLinkService),this._inputHandler=new g.InputHandler(this._bufferService,this._charsetService,this.coreService,this._dirtyRowService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService),this.register((0,l.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,l.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,l.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,l.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.optionsService.onOptionChange((e=>this._updateOptions(e)))),this.register(this._bufferService.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=new p.WriteBuffer(((e,t)=>this._inputHandler.parse(e,t))),this.register((0,l.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onBinary(){return this._onBinary.event}get onData(){return this._onData.event}get onLineFeed(){return this._onLineFeed.event}get onResize(){return this._onResize.event}get onWriteParsed(){return this._onWriteParsed.event}get onScroll(){return this._onScrollApi||(this._onScrollApi=new l.EventEmitter,this.register(this._onScroll.event((e=>{var t;null===(t=this._onScrollApi)||void 0===t||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(const t in e)this.optionsService.options[t]=e[t]}dispose(){var e;this._isDisposed||(super.dispose(),null===(e=this._windowsMode)||void 0===e||e.dispose(),this._windowsMode=void 0)}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=r.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,a.MINIMUM_COLS),t=Math.max(t,a.MINIMUM_ROWS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t,i){this._bufferService.scrollLines(e,t,i)}scrollPages(e){this._bufferService.scrollPages(e)}scrollToTop(){this._bufferService.scrollToTop()}scrollToBottom(){this._bufferService.scrollToBottom()}scrollToLine(e){this._bufferService.scrollToLine(e)}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.optionsService.rawOptions.windowsMode&&this._enableWindowsMode()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_updateOptions(e){var t;switch(e){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.rawOptions.windowsMode?this._enableWindowsMode():(null===(t=this._windowsMode)||void 0===t||t.dispose(),this._windowsMode=void 0)}}_enableWindowsMode(){if(!this._windowsMode){const e=[];e.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},(()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsMode={dispose:()=>{for(const t of e)t.dispose()}}}}}t.CoreTerminal=C},8460:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed)for(let t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)}})),this._event}fire(e,t){const i=[];for(let e=0;e<this._listeners.length;e++)i.push(this._listeners[e]);for(let s=0;s<i.length;s++)i[s].call(void 0,e,t)}dispose(){this._listeners&&(this._listeners.length=0),this._disposed=!0}},t.forwardEvent=function(e,t){return e((e=>t.fire(e)))}},5435:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;const s=i(2584),r=i(7116),n=i(2015),o=i(844),a=i(482),h=i(8437),c=i(8460),l=i(643),d=i(511),_=i(3734),u=i(2585),f=i(6242),v=i(6351),g=i(5941),p={"(":0,")":1,"*":2,"+":3,"-":1,".":2},S=131072;function m(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 C;!function(e){e[e.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",e[e.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(C=t.WindowsOptionsReportType||(t.WindowsOptionsReportType={}));class b extends o.Disposable{constructor(e,t,i,o,l,_,u,g,p,S=new n.EscapeSequenceParser){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._dirtyRowService=o,this._logService=l,this._optionsService=_,this._oscLinkService=u,this._coreMouseService=g,this._unicodeService=p,this._parser=S,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new a.StringToUtf32,this._utf8Decoder=new a.Utf8ToUtf32,this._workCell=new d.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=new c.EventEmitter,this._onRequestRefreshRows=new c.EventEmitter,this._onRequestReset=new c.EventEmitter,this._onRequestSendFocus=new c.EventEmitter,this._onRequestSyncScrollBar=new c.EventEmitter,this._onRequestWindowsOptionsReport=new c.EventEmitter,this._onA11yChar=new c.EventEmitter,this._onA11yTab=new c.EventEmitter,this._onCursorMove=new c.EventEmitter,this._onLineFeed=new c.EventEmitter,this._onScroll=new c.EventEmitter,this._onTitleChange=new c.EventEmitter,this._onColor=new c.EventEmitter,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._parser.setCsiHandlerFallback(((e,t)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e),params:t.toArray()})})),this._parser.setEscHandlerFallback((e=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e)})})),this._parser.setExecuteHandlerFallback((e=>{this._logService.debug("Unknown EXECUTE code: ",{code:e})})),this._parser.setOscHandlerFallback(((e,t,i)=>{this._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:i})})),this._parser.setDcsHandlerFallback(((e,t,i)=>{"HOOK"===t&&(i=i.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e),action:t,payload:i})})),this._parser.setPrintHandler(((e,t,i)=>this.print(e,t,i))),this._parser.registerCsiHandler({final:"@"},(e=>this.insertChars(e))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(e=>this.scrollLeft(e))),this._parser.registerCsiHandler({final:"A"},(e=>this.cursorUp(e))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(e=>this.scrollRight(e))),this._parser.registerCsiHandler({final:"B"},(e=>this.cursorDown(e))),this._parser.registerCsiHandler({final:"C"},(e=>this.cursorForward(e))),this._parser.registerCsiHandler({final:"D"},(e=>this.cursorBackward(e))),this._parser.registerCsiHandler({final:"E"},(e=>this.cursorNextLine(e))),this._parser.registerCsiHandler({final:"F"},(e=>this.cursorPrecedingLine(e))),this._parser.registerCsiHandler({final:"G"},(e=>this.cursorCharAbsolute(e))),this._parser.registerCsiHandler({final:"H"},(e=>this.cursorPosition(e))),this._parser.registerCsiHandler({final:"I"},(e=>this.cursorForwardTab(e))),this._parser.registerCsiHandler({final:"J"},(e=>this.eraseInDisplay(e,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(e=>this.eraseInDisplay(e,!0))),this._parser.registerCsiHandler({final:"K"},(e=>this.eraseInLine(e,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(e=>this.eraseInLine(e,!0))),this._parser.registerCsiHandler({final:"L"},(e=>this.insertLines(e))),this._parser.registerCsiHandler({final:"M"},(e=>this.deleteLines(e))),this._parser.registerCsiHandler({final:"P"},(e=>this.deleteChars(e))),this._parser.registerCsiHandler({final:"S"},(e=>this.scrollUp(e))),this._parser.registerCsiHandler({final:"T"},(e=>this.scrollDown(e))),this._parser.registerCsiHandler({final:"X"},(e=>this.eraseChars(e))),this._parser.registerCsiHandler({final:"Z"},(e=>this.cursorBackwardTab(e))),this._parser.registerCsiHandler({final:"`"},(e=>this.charPosAbsolute(e))),this._parser.registerCsiHandler({final:"a"},(e=>this.hPositionRelative(e))),this._parser.registerCsiHandler({final:"b"},(e=>this.repeatPrecedingCharacter(e))),this._parser.registerCsiHandler({final:"c"},(e=>this.sendDeviceAttributesPrimary(e))),this._parser.registerCsiHandler({prefix:">",final:"c"},(e=>this.sendDeviceAttributesSecondary(e))),this._parser.registerCsiHandler({final:"d"},(e=>this.linePosAbsolute(e))),this._parser.registerCsiHandler({final:"e"},(e=>this.vPositionRelative(e))),this._parser.registerCsiHandler({final:"f"},(e=>this.hVPosition(e))),this._parser.registerCsiHandler({final:"g"},(e=>this.tabClear(e))),this._parser.registerCsiHandler({final:"h"},(e=>this.setMode(e))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(e=>this.setModePrivate(e))),this._parser.registerCsiHandler({final:"l"},(e=>this.resetMode(e))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(e=>this.resetModePrivate(e))),this._parser.registerCsiHandler({final:"m"},(e=>this.charAttributes(e))),this._parser.registerCsiHandler({final:"n"},(e=>this.deviceStatus(e))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(e=>this.deviceStatusPrivate(e))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(e=>this.softReset(e))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(e=>this.setCursorStyle(e))),this._parser.registerCsiHandler({final:"r"},(e=>this.setScrollRegion(e))),this._parser.registerCsiHandler({final:"s"},(e=>this.saveCursor(e))),this._parser.registerCsiHandler({final:"t"},(e=>this.windowOptions(e))),this._parser.registerCsiHandler({final:"u"},(e=>this.restoreCursor(e))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(e=>this.insertColumns(e))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(e=>this.deleteColumns(e))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(e=>this.selectProtected(e))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(e=>this.requestMode(e,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(e=>this.requestMode(e,!1))),this._parser.setExecuteHandler(s.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(s.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(s.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(s.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(s.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(s.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(s.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(s.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(s.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(s.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(s.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(s.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new f.OscHandler((e=>(this.setTitle(e),this.setIconName(e),!0)))),this._parser.registerOscHandler(1,new f.OscHandler((e=>this.setIconName(e)))),this._parser.registerOscHandler(2,new f.OscHandler((e=>this.setTitle(e)))),this._parser.registerOscHandler(4,new f.OscHandler((e=>this.setOrReportIndexedColor(e)))),this._parser.registerOscHandler(8,new f.OscHandler((e=>this.setHyperlink(e)))),this._parser.registerOscHandler(10,new f.OscHandler((e=>this.setOrReportFgColor(e)))),this._parser.registerOscHandler(11,new f.OscHandler((e=>this.setOrReportBgColor(e)))),this._parser.registerOscHandler(12,new f.OscHandler((e=>this.setOrReportCursorColor(e)))),this._parser.registerOscHandler(104,new f.OscHandler((e=>this.restoreIndexedColor(e)))),this._parser.registerOscHandler(110,new f.OscHandler((e=>this.restoreFgColor(e)))),this._parser.registerOscHandler(111,new f.OscHandler((e=>this.restoreBgColor(e)))),this._parser.registerOscHandler(112,new f.OscHandler((e=>this.restoreCursorColor(e)))),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(const e in r.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:e},(()=>this.selectCharset("("+e))),this._parser.registerEscHandler({intermediates:")",final:e},(()=>this.selectCharset(")"+e))),this._parser.registerEscHandler({intermediates:"*",final:e},(()=>this.selectCharset("*"+e))),this._parser.registerEscHandler({intermediates:"+",final:e},(()=>this.selectCharset("+"+e))),this._parser.registerEscHandler({intermediates:"-",final:e},(()=>this.selectCharset("-"+e))),this._parser.registerEscHandler({intermediates:".",final:e},(()=>this.selectCharset("."+e))),this._parser.registerEscHandler({intermediates:"/",final:e},(()=>this.selectCharset("/"+e)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((e=>(this._logService.error("Parsing error: ",e),e))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new v.DcsHandler(((e,t)=>this.requestStatusString(e,t))))}getAttrData(){return this._curAttrData}get onRequestBell(){return this._onRequestBell.event}get onRequestRefreshRows(){return this._onRequestRefreshRows.event}get onRequestReset(){return this._onRequestReset.event}get onRequestSendFocus(){return this._onRequestSendFocus.event}get onRequestSyncScrollBar(){return this._onRequestSyncScrollBar.event}get onRequestWindowsOptionsReport(){return this._onRequestWindowsOptionsReport.event}get onA11yChar(){return this._onA11yChar.event}get onA11yTab(){return this._onA11yTab.event}get onCursorMove(){return this._onCursorMove.event}get onLineFeed(){return this._onLineFeed.event}get onScroll(){return this._onScroll.event}get onTitleChange(){return this._onTitleChange.event}get onColor(){return this._onColor.event}dispose(){super.dispose()}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=u.LogLevelEnum.WARN&&Promise.race([e,new Promise(((e,t)=>setTimeout((()=>t("#SLOW_TIMEOUT")),5e3)))]).catch((e=>{if("#SLOW_TIMEOUT"!==e)throw e;console.warn("async parser handler taking longer than 5000 ms")}))}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0;const o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>S&&(n=this._parseStack.position+S)}if(this._logService.logLevel<=u.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+("string"==typeof e?` "${e}"`:` "${Array.prototype.map.call(e,(e=>String.fromCharCode(e))).join("")}"`),"string"==typeof e?e.split("").map((e=>e.charCodeAt(0))):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<S&&(this._parseBuffer=new Uint32Array(Math.min(e.length,S))),o||this._dirtyRowService.clearRange(),e.length>S)for(let t=n;t<e.length;t+=S){const n=t+S<e.length?t+S:e.length,o="string"==typeof e?this._stringDecoder.decode(e.substring(t,n),this._parseBuffer):this._utf8Decoder.decode(e.subarray(t,n),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,o))return this._preserveStack(s,r,o,t),this._logSlowResolvingAsync(i),i}else if(!o){const t="string"==typeof e?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,t))return this._preserveStack(s,r,t,0),this._logSlowResolvingAsync(i),i}this._activeBuffer.x===s&&this._activeBuffer.y===r||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)}print(e,t,i){let s,r;const n=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,_=this._curAttrData;let u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowService.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&2===u.getWidth(this._activeBuffer.x-1)&&u.setCellFromCodePoint(this._activeBuffer.x-1,0,1,_.fg,_.bg,_.extended);for(let f=t;f<i;++f){if(s=e[f],r=this._unicodeService.wcwidth(s),s<127&&n){const e=n[String.fromCharCode(s)];e&&(s=e.charCodeAt(0))}if(o&&this._onA11yChar.fire((0,a.stringFromCodePoint)(s)),void 0!==this._currentLinkId&&this._oscLinkService.addLineToLink(this._currentLinkId,this._activeBuffer.ybase+this._activeBuffer.y),r||!this._activeBuffer.x){if(this._activeBuffer.x+r-1>=h)if(c){for(;this._activeBuffer.x<h;)u.setCellFromCodePoint(this._activeBuffer.x++,0,1,_.fg,_.bg,_.extended);this._activeBuffer.x=0,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),u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=h-1,2===r)continue;if(d&&(u.insertCells(this._activeBuffer.x,r,this._activeBuffer.getNullCell(_),_),2===u.getWidth(h-1)&&u.setCellFromCodePoint(h-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,_.fg,_.bg,_.extended)),u.setCellFromCodePoint(this._activeBuffer.x++,s,r,_.fg,_.bg,_.extended),r>0)for(;--r;)u.setCellFromCodePoint(this._activeBuffer.x++,0,0,_.fg,_.bg,_.extended)}else u.getWidth(this._activeBuffer.x-1)?u.addCodepointToCell(this._activeBuffer.x-1,s):u.addCodepointToCell(this._activeBuffer.x-2,s)}i-t>0&&(u.loadCell(this._activeBuffer.x-1,this._workCell),2===this._workCell.getWidth()||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<h&&i-t>0&&0===u.getWidth(this._activeBuffer.x)&&!u.hasContent(this._activeBuffer.x)&&u.setCellFromCodePoint(this._activeBuffer.x,0,1,_.fg,_.bg,_.extended),this._dirtyRowService.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return"t"!==e.final||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,(e=>!m(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)))}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new v.DcsHandler(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new f.OscHandler(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowService.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.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowService.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(0===this._activeBuffer.x&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(null===(e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))||void 0===e?void 0:e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const 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._dirtyRowService.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowService.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._dirtyRowService.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){const 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){const 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){const t=e.params[0];return 0===t?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===t&&(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){const t=e.params[0];return 1===t&&(this._curAttrData.bg|=536870912),2!==t&&0!==t||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){const n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1}eraseInDisplay(e,t=!1){let i;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowService.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowService.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(0);break;case 2:for(i=this._bufferService.rows,this._dirtyRowService.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(0);break;case 3:const e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}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,0===this._activeBuffer.x,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)}return this._dirtyRowService.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;const i=this._activeBuffer.ybase+this._activeBuffer.y,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowService.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;const i=this._activeBuffer.ybase+this._activeBuffer.y;let s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowService.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();const 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._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();const 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._eraseAttrData()),this._dirtyRowService.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._dirtyRowService.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(h.DEFAULT_ATTR_DATA));return this._dirtyRowService.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;const t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}return this._dirtyRowService.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;const t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}return this._dirtyRowService.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;const t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}return this._dirtyRowService.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;const t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();const 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._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){if(!this._parser.precedingCodepoint)return!0;const t=e.params[0]||1,i=new Uint32Array(t);for(let e=0;e<t;++e)i[e]=this._parser.precedingCodepoint;return this.print(i,0,i.length),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(s.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(s.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(s.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(s.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(s.C0.ESC+"[>83;40003;0c")),!0}_is(e){return 0===(this._optionsService.rawOptions.termName+"").indexOf(e)}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}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,r.DEFAULT_CHARSET),this._charsetService.setgCharset(1,r.DEFAULT_CHARSET),this._charsetService.setgCharset(2,r.DEFAULT_CHARSET),this._charsetService.setgCharset(3,r.DEFAULT_CHARSET);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(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}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}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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),1049===e.params[t]&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(e,t){const i=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:n}=this._coreMouseService,o=this._coreService,{buffers:a,cols:h}=this._bufferService,{active:c,alt:l}=a,d=this._optionsService.rawOptions,_=e=>e?1:2,u=e.params[0];return f=u,v=t?2===u?3:4===u?_(o.modes.insertMode):12===u?4:20===u?_(d.convertEol):0:1===u?_(i.applicationCursorKeys):3===u?d.windowOptions.setWinLines?80===h?2:132===h?1:0:0:6===u?_(i.origin):7===u?_(i.wraparound):8===u?3:9===u?_("X10"===r):12===u?_(d.cursorBlink):25===u?_(!o.isCursorHidden):45===u?_(i.reverseWraparound):66===u?_(i.applicationKeypad):1e3===u?_("VT200"===r):1002===u?_("DRAG"===r):1003===u?_("ANY"===r):1004===u?_(i.sendFocus):1005===u?4:1006===u?_("SGR"===n):1015===u?4:1016===u?_("SGR_PIXELS"===n):1048===u?1:47===u||1047===u||1049===u?_(c===l):2004===u?_(i.bracketedPasteMode):0,o.triggerDataEvent(`${s.C0.ESC}[${t?"":"?"}${f};${v}$y`),!0;var f,v}_updateAttrColor(e,t,i,s,r){return 2===t?(e|=50331648,e&=-16777216,e|=_.AttributeData.fromColorRGB([i,s,r])):5===t&&(e&=-50331904,e|=33554432|255&i),e}_extractColor(e,t,i){const s=[0,0,-1,0,0,0];let r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){const i=e.getSubParams(t+n);let o=0;do{5===s[1]&&(r=1),s[n+o+1+r]=i[o]}while(++o<i.length&&o+n+1+r<s.length);break}if(5===s[1]&&n+r>=2||2===s[1]&&n+r>=5)break;s[1]&&(r=1)}while(++n+t<e.length&&n+r<s.length);for(let e=2;e<s.length;++e)-1===s[e]&&(s[e]=0);switch(s[0]){case 38:i.fg=this._updateAttrColor(i.fg,s[1],s[3],s[4],s[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,s[1],s[3],s[4],s[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,s[1],s[3],s[4],s[5])}return n}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()}charAttributes(e){if(1===e.length&&0===e.params[0])return this._curAttrData.fg=h.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=h.DEFAULT_ATTR_DATA.bg,!0;const t=e.length;let i;const s=this._curAttrData;for(let r=0;r<t;r++)i=e.params[r],i>=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777224|i-90):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777224|i-100):0===i?(s.fg=h.DEFAULT_ATTR_DATA.fg,s.bg=h.DEFAULT_ATTR_DATA.bg):1===i?s.fg|=134217728:3===i?s.bg|=67108864:4===i?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):5===i?s.fg|=536870912:7===i?s.fg|=67108864:8===i?s.fg|=1073741824:9===i?s.fg|=2147483648:2===i?s.bg|=134217728:21===i?this._processUnderline(2,s):22===i?(s.fg&=-134217729,s.bg&=-134217729):23===i?s.bg&=-67108865:24===i?(s.fg&=-268435457,this._processUnderline(0,s)):25===i?s.fg&=-536870913:27===i?s.fg&=-67108865:28===i?s.fg&=-1073741825:29===i?s.fg&=2147483647:39===i?(s.fg&=-67108864,s.fg|=16777215&h.DEFAULT_ATTR_DATA.fg):49===i?(s.bg&=-67108864,s.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):38===i||48===i||58===i?r+=this._extractColor(e,r,s):59===i?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):100===i?(s.fg&=-67108864,s.fg|=16777215&h.DEFAULT_ATTR_DATA.fg,s.bg&=-67108864,s.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${s.C0.ESC}[0n`);break;case 6:const e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${s.C0.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(6===e.params[0]){const e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${s.C0.ESC}[?${e};${t}R`)}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=h.DEFAULT_ATTR_DATA.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){const t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const i=t%2==1;return this._optionsService.options.cursorBlink=i,!0}setScrollRegion(e){const t=e.params[0]||1;let i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||0===i)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!m(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;const t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(C.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(C.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${s.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}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){const t=[],i=e.split(";");for(;i.length>1;){const e=i.shift(),s=i.shift();if(/^\d+$/.exec(e)){const i=parseInt(e);if(0<=i&&i<256)if("?"===s)t.push({type:0,index:i});else{const e=(0,g.parseColor)(s);e&&t.push({type:1,index:i,color:e})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){const t=e.split(";");return!(t.length<2)&&(t[1]?this._createHyperlink(t[0],t[1]):!t[0]&&this._finishHyperlink())}_createHyperlink(e,t){void 0!==this._currentLinkId&&this._finishHyperlink();const i=e.split(":");let s;const r=i.findIndex((e=>e.startsWith("id=")));return-1!==r&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._currentLinkId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.extended.urlId=this._currentLinkId,this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),this._currentLinkId=void 0,!0}_setOrReportSpecialColor(e,t){const i=e.split(";");for(let e=0;e<i.length&&!(t>=this._specialColors.length);++e,++t)if("?"===i[e])this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{const s=(0,g.parseColor)(i[e]);s&&this._onColor.fire([{type:1,index:this._specialColors[t],color:s}])}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;const t=[],i=e.split(";");for(let e=0;e<i.length;++e)if(/^\d+$/.exec(i[e])){const s=parseInt(i[e]);0<=s&&s<256&&t.push({type:2,index:s})}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,r.DEFAULT_CHARSET),!0}selectCharset(e){return 2!==e.length?(this.selectDefaultCharset(),!0):("/"===e[0]||this._charsetService.setgCharset(p[e[0]],r.CHARSETS[e[1]]||r.DEFAULT_CHARSET),!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){const 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._dirtyRowService.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=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){const e=new d.CellData;e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){const i=this._activeBuffer.ybase+this._activeBuffer.y+t,s=this._activeBuffer.lines.get(i);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowService.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){const i=this._bufferService.buffer,r=this._optionsService.rawOptions;return(e=>(this._coreService.triggerDataEvent(`${s.C0.ESC}${e}${s.C0.ESC}\\`),!0))('"q'===e?`P1$r${this._curAttrData.isProtected()?1:0}"q`:'"p'===e?'P1$r61;1"p':"r"===e?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:"m"===e?"P1$r0m":" q"===e?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r")}}t.InputHandler=b},844:(e,t)=>{function i(e){for(const t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){const t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=i,t.getDisposeArrayDisposable=function(e){return{dispose:()=>i(e)}}},1505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class i{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=i,t.FourKeyMap=class{constructor(){this._data=new i}set(e,t,s,r,n){this._data.get(e,t)||this._data.set(e,t,new i),this._data.get(e,t).set(s,r,n)}get(e,t,i,s){var r;return null===(r=this._data.get(e,t))||void 0===r?void 0:r.get(i,s)}clear(){this._data.clear()}}},6114:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isLegacyEdge=t.isFirefox=void 0;const i="undefined"==typeof navigator,s=i?"node":navigator.userAgent,r=i?"node":navigator.platform;t.isFirefox=s.includes("Firefox"),t.isLegacyEdge=s.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(s),t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(r),t.isIpad="iPad"===r,t.isIphone="iPhone"===r,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(r),t.isLinux=r.indexOf("Linux")>=0},6106:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let i=0;t.SortedList=class{constructor(e){this._getKey=e,this._array=[]}clear(){this._array.length=0}insert(e){0!==this._array.length?(i=this._search(this._getKey(e),0,this._array.length-1),this._array.splice(i,0,e)):this._array.push(e)}delete(e){if(0===this._array.length)return!1;const t=this._getKey(e);if(void 0===t)return!1;if(i=this._search(t,0,this._array.length-1),-1===i)return!1;if(this._getKey(this._array[i])!==t)return!1;do{if(this._array[i]===e)return this._array.splice(i,1),!0}while(++i<this._array.length&&this._getKey(this._array[i])===t);return!1}*getKeyIterator(e){if(0!==this._array.length&&(i=this._search(e,0,this._array.length-1),!(i<0||i>=this._array.length)&&this._getKey(this._array[i])===e))do{yield this._array[i]}while(++i<this._array.length&&this._getKey(this._array[i])===e)}forEachByKey(e,t){if(0!==this._array.length&&(i=this._search(e,0,this._array.length-1),!(i<0||i>=this._array.length)&&this._getKey(this._array[i])===e))do{t(this._array[i])}while(++i<this._array.length&&this._getKey(this._array[i])===e)}values(){return this._array.values()}_search(e,t,i){if(i<t)return t;let s=Math.floor((t+i)/2);const r=this._getKey(this._array[s]);if(r>e)return this._search(e,t,s-1);if(r<e)return this._search(e,s+1,i);for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}},8273:(e,t)=>{function i(e,t,i=0,s=e.length){if(i>=e.length)return e;i=(e.length+i)%e.length,s=s>=e.length?e.length:(e.length+s)%e.length;for(let r=i;r<s;++r)e[r]=t;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.concat=t.fillFallback=t.fill=void 0,t.fill=function(e,t,s,r){return e.fill?e.fill(t,s,r):i(e,t,s,r)},t.fillFallback=i,t.concat=function(e,t){const i=new e.constructor(e.length+t.length);return i.set(e),i.set(t,e.length),i}},9282:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;const s=i(643);t.updateWindowsModeWrappedState=function(e){const t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1),i=null==t?void 0:t.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&i&&(r.isWrapped=i[s.CHAR_DATA_CODE_INDEX]!==s.NULL_CELL_CODE&&i[s.CHAR_DATA_CODE_INDEX]!==s.WHITESPACE_CELL_CODE)}},3734:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class i{constructor(){this.fg=0,this.bg=0,this.extended=new s}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return 50331648==(50331648&this.fg)}isBgRGB(){return 50331648==(50331648&this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return 0==(50331648&this.fg)}isBgDefault(){return 0==(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}t.AttributeData=i;class s{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}clone(){return new s(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}t.ExtendedAttrs=s},9092:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferStringIterator=t.Buffer=t.MAX_BUFFER_SIZE=void 0;const s=i(6349),r=i(8437),n=i(511),o=i(643),a=i(4634),h=i(4863),c=i(7116),l=i(3734);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=r.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=n.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]),this._whitespaceCell=n.CellData.fromCharData([0,o.WHITESPACE_CELL_CHAR,o.WHITESPACE_CELL_WIDTH,o.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new s.CircularList(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 l.ExtendedAttrs),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 l.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new r.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const i=e+this._optionsService.rawOptions.scrollback;return i>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:i}fillViewportRows(e){if(0===this.lines.length){void 0===e&&(e=r.DEFAULT_ATTR_DATA);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 s.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){const i=this.getNullCell(r.DEFAULT_ATTR_DATA),s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let t=0;t<this.lines.length;t++)this.lines.get(t).resize(e,i);let n=0;if(this._rows<t)for(let s=this._rows;s<t;s++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode?this.lines.push(new r.BufferLine(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new r.BufferLine(e,i)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){const e=this.lines.length-s;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),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 t=0;t<this.lines.length;t++)this.lines.get(t).resize(e,i);this._cols=e,this._rows=t}get _isReflowEnabled(){return 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){const i=(0,a.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(r.DEFAULT_ATTR_DATA));if(i.length>0){const s=(0,a.reflowLargerCreateNewLayout)(this.lines,i);(0,a.reflowLargerApplyNewLayout)(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){const s=this.getNullCell(r.DEFAULT_ATTR_DATA);let n=i;for(;n-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new r.BufferLine(e,s))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){const i=this.getNullCell(r.DEFAULT_ATTR_DATA),s=[];let n=0;for(let o=this.lines.length-1;o>=0;o--){let h=this.lines.get(o);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;const c=[h];for(;h.isWrapped&&o>0;)h=this.lines.get(--o),c.unshift(h);const l=this.ybase+this.y;if(l>=o&&l<o+c.length)continue;const d=c[c.length-1].getTrimmedLength(),_=(0,a.reflowSmallerGetNewLineLengths)(c,this._cols,e),u=_.length-c.length;let f;f=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+u):Math.max(0,this.lines.length-this.lines.maxLength+u);const v=[];for(let e=0;e<u;e++){const e=this.getBlankLine(r.DEFAULT_ATTR_DATA,!0);v.push(e)}v.length>0&&(s.push({start:o+c.length+n,newLines:v}),n+=v.length),c.push(...v);let g=_.length-1,p=_[g];0===p&&(g--,p=_[g]);let S=c.length-u-1,m=d;for(;S>=0;){const e=Math.min(m,p);if(void 0===c[g])break;if(c[g].copyCellsFrom(c[S],m-e,p-e,e,!0),p-=e,0===p&&(g--,p=_[g]),m-=e,0===m){S--;const e=Math.max(S,0);m=(0,a.getWrappedLineTrimmedLength)(c,e,this._cols)}}for(let t=0;t<c.length;t++)_[t]<e&&c[t].setCell(_[t],i);let C=u-f;for(;C-- >0;)0===this.ybase?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+n)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+u,this.ybase+t-1)}if(s.length>0){const e=[],t=[];for(let e=0;e<this.lines.length;e++)t.push(this.lines.get(e));const i=this.lines.length;let r=i-1,o=0,a=s[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n);let h=0;for(let c=Math.min(this.lines.maxLength-1,i+n-1);c>=0;c--)if(a&&a.start>r+h){for(let e=a.newLines.length-1;e>=0;e--)this.lines.set(c--,a.newLines[e]);c++,e.push({index:r+1,amount:a.newLines.length}),h+=a.newLines.length,a=s[++o]}else this.lines.set(c,t[r--]);let c=0;for(let t=e.length-1;t>=0;t--)e[t].index+=c,this.lines.onInsertEmitter.fire(e[t]),c+=e[t].amount;const l=Math.max(0,i+n-this.lines.maxLength);l>0&&this.lines.onTrimEmitter.fire(l)}}stringIndexToBufferIndex(e,t,i=!1){for(;t;){const s=this.lines.get(e);if(!s)return[-1,-1];const r=i?s.getTrimmedLength():s.length;for(let i=0;i<r;++i)if(s.get(i)[o.CHAR_DATA_WIDTH_INDEX]&&(t-=s.get(i)[o.CHAR_DATA_CHAR_INDEX].length||1),t<0)return[e,i];e++}return[e,0]}translateBufferLineToString(e,t,i=0,s){const r=this.lines.get(e);return r?r.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(null!=e?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(null==e&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(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.splice(e--,1);this._isClearing=!1}addMarker(e){const t=new h.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim((e=>{t.line-=e,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((e=>{t.line>=e.index&&(t.line+=e.amount)}))),t.register(this.lines.onDelete((e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}iterator(e,t,i,s,r){return new d(this,e,t,i,s,r)}};class d{constructor(e,t,i=0,s=e.lines.length,r=0,n=0){this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=s,this._startOverscan=r,this._endOverscan=n,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}hasNext(){return this._current<this._endIndex}next(){const e=this._buffer.getWrappedRangeForLine(this._current);e.first<this._startIndex-this._startOverscan&&(e.first=this._startIndex-this._startOverscan),e.last>this._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);let t="";for(let i=e.first;i<=e.last;++i)t+=this._buffer.translateBufferLineToString(i,this._trimRight);return this._current=e.last+1,{range:e,content:t}}}t.BufferStringIterator=d},8437:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;const s=i(482),r=i(643),n=i(511),o=i(3734);t.DEFAULT_ATTR_DATA=Object.freeze(new o.AttributeData);const a={startIndex:0};class h{constructor(e,t,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const s=t||n.CellData.fromCharData([0,r.NULL_CELL_CHAR,r.NULL_CELL_WIDTH,r.NULL_CELL_CODE]);for(let t=0;t<e;++t)this.setCell(t,s);this.length=e}get(e){const t=this._data[3*e+0],i=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:i?(0,s.stringFromCodePoint)(i):"",t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,t){this._data[3*e+1]=t[r.CHAR_DATA_ATTR_INDEX],t[r.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[r.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[r.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?(0,s.stringFromCodePoint)(2097151&t):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,t){return a.startIndex=3*e,t.content=this._data[a.startIndex+0],t.fg=this._data[a.startIndex+1],t.bg=this._data[a.startIndex+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg}setCellFromCodePoint(e,t,i,s,r,n){268435456&r&&(this._extendedAttrs[e]=n),this._data[3*e+0]=t|i<<22,this._data[3*e+1]=s,this._data[3*e+2]=r}addCodepointToCell(e,t){let i=this._data[3*e+0];2097152&i?this._combined[e]+=(0,s.stringFromCodePoint)(t):(2097151&i?(this._combined[e]=(0,s.stringFromCodePoint)(2097151&i)+(0,s.stringFromCodePoint)(t),i&=-2097152,i|=2097152):i=t|1<<22,this._data[3*e+0]=i)}insertCells(e,t,i,s){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs),t<this.length-e){const s=new n.CellData;for(let i=this.length-e-t-1;i>=0;--i)this.setCell(e+t+i,this.loadCell(e+i,s));for(let s=0;s<t;++s)this.setCell(e+s,i)}else for(let t=e;t<this.length;++t)this.setCell(t,i);2===this.getWidth(this.length-1)&&this.setCellFromCodePoint(this.length-1,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs)}deleteCells(e,t,i,s){if(e%=this.length,t<this.length-e){const s=new n.CellData;for(let i=0;i<this.length-e-t;++i)this.setCell(e+i,this.loadCell(e+t+i,s));for(let e=this.length-t;e<this.length;++e)this.setCell(e,i)}else for(let t=e;t<this.length;++t)this.setCell(t,i);e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs),0!==this.getWidth(e)||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs)}replaceCells(e,t,i,s,r=!1){if(r)for(e&&2===this.getWidth(e-1)&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs),t<this.length&&2===this.getWidth(t-1)&&!this.isProtected(t)&&this.setCellFromCodePoint(t,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,i),e++;else for(e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs),t<this.length&&2===this.getWidth(t-1)&&this.setCellFromCodePoint(t,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs);e<t&&e<this.length;)this.setCell(e++,i)}resize(e,t){if(e!==this.length){if(e>this.length){const i=new Uint32Array(3*e);this.length&&(3*e<this._data.length?i.set(this._data.subarray(0,3*e)):i.set(this._data)),this._data=i;for(let i=this.length;i<e;++i)this.setCell(i,t)}else if(e){const t=new Uint32Array(3*e);t.set(this._data.subarray(0,3*e)),this._data=t;const i=Object.keys(this._combined);for(let t=0;t<i.length;t++){const s=parseInt(i[t],10);s>=e&&delete this._combined[s]}}else this._data=new Uint32Array(0),this._combined={};this.length=e}}fill(e,t=!1){if(t)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(const t in e._combined)this._combined[t]=e._combined[t];this._extendedAttrs={};for(const t in e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped}clone(){const e=new h(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const t in this._combined)e._combined[t]=this._combined[t];for(const t in this._extendedAttrs)e._extendedAttrs[t]=this._extendedAttrs[t];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,t,i,s,r){const n=e._data;if(r)for(let r=s-1;r>=0;r--){for(let e=0;e<3;e++)this._data[3*(i+r)+e]=n[3*(t+r)+e];268435456&n[3*(t+r)+2]&&(this._extendedAttrs[i+r]=e._extendedAttrs[t+r])}else for(let r=0;r<s;r++){for(let e=0;e<3;e++)this._data[3*(i+r)+e]=n[3*(t+r)+e];268435456&n[3*(t+r)+2]&&(this._extendedAttrs[i+r]=e._extendedAttrs[t+r])}const o=Object.keys(e._combined);for(let s=0;s<o.length;s++){const r=parseInt(o[s],10);r>=t&&(this._combined[r-t+i]=e._combined[r])}}translateToString(e=!1,t=0,i=this.length){e&&(i=Math.min(i,this.getTrimmedLength()));let n="";for(;t<i;){const e=this._data[3*t+0],i=2097151&e;n+=2097152&e?this._combined[t]:i?(0,s.stringFromCodePoint)(i):r.WHITESPACE_CELL_CHAR,t+=e>>22||1}return n}}t.BufferLine=h},4841:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(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)}},4634:(e,t)=>{function i(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();const s=!e[t].hasContent(i-1)&&1===e[t].getWidth(i-1),r=2===e[t+1].getWidth(0);return s&&r?i-1:i}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,s,r,n){const o=[];for(let a=0;a<e.length-1;a++){let h=a,c=e.get(++h);if(!c.isWrapped)continue;const l=[e.get(a)];for(;h<e.length&&c.isWrapped;)l.push(c),c=e.get(++h);if(r>=a&&r<h){a+=l.length-1;continue}let d=0,_=i(l,d,t),u=1,f=0;for(;u<l.length;){const e=i(l,u,t),r=e-f,o=s-_,a=Math.min(r,o);l[d].copyCellsFrom(l[u],f,_,a,!1),_+=a,_===s&&(d++,_=0),f+=a,f===e&&(u++,f=0),0===_&&0!==d&&2===l[d-1].getWidth(s-1)&&(l[d].copyCellsFrom(l[d-1],s-1,_++,1,!1),l[d-1].setCell(s-1,n))}l[d].replaceCells(_,s,n);let v=0;for(let e=l.length-1;e>0&&(e>d||0===l[e].getTrimmedLength());e--)v++;v>0&&(o.push(a+l.length-v),o.push(v)),a+=l.length-1}return o},t.reflowLargerCreateNewLayout=function(e,t){const i=[];let s=0,r=t[s],n=0;for(let o=0;o<e.length;o++)if(r===o){const i=t[++s];e.onDeleteEmitter.fire({index:o-n,amount:i}),o+=i-1,n+=i,r=t[++s]}else i.push(o);return{layout:i,countRemoved:n}},t.reflowLargerApplyNewLayout=function(e,t){const i=[];for(let s=0;s<t.length;s++)i.push(e.get(t[s]));for(let t=0;t<i.length;t++)e.set(t,i[t]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,s){const r=[],n=e.map(((s,r)=>i(e,r,t))).reduce(((e,t)=>e+t));let o=0,a=0,h=0;for(;h<n;){if(n-h<s){r.push(n-h);break}o+=s;const c=i(e,a,t);o>c&&(o-=c,a++);const l=2===e[a].getWidth(o-1);l&&o--;const d=l?s-1:s;r.push(d),h+=d}return r},t.getWrappedLineTrimmedLength=i},5295:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;const s=i(9092),r=i(8460),n=i(844);class o extends n.Disposable{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this.register(new r.EventEmitter),this.reset()}get onBufferActivate(){return this._onBufferActivate.event}reset(){this._normal=new s.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new s.Buffer(!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)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}}t.BufferSet=o},511:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const s=i(482),r=i(643),n=i(3734);class o extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(e){const t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,s.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[r.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[r.CHAR_DATA_CHAR_INDEX].length){const i=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|e[r.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[r.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[r.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[r.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},643:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;const s=i(8460),r=i(844);class n extends r.Disposable{constructor(e){super(),this.line=e,this._id=n._nextId++,this.isDisposed=!1,this._onDispose=new s.EventEmitter}get id(){return this._id}get onDispose(){return this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),super.dispose())}}t.Marker=n,n._nextId=1},7116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(e,t)=>{var i,s;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(e){e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="",e.BS="\b",e.HT="\t",e.LF="\n",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="",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""}(i=t.C0||(t.C0={})),(s=t.C1||(t.C1={})).PAD="",s.HOP="",s.BPH="",s.NBH="",s.IND="",s.NEL=" ",s.SSA="",s.ESA="",s.HTS="",s.HTJ="",s.VTS="",s.PLD="",s.PLU="",s.RI="",s.SS2="",s.SS3="",s.DCS="",s.PU1="",s.PU2="",s.STS="",s.CCH="",s.MW="",s.SPA="",s.EPA="",s.SOS="",s.SGCI="",s.SCI="",s.CSI="",s.ST="",s.OSC="",s.PM="",s.APC="",(t.C1_ESCAPED||(t.C1_ESCAPED={})).ST=`${i.ESC}\\`},7399:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;const s=i(2584),r={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:["'",'"']};t.evaluateKeyboardEvent=function(e,t,i,n){const o={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?o.key=t?s.C0.ESC+"OA":s.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?o.key=t?s.C0.ESC+"OD":s.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?o.key=t?s.C0.ESC+"OC":s.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(o.key=t?s.C0.ESC+"OB":s.C0.ESC+"[B");break;case 8:if(e.altKey){o.key=s.C0.ESC+s.C0.DEL;break}o.key=s.C0.DEL;break;case 9:if(e.shiftKey){o.key=s.C0.ESC+"[Z";break}o.key=s.C0.HT,o.cancel=!0;break;case 13:o.key=e.altKey?s.C0.ESC+s.C0.CR:s.C0.CR,o.cancel=!0;break;case 27:o.key=s.C0.ESC,e.altKey&&(o.key=s.C0.ESC+s.C0.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"D",o.key===s.C0.ESC+"[1;3D"&&(o.key=s.C0.ESC+(i?"b":"[1;5D"))):o.key=t?s.C0.ESC+"OD":s.C0.ESC+"[D";break;case 39:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"C",o.key===s.C0.ESC+"[1;3C"&&(o.key=s.C0.ESC+(i?"f":"[1;5C"))):o.key=t?s.C0.ESC+"OC":s.C0.ESC+"[C";break;case 38:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"A",i||o.key!==s.C0.ESC+"[1;3A"||(o.key=s.C0.ESC+"[1;5A")):o.key=t?s.C0.ESC+"OA":s.C0.ESC+"[A";break;case 40:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"B",i||o.key!==s.C0.ESC+"[1;3B"||(o.key=s.C0.ESC+"[1;5B")):o.key=t?s.C0.ESC+"OB":s.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(o.key=s.C0.ESC+"[2~");break;case 46:o.key=a?s.C0.ESC+"[3;"+(a+1)+"~":s.C0.ESC+"[3~";break;case 36:o.key=a?s.C0.ESC+"[1;"+(a+1)+"H":t?s.C0.ESC+"OH":s.C0.ESC+"[H";break;case 35:o.key=a?s.C0.ESC+"[1;"+(a+1)+"F":t?s.C0.ESC+"OF":s.C0.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=s.C0.ESC+"[5;"+(a+1)+"~":o.key=s.C0.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=s.C0.ESC+"[6;"+(a+1)+"~":o.key=s.C0.ESC+"[6~";break;case 112:o.key=a?s.C0.ESC+"[1;"+(a+1)+"P":s.C0.ESC+"OP";break;case 113:o.key=a?s.C0.ESC+"[1;"+(a+1)+"Q":s.C0.ESC+"OQ";break;case 114:o.key=a?s.C0.ESC+"[1;"+(a+1)+"R":s.C0.ESC+"OR";break;case 115:o.key=a?s.C0.ESC+"[1;"+(a+1)+"S":s.C0.ESC+"OS";break;case 116:o.key=a?s.C0.ESC+"[15;"+(a+1)+"~":s.C0.ESC+"[15~";break;case 117:o.key=a?s.C0.ESC+"[17;"+(a+1)+"~":s.C0.ESC+"[17~";break;case 118:o.key=a?s.C0.ESC+"[18;"+(a+1)+"~":s.C0.ESC+"[18~";break;case 119:o.key=a?s.C0.ESC+"[19;"+(a+1)+"~":s.C0.ESC+"[19~";break;case 120:o.key=a?s.C0.ESC+"[20;"+(a+1)+"~":s.C0.ESC+"[20~";break;case 121:o.key=a?s.C0.ESC+"[21;"+(a+1)+"~":s.C0.ESC+"[21~";break;case 122:o.key=a?s.C0.ESC+"[23;"+(a+1)+"~":s.C0.ESC+"[23~";break;case 123:o.key=a?s.C0.ESC+"[24;"+(a+1)+"~":s.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(i&&!n||!e.altKey||e.metaKey)!i||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&1===e.key.length?o.key=e.key:e.key&&e.ctrlKey&&("_"===e.key&&(o.key=s.C0.US),"@"===e.key&&(o.key=s.C0.NUL)):65===e.keyCode&&(o.type=1);else{const t=r[e.keyCode],i=null==t?void 0:t[e.shiftKey?1:0];if(i)o.key=s.C0.ESC+i;else if(e.keyCode>=65&&e.keyCode<=90){const t=e.ctrlKey?e.keyCode-64:e.keyCode+32;let i=String.fromCharCode(t);e.shiftKey&&(i=i.toUpperCase()),o.key=s.C0.ESC+i}else if("Dead"===e.key&&e.code.startsWith("Key")){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),o.key=s.C0.ESC+t,o.cancel=!0}}else e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?o.key=s.C0.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?o.key=s.C0.DEL:219===e.keyCode?o.key=s.C0.ESC:220===e.keyCode?o.key=s.C0.FS:221===e.keyCode&&(o.key=s.C0.GS)}return o}},482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let t=e[r];t>65535?(t-=65536,s+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):s+=String.fromCharCode(t)}return s},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){const i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){const i=e.charCodeAt(r++);56320<=i&&i<=57343?t[s++]=1024*(this._interim-55296)+i-56320+65536:(t[s++]=this._interim,t[s++]=i),this._interim=0}for(let n=r;n<i;++n){const r=e.charCodeAt(n);if(55296<=r&&r<=56319){if(++n>=i)return this._interim=r,s;const o=e.charCodeAt(n);56320<=o&&o<=57343?t[s++]=1024*(r-55296)+o-56320+65536:(t[s++]=r,t[s++]=o)}else 65279!==r&&(t[s++]=r)}return s}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){const i=e.length;if(!i)return 0;let s,r,n,o,a=0,h=0,c=0;if(this.interim[0]){let s=!1,r=this.interim[0];r&=192==(224&r)?31:224==(240&r)?15:7;let n,o=0;for(;(n=63&this.interim[++o])&&o<4;)r<<=6,r|=n;const h=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,l=h-o;for(;c<l;){if(c>=i)return 0;if(n=e[c++],128!=(192&n)){c--,s=!0;break}this.interim[o++]=n,r<<=6,r|=63&n}s||(2===h?r<128?c--:t[a++]=r:3===h?r<2048||r>=55296&&r<=57343||65279===r||(t[a++]=r):r<65536||r>1114111||(t[a++]=r)),this.interim.fill(0)}const l=i-4;let d=c;for(;d<i;){for(;!(!(d<l)||128&(s=e[d])||128&(r=e[d+1])||128&(n=e[d+2])||128&(o=e[d+3]));)t[a++]=s,t[a++]=r,t[a++]=n,t[a++]=o,d+=4;if(s=e[d++],s<128)t[a++]=s;else if(192==(224&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(h=(31&s)<<6|63&r,h<128){d--;continue}t[a++]=h}else if(224==(240&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(n=e[d++],128!=(192&n)){d--;continue}if(h=(15&s)<<12|(63&r)<<6|63&n,h<2048||h>=55296&&h<=57343||65279===h)continue;t[a++]=h}else if(240==(248&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(n=e[d++],128!=(192&n)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,this.interim[2]=n,a;if(o=e[d++],128!=(192&o)){d--;continue}if(h=(7&s)<<18|(63&r)<<12|(63&n)<<6|63&o,h<65536||h>1114111)continue;t[a++]=h}}return a}}},225:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const s=i(8273),r=[[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]],n=[[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]];let o;t.UnicodeV6=class{constructor(){if(this.version="6",!o){o=new Uint8Array(65536),(0,s.fill)(o,1),o[0]=0,(0,s.fill)(o,0,1,32),(0,s.fill)(o,0,127,160),(0,s.fill)(o,2,4352,4448),o[9001]=2,o[9002]=2,(0,s.fill)(o,2,11904,42192),o[12351]=1,(0,s.fill)(o,2,44032,55204),(0,s.fill)(o,2,63744,64256),(0,s.fill)(o,2,65040,65050),(0,s.fill)(o,2,65072,65136),(0,s.fill)(o,2,65280,65377),(0,s.fill)(o,2,65504,65511);for(let e=0;e<r.length;++e)(0,s.fill)(o,0,r[e][0],r[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?o[e]:function(e,t){let i,s=0,r=t.length-1;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=s;)if(i=s+r>>1,e>t[i][1])s=i+1;else{if(!(e<t[i][0]))return!0;r=i-1}return!1}(e,n)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}}},5981:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;const s=i(8460),r="undefined"==typeof queueMicrotask?e=>{Promise.resolve().then(e)}:queueMicrotask;t.WriteBuffer=class{constructor(e){this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._onWriteParsed=new s.EventEmitter}get onWriteParsed(){return this._onWriteParsed.event}writeSync(e,t){if(void 0!==t&&this._syncCalls>t)return void(this._syncCalls=0);if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let i;for(this._isSyncWriting=!0;i=this._writeBuffer.shift();){this._action(i);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout((()=>this._innerWrite()))),this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){const i=e||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],s=this._action(e,t);if(s){const e=e=>Date.now()-i>=12?setTimeout((()=>this._innerWrite(0,e))):this._innerWrite(i,e);return void s.catch((e=>(r((()=>{throw e})),Promise.resolve(!1)))).then(e)}const n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-i>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}},5941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;const i=/^([\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})$/,s=/^[\da-f]+$/;function r(e,t){const i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}t.parseColor=function(e){if(!e)return;let t=e.toLowerCase();if(0===t.indexOf("rgb:")){t=t.slice(4);const e=i.exec(t);if(e){const t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(0===t.indexOf("#")&&(t=t.slice(1),s.exec(t)&&[3,6,9,12].includes(t.length))){const e=t.length/3,i=[0,0,0];for(let s=0;s<3;++s){const r=parseInt(t.slice(e*s,e*s+e),16);i[s]=1===e?r<<4:2===e?r:3===e?r>>4:r>>8}return i}},t.toRgbString=function(e,t=16){const[i,s,n]=e;return`rgb:${r(i,t)}/${r(s,t)}/${r(n,t)}`}},5770:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;const s=i(482),r=i(8742),n=i(5770),o=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);const i=this._handlers[e];return i.push(t),{dispose:()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,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=o,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t);else this._handlerFb(this._ident,"HOOK",t)}put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i);else this._handlerFb(this._ident,"PUT",(0,s.utf32ToString)(e,t,i))}unhook(e,t=!0){if(this._active.length){let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&!1===i){for(;s>=0&&(i=this._active[s].unhook(e),!0!==i);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",e);this._active=o,this._ident=0}};const a=new r.Params;a.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data="",this._params=a,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():a,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,s.utf32ToString)(e,t,i),this._data.length>n.PAYLOAD_LIMIT&&(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((e=>(this._params=a,this._data="",this._hitLimit=!1,e)));return this._params=a,this._data="",this._hitLimit=!1,t}}},2015:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;const s=i(844),r=i(8273),n=i(8742),o=i(6242),a=i(6351);class h{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){(0,r.fill)(this.table,e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|s}}t.TransitionTable=h;const c=160;t.VT500_TRANSITION_TABLE=function(){const e=new h(4095),t=Array.apply(null,Array(256)).map(((e,t)=>t)),i=(e,i)=>t.slice(e,i),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));const n=i(0,14);let o;for(o in e.setDefault(1,0),e.addMany(s,0,2,0),n)e.addMany([24,26,153,154],o,3,0),e.addMany(i(128,144),o,3,0),e.addMany(i(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(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(c,0,2,0),e.add(c,8,5,8),e.add(c,6,0,6),e.add(c,11,0,11),e.add(c,13,13,13),e}();class l extends s.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){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 n.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(e,t,i)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser=new o.OscParser,this._dcsParser=new a.DcsParser,this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>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 t=0;t<e.intermediates.length;++t){const s=e.intermediates.charCodeAt(t);if(32>s||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=s}}if(1!==e.final.length)throw new Error("final must be a single byte");const s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){const t=[];for(;e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")}dispose(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){const i=this._identifier(e,[48,126]);void 0===this._escHandlers[i]&&(this._escHandlers[i]=[]);const s=this._escHandlers[i];return s.push(t),{dispose:()=>{const e=s.indexOf(t);-1!==e&&s.splice(e,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){const i=this._identifier(e);void 0===this._csiHandlers[i]&&(this._csiHandlers[i]=[]);const s=this._csiHandlers[i];return s.push(t),{dispose:()=>{const e=s.indexOf(t);-1!==e&&s.splice(e,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.precedingCodepoint=0,0!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s,r=0,n=0,o=0;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(void 0===i||1===this._parseStack.state)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const t=this._parseStack.handlers;let n=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===i&&n>-1)for(;n>=0&&(s=t[n](this._params),!0!==s);n--)if(s instanceof Promise)return this._parseStack.handlerPos=n,s;this._parseStack.handlers=[];break;case 4:if(!1===i&&n>-1)for(;n>=0&&(s=t[n](),!0!==s);n--)if(s instanceof Promise)return this._parseStack.handlerPos=n,s;this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],s=this._dcsParser.unhook(24!==r&&26!==r,i),s)return s;27===r&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],s=this._oscParser.end(24!==r&&26!==r,i),s)return s;27===r&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let i=o;i<t;++i){switch(r=e[i],n=this._transitions.table[this.currentState<<8|(r<160?r:c)],n>>4){case 2:for(let s=i+1;;++s){if(s>=t||(r=e[s])<32||r>126&&r<c){this._printHandler(e,i,s),i=s-1;break}if(++s>=t||(r=e[s])<32||r>126&&r<c){this._printHandler(e,i,s),i=s-1;break}if(++s>=t||(r=e[s])<32||r>126&&r<c){this._printHandler(e,i,s),i=s-1;break}if(++s>=t||(r=e[s])<32||r>126&&r<c){this._printHandler(e,i,s),i=s-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:i,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const o=this._csiHandlers[this._collect<<8|r];let a=o?o.length-1:-1;for(;a>=0&&(s=o[a](this._params),!0!==s);a--)if(s instanceof Promise)return this._preserveStack(3,o,a,n,i),s;a<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingCodepoint=0;break;case 8:do{switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}}while(++i<t&&(r=e[i])>47&&r<60);i--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:const h=this._escHandlers[this._collect<<8|r];let l=h?h.length-1:-1;for(;l>=0&&(s=h[l](),!0!==s);l--)if(s instanceof Promise)return this._preserveStack(4,h,l,n,i),s;l<0&&this._escHandlerFb(this._collect<<8|r),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let s=i+1;;++s)if(s>=t||24===(r=e[s])||26===r||27===r||r>127&&r<c){this._dcsParser.put(e,i,s),i=s-1;break}break;case 14:if(s=this._dcsParser.unhook(24!==r&&26!==r),s)return this._preserveStack(6,[],0,n,i),s;27===r&&(n|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let s=i+1;;s++)if(s>=t||(r=e[s])<32||r>127&&r<c){this._oscParser.put(e,i,s),i=s-1;break}break;case 6:if(s=this._oscParser.end(24!==r&&26!==r),s)return this._preserveStack(5,[],0,n,i),s;27===r&&(n|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&n}}}t.EscapeSequenceParser=l},6242:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;const s=i(5770),r=i(482),n=[];t.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);const i=this._handlers[e];return i.push(t),{dispose:()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,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=n}reset(){if(2===this._state)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=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,"START")}_put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i);else this._handlerFb(this._id,"PUT",(0,r.utf32ToString)(e,t,i))}start(){this.reset(),this._state=1}put(e,t,i){if(3!==this._state){if(1===this._state)for(;t<i;){const i=e[t++];if(59===i){this._state=2,this._start();break}if(i<48||57<i)return void(this._state=3);-1===this._id&&(this._id=0),this._id=10*this._id+i-48}2===this._state&&i-t>0&&this._put(e,t,i)}}end(e,t=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),this._active.length){let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&!1===i){for(;s>=0&&(i=this._active[s].end(e),!0!==i);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._id,"END",e);this._active=n,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,r.utf32ToString)(e,t,i),this._data.length>s.PAYLOAD_LIMIT&&(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((e=>(this._data="",this._hitLimit=!1,e)));return this._data="",this._hitLimit=!1,t}}},8742:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;const i=2147483647;class s{constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(e){const t=new s;if(!e.length)return t;for(let i=Array.isArray(e[0])?1:0;i<e.length;++i){const s=e[i];if(Array.isArray(s))for(let e=0;e<s.length;++e)t.addSubParam(s[e]);else t.addParam(s)}return t}clone(){const e=new s(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){const e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);const i=this._subParamsIdx[t]>>8,s=255&this._subParamsIdx[t];s-i>0&&e.push(Array.prototype.slice.call(this._subParams,i,s))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>i?i:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>i?i:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){const t=this._subParamsIdx[e]>>8,i=255&this._subParamsIdx[e];return i-t>0?this._subParams.subarray(t,i):null}getSubParamsAll(){const e={};for(let t=0;t<this.length;++t){const i=this._subParamsIdx[t]>>8,s=255&this._subParamsIdx[t];s-i>0&&(e[t]=this._subParams.slice(i,s))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const s=this._digitIsSub?this._subParams:this.params,r=s[t-1];s[t-1]=~r?Math.min(10*r+e,i):e}}t.Params=s},5741:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){const i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(-1===t)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)}}},8771:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;const s=i(3785),r=i(511);t.BufferApiView=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){const t=this._buffer.lines.get(e);if(t)return new s.BufferLineApiView(t)}getNullCell(){return new r.CellData}}},3785:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;const s=i(511);t.BufferLineApiView=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 s.CellData)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}}},8285:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;const s=i(8771),r=i(8460);t.BufferNamespaceApi=class{constructor(e){this._core=e,this._onBufferChange=new r.EventEmitter,this._normal=new s.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new s.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get onBufferChange(){return this._onBufferChange.event}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)}}},7975:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,(e=>t(e.toArray())))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,((e,i)=>t(e,i.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)}}},7090:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=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}}},744:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;const n=i(2585),o=i(5295),a=i(8460),h=i(844);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let c=class extends h.Disposable{constructor(e){super(),this.isUserScrolling=!1,this._onResize=new a.EventEmitter,this._onScroll=new a.EventEmitter,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=new o.BufferSet(e,this)}get onResize(){return this._onResize.event}get onScroll(){return this._onScroll.event}get buffer(){return this.buffers.active}dispose(){super.dispose(),this.buffers.dispose()}resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:e,rows:t})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){const i=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===e.fg&&s.getBg(0)===e.bg||(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;const r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(0===i.scrollTop){const e=i.lines.isFull;n===i.lines.length-1?e?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),e?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const e=n-r+1;i.lines.shiftElements(r+1,e-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t,i){const s=this.buffer;if(e<0){if(0===s.ydisp)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const r=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),r!==s.ydisp&&(t||this._onScroll.fire(s.ydisp))}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this.buffer.ydisp)}scrollToBottom(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)}scrollToLine(e){const t=e-this.buffer.ydisp;0!==t&&this.scrollLines(t)}};c=s([r(0,n.IOptionsService)],c),t.BufferService=c},7994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=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)}}},1753:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;const n=i(2585),o=i(8460),a={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>32!==e.action},DRAG:{events:23,restrict:e=>32!==e.action||3!==e.button},ANY:{events:31,restrict:e=>!0}};function h(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?(i|=64,i|=e.action):(i|=3&e.button,4&e.button&&(i|=64),8&e.button&&(i|=128),32===e.action?i|=32:0!==e.action||t||(i|=3)),i}const c=String.fromCharCode,l={DEFAULT:e=>{const t=[h(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`[M${c(t[0])}${c(t[1])}${c(t[2])}`},SGR:e=>{const t=0===e.action&&4!==e.button?"m":"M";return`[<${h(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{const t=0===e.action&&4!==e.button?"m":"M";return`[<${h(e,!0)};${e.x};${e.y}${t}`}};let d=class{constructor(e,t){this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new o.EventEmitter,this._lastEvent=null;for(const e of Object.keys(a))this.addProtocol(e,a[e]);for(const e of Object.keys(l))this.addEncoding(e,l[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return 0!==this._protocols[this._activeProtocol].events}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}get onProtocolChange(){return this._onProtocolChange.event}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows)return!1;if(4===e.button&&32===e.action)return!1;if(3===e.button&&32!==e.action)return!1;if(4!==e.button&&(2===e.action||3===e.action))return!1;if(e.col++,e.row++,32===e.action&&this._lastEvent&&this._equalEvents(this._lastEvent,e,"SGR_PIXELS"===this._activeEncoding))return!1;if(!this._protocols[this._activeProtocol].restrict(e))return!1;const t=this._encodings[this._activeEncoding](e);return t&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x)return!1;if(e.y!==t.y)return!1}else{if(e.col!==t.col)return!1;if(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}};d=s([r(0,n.IBufferService),r(1,n.ICoreService)],d),t.CoreMouseService=d},6975:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;const n=i(2585),o=i(8460),a=i(1439),h=i(844),c=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let d=class extends h.Disposable{constructor(e,t,i,s){super(),this._bufferService=t,this._logService=i,this._optionsService=s,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new o.EventEmitter),this._onUserInput=this.register(new o.EventEmitter),this._onBinary=this.register(new o.EventEmitter),this._scrollToBottom=e,this.register({dispose:()=>this._scrollToBottom=void 0}),this.modes=(0,a.clone)(c),this.decPrivateModes=(0,a.clone)(l)}get onData(){return this._onData.event}get onUserInput(){return this._onUserInput.event}get onBinary(){return this._onBinary.event}reset(){this.modes=(0,a.clone)(c),this.decPrivateModes=(0,a.clone)(l)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const i=this._bufferService.buffer;i.ybase!==i.ydisp&&this._scrollToBottom(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split("").map((e=>e.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split("").map((e=>e.charCodeAt(0))))),this._onBinary.fire(e))}};d=s([r(1,n.IBufferService),r(2,n.ILogService),r(3,n.IOptionsService)],d),t.CoreService=d},9074:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;const s=i(8055),r=i(8460),n=i(844),o=i(6106),a={xmin:0,xmax:0};class h extends n.Disposable{constructor(){super(...arguments),this._decorations=new o.SortedList((e=>null==e?void 0:e.marker.line)),this._onDecorationRegistered=this.register(new r.EventEmitter),this._onDecorationRemoved=this.register(new r.EventEmitter)}get onDecorationRegistered(){return this._onDecorationRegistered.event}get onDecorationRemoved(){return this._onDecorationRemoved.event}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;const t=new c(e);if(t){const e=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){var s,r,n;let o=0,a=0;for(const h of this._decorations.getKeyIterator(t))o=null!==(s=h.options.x)&&void 0!==s?s:0,a=o+(null!==(r=h.options.width)&&void 0!==r?r:1),e>=o&&e<a&&(!i||(null!==(n=h.options.layer)&&void 0!==n?n:"bottom")===i)&&(yield h)}forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,(t=>{var r,n,o;a.xmin=null!==(r=t.options.x)&&void 0!==r?r:0,a.xmax=a.xmin+(null!==(n=t.options.width)&&void 0!==n?n:1),e>=a.xmin&&e<a.xmax&&(!i||(null!==(o=t.options.layer)&&void 0!==o?o:"bottom")===i)&&s(t)}))}dispose(){for(const e of this._decorations.values())this._onDecorationRemoved.fire(e);this.reset()}}t.DecorationService=h;class c extends n.Disposable{constructor(e){super(),this.options=e,this.isDisposed=!1,this.onRenderEmitter=this.register(new r.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new r.EventEmitter),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 null===this._cachedBg&&(this.options.backgroundColor?this._cachedBg=s.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return null===this._cachedFg&&(this.options.foregroundColor?this._cachedFg=s.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._isDisposed||(this._isDisposed=!0,this._onDispose.fire(),super.dispose())}}},3730:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DirtyRowService=void 0;const n=i(2585);let o=class{constructor(e){this._bufferService=e,this.clearRange()}get start(){return this._start}get end(){return this._end}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){if(e>t){const i=e;e=t,t=i}e<this._start&&(this._start=e),t>this._end&&(this._end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};o=s([r(0,n.IBufferService)],o),t.DirtyRowService=o},4348:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;const s=i(2585),r=i(8343);class n{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){this._entries.forEach(((t,i)=>e(i,t)))}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=n,t.InstantiationService=class{constructor(){this._services=new n,this._services.set(s.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){const i=(0,r.getServiceDependencies)(e).sort(((e,t)=>e.index-t.index)),s=[];for(const t of i){const i=this._services.get(t.id);if(!i)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);s.push(i)}const n=i.length>0?i[0].index:t.length;if(t.length!==n)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${n+1} conflicts with ${t.length} static arguments`);return new e(...[...t,...s])}}},7866:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LogService=void 0;const n=i(2585),o={debug:n.LogLevelEnum.DEBUG,info:n.LogLevelEnum.INFO,warn:n.LogLevelEnum.WARN,error:n.LogLevelEnum.ERROR,off:n.LogLevelEnum.OFF};let a=class{constructor(e){this._optionsService=e,this.logLevel=n.LogLevelEnum.OFF,this._updateLogLevel(),this._optionsService.onOptionChange((e=>{"logLevel"===e&&this._updateLogLevel()}))}_updateLogLevel(){this.logLevel=o[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,"xterm.js: "+t,...i)}debug(e,...t){this.logLevel<=n.LogLevelEnum.DEBUG&&this._log(console.log,e,t)}info(e,...t){this.logLevel<=n.LogLevelEnum.INFO&&this._log(console.info,e,t)}warn(e,...t){this.logLevel<=n.LogLevelEnum.WARN&&this._log(console.warn,e,t)}error(e,...t){this.logLevel<=n.LogLevelEnum.ERROR&&this._log(console.error,e,t)}};a=s([r(0,n.IOptionsService)],a),t.LogService=a},7302:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;const s=i(8460),r=i(6114);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:r.isMac,windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const n=["normal","bold","100","200","300","400","500","600","700","800","900"];t.OptionsService=class{constructor(e){this._onOptionChange=new s.EventEmitter;const i=Object.assign({},t.DEFAULT_OPTIONS);for(const t in e)if(t in i)try{const s=e[t];i[t]=this._sanitizeAndValidateOption(t,s)}catch(e){console.error(e)}this.rawOptions=i,this.options=Object.assign({},i),this._setupOptions()}get onOptionChange(){return this._onOptionChange.event}_setupOptions(){const e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);return this.rawOptions[e]},i=(e,i)=>{if(!(e in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);i=this._sanitizeAndValidateOption(e,i),this.rawOptions[e]!==i&&(this.rawOptions[e]=i,this._onOptionChange.fire(e))};for(const t in this.rawOptions){const s={get:e.bind(this,t),set:i.bind(this,t)};Object.defineProperty(this.options,t,s)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=t.DEFAULT_OPTIONS[e]),!function(e){return"block"===e||"underline"===e||"bar"===e}(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=t.DEFAULT_OPTIONS[e]);break;case"fontWeight":case"fontWeightBold":if("number"==typeof i&&1<=i&&i<=1e3)break;i=n.includes(i)?i:t.DEFAULT_OPTIONS[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);case"rows":case"cols":if(!i&&0!==i)throw new Error(`${e} must be numeric, value: ${i}`)}return i}}},2660:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;const n=i(2585);let o=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){const t=this._bufferService.buffer;if(void 0===e.id){const i=t.addMarker(t.ybase+t.y),s={data:e,id:this._nextId++,lines:[i]};return i.onDispose((()=>this._removeMarkerFromLink(s,i))),this._dataByLinkId.set(s.id,s),s.id}const i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;const n=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(o,n))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){const i=this._dataByLinkId.get(e);if(i&&i.lines.every((e=>e.line!==t))){const e=this._bufferService.buffer.addMarker(t);i.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(i,e)))}}getLinkData(e){var t;return null===(t=this._dataByLinkId.get(e))||void 0===t?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){const i=e.lines.indexOf(t);-1!==i&&(e.lines.splice(i,1),0===e.lines.length&&(void 0!==e.data.id&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};o=s([r(0,n.IBufferService)],o),t.OscLinkService=o},8343:(e,t)=>{function i(e,t,i){t.di$target===t?t.di$dependencies.push({id:e,index:i}):(t.di$dependencies=[{id:e,index:i}],t.di$target=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0,t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e.di$dependencies||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);const s=function(e,t,r){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");i(s,e,r)};return s.toString=()=>e,t.serviceRegistry.set(e,s),s}},2585:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.IDirtyRowService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const s=i(8343);var r;t.IBufferService=(0,s.createDecorator)("BufferService"),t.ICoreMouseService=(0,s.createDecorator)("CoreMouseService"),t.ICoreService=(0,s.createDecorator)("CoreService"),t.ICharsetService=(0,s.createDecorator)("CharsetService"),t.IDirtyRowService=(0,s.createDecorator)("DirtyRowService"),t.IInstantiationService=(0,s.createDecorator)("InstantiationService"),(r=t.LogLevelEnum||(t.LogLevelEnum={}))[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.WARN=2]="WARN",r[r.ERROR=3]="ERROR",r[r.OFF=4]="OFF",t.ILogService=(0,s.createDecorator)("LogService"),t.IOptionsService=(0,s.createDecorator)("OptionsService"),t.IOscLinkService=(0,s.createDecorator)("OscLinkService"),t.IUnicodeService=(0,s.createDecorator)("UnicodeService"),t.IDecorationService=(0,s.createDecorator)("DecorationService")},1480:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const s=i(8460),r=i(225);t.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new s.EventEmitter;const e=new r.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}get onChange(){return this._onChange.event}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0;const i=e.length;for(let s=0;s<i;++s){let r=e.charCodeAt(s);if(55296<=r&&r<=56319){if(++s>=i)return t+this.wcwidth(r);const n=e.charCodeAt(s);56320<=n&&n<=57343?r=1024*(r-55296)+n-56320+65536:t+=this.wcwidth(n)}t+=this.wcwidth(r)}return t}}}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var n=t[s]={exports:{}};return e[s].call(n.exports,n,n.exports,i),n.exports}var s={};return(()=>{var e=s;Object.defineProperty(e,"__esModule",{value:!0}),e.Terminal=void 0;const t=i(3236),r=i(9042),n=i(7975),o=i(7090),a=i(5741),h=i(8285),c=["cols","rows"];e.Terminal=class{constructor(e){this._core=new t.Terminal(e),this._addonManager=new a.AddonManager,this._publicOptions=Object.assign({},this._core.options);const i=e=>this._core.options[e],s=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(const e in this._core.options){const t={get:i.bind(this,e),set:s.bind(this,e)};Object.defineProperty(this._publicOptions,e,t)}}_checkReadonlyOptions(e){if(c.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._checkProposedApi(),this._parser||(this._parser=new n.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new o.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._checkProposedApi(),this._buffer||(this._buffer=new h.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const e=this._core.coreService.decPrivateModes;let 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"}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,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(const t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}registerLinkProvider(e){return this._checkProposedApi(),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.addMarker(e)}registerDecoration(e){var t,i,s;return this._checkProposedApi(),this._verifyPositiveIntegers(null!==(t=e.x)&&void 0!==t?t:0,null!==(i=e.width)&&void 0!==i?i:0,null!==(s=e.height)&&void 0!==s?s:0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}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(){this._addonManager.dispose(),this._core.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\n",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){return this._addonManager.loadAddon(this,e)}static get strings(){return r}_verifyIntegers(...e){for(const t of e)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(const t of e)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}})(),s})()}));+!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(globalThis,(()=>(()=>{"use strict";var e={2840:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const n=i(7721),o=i(4292),a=i(7150),l=i(7098),h=i(6501),c=i(7093);let d=class extends a.Disposable{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";const r=this._coreBrowserService.mainDocument;this._accessibilityContainer=r.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=r.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,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=r.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new o.TimeBasedDebouncer(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((e=>this._handleResize(e.rows)))),this._register(this._terminal.onRender((e=>this._refreshRows(e.start,e.end)))),this._register(this._terminal.onScroll((()=>this._refreshRows()))),this._register(this._terminal.onA11yChar((e=>this._handleChar(e)))),this._register(this._terminal.onLineFeed((()=>this._handleChar("\n")))),this._register(this._terminal.onA11yTab((e=>this._handleTab(e)))),this._register(this._terminal.onKey((e=>this._handleKey(e.key)))),this._register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this._register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._register((0,c.addDisposableListener)(r,"selectionchange",(()=>this._handleSelectionChange()))),this._register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRowsDimensions(),this._refreshRows(),this._register((0,a.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=n.tooMuchOutput.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){const e=i.lines.get(i.ydisp+r),t=[],n=e?.translateToString(!0,void 0,void 0,t)||"",o=(i.ydisp+r+1).toString(),a=this._rowElements[r];a&&(0===n.length?(a.textContent=" ",this._rowColumns.set(a,[0,1])):(a.textContent=n,this._rowColumns.set(a,t)),a.setAttribute("aria-posinset",o),a.setAttribute("aria-setsize",s),this._alignRowWidth(a))}this._announceCharacters()}_announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){const i=e.target,s=this._rowElements[0===t?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")===(0===t?"1":`${this._terminal.buffer.lines.length}`))return;if(e.relatedTarget!==s)return;let r,n;if(0===t?(r=i,n=this._rowElements.pop(),this._rowContainer.removeChild(n)):(r=this._rowElements.shift(),n=i,this._rowContainer.removeChild(r)),r.removeEventListener("focus",this._topBoundaryFocusListener),n.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){const e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement("afterbegin",e)}else{const e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(0===this._rowElements.length)return;const e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,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;const s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;const r=({node:e,offset:t})=>{const i=e instanceof Text?e.parentNode:e;let s=parseInt(i?.getAttribute("aria-posinset"),10)-1;if(isNaN(s))return console.warn("row is invalid. Race condition?"),null;const r=this._rowColumns.get(i);if(!r)return console.warn("columns is null. Race condition?"),null;let n=t<r.length?r[t]:r.slice(-1)[0]+1;return n>=this._terminal.cols&&(++s,n=0),{row:s,column:n}},n=r(t),o=r(i);if(n&&o){if(n.row>o.row||n.row===o.row&&n.column>=o.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(o.row-n.row)*this._terminal.cols-n.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const 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){e.style.transform="";const t=e.getBoundingClientRect().width,i=this._rowColumns.get(e)?.slice(-1)?.[0];if(!i)return;const s=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${s/t})`}};t.AccessibilityManager=d,t.AccessibilityManager=d=s([r(1,h.IInstantiationService),r(2,l.ICoreBrowserService),r(3,l.IRenderService)],d)},7861:(e,t)=>{function i(e){return e.replace(/\r?\n/g,"\r")}function s(e,t){return t?"[200~"+e+"[201~":e}function r(e,t,r,n){e=s(e=i(e),r.decPrivateModes.bracketedPasteMode&&!0!==n.rawOptions.ignoreBracketedPasteMode),r.triggerDataEvent(e,!0),t.value=""}function n(e,t,i){const s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.prepareTextForTerminal=i,t.bracketTextForPaste=s,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,i,s){e.stopPropagation(),e.clipboardData&&r(e.clipboardData.getData("text/plain"),t,i,s)},t.paste=r,t.moveTextAreaUnderMouseCursor=n,t.rightClickHandler=function(e,t,i,s,r){n(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}},7174:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const s=i(7710);t.ColorContrastCache=class{constructor(){this._color=new s.TwoKeyMap,this._css=new s.TwoKeyMap}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},1718:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserTerminal=void 0;const s=i(7861),r=i(7721),n=i(3285),o=i(4017),a=i(4196),l=i(9925),h=i(3618),c=i(3955),d=i(4792),u=i(945),_=i(9574),f=i(9820),p=i(9784),g=i(5783),m=i(2079),v=i(7098),S=i(9078),b=i(4103),C=i(5777),y=i(701),w=i(6107),E=i(3534),D=i(706),L=i(8693),R=i(4720),A=i(6501),T=i(2486),k=i(2840),M=i(8906),O=i(802),I=i(7093),P=i(7150);class x extends C.CoreTerminal{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}constructor(e={}){super(e),this._linkifier=this._register(new P.MutableDisposable),this.browser=y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new P.MutableDisposable),this._onCursorMove=this._register(new O.Emitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new O.Emitter),this.onKey=this._onKey.event,this._onRender=this._register(new O.Emitter),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new O.Emitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new O.Emitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new O.Emitter),this.onBell=this._onBell.event,this._onFocus=this._register(new O.Emitter),this._onBlur=this._register(new O.Emitter),this._onA11yCharEmitter=this._register(new O.Emitter),this._onA11yTabEmitter=this._register(new O.Emitter),this._onWillOpen=this._register(new O.Emitter),this._setup(),this._decorationService=this._instantiationService.createInstance(R.DecorationService),this._instantiationService.setService(A.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(f.LinkProviderService),this._instantiationService.setService(v.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(n.OscLinkProvider)),this._register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this._register(this._inputHandler.onRequestRefreshRows((e=>this.refresh(e?.start??0,e?.end??this.rows-1)))),this._register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this._register(this._inputHandler.onRequestReset((()=>this.reset()))),this._register(this._inputHandler.onRequestWindowsOptionsReport((e=>this._reportWindowsOptions(e)))),this._register(this._inputHandler.onColor((e=>this._handleColorEvent(e)))),this._register(O.Event.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(O.Event.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(O.Event.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(O.Event.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize((e=>this._afterResize(e.cols,e.rows)))),this._register((0,P.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(e){if(this._themeService)for(const t of e){let e,i="";switch(t.index){case 256:e="foreground",i="10";break;case 257:e="background",i="11";break;case 258:e="cursor",i="12";break;default:e="ansi",i="4;"+t.index}switch(t.type){case 0:const s=b.color.toColorRGB("ansi"===e?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${E.C0.ESC}]${i};${(0,L.toRgbString)(s)}${E.C1_ESCAPED.ST}`);break;case 1:if("ansi"===e)this._themeService.modifyColors((e=>e.ansi[t.index]=b.channels.toColor(...t.color)));else{const i=e;this._themeService.modifyColors((e=>e[i]=b.channels.toColor(...t.color)))}break;case 2:this._themeService.restoreColor(t.index)}}}_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(k.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(E.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(E.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;const i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),n=this._renderService.dimensions.css.cell.width*r,o=this.buffer.y*this._renderService.dimensions.css.cell.height,a=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register((0,I.addDisposableListener)(this.element,"copy",(e=>{this.hasSelection()&&(0,s.copyHandler)(e,this._selectionService)})));const e=e=>(0,s.handlePasteEvent)(e,this.textarea,this.coreService,this.optionsService);this._register((0,I.addDisposableListener)(this.textarea,"paste",e)),this._register((0,I.addDisposableListener)(this.element,"paste",e)),y.isFirefox?this._register((0,I.addDisposableListener)(this.element,"mousedown",(e=>{2===e.button&&(0,s.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this._register((0,I.addDisposableListener)(this.element,"contextmenu",(e=>{(0,s.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),y.isLinux&&this._register((0,I.addDisposableListener)(this.element,"auxclick",(e=>{1===e.button&&(0,s.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)})))}_bindKeys(){this._register((0,I.addDisposableListener)(this.textarea,"keyup",(e=>this._keyUp(e)),!0)),this._register((0,I.addDisposableListener)(this.textarea,"keydown",(e=>this._keyDown(e)),!0)),this._register((0,I.addDisposableListener)(this.textarea,"keypress",(e=>this._keyPress(e)),!0)),this._register((0,I.addDisposableListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this._register((0,I.addDisposableListener)(this.textarea,"compositionupdate",(e=>this._compositionHelper.compositionupdate(e)))),this._register((0,I.addDisposableListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this._register((0,I.addDisposableListener)(this.textarea,"input",(e=>this._inputEvent(e)),!0)),this._register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(e){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"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));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);const 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((0,I.addDisposableListener)(this.screenElement,"mousemove",(e=>this.updateCursorStyle(e)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);const i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",r.promptLabel.get()),y.isChromeOS||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",(()=>i.readOnly=this.optionsService.rawOptions.disableStdin))),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(_.CoreBrowserService,this.textarea,e.ownerDocument.defaultView??window,this._document??"undefined"!=typeof window?window.document:null)),this._instantiationService.setService(v.ICoreBrowserService,this._coreBrowserService),this._register((0,I.addDisposableListener)(this.textarea,"focus",(e=>this._handleTextAreaFocus(e)))),this._register((0,I.addDisposableListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(d.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(v.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(S.ThemeService),this._instantiationService.setService(v.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(u.CharacterJoinerService),this._instantiationService.setService(v.ICharacterJoinerService,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(g.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(v.IRenderService,this._renderService),this._register(this._renderService.onRenderedViewportChange((e=>this._onRender.fire(e)))),this.onResize((e=>this._renderService.resize(e.cols,e.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(p.MouseService),this._instantiationService.setService(v.IMouseService,this._mouseService);const s=this._linkifier.value=this._register(this._instantiationService.createInstance(M.Linkifier,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(o.Viewport,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines((e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)}))),this._selectionService=this._register(this._instantiationService.createInstance(m.SelectionService,this.element,this.screenElement,s)),this._instantiationService.setService(v.ISelectionService,this._selectionService),this._register(this._selectionService.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent)))),this._register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this._register(this._selectionService.onRequestRedraw((e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode)))),this._register(this._selectionService.onLinuxMouseSelection((e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()}))),this._register(O.Event.any(this._onScroll.event,this._inputHandler.onScroll)((()=>{this._selectionService.refresh(),this._viewport?.queueSync()}))),this._register(this._instantiationService.createInstance(a.BufferDecorationRenderer,this.screenElement)),this._register((0,I.addDisposableListener)(this.element,"mousedown",(e=>this._selectionService.handleMouseDown(e)))),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(k.AccessibilityManager,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",(e=>this._handleScreenReaderModeOptionChange(e)))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",(e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(c.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const e=this,t=this.element;function i(t){const i=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!i)return!1;let s,r;switch(t.overrideType||t.type){case"mousemove":r=32,void 0===t.buttons?(s=3,void 0!==t.button&&(s=t.button<3?t.button:3)):s=1&t.buttons?0:4&t.buttons?1:2&t.buttons?2:3;break;case"mouseup":r=0,s=t.button<3?t.button:3;break;case"mousedown":r=1,s=t.button<3?t.button:3;break;case"wheel":if(e._customWheelEventHandler&&!1===e._customWheelEventHandler(t))return!1;const i=t.deltaY;if(0===i)return!1;if(0===e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr))return!1;r=i<0?0:1,s=4;break;default:return!1}return!(void 0===r||void 0===s||s>4)&&e.coreMouseService.triggerMouseEvent({col:i.col,row:i.row,x:i.x,y:i.y,button:s,action:r,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}const s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:e=>(i(e),e.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(e)),wheel:e=>(i(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&i(e)},mousemove:e=>{e.buttons||i(e)}};this._register(this.coreMouseService.onProtocolChange((e=>{e?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(e)),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()),8&e?s.mousemove||(t.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),16&e?s.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),2&e?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),4&e?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register((0,I.addDisposableListener)(t,"mousedown",(e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return i(e),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(e)}))),this._register((0,I.addDisposableListener)(t,"wheel",(t=>{if(!s.wheel){if(this._customWheelEventHandler&&!1===this._customWheelEventHandler(t))return!1;if(!this.buffer.hasScrollback){if(0===t.deltaY)return!1;if(0===e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr))return this.cancel(t,!0);const i=E.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(t.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(i,!0),this.cancel(t,!0)}}}),{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.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){const t=e-this._bufferService.buffer.ydisp;0!==t&&this.scrollLines(t)}paste(e){(0,s.paste)(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");const 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}select(e,t,i){this._selectionService.setSelection(e,t,i)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;const 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||"Dead"!==e.key&&"AltGraph"!==e.key||(this._unprocessedDeadKey=!0);const i=(0,D.evaluateKeyboardEvent)(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===i.type||2===i.type){const t=this.rows-1;return this.scrollLines(2===i.type?-t:t),this.cancel(e,!0)}return 1===i.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key||!!(e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&1===e.key.length&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(i.key!==E.C0.ETX&&i.key!==E.C0.CR||(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey?this.cancel(e,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(e,t){const i=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"keypress"===t.type?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(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&&"insertText"===e.inputType&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){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(w.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(E.C0.ESC+"[I"):this.coreService.triggerDataEvent(E.C0.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case T.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${E.C0.ESC}[4;${t};${e}t`);break;case T.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const i=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${E.C0.ESC}[6;${s};${i}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}}t.CoreBrowserTerminal=x},8906:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier=void 0;const n=i(7150),o=i(6501),a=i(7098),l=i(802),h=i(7093);let c=class extends n.Disposable{get currentLink(){return this._currentLink}constructor(e,t,i,s,r){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=r,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new l.Emitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new l.Emitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register((0,n.toDisposable)((()=>{(0,n.dispose)(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this._register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this._register((0,h.addDisposableListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this._register((0,h.addDisposableListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register((0,h.addDisposableListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register((0,h.addDisposableListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){this._lastMouseEvent=e;const t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;const i=e.composedPath();for(let e=0;e<i.length;e++){const t=i[e];if(t.classList.contains("xterm"))break;if(t.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)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){this._activeProviderReplies&&t||(this._activeProviderReplies?.forEach((e=>{e?.forEach((e=>{e.link.dispose&&e.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(const[s,r]of this._linkProviderService.linkProviders.entries())if(t){const t=this._activeProviderReplies?.get(s);t&&(i=this._checkLinkProviderResult(s,e,i))}else r.provideLinks(e.y,(t=>{if(this._isMouseOut)return;const r=t?.map((e=>({link:e})));this._activeProviderReplies?.set(s,r),i=this._checkLinkProviderResult(s,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,t){const i=new Set;for(let s=0;s<t.size;s++){const r=t.get(s);if(r)for(let t=0;t<r.length;t++){const s=r[t],n=s.link.range.start.y<e?0:s.link.range.start.x,o=s.link.range.end.y>e?this._bufferService.cols:s.link.range.end.x;for(let e=n;e<=o;e++){if(i.has(e)){r.splice(t--,1);break}i.add(e)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;const s=this._activeProviderReplies.get(e);let r=!1;for(let t=0;t<e;t++)this._activeProviderReplies.has(t)&&!this._activeProviderReplies.get(t)||(r=!0);if(!r&&s){const e=s.find((e=>this._linkAtPosition(e.link,t)));e&&(i=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let e=0;e<this._activeProviderReplies.size;e++){const s=this._activeProviderReplies.get(e)?.find((e=>this._linkAtPosition(e.link,t)));if(s){i=!0,this._handleNewLink(s);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;const t=this._positionFromMouseEvent(e,this._element,this._mouseService);var i,s;t&&this._mouseDownLink&&(i=this._mouseDownLink.link,s=this._currentLink.link,i.text===s.text&&i.range.start.x===s.range.start.x&&i.range.start.y===s.range.start.y&&i.range.end.x===s.range.end.x&&i.range.end.y===s.range.end.y)&&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,(0,n.dispose)(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;const t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{if(!this._currentLink)return;const t=0===e.start?0:e.start+1+this._bufferService.buffer.ydisp,i=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=i&&(this._clearCurrentLink(t,i),this._lastMouseEvent)){const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}}))))}_linkHover(e,t,i){this._currentLink?.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(i,t.text)}_fireUnderlineEvent(e,t){const i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){this._currentLink?.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(i,t.text)}_linkAtPosition(e,t){const i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,r=t.y*this._bufferService.cols+t.x;return i<=r&&r<=s}_positionFromMouseEvent(e,t,i){const s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};t.Linkifier=c,t.Linkifier=c=s([r(1,a.IMouseService),r(2,a.IRenderService),r(3,o.IBufferService),r(4,a.ILinkProviderService)],c)},7721:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0;let i="Terminal input";const s={get:()=>i,set:e=>i=e};t.promptLabel=s;let r="Too much output to announce, navigate to rows manually to read";const n={get:()=>r,set:e=>r=e};t.tooMuchOutput=n},3285:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const n=i(3055),o=i(6501);let a=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){const i=this._bufferService.buffer.lines.get(e-1);if(!i)return void t(void 0);const s=[],r=this._optionsService.rawOptions.linkHandler,o=new n.CellData,a=i.getTrimmedLength();let h=-1,c=-1,d=!1;for(let t=0;t<a;t++)if(-1!==c||i.hasContent(t)){if(i.loadCell(t,o),o.hasExtendedAttrs()&&o.extended.urlId){if(-1===c){c=t,h=o.extended.urlId;continue}d=o.extended.urlId!==h}else-1!==c&&(d=!0);if(d||-1!==c&&t===a-1){const i=this._oscLinkService.getLinkData(h)?.uri;if(i){const n={start:{x:c+1,y:e},end:{x:t+(d||t!==a-1?0:1),y:e}};let o=!1;if(!r?.allowNonHttpProtocols)try{const e=new URL(i);["http:","https:"].includes(e.protocol)||(o=!0)}catch(e){o=!0}o||s.push({text:i,range:n,activate:(e,t)=>r?r.activate(e,t,n):l(0,t),hover:(e,t)=>r?.hover?.(e,t,n),leave:(e,t)=>r?.leave?.(e,t,n)})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(c=t,h=o.extended.urlId):(c=-1,h=-1)}}t(s)}};function l(e,t){if(confirm(`Do you want to navigate to ${t}?\n\nWARNING: This link could potentially be dangerous`)){const e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}t.OscLinkProvider=a,t.OscLinkProvider=a=s([r(0,o.IBufferService),r(1,o.IOptionsService),r(2,o.IOscLinkService)],a)},4852:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=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,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return void this._runRefreshCallbacks();const 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(const e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},4292:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t;const s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){const e=s-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),t)}}_innerRefresh(){if(void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return;const 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)}}},9302:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_ANSI_COLORS=void 0;const s=i(4103);t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const e=[s.css.toColor("#2e3436"),s.css.toColor("#cc0000"),s.css.toColor("#4e9a06"),s.css.toColor("#c4a000"),s.css.toColor("#3465a4"),s.css.toColor("#75507b"),s.css.toColor("#06989a"),s.css.toColor("#d3d7cf"),s.css.toColor("#555753"),s.css.toColor("#ef2929"),s.css.toColor("#8ae234"),s.css.toColor("#fce94f"),s.css.toColor("#729fcf"),s.css.toColor("#ad7fa8"),s.css.toColor("#34e2e2"),s.css.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){const r=t[i/36%6|0],n=t[i/6%6|0],o=t[i%6];e.push({css:s.channels.toCss(r,n,o),rgba:s.channels.toRgba(r,n,o)})}for(let t=0;t<24;t++){const i=8+10*t;e.push({css:s.channels.toCss(i,i,i),rgba:s.channels.toRgba(i,i,i)})}return e})())},4017:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;const n=i(7098),o=i(7150),a=i(6501),l=i(7093),h=i(8234),c=i(802),d=i(9881);let u=class extends o.Disposable{constructor(e,t,i,s,r,n,a,u){super(),this._bufferService=i,this._optionsService=a,this._renderService=u,this._onRequestScrollLines=this._register(new c.Emitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;const _=this._register(new d.Scrollable({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:e=>(0,l.scheduleAtNextAnimationFrame)(s.window,e)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",(()=>{_.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)}))),this._scrollableElement=this._register(new h.SmoothScrollableElement(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},_)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],(()=>this._scrollableElement.updateOptions(this._getChangeOptions())))),this._register(r.onProtocolChange((e=>{this._scrollableElement.updateOptions({handleMouseWheel:!(16&e)})}))),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(c.Event.runAndSubscribe(n.onChangeColors,(()=>{this._scrollableElement.getDomNode().style.backgroundColor=n.colors.background.css}))),e.appendChild(this._scrollableElement.getDomNode()),this._register((0,o.toDisposable)((()=>this._scrollableElement.getDomNode().remove()))),this._styleElement=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register((0,o.toDisposable)((()=>this._styleElement.remove()))),this._register(c.Event.runAndSubscribe(n.onChangeColors,(()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${n.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${n.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${n.colors.scrollbarSliderActiveBackground.css};`,"}"].join("\n")}))),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((e=>this._handleScroll(e))))}scrollLines(e){const 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(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){void 0!==e&&(this._latestYDisp=e),void 0===this._queuedAnimationFrame&&(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)return;if(this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;const t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),i=t-this._bufferService.buffer.ydisp;0!==i&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};t.Viewport=u,t.Viewport=u=s([r(2,a.IBufferService),r(3,n.ICoreBrowserService),r(4,a.ICoreMouseService),r(5,n.IThemeService),r(6,a.IOptionsService),r(7,n.IRenderService)],u)},4196:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;const n=i(7098),o=i(7150),a=i(6501);let l=class extends o.Disposable{constructor(e,t,i,s,r){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=s,this._renderService=r,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((e=>this._removeDecoration(e)))),this._register((0,o.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){void 0===this._animationFrame&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){const t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer","top"===e?.options?.layer),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`;const i=e.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){const 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 i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose((()=>{this._decorationElements.delete(e),i.remove()}))),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+"px",i.style.top=t*this._renderService.dimensions.css.cell.height+"px",i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;const i=e.options.x??0;"right"===(e.options.anchor||"left")?t.style.right=i?i*this._renderService.dimensions.css.cell.width+"px":"":t.style.left=i?i*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};t.BufferDecorationRenderer=l,t.BufferDecorationRenderer=l=s([r(1,a.IBufferService),r(2,n.ICoreBrowserService),r(3,a.IDecorationService),r(4,n.IRenderService)],l)},957:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=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(const 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))return void this._addLineToZone(t,e.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return 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,void this._zones.push(this._zonePool[this._zonePoolIndex++]);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,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},9925:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;const n=i(957),o=i(7098),a=i(7150),l=i(6501),h={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0};let u=class extends a.Disposable{get _width(){return this._optionsService.options.overviewRuler?.width||0}constructor(e,t,i,s,r,o,l,h){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=r,this._optionsService=o,this._themeService=l,this._coreBrowserService=h,this._colorZoneStore=new n.ColorZoneStore,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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register((0,a.toDisposable)((()=>this._canvas?.remove())));const c=this._canvas.getContext("2d");if(!c)throw new Error("Ctx cannot be null");this._ctx=c,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)}_refreshDrawConstants(){const e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);c.full=this._canvas.width,c.left=e,c.center=t,c.right=e,this._refreshDrawHeightConstants(),d.full=1,d.left=1,d.center=1+c.left,d.right=1+c.left+c.center}_refreshDrawHeightConstants(){h.full=Math.round(2*this._coreBrowserService.dpr);const e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);h.left=t,h.center=t,h.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.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(const e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1,this._renderRulerOutline();const e=this._colorZoneStore.zones;for(const t of e)"full"!==t.position&&this._renderColorZone(t);for(const t of e)"full"===t.position&&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(d[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-h[e.position||"full"]/2),c[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+h[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,void 0===this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};t.OverviewRulerRenderer=u,t.OverviewRulerRenderer=u=s([r(2,l.IBufferService),r(3,l.IDecorationService),r(4,o.IRenderService),r(5,l.IOptionsService),r(6,o.IThemeService),r(7,o.ICoreBrowserService)],u)},3618:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;const n=i(7098),o=i(6501),a=i(3534);let l=class{get isComposing(){return this._isComposing}constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}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(20===e.keyCode||229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let t;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}}),0)}else{this._isSendingComposition=!1;const e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){const e=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${a.C0.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}}),0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=t+"px",this._compositionView.style.lineHeight=t+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const r=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(r.width,1)+"px",this._textarea.style.height=Math.max(r.height,1)+"px",this._textarea.style.lineHeight=r.height+"px"}e||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};t.CompositionHelper=l,t.CompositionHelper=l=s([r(2,o.IBufferService),r(3,o.IOptionsService),r(4,o.ICoreService),r(5,n.IRenderService)],l)},5251:(e,t)=>{function i(e,t,i){const s=i.getBoundingClientRect(),r=e.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),o=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-s.left-n,t.clientY-s.top-o]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoordsRelativeToElement=i,t.getCoords=function(e,t,s,r,n,o,a,l,h){if(!o)return;const c=i(e,t,s);return c?(c[0]=Math.ceil((c[0]+(h?a/2:0))/a),c[1]=Math.ceil(c[1]/l),c[0]=Math.min(Math.max(c[0],1),r+(h?1:0)),c[1]=Math.min(Math.max(c[1],1),n),c):void 0}},9686:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=function(e,t,i,s){const o=i.buffer.x,c=i.buffer.y;if(!i.buffer.hasScrollback)return function(e,t,i,s,o,c){return 0===r(t,s,o,c).length?"":h(a(e,t,e,t-n(t,o),!1,o).length,l("D",c))}(o,c,0,t,i,s)+r(c,t,i,s)+function(e,t,i,s,o,c){let d;d=r(t,s,o,c).length>0?s-n(s,o):t;const u=s,_=function(e,t,i,s,o,a){let l;return l=r(i,s,o,a).length>0?s-n(s,o):t,e<i&&l<=s||e>=i&&l<s?"C":"D"}(e,t,i,s,o,c);return h(a(e,d,i,u,"C"===_,o).length,l(_,c))}(o,c,e,t,i,s);let d;if(c===t)return d=o>e?"D":"C",h(Math.abs(o-e),l(d,s));d=c>t?"D":"C";const u=Math.abs(c-t);return h(function(e,t){return t.cols-e}(c>t?e:o,i)+(u-1)*i.cols+1+((c>t?o:e)-1),l(d,s))};const s=i(3534);function r(e,t,i,s){const r=e-n(e,i),a=t-n(t,i),c=Math.abs(r-a)-function(e,t,i){let s=0;const r=e-n(e,i),a=t-n(t,i);for(let n=0;n<Math.abs(r-a);n++){const a="A"===o(e,t)?-1:1,l=i.buffer.lines.get(r+a*n);l?.isWrapped&&s++}return s}(e,t,i);return h(c,l(o(e,t),s))}function n(e,t){let i=0,s=t.buffer.lines.get(e),r=s?.isWrapped;for(;r&&e>=0&&e<t.rows;)i++,s=t.buffer.lines.get(--e),r=s?.isWrapped;return i}function o(e,t){return e>t?"A":"B"}function a(e,t,i,s,r,n){let o=e,a=t,l="";for(;(o!==i||a!==s)&&a>=0&&a<n.buffer.lines.length;)o+=r?1:-1,r&&o>n.cols-1?(l+=n.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!r&&o<0&&(l+=n.buffer.translateBufferLineToString(a,!1,0,e+1),o=n.cols-1,e=o,a--);return l+n.buffer.translateBufferLineToString(a,!1,e,o)}function l(e,t){const i=t?"O":"[";return s.C0.ESC+i+e}function h(e,t){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=t;return i}},3955:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;const n=i(1433),o=i(2744),a=i(9176),l=i(6181),h=i(2274),c=i(7098),d=i(4103),u=i(7150),_=i(6501),f=i(802),p="xterm-dom-renderer-owner-",g="xterm-rows",m="xterm-fg-",v="xterm-bg-",S="xterm-focus",b="xterm-selection";let C=1,y=class extends u.Disposable{constructor(e,t,i,s,r,a,c,d,_,m,v,S,y,w){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=s,this._viewportElement=r,this._helperContainer=a,this._linkifier2=c,this._charSizeService=_,this._optionsService=m,this._bufferService=v,this._coreService=S,this._coreBrowserService=y,this._themeService=w,this._terminalClass=C++,this._rowElements=[],this._selectionRenderModel=(0,h.createSelectionRenderModel)(),this.onRequestRedraw=this._register(new f.Emitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(g),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(b),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,l.createRenderDimensions)(),this._updateDimensions(),this._register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this._register(this._themeService.onChangeColors((e=>this._injectCss(e)))),this._injectCss(this._themeService.colors),this._rowFactory=d.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(p+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline((e=>this._handleLinkHover(e)))),this._register(this._linkifier2.onHideLinkUnderline((e=>this._handleLinkLeave(e)))),this._register((0,u.toDisposable)((()=>{this._element.classList.remove(p+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new o.WidthCache(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(){const 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(const e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const t=`${this._terminalSelector} .${g} 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} .${g} { 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} .${g} .xterm-dim { color: ${d.color.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;}`;const i=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,r=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${r} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${g}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${g}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${g}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${b} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${b} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${b} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(const[i,s]of e.ansi.entries())t+=`${this._terminalSelector} .${m}${i} { color: ${s.css}; }${this._terminalSelector} .${m}${i}.xterm-dim { color: ${d.color.multiplyOpacity(s,.5).css}; }${this._terminalSelector} .${v}${i} { background-color: ${s.css}; }`;t+=`${this._terminalSelector} .${m}${a.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(e.background).css}; }${this._terminalSelector} .${m}${a.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(e.background),.5).css}; }${this._terminalSelector} .${v}${a.INVERTED_DEFAULT_COLOR} { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){const 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 e=this._rowElements.length;e<=t;e++){const e=this._document.createElement("div");this._rowContainer.appendChild(e),this._rowElements.push(e)}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(S),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t)return;if(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection)return;const s=this._selectionRenderModel.viewportStartRow,r=this._selectionRenderModel.viewportEndRow,n=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,a=this._document.createDocumentFragment();if(i){const i=e[0]>t[0];a.appendChild(this._createSelectionElement(n,i?t[0]:e[0],i?e[0]:t[0],o-n+1))}else{const i=s===n?e[0]:0,l=n===r?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(n,i,l));const h=o-n-1;if(a.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,h)),n!==o){const e=r===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,i,s=1){const r=this._document.createElement("div"),n=t*this.dimensions.css.cell.width;let o=this.dimensions.css.cell.width*(i-t);return n+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-n),r.style.height=s*this.dimensions.css.cell.height+"px",r.style.top=e*this.dimensions.css.cell.height+"px",r.style.left=`${n}px`,r.style.width=`${o}px`,r}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(const e of this._rowElements)e.replaceChildren()}renderRows(e,t){const i=this._bufferService.buffer,s=i.ybase+i.y,r=Math.min(i.x,this._bufferService.cols-1),n=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++){const e=l+i.ydisp,t=this._rowElements[l],h=i.lines.get(e);if(!t||!h)break;t.replaceChildren(...this._rowFactory.createRow(h,e,e===s,o,a,r,n,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${p}${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,i,s,r,n){i<0&&(e=0),s<0&&(t=0);const o=this._bufferService.rows-1;i=Math.max(Math.min(i,o),0),s=Math.max(Math.min(s,o),0),r=Math.min(r,this._bufferService.cols);const a=this._bufferService.buffer,l=a.ybase+a.y,h=Math.min(a.x,r-1),c=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=i;o<=s;++o){const _=o+a.ydisp,f=this._rowElements[o],p=a.lines.get(_);if(!f||!p)break;f.replaceChildren(...this._rowFactory.createRow(p,_,_===l,d,u,h,c,this.dimensions.css.cell.width,this._widthCache,n?o===i?e:0:-1,n?(o===s?t:r)-1:-1))}}};t.DomRenderer=y,t.DomRenderer=y=s([r(7,_.IInstantiationService),r(8,c.ICharSizeService),r(9,_.IOptionsService),r(10,_.IBufferService),r(11,_.ICoreService),r(12,c.ICoreBrowserService),r(13,c.IThemeService)],y)},1433:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=void 0;const n=i(9176),o=i(8938),a=i(3055),l=i(6501),h=i(4103),c=i(7098),d=i(945),u=i(6181),_=i(5451);let f=class{constructor(e,t,i,s,r,n,o){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._themeService=o,this._workCell=new a.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,t,i,s,r,a,l,c,u,f,g){const m=[],v=this._characterJoinerService.getJoinedCharacters(t),S=this._themeService.colors;let b,C=e.getNoBgTrimmedLength();i&&C<a+1&&(C=a+1);let y=0,w="",E=0,D=0,L=0,R=0,A=!1,T=0,k=!1,M=0,O=0;const I=[],P=-1!==f&&-1!==g;for(let x=0;x<C;x++){e.loadCell(x,this._workCell);let C=this._workCell.getWidth();if(0===C)continue;let B=!1,N=x>=O,U=x,F=this._workCell;if(v.length>0&&x===v[0][0]&&N){const s=v.shift(),r=this._isCellInSelection(s[0],t);for(E=s[0]+1;E<s[1];E++)N&&=r===this._isCellInSelection(E,t);N&&=!i||a<s[0]||a>=s[1],N?(B=!0,F=new d.JoinedCellData(this._workCell,e.translateToString(!0,s[0],s[1]),s[1]-s[0]),U=s[1]-1,C=F.getWidth()):O=s[1]}const W=this._isCellInSelection(x,t),H=i&&x===a,K=P&&x>=f&&x<=g;let z=!1;this._decorationService.forEachDecorationAtCell(x,t,void 0,(e=>{z=!0}));let j=F.getChars()||o.WHITESPACE_CELL_CHAR;if(" "===j&&(F.isUnderline()||F.isOverline())&&(j=" "),M=C*c-u.get(j,F.isBold(),F.isItalic()),b){if(y&&(W&&k||!W&&!k&&F.bg===D)&&(W&&k&&S.selectionForeground||F.fg===L)&&F.extended.ext===R&&K===A&&M===T&&!H&&!B&&!z&&N){F.isInvisible()?w+=o.WHITESPACE_CELL_CHAR:w+=j,y++;continue}y&&(b.textContent=w),b=this._document.createElement("span"),y=0,w=""}else b=this._document.createElement("span");if(D=F.bg,L=F.fg,R=F.extended.ext,A=K,T=M,k=W,B&&a>=x&&a<=U&&(a=x),!this._coreService.isCursorHidden&&H&&this._coreService.isCursorInitialized)if(I.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&I.push("xterm-cursor-blink"),I.push("bar"===s?"xterm-cursor-bar":"underline"===s?"xterm-cursor-underline":"xterm-cursor-block");else if(r)switch(r){case"outline":I.push("xterm-cursor-outline");break;case"block":I.push("xterm-cursor-block");break;case"bar":I.push("xterm-cursor-bar");break;case"underline":I.push("xterm-cursor-underline")}if(F.isBold()&&I.push("xterm-bold"),F.isItalic()&&I.push("xterm-italic"),F.isDim()&&I.push("xterm-dim"),w=F.isInvisible()?o.WHITESPACE_CELL_CHAR:F.getChars()||o.WHITESPACE_CELL_CHAR,F.isUnderline()&&(I.push(`xterm-underline-${F.extended.underlineStyle}`)," "===w&&(w=" "),!F.isUnderlineColorDefault()))if(F.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${_.AttributeData.toColorRGB(F.getUnderlineColor()).join(",")})`;else{let e=F.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&F.isBold()&&e<8&&(e+=8),b.style.textDecorationColor=S.ansi[e].css}F.isOverline()&&(I.push("xterm-overline")," "===w&&(w=" ")),F.isStrikethrough()&&I.push("xterm-strikethrough"),K&&(b.style.textDecoration="underline");let $=F.getFgColor(),V=F.getFgColorMode(),G=F.getBgColor(),q=F.getBgColorMode();const X=!!F.isInverse();if(X){const e=$;$=G,G=e;const t=V;V=q,q=t}let Y,Z,J,Q=!1;switch(this._decorationService.forEachDecorationAtCell(x,t,void 0,(e=>{"top"!==e.options.layer&&Q||(e.backgroundColorRGB&&(q=50331648,G=e.backgroundColorRGB.rgba>>8&16777215,Y=e.backgroundColorRGB),e.foregroundColorRGB&&(V=50331648,$=e.foregroundColorRGB.rgba>>8&16777215,Z=e.foregroundColorRGB),Q="top"===e.options.layer)})),!Q&&W&&(Y=this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque,G=Y.rgba>>8&16777215,q=50331648,Q=!0,S.selectionForeground&&(V=50331648,$=S.selectionForeground.rgba>>8&16777215,Z=S.selectionForeground)),Q&&I.push("xterm-decoration-top"),q){case 16777216:case 33554432:J=S.ansi[G],I.push(`xterm-bg-${G}`);break;case 50331648:J=h.channels.toColor(G>>16,G>>8&255,255&G),this._addStyle(b,`background-color:#${p((G>>>0).toString(16),"0",6)}`);break;default:X?(J=S.foreground,I.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):J=S.background}switch(Y||F.isDim()&&(Y=h.color.multiplyOpacity(J,.5)),V){case 16777216:case 33554432:F.isBold()&&$<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($+=8),this._applyMinimumContrast(b,J,S.ansi[$],F,Y,void 0)||I.push(`xterm-fg-${$}`);break;case 50331648:const e=h.channels.toColor($>>16&255,$>>8&255,255&$);this._applyMinimumContrast(b,J,e,F,Y,Z)||this._addStyle(b,`color:#${p($.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(b,J,S.foreground,F,Y,Z)||X&&I.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}I.length&&(b.className=I.join(" "),I.length=0),H||B||z||!N?b.textContent=w:y++,M!==this.defaultSpacing&&(b.style.letterSpacing=`${M}px`),m.push(b),x=U}return b&&y&&(b.textContent=w),m}_applyMinimumContrast(e,t,i,s,r,n){if(1===this._optionsService.rawOptions.minimumContrastRatio||(0,u.treatGlyphAsBackgroundColor)(s.getCode()))return!1;const o=this._getContrastCache(s);let a;if(r||n||(a=o.getColor(t.rgba,i.rgba)),void 0===a){const e=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);a=h.color.ensureContrastRatio(r||t,n||i,e),o.setColor((r||t).rgba,(n||i).rgba,a??null)}return!!a&&(this._addStyle(e,`color:${a.css}`),!0)}_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){const i=this._selectionStart,s=this._selectionEnd;return!(!i||!s)&&(this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e<s[0]&&t<=s[1]:e<i[0]&&t>=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t<s[1]||i[1]===s[1]&&t===i[1]&&e>=i[0]&&e<s[0]||i[1]<s[1]&&t===s[1]&&e<s[0]||i[1]<s[1]&&t===i[1]&&e>=i[0])}};function p(e,t,i){for(;e.length<i;)e=t+e;return e}t.DomRendererRowFactory=f,t.DomRendererRowFactory=f=s([r(1,c.ICharacterJoinerService),r(2,l.IOptionsService),r(3,c.ICoreBrowserService),r(4,l.ICoreService),r(5,l.IDecorationService),r(6,c.IThemeService)],f)},2744:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WidthCache=void 0,t.WidthCache=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";const i=e.createElement("span");i.classList.add("xterm-char-measure-element");const s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";const r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontStyle="italic";const n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold",n.style.fontStyle="italic",this._measureElements=[i,s,r,n],this._container.appendChild(i),this._container.appendChild(s),this._container.appendChild(r),this._container.appendChild(n),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,i,s){e===this._font&&t===this._fontSize&&i===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=t,this._weight=i,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,t,i){let s=0;if(!t&&!i&&1===e.length&&(s=e.charCodeAt(0))<256){if(-9999!==this._flat[s])return this._flat[s];const t=this._measure(e,0);return t>0&&(this._flat[s]=t),t}let r=e;t&&(r+="B"),i&&(r+="I");let n=this._holey.get(r);if(void 0===n){let s=0;t&&(s|=1),i&&(s|=2),n=this._measure(e,s),n>0&&this._holey.set(r,n)}return n}_measure(e,t){const i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}}},9176:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVERTED_DEFAULT_COLOR=void 0,t.INVERTED_DEFAULT_COLOR=257},6181:(e,t)=>{function i(e){return 57508<=e&&e<=57558}function s(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e},t.isPowerlineGlyph=i,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.isEmoji=s,t.allowRescaling=function(e,t,r,n){return 1===t&&r>Math.ceil(1.5*n)&&void 0!==e&&e>255&&!s(e)&&!i(e)&&!function(e){return 57344<=e&&e<=63743}(e)},t.treatGlyphAsBackgroundColor=function(e){return i(e)||function(e){return 9472<=e&&e<=9631}(e)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},t.computeNextVariantOffset=function(e,t,i=0){return(e-(2*Math.round(t)-i))%(2*Math.round(t))}},2274:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=function(){return new i};class i{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,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1])return void this.clear();const r=e.buffers.active.ydisp,n=t[1]-r,o=i[1]-r,a=Math.max(n,0),l=Math.min(o,e.rows-1);a>=e.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=n,this.viewportEndRow=o,this.viewportCappedStartRow=a,this.viewportCappedEndRow=l,this.startCol=t[0],this.endCol=i[0])}isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol)}}},5959:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,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.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()){const e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},4792:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;const n=i(6501),o=i(7150),a=i(802);let l=class extends o.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new a.Emitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new d(this._optionsService))}catch{this._measureStrategy=this._register(new c(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};t.CharSizeService=l,t.CharSizeService=l=s([r(2,n.IOptionsService)],l);class h extends o.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){void 0!==e&&e>0&&void 0!==t&&t>0&&(this._result.width=e,this._result.height=t)}}class c extends h{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,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}}class d extends h{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const 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}`;const e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}}},945:function(e,t,i){var s,r=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},n=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const o=i(5451),a=i(8938),l=i(3055),h=i(6501);class c extends o.AttributeData{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}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()]}}t.JoinedCellData=c;let d=s=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new l.CellData}register(e){const 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(0===this._characterJoiners.length)return[];const t=this._bufferService.buffer.lines.get(e);if(!t||0===t.length)return[];const i=[],s=t.translateToString(!0);let r=0,n=0,o=0,l=t.getFg(0),h=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==l||this._workCell.bg!==h){if(e-r>1){const e=this._getJoinedRanges(s,o,n,t,r);for(let t=0;t<e.length;t++)i.push(e[t])}r=e,o=n,l=this._workCell.fg,h=this._workCell.bg}n+=this._workCell.getChars().length||a.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-r>1){const e=this._getJoinedRanges(s,o,n,t,r);for(let t=0;t<e.length;t++)i.push(e[t])}return i}_getJoinedRanges(e,t,i,r,n){const o=e.substring(t,i);let a=[];try{a=this._characterJoiners[0].handler(o)}catch(e){console.error(e)}for(let e=1;e<this._characterJoiners.length;e++)try{const t=this._characterJoiners[e].handler(o);for(let e=0;e<t.length;e++)s._mergeRanges(a,t[e])}catch(e){console.error(e)}return this._stringRangesToCellRanges(a,r,n),a}_stringRangesToCellRanges(e,t,i){let s=0,r=!1,n=0,o=e[s];if(o){for(let l=i;l<this._bufferService.cols;l++){const i=t.getWidth(l),h=t.getString(l).length||a.WHITESPACE_CELL_CHAR.length;if(0!==i){if(!r&&o[0]<=n&&(o[0]=l,r=!0),o[1]<=n){if(o[1]=l,o=e[++s],!o)break;o[0]<=n?(o[0]=l,r=!0):r=!1}n+=h}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let s=0;s<e.length;s++){const r=e[s];if(i){if(t[1]<=r[0])return e[s-1][1]=t[1],e;if(t[1]<=r[1])return e[s-1][1]=Math.max(t[1],r[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=r[0])return e.splice(s,0,t),e;if(t[1]<=r[1])return r[0]=Math.min(t[0],r[0]),e;t[0]<r[1]&&(r[0]=Math.min(t[0],r[0]),i=!0)}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};t.CharacterJoinerService=d,t.CharacterJoinerService=d=s=r([n(0,h.IBufferService)],d)},9574:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;const s=i(802),r=i(7093),n=i(7150);class o extends n.Disposable{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new a(this._window)),this._onDprChange=this._register(new s.Emitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new s.Emitter),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange((e=>this._screenDprMonitor.setWindow(e)))),this._register(s.Event.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register((0,r.addDisposableListener)(this._textarea,"focus",(()=>this._isFocused=!0))),this._register((0,r.addDisposableListener)(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 void 0===this._cachedIsFocused&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}t.CoreBrowserService=o;class a extends n.Disposable{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new n.MutableDisposable),this._onDprChange=this._register(new s.Emitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register((0,n.toDisposable)((()=>this.clearListener())))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,r.addDisposableListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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)}}},9820:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkProviderService=void 0;const s=i(7150);class r extends s.Disposable{constructor(){super(),this.linkProviders=[],this._register((0,s.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{const t=this.linkProviders.indexOf(e);-1!==t&&this.linkProviders.splice(t,1)}}}}t.LinkProviderService=r},9784:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;const n=i(7098),o=i(5251);let a=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,r){return(0,o.getCoords)(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(e,t){const i=(0,o.getCoordsRelativeToElement)(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};t.MouseService=a,t.MouseService=a=s([r(0,n.IRenderService),r(1,n.ICharSizeService)],a)},5783:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;const n=i(4852),o=i(7098),a=i(7150),l=i(6168),h=i(6501),c=i(802);let d=class extends a.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,i,s,r,o,h,d,_){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=s,this._coreService=r,this._coreBrowserService=d,this._renderer=this._register(new a.MutableDisposable),this._pausedResizeTask=new l.DebouncedIdleTask,this._observerDisposable=this._register(new a.MutableDisposable),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 c.Emitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new c.Emitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new c.Emitter),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new c.Emitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new n.RenderDebouncer(((e,t)=>this._renderRows(e,t)),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new u(this._coreBrowserService,this._coreService,(()=>this._fullRefresh())),this._register((0,a.toDisposable)((()=>this._syncOutputHandler.dispose()))),this._register(this._coreBrowserService.onDprChange((()=>this.handleDevicePixelRatioChange()))),this._register(h.onResize((()=>this._fullRefresh()))),this._register(h.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this._register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this._register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this._register(o.onDecorationRegistered((()=>this._fullRefresh()))),this._register(o.onDecorationRemoved((()=>this._fullRefresh()))),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(h.cols,h.rows),this._fullRefresh()}))),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(h.buffer.y,h.buffer.y,!0)))),this._register(_.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange((e=>this._registerIntersectionObserver(e,t))))}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){const i=new e.IntersectionObserver((e=>this._handleIntersectionChange(e[e.length-1])),{threshold:0});i.observe(t),this._observerDisposable.value=(0,a.toDisposable)((()=>i.disconnect()))}}_handleIntersectionChange(e){this._isPaused=void 0===e.isIntersecting?0===e.intersectionRatio:!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,i=!1){if(this._isPaused)return void(this._needsFullRefresh=!0);if(this._coreService.decPrivateModes.synchronizedOutput)return void this._syncOutputHandler.bufferRows(e,t);const s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.end)),i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){this._renderer.value&&(this._coreService.decPrivateModes.synchronizedOutput?this._syncOutputHandler.bufferRows(e,t):(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((e=>this.refreshRows(e.start,e.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(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),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((()=>this._renderer.value?.handleResize(e,t))):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(e,t,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};t.RenderService=d,t.RenderService=d=s([r(2,h.IOptionsService),r(3,o.ICharSizeService),r(4,h.ICoreService),r(5,h.IDecorationService),r(6,h.IBufferService),r(7,o.ICoreBrowserService),r(8,o.IThemeService)],d);class u{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,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),void 0===this._timeout&&(this._timeout=this._coreBrowserService.window.setTimeout((()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()}),1e3))}flush(){if(void 0!==this._timeout&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;const e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){void 0!==this._timeout&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}}},2079:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;const n=i(5251),o=i(9686),a=i(5959),l=i(7098),h=i(7150),c=i(701),d=i(9384),u=i(3055),_=i(6501),f=i(802),p=String.fromCharCode(160),g=new RegExp(p,"g");let m=class extends h.Disposable{constructor(e,t,i,s,r,n,o,l,c){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=r,this._mouseService=n,this._optionsService=o,this._renderService=l,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new u.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new f.Emitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new f.Emitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new f.Emitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new f.Emitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((e=>this._handleTrim(e))),this._register(this._bufferService.buffers.onBufferActivate((e=>this._handleBufferActivate(e)))),this.enable(),this._model=new a.SelectionModel(this._bufferService),this._activeSelectionMode=0,this._register((0,h.toDisposable)((()=>{this._removeMouseDownListeners()}))),this._register(this._bufferService.onResize((e=>{e.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(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";const i=this._bufferService.buffer,s=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";const r=e[0]<t[0]?e[0]:t[0],n=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){const e=i.translateBufferLineToString(o,!0,r,n);s.push(e)}}else{const r=e[1]===t[1]?t[0]:void 0;s.push(i.translateBufferLineToString(e[1],!0,e[0],r));for(let r=e[1]+1;r<=t[1]-1;r++){const e=i.lines.get(r),t=i.translateBufferLineToString(r,!0);e?.isWrapped?s[s.length-1]+=t:s.push(t)}if(e[1]!==t[1]){const e=i.lines.get(t[1]),r=i.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?s[s.length-1]+=r:s.push(r)}}return s.map((e=>e.replace(g," "))).join(c.isWindows?"\r\n":"\n")}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),c.isLinux&&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:3===this._activeSelectionMode})}_isClickInSelection(e){const t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!!(i&&s&&t)&&this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){const i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!(!i||!s)&&this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){const i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const s=this._getMouseBufferCoords(e);return!!s&&(this._selectWordAt(s,t),this._model.selectionEnd=void 0,!0)}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){const 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=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,e,this._screenElement)[1];const i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-50),50),t/=50,t/Math.abs(t)+Math.round(14*t))}shouldForceSelection(e){return c.isMac?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):1===e.detail?this._handleSingleClick(e):2===e.detail?this._handleDoubleClick(e):3===e.detail&&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()),50)}_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;const t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){const t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(c.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;const t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd)return void this.refresh(!0);2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){const e=i.lines.get(this._model.selectionEnd[1]);e&&0===e.hasWidth(this._model.selectionEnd[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});const e=this._bufferService.buffer;this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){const t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&void 0!==t[0]&&void 0!==t[1]){const e=(0,o.moveToCellSequence)(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);i?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,i)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim((e=>this._handleTrim(e)))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){const r=e.loadCell(s,this._workCell).getChars().length;0===this._workCell.getWidth()?i--:r>1&&t!==s&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;const r=this._bufferService.buffer,n=r.lines.get(e[1]);if(!n)return;const o=r.translateBufferLineToString(e[1],!1);let a=this._convertViewportColToCharacterIndex(n,e[0]),l=a;const h=e[0]-a;let c=0,d=0,u=0,_=0;if(" "===o.charAt(a)){for(;a>0&&" "===o.charAt(a-1);)a--;for(;l<o.length&&" "===o.charAt(l+1);)l++}else{let t=e[0],i=e[0];0===n.getWidth(t)&&(c++,t--),2===n.getWidth(i)&&(d++,i++);const s=n.getString(i).length;for(s>1&&(_+=s-1,l+=s-1);t>0&&a>0&&!this._isCharWordSeparator(n.loadCell(t-1,this._workCell));){n.loadCell(t-1,this._workCell);const e=this._workCell.getChars().length;0===this._workCell.getWidth()?(c++,t--):e>1&&(u+=e-1,a-=e-1),a--,t--}for(;i<n.length&&l+1<o.length&&!this._isCharWordSeparator(n.loadCell(i+1,this._workCell));){n.loadCell(i+1,this._workCell);const e=this._workCell.getChars().length;2===this._workCell.getWidth()?(d++,i++):e>1&&(_+=e-1,l+=e-1),l++,i++}}l++;let f=a+h-c+u,p=Math.min(this._bufferService.cols,l-a+c+d-u-_);if(t||""!==o.slice(a,l).trim()){if(i&&0===f&&32!==n.getCodePoint(0)){const t=r.lines.get(e[1]-1);if(t&&n.isWrapped&&32!==t.getCodePoint(this._bufferService.cols-1)){const t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){const e=this._bufferService.cols-t.start;f-=e,p+=e}}}if(s&&f+p===this._bufferService.cols&&32!==n.getCodePoint(this._bufferService.cols-1)){const t=r.lines.get(e[1]+1);if(t?.isWrapped&&32!==t.getCodePoint(0)){const t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(p+=t.length)}}return{start:f,length:p}}}_selectWordAt(e,t){const i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){const t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return 0!==e.getWidth()&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){const t=this._bufferService.buffer.getWrappedRangeForLine(e),i={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=(0,d.getRangeLength)(i,this._bufferService.cols)}};t.SelectionService=m,t.SelectionService=m=s([r(3,_.IBufferService),r(4,_.ICoreService),r(5,l.IMouseService),r(6,_.IOptionsService),r(7,l.IRenderService),r(8,l.ICoreBrowserService)],m)},7098:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ILinkProviderService=t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;const s=i(6201);t.ICharSizeService=(0,s.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,s.createDecorator)("CoreBrowserService"),t.IMouseService=(0,s.createDecorator)("MouseService"),t.IRenderService=(0,s.createDecorator)("RenderService"),t.ISelectionService=(0,s.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,s.createDecorator)("CharacterJoinerService"),t.IThemeService=(0,s.createDecorator)("ThemeService"),t.ILinkProviderService=(0,s.createDecorator)("LinkProviderService")},9078:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeService=void 0;const n=i(7174),o=i(9302),a=i(4103),l=i(7150),h=i(6501),c=i(802),d=a.css.toColor("#ffffff"),u=a.css.toColor("#000000"),_=a.css.toColor("#ffffff"),f=u,p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},g=d;let m=class extends l.Disposable{get colors(){return this._colors}constructor(e){super(),this._optionsService=e,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this._register(new c.Emitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:u,cursor:_,cursorAccent:f,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:a.color.blend(u,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:a.color.blend(u,p),scrollbarSliderBackground:a.color.opacity(d,.2),scrollbarSliderHoverBackground:a.color.opacity(d,.4),scrollbarSliderActiveBackground:a.color.opacity(d,.5),overviewRulerBorder:d,ansi:o.DEFAULT_ANSI_COLORS.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))))}_setTheme(e={}){const t=this._colors;if(t.foreground=v(e.foreground,d),t.background=v(e.background,u),t.cursor=a.color.blend(t.background,v(e.cursor,_)),t.cursorAccent=a.color.blend(t.background,v(e.cursorAccent,f)),t.selectionBackgroundTransparent=v(e.selectionBackground,p),t.selectionBackgroundOpaque=a.color.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=v(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=a.color.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?v(e.selectionForeground,a.NULL_COLOR):void 0,t.selectionForeground===a.NULL_COLOR&&(t.selectionForeground=void 0),a.color.isOpaque(t.selectionBackgroundTransparent)){const e=.3;t.selectionBackgroundTransparent=a.color.opacity(t.selectionBackgroundTransparent,e)}if(a.color.isOpaque(t.selectionInactiveBackgroundTransparent)){const e=.3;t.selectionInactiveBackgroundTransparent=a.color.opacity(t.selectionInactiveBackgroundTransparent,e)}if(t.scrollbarSliderBackground=v(e.scrollbarSliderBackground,a.color.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=v(e.scrollbarSliderHoverBackground,a.color.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=v(e.scrollbarSliderActiveBackground,a.color.opacity(t.foreground,.5)),t.overviewRulerBorder=v(e.overviewRulerBorder,g),t.ansi=o.DEFAULT_ANSI_COLORS.slice(),t.ansi[0]=v(e.black,o.DEFAULT_ANSI_COLORS[0]),t.ansi[1]=v(e.red,o.DEFAULT_ANSI_COLORS[1]),t.ansi[2]=v(e.green,o.DEFAULT_ANSI_COLORS[2]),t.ansi[3]=v(e.yellow,o.DEFAULT_ANSI_COLORS[3]),t.ansi[4]=v(e.blue,o.DEFAULT_ANSI_COLORS[4]),t.ansi[5]=v(e.magenta,o.DEFAULT_ANSI_COLORS[5]),t.ansi[6]=v(e.cyan,o.DEFAULT_ANSI_COLORS[6]),t.ansi[7]=v(e.white,o.DEFAULT_ANSI_COLORS[7]),t.ansi[8]=v(e.brightBlack,o.DEFAULT_ANSI_COLORS[8]),t.ansi[9]=v(e.brightRed,o.DEFAULT_ANSI_COLORS[9]),t.ansi[10]=v(e.brightGreen,o.DEFAULT_ANSI_COLORS[10]),t.ansi[11]=v(e.brightYellow,o.DEFAULT_ANSI_COLORS[11]),t.ansi[12]=v(e.brightBlue,o.DEFAULT_ANSI_COLORS[12]),t.ansi[13]=v(e.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),t.ansi[14]=v(e.brightCyan,o.DEFAULT_ANSI_COLORS[14]),t.ansi[15]=v(e.brightWhite,o.DEFAULT_ANSI_COLORS[15]),e.extendedAnsi){const i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<i;s++)t.ansi[s+16]=v(e.extendedAnsi[s],o.DEFAULT_ANSI_COLORS[s+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(void 0!==e)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]}else for(let e=0;e<this._restoreColors.ansi.length;++e)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()}}};function v(e,t){if(void 0!==e)try{return a.css.toColor(e)}catch{}return t}t.ThemeService=m,t.ThemeService=m=s([r(0,h.IOptionsService)],m)},5639:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;const s=i(7150),r=i(802);class n extends s.Disposable{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new r.Emitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new r.Emitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new r.Emitter),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;const t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];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,...i){if(t){for(let i=e;i<this._length-t;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let t=this._length-1;t>=e;t--)this._array[this._getCyclicIndex(t+i.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<i.length;t++)this._array[this._getCyclicIndex(e+t)]=i[t];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){const e=this._length+i.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let s=t-1;s>=0;s--)this.set(e+s+i,this.get(e+s));const s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+i,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}}t.CircularList=n},7453:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=function e(t,i=5){if("object"!=typeof t)return t;const s=Array.isArray(t)?[]:{};for(const r in t)s[r]=i<=1?t[r]:t[r]&&e(t[r],i-1);return s}},4103:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0,t.toPaddedHex=d,t.contrastRatio=u;let i=0,s=0,r=0,n=0;var o,a,l,h,c;function d(e){const t=e.toString(16);return t.length<2?"0"+t:t}function u(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},function(e){e.toCss=function(e,t,i,s){return void 0!==s?`#${d(e)}${d(t)}${d(i)}${d(s)}`:`#${d(e)}${d(t)}${d(i)}`},e.toRgba=function(e,t,i,s=255){return(e<<24|t<<16|i<<8|s)>>>0},e.toColor=function(t,i,s,r){return{css:e.toCss(t,i,s,r),rgba:e.toRgba(t,i,s,r)}}}(o||(t.channels=o={})),function(e){function t(e,t){return n=Math.round(255*t),[i,s,r]=c.toChannels(e.rgba),{css:o.toCss(i,s,r,n),rgba:o.toRgba(i,s,r,n)}}e.blend=function(e,t){if(n=(255&t.rgba)/255,1===n)return{css:t.css,rgba:t.rgba};const a=t.rgba>>24&255,l=t.rgba>>16&255,h=t.rgba>>8&255,c=e.rgba>>24&255,d=e.rgba>>16&255,u=e.rgba>>8&255;return i=c+Math.round((a-c)*n),s=d+Math.round((l-d)*n),r=u+Math.round((h-u)*n),{css:o.toCss(i,s,r),rgba:o.toRgba(i,s,r)}},e.isOpaque=function(e){return!(255&~e.rgba)},e.ensureContrastRatio=function(e,t,i){const s=c.ensureContrastRatio(e.rgba,t.rgba,i);if(s)return o.toColor(s>>24&255,s>>16&255,s>>8&255)},e.opaque=function(e){const t=(255|e.rgba)>>>0;return[i,s,r]=c.toChannels(t),{css:o.toCss(i,s,r),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,i){return n=255&e.rgba,t(e,n*i/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(a||(t.color=a={})),function(e){let t,a;try{const e=document.createElement("canvas");e.width=1,e.height=1;const i=e.getContext("2d",{willReadFrequently:!0});i&&(t=i,t.globalCompositeOperation="copy",a=t.createLinearGradient(0,0,1,1))}catch{}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return i=parseInt(e.slice(1,2).repeat(2),16),s=parseInt(e.slice(2,3).repeat(2),16),r=parseInt(e.slice(3,4).repeat(2),16),o.toColor(i,s,r);case 5:return i=parseInt(e.slice(1,2).repeat(2),16),s=parseInt(e.slice(2,3).repeat(2),16),r=parseInt(e.slice(3,4).repeat(2),16),n=parseInt(e.slice(4,5).repeat(2),16),o.toColor(i,s,r,n);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}const l=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(l)return i=parseInt(l[1]),s=parseInt(l[2]),r=parseInt(l[3]),n=Math.round(255*(void 0===l[5]?1:parseFloat(l[5]))),o.toColor(i,s,r,n);if(!t||!a)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=a,t.fillStyle=e,"string"!=typeof t.fillStyle)throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[i,s,r,n]=t.getImageData(0,0,1,1).data,255!==n)throw new Error("css.toColor: Unsupported css format");return{rgba:o.toRgba(i,s,r,n),css:e}}}(l||(t.css=l={})),function(e){function t(e,t,i){const s=e/255,r=t/255,n=i/255;return.2126*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(h||(t.rgb=h={})),function(e){function t(e,t,i){const s=e>>24&255,r=e>>16&255,n=e>>8&255;let o=t>>24&255,a=t>>16&255,l=t>>8&255,c=u(h.relativeLuminance2(o,a,l),h.relativeLuminance2(s,r,n));for(;c<i&&(o>0||a>0||l>0);)o-=Math.max(0,Math.ceil(.1*o)),a-=Math.max(0,Math.ceil(.1*a)),l-=Math.max(0,Math.ceil(.1*l)),c=u(h.relativeLuminance2(o,a,l),h.relativeLuminance2(s,r,n));return(o<<24|a<<16|l<<8|255)>>>0}function a(e,t,i){const s=e>>24&255,r=e>>16&255,n=e>>8&255;let o=t>>24&255,a=t>>16&255,l=t>>8&255,c=u(h.relativeLuminance2(o,a,l),h.relativeLuminance2(s,r,n));for(;c<i&&(o<255||a<255||l<255);)o=Math.min(255,o+Math.ceil(.1*(255-o))),a=Math.min(255,a+Math.ceil(.1*(255-a))),l=Math.min(255,l+Math.ceil(.1*(255-l))),c=u(h.relativeLuminance2(o,a,l),h.relativeLuminance2(s,r,n));return(o<<24|a<<16|l<<8|255)>>>0}e.blend=function(e,t){if(n=(255&t)/255,1===n)return t;const a=t>>24&255,l=t>>16&255,h=t>>8&255,c=e>>24&255,d=e>>16&255,u=e>>8&255;return i=c+Math.round((a-c)*n),s=d+Math.round((l-d)*n),r=u+Math.round((h-u)*n),o.toRgba(i,s,r)},e.ensureContrastRatio=function(e,i,s){const r=h.relativeLuminance(e>>8),n=h.relativeLuminance(i>>8);if(u(r,n)<s){if(n<r){const n=t(e,i,s),o=u(r,h.relativeLuminance(n>>8));if(o<s){const t=a(e,i,s);return o>u(r,h.relativeLuminance(t>>8))?n:t}return n}const o=a(e,i,s),l=u(r,h.relativeLuminance(o>>8));if(l<s){const n=t(e,i,s);return l>u(r,h.relativeLuminance(n>>8))?o:n}return o}},e.reduceLuminance=t,e.increaseLuminance=a,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]}}(c||(t.rgba=c={}))},5777:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;const s=i(6501),r=i(6025),n=i(7276),o=i(9640),a=i(56),l=i(4071),h=i(7792),c=i(6415),d=i(5746),u=i(5882),_=i(2486),f=i(3562),p=i(8811),g=i(802),m=i(7150);let v=!1;class S extends m.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new g.Emitter),this._onScroll.event((e=>{this._onScrollApi?.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(const t in e)this.optionsService.options[t]=e[t]}constructor(e){super(),this._windowsWrappingHeuristics=this._register(new m.MutableDisposable),this._onBinary=this._register(new g.Emitter),this.onBinary=this._onBinary.event,this._onData=this._register(new g.Emitter),this.onData=this._onData.event,this._onLineFeed=this._register(new g.Emitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new g.Emitter),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new g.Emitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new g.Emitter),this._instantiationService=new r.InstantiationService,this.optionsService=this._register(new a.OptionsService(e)),this._instantiationService.setService(s.IOptionsService,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(o.BufferService)),this._instantiationService.setService(s.IBufferService,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(n.LogService)),this._instantiationService.setService(s.ILogService,this._logService),this.coreService=this._register(this._instantiationService.createInstance(l.CoreService)),this._instantiationService.setService(s.ICoreService,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(h.CoreMouseService)),this._instantiationService.setService(s.ICoreMouseService,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(c.UnicodeService)),this._instantiationService.setService(s.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(d.CharsetService),this._instantiationService.setService(s.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(p.OscLinkService),this._instantiationService.setService(s.IOscLinkService,this._oscLinkService),this._inputHandler=this._register(new _.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(g.Event.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(g.Event.forward(this._bufferService.onResize,this._onResize)),this._register(g.Event.forward(this.coreService.onData,this._onData)),this._register(g.Event.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 f.WriteBuffer(((e,t)=>this._inputHandler.parse(e,t)))),this._register(g.Event.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=s.LogLevelEnum.WARN&&!v&&(this._logService.warn("writeSync is unreliable and will be removed soon."),v=!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,o.MINIMUM_COLS),t=Math.max(t,o.MINIMUM_ROWS),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){const t=e-this._bufferService.buffer.ydisp;0!==t&&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;const t=this.optionsService.rawOptions.windowsPty;t&&void 0!==t.buildNumber&&void 0!==t.buildNumber?e=!!("conpty"===t.backend&&t.buildNumber<21376):this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const e=[];e.push(this.onLineFeed(u.updateWindowsModeWrappedState.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},(()=>((0,u.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,m.toDisposable)((()=>{for(const t of e)t.dispose()}))}}}t.CoreTerminal=S},2486:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0,t.isValidColorIndex=R;const n=i(3534),o=i(6760),a=i(6717),l=i(7150),h=i(726),c=i(6107),d=i(8938),u=i(3055),_=i(5451),f=i(6501),p=i(6415),g=i(1346),m=i(9823),v=i(8693),S=i(802),b={"(":0,")":1,"*":2,"+":3,"-":1,".":2},C=131072;function y(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 w;!function(e){e[e.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",e[e.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(w||(t.WindowsOptionsReportType=w={}));let E=0;class D extends l.Disposable{getAttrData(){return this._curAttrData}constructor(e,t,i,s,r,l,d,u,_=new a.EscapeSequenceParser){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=l,this._coreMouseService=d,this._unicodeService=u,this._parser=_,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new h.StringToUtf32,this._utf8Decoder=new h.Utf8ToUtf32,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this._register(new S.Emitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new S.Emitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new S.Emitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new S.Emitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new S.Emitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new S.Emitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new S.Emitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new S.Emitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new S.Emitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new S.Emitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new S.Emitter),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new S.Emitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new S.Emitter),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 L(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._parser.setCsiHandlerFallback(((e,t)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e),params:t.toArray()})})),this._parser.setEscHandlerFallback((e=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e)})})),this._parser.setExecuteHandlerFallback((e=>{this._logService.debug("Unknown EXECUTE code: ",{code:e})})),this._parser.setOscHandlerFallback(((e,t,i)=>{this._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:i})})),this._parser.setDcsHandlerFallback(((e,t,i)=>{"HOOK"===t&&(i=i.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e),action:t,payload:i})})),this._parser.setPrintHandler(((e,t,i)=>this.print(e,t,i))),this._parser.registerCsiHandler({final:"@"},(e=>this.insertChars(e))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(e=>this.scrollLeft(e))),this._parser.registerCsiHandler({final:"A"},(e=>this.cursorUp(e))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(e=>this.scrollRight(e))),this._parser.registerCsiHandler({final:"B"},(e=>this.cursorDown(e))),this._parser.registerCsiHandler({final:"C"},(e=>this.cursorForward(e))),this._parser.registerCsiHandler({final:"D"},(e=>this.cursorBackward(e))),this._parser.registerCsiHandler({final:"E"},(e=>this.cursorNextLine(e))),this._parser.registerCsiHandler({final:"F"},(e=>this.cursorPrecedingLine(e))),this._parser.registerCsiHandler({final:"G"},(e=>this.cursorCharAbsolute(e))),this._parser.registerCsiHandler({final:"H"},(e=>this.cursorPosition(e))),this._parser.registerCsiHandler({final:"I"},(e=>this.cursorForwardTab(e))),this._parser.registerCsiHandler({final:"J"},(e=>this.eraseInDisplay(e,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(e=>this.eraseInDisplay(e,!0))),this._parser.registerCsiHandler({final:"K"},(e=>this.eraseInLine(e,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(e=>this.eraseInLine(e,!0))),this._parser.registerCsiHandler({final:"L"},(e=>this.insertLines(e))),this._parser.registerCsiHandler({final:"M"},(e=>this.deleteLines(e))),this._parser.registerCsiHandler({final:"P"},(e=>this.deleteChars(e))),this._parser.registerCsiHandler({final:"S"},(e=>this.scrollUp(e))),this._parser.registerCsiHandler({final:"T"},(e=>this.scrollDown(e))),this._parser.registerCsiHandler({final:"X"},(e=>this.eraseChars(e))),this._parser.registerCsiHandler({final:"Z"},(e=>this.cursorBackwardTab(e))),this._parser.registerCsiHandler({final:"`"},(e=>this.charPosAbsolute(e))),this._parser.registerCsiHandler({final:"a"},(e=>this.hPositionRelative(e))),this._parser.registerCsiHandler({final:"b"},(e=>this.repeatPrecedingCharacter(e))),this._parser.registerCsiHandler({final:"c"},(e=>this.sendDeviceAttributesPrimary(e))),this._parser.registerCsiHandler({prefix:">",final:"c"},(e=>this.sendDeviceAttributesSecondary(e))),this._parser.registerCsiHandler({final:"d"},(e=>this.linePosAbsolute(e))),this._parser.registerCsiHandler({final:"e"},(e=>this.vPositionRelative(e))),this._parser.registerCsiHandler({final:"f"},(e=>this.hVPosition(e))),this._parser.registerCsiHandler({final:"g"},(e=>this.tabClear(e))),this._parser.registerCsiHandler({final:"h"},(e=>this.setMode(e))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(e=>this.setModePrivate(e))),this._parser.registerCsiHandler({final:"l"},(e=>this.resetMode(e))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(e=>this.resetModePrivate(e))),this._parser.registerCsiHandler({final:"m"},(e=>this.charAttributes(e))),this._parser.registerCsiHandler({final:"n"},(e=>this.deviceStatus(e))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(e=>this.deviceStatusPrivate(e))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(e=>this.softReset(e))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(e=>this.setCursorStyle(e))),this._parser.registerCsiHandler({final:"r"},(e=>this.setScrollRegion(e))),this._parser.registerCsiHandler({final:"s"},(e=>this.saveCursor(e))),this._parser.registerCsiHandler({final:"t"},(e=>this.windowOptions(e))),this._parser.registerCsiHandler({final:"u"},(e=>this.restoreCursor(e))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(e=>this.insertColumns(e))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(e=>this.deleteColumns(e))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(e=>this.selectProtected(e))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(e=>this.requestMode(e,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(e=>this.requestMode(e,!1))),this._parser.setExecuteHandler(n.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(n.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(n.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(n.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(n.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(n.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(n.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(n.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(n.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new g.OscHandler((e=>(this.setTitle(e),this.setIconName(e),!0)))),this._parser.registerOscHandler(1,new g.OscHandler((e=>this.setIconName(e)))),this._parser.registerOscHandler(2,new g.OscHandler((e=>this.setTitle(e)))),this._parser.registerOscHandler(4,new g.OscHandler((e=>this.setOrReportIndexedColor(e)))),this._parser.registerOscHandler(8,new g.OscHandler((e=>this.setHyperlink(e)))),this._parser.registerOscHandler(10,new g.OscHandler((e=>this.setOrReportFgColor(e)))),this._parser.registerOscHandler(11,new g.OscHandler((e=>this.setOrReportBgColor(e)))),this._parser.registerOscHandler(12,new g.OscHandler((e=>this.setOrReportCursorColor(e)))),this._parser.registerOscHandler(104,new g.OscHandler((e=>this.restoreIndexedColor(e)))),this._parser.registerOscHandler(110,new g.OscHandler((e=>this.restoreFgColor(e)))),this._parser.registerOscHandler(111,new g.OscHandler((e=>this.restoreBgColor(e)))),this._parser.registerOscHandler(112,new g.OscHandler((e=>this.restoreCursorColor(e)))),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(const e in o.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:e},(()=>this.selectCharset("("+e))),this._parser.registerEscHandler({intermediates:")",final:e},(()=>this.selectCharset(")"+e))),this._parser.registerEscHandler({intermediates:"*",final:e},(()=>this.selectCharset("*"+e))),this._parser.registerEscHandler({intermediates:"+",final:e},(()=>this.selectCharset("+"+e))),this._parser.registerEscHandler({intermediates:"-",final:e},(()=>this.selectCharset("-"+e))),this._parser.registerEscHandler({intermediates:".",final:e},(()=>this.selectCharset("."+e))),this._parser.registerEscHandler({intermediates:"/",final:e},(()=>this.selectCharset("/"+e)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((e=>(this._logService.error("Parsing error: ",e),e))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler(((e,t)=>this.requestStatusString(e,t))))}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=f.LogLevelEnum.WARN&&Promise.race([e,new Promise(((e,t)=>setTimeout((()=>t("#SLOW_TIMEOUT")),5e3)))]).catch((e=>{if("#SLOW_TIMEOUT"!==e)throw e;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0;const o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>C&&(n=this._parseStack.position+C)}if(this._logService.logLevel<=f.LogLevelEnum.DEBUG&&this._logService.debug("parsing data "+("string"==typeof e?` "${e}"`:` "${Array.prototype.map.call(e,(e=>String.fromCharCode(e))).join("")}"`)),this._logService.logLevel===f.LogLevelEnum.TRACE&&this._logService.trace("parsing data (codes)","string"==typeof e?e.split("").map((e=>e.charCodeAt(0))):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<C&&(this._parseBuffer=new Uint32Array(Math.min(e.length,C))),o||this._dirtyRowTracker.clearRange(),e.length>C)for(let t=n;t<e.length;t+=C){const n=t+C<e.length?t+C:e.length,o="string"==typeof e?this._stringDecoder.decode(e.substring(t,n),this._parseBuffer):this._utf8Decoder.decode(e.subarray(t,n),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,o))return this._preserveStack(s,r,o,t),this._logSlowResolvingAsync(i),i}else if(!o){const t="string"==typeof e?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,t))return this._preserveStack(s,r,t,0),this._logSlowResolvingAsync(i),i}this._activeBuffer.x===s&&this._activeBuffer.y===r||this._onCursorMove.fire();const 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,i){let s,r;const n=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,a=this._bufferService.cols,l=this._coreService.decPrivateModes.wraparound,u=this._coreService.modes.insertMode,_=this._curAttrData;let f=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&2===f.getWidth(this._activeBuffer.x-1)&&f.setCellFromCodepoint(this._activeBuffer.x-1,0,1,_);let g=this._parser.precedingJoinState;for(let m=t;m<i;++m){if(s=e[m],s<127&&n){const e=n[String.fromCharCode(s)];e&&(s=e.charCodeAt(0))}const t=this._unicodeService.charProperties(s,g);r=p.UnicodeService.extractWidth(t);const i=p.UnicodeService.extractShouldJoin(t),v=i?p.UnicodeService.extractWidth(g):0;if(g=t,o&&this._onA11yChar.fire((0,h.stringFromCodePoint)(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+r-v>a)if(l){const e=f;let t=this._activeBuffer.x-v;for(this._activeBuffer.x=v,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),f=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),v>0&&f instanceof c.BufferLine&&f.copyCellsFrom(e,t,0,v,!1);t<a;)e.setCellFromCodepoint(t++,0,1,_)}else if(this._activeBuffer.x=a-1,2===r)continue;if(i&&this._activeBuffer.x){const e=f.getWidth(this._activeBuffer.x-1)?1:2;f.addCodepointToCell(this._activeBuffer.x-e,s,r);for(let e=r-v;--e>=0;)f.setCellFromCodepoint(this._activeBuffer.x++,0,0,_)}else if(u&&(f.insertCells(this._activeBuffer.x,r-v,this._activeBuffer.getNullCell(_)),2===f.getWidth(a-1)&&f.setCellFromCodepoint(a-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,_)),f.setCellFromCodepoint(this._activeBuffer.x++,s,r,_),r>0)for(;--r;)f.setCellFromCodepoint(this._activeBuffer.x++,0,0,_)}this._parser.precedingJoinState=g,this._activeBuffer.x<a&&i-t>0&&0===f.getWidth(this._activeBuffer.x)&&!f.hasContent(this._activeBuffer.x)&&f.setCellFromCodepoint(this._activeBuffer.x,0,1,_),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return"t"!==e.final||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,(e=>!y(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)))}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new m.DcsHandler(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new g.OscHandler(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(){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(0===this._activeBuffer.x&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const 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){const 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){const 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){const t=e.params[0];return 0===t?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===t&&(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){const t=e.params[0];return 1===t&&(this._curAttrData.bg|=536870912),2!==t&&0!==t||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){const n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){let i;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--;){const e=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);if(e?.getTrimmedLength())break}for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:const e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}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,0===this._activeBuffer.x,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)}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;const i=this._activeBuffer.ybase+this._activeBuffer.y,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,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;const i=this._activeBuffer.ybase+this._activeBuffer.y;let s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(s,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();const 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();const 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(c.DEFAULT_ATTR_DATA));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;const t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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;const t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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;const t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.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;const t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();const 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){const t=this._parser.precedingJoinState;if(!t)return!0;const i=e.params[0]||1,s=p.UnicodeService.extractWidth(t),r=this._activeBuffer.x-s,n=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(r),o=new Uint32Array(n.length*i);let a=0;for(let e=0;e<n.length;){const t=n.codePointAt(e)||0;o[a++]=t,e+=t>65535?2:1}let l=a;for(let e=1;e<i;++e)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(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(e){return 0===(this._optionsService.rawOptions.termName+"").indexOf(e)}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}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,o.DEFAULT_CHARSET),this._charsetService.setgCharset(1,o.DEFAULT_CHARSET),this._charsetService.setgCharset(2,o.DEFAULT_CHARSET),this._charsetService.setgCharset(3,o.DEFAULT_CHARSET);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}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}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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),1049===e.params[t]&&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)}return!0}requestMode(e,t){const i=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:r}=this._coreMouseService,o=this._coreService,{buffers:a,cols:l}=this._bufferService,{active:h,alt:c}=a,d=this._optionsService.rawOptions,u=e=>e?1:2,_=e.params[0];return f=_,p=t?2===_?4:4===_?u(o.modes.insertMode):12===_?3:20===_?u(d.convertEol):0:1===_?u(i.applicationCursorKeys):3===_?d.windowOptions.setWinLines?80===l?2:132===l?1:0:0:6===_?u(i.origin):7===_?u(i.wraparound):8===_?3:9===_?u("X10"===s):12===_?u(d.cursorBlink):25===_?u(!o.isCursorHidden):45===_?u(i.reverseWraparound):66===_?u(i.applicationKeypad):67===_?4:1e3===_?u("VT200"===s):1002===_?u("DRAG"===s):1003===_?u("ANY"===s):1004===_?u(i.sendFocus):1005===_?4:1006===_?u("SGR"===r):1015===_?4:1016===_?u("SGR_PIXELS"===r):1048===_?1:47===_||1047===_||1049===_?u(h===c):2004===_?u(i.bracketedPasteMode):2026===_?u(i.synchronizedOutput):0,o.triggerDataEvent(`${n.C0.ESC}[${t?"":"?"}${f};${p}$y`),!0;var f,p}_updateAttrColor(e,t,i,s,r){return 2===t?(e|=50331648,e&=-16777216,e|=_.AttributeData.fromColorRGB([i,s,r])):5===t&&(e&=-50331904,e|=33554432|255&i),e}_extractColor(e,t,i){const s=[0,0,-1,0,0,0];let r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){const i=e.getSubParams(t+n);let o=0;do{5===s[1]&&(r=1),s[n+o+1+r]=i[o]}while(++o<i.length&&o+n+1+r<s.length);break}if(5===s[1]&&n+r>=2||2===s[1]&&n+r>=5)break;s[1]&&(r=1)}while(++n+t<e.length&&n+r<s.length);for(let e=2;e<s.length;++e)-1===s[e]&&(s[e]=0);switch(s[0]){case 38:i.fg=this._updateAttrColor(i.fg,s[1],s[3],s[4],s[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,s[1],s[3],s[4],s[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,s[1],s[3],s[4],s[5])}return n}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=c.DEFAULT_ATTR_DATA.fg,e.bg=c.DEFAULT_ATTR_DATA.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(1===e.length&&0===e.params[0])return this._processSGR0(this._curAttrData),!0;const t=e.length;let i;const s=this._curAttrData;for(let r=0;r<t;r++)i=e.params[r],i>=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777224|i-90):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777224|i-100):0===i?this._processSGR0(s):1===i?s.fg|=134217728:3===i?s.bg|=67108864:4===i?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):5===i?s.fg|=536870912:7===i?s.fg|=67108864:8===i?s.fg|=1073741824:9===i?s.fg|=2147483648:2===i?s.bg|=134217728:21===i?this._processUnderline(2,s):22===i?(s.fg&=-134217729,s.bg&=-134217729):23===i?s.bg&=-67108865:24===i?(s.fg&=-268435457,this._processUnderline(0,s)):25===i?s.fg&=-536870913:27===i?s.fg&=-67108865:28===i?s.fg&=-1073741825:29===i?s.fg&=2147483647:39===i?(s.fg&=-67108864,s.fg|=16777215&c.DEFAULT_ATTR_DATA.fg):49===i?(s.bg&=-67108864,s.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):38===i||48===i||58===i?r+=this._extractColor(e,r,s):53===i?s.bg|=1073741824:55===i?s.bg&=-1073741825:59===i?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):100===i?(s.fg&=-67108864,s.fg|=16777215&c.DEFAULT_ATTR_DATA.fg,s.bg&=-67108864,s.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(6===e.params[0]){const e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${e};${t}R`)}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=c.DEFAULT_ATTR_DATA.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){const t=0===e.length?1:e.params[0];if(0===t)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"}const e=t%2==1;this._coreService.decPrivateModes.cursorBlink=e}return!0}setScrollRegion(e){const t=e.params[0]||1;let i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||0===i)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!y(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;const t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(w.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(w.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}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){const t=[],i=e.split(";");for(;i.length>1;){const e=i.shift(),s=i.shift();if(/^\d+$/.exec(e)){const i=parseInt(e);if(R(i))if("?"===s)t.push({type:0,index:i});else{const e=(0,v.parseColor)(s);e&&t.push({type:1,index:i,color:e})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){const t=e.indexOf(";");if(-1===t)return!0;const i=e.slice(0,t).trim(),s=e.slice(t+1);return s?this._createHyperlink(i,s):!i.trim()&&this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();const i=e.split(":");let s;const r=i.findIndex((e=>e.startsWith("id=")));return-1!==r&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,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){const i=e.split(";");for(let e=0;e<i.length&&!(t>=this._specialColors.length);++e,++t)if("?"===i[e])this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{const s=(0,v.parseColor)(i[e]);s&&this._onColor.fire([{type:1,index:this._specialColors[t],color:s}])}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;const t=[],i=e.split(";");for(let e=0;e<i.length;++e)if(/^\d+$/.exec(i[e])){const s=parseInt(i[e]);R(s)&&t.push({type:2,index:s})}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,o.DEFAULT_CHARSET),!0}selectCharset(e){return 2!==e.length?(this.selectDefaultCharset(),!0):("/"===e[0]||this._charsetService.setgCharset(b[e[0]],o.CHARSETS[e[1]]||o.DEFAULT_CHARSET),!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){const 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=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){const e=new u.CellData;e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){const i=this._activeBuffer.ybase+this._activeBuffer.y+t,s=this._activeBuffer.lines.get(i);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){const i=this._bufferService.buffer,s=this._optionsService.rawOptions;return(e=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${e}${n.C0.ESC}\\`),!0))('"q'===e?`P1$r${this._curAttrData.isProtected()?1:0}"q`:'"p'===e?'P1$r61;1"p':"r"===e?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:"m"===e?"P1$r0m":" q"===e?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}}t.InputHandler=D;let L=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&&(E=e,e=t,t=E),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function R(e){return 0<=e&&e<256}L=s([r(0,f.IBufferService)],L)},7710:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class i{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=i,t.FourKeyMap=class{constructor(){this._data=new i}set(e,t,s,r,n){this._data.get(e,t)||this._data.set(e,t,new i),this._data.get(e,t).set(s,r,n)}get(e,t,i,s){return this._data.get(e,t)?.get(i,s)}clear(){this._data.clear()}}},701:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.getSafariVersion=function(){if(!t.isSafari)return 0;const e=i.match(/Version\/(\d+)/);return null===e||e.length<2?0:parseInt(e[1])},t.isNode="undefined"!=typeof process&&"title"in process;const i=t.isNode?"node":navigator.userAgent,s=t.isNode?"node":navigator.platform;t.isFirefox=i.includes("Firefox"),t.isLegacyEdge=i.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(i),t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(s),t.isIpad="iPad"===s,t.isIphone="iPhone"===s,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(s),t.isLinux=s.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(i)},3087:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;const s=i(6168);let r=0;t.SortedList=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new s.IdleTaskQueue,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new s.IdleTaskQueue,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(),0===this._insertedValues.length&&this._flushInsertedTask.enqueue((()=>this._flushInserted())),this._insertedValues.push(e)}_flushInserted(){const e=this._insertedValues.sort(((e,t)=>this._getKey(e)-this._getKey(t)));let t=0,i=0;const s=new Array(this._array.length+this._insertedValues.length);for(let r=0;r<s.length;r++)i>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(s[r]=e[t],t++):s[r]=this._array[i++];this._array=s,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),0===this._array.length)return!1;const t=this._getKey(e);if(void 0===t)return!1;if(r=this._search(t),-1===r)return!1;if(this._getKey(this._array[r])!==t)return!1;do{if(this._array[r]===e)return 0===this._deletedIndices.length&&this._flushDeletedTask.enqueue((()=>this._flushDeleted())),this._deletedIndices.push(r),!0}while(++r<this._array.length&&this._getKey(this._array[r])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;const e=this._deletedIndices.sort(((e,t)=>e-t));let t=0;const i=new Array(this._array.length-e.length);let s=0;for(let r=0;r<this._array.length;r++)e[t]===r?t++:i[s++]=this._array[r];this._array=i,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),0!==this._array.length&&(r=this._search(e),!(r<0||r>=this._array.length)&&this._getKey(this._array[r])===e))do{yield this._array[r]}while(++r<this._array.length&&this._getKey(this._array[r])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),0!==this._array.length&&(r=this._search(e),!(r<0||r>=this._array.length)&&this._getKey(this._array[r])===e))do{t(this._array[r])}while(++r<this._array.length&&this._getKey(this._array[r])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,i=this._array.length-1;for(;i>=t;){let s=t+i>>1;const r=this._getKey(this._array[s]);if(r>e)i=s-1;else{if(!(r<e)){for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}t=s+1}}return t}}},6168:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const s=i(701);class r{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,i=0,s=e.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),r=e.timeRemaining(),1.5*i>r)return s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),void this._start();s=r}this.clear()}}class n extends r{_requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){const t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!s.isNode&&"requestIdleCallback"in window?class extends r{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}}},5882:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=function(e){const t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1),i=t?.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&i&&(r.isWrapped=i[s.CHAR_DATA_CODE_INDEX]!==s.NULL_CELL_CODE&&i[s.CHAR_DATA_CODE_INDEX]!==s.WHITESPACE_CELL_CODE)};const s=i(8938)},5451:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class i{constructor(){this.fg=0,this.bg=0,this.extended=new s}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return!(50331648&~this.fg)}isBgRGB(){return!(50331648&~this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return!(50331648&this.fg)}isBgDefault(){return!(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?!(50331648&~this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?!(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=i;class s{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){const e=(3758096384&this._ext)>>29;return e<0?4294967288^e:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}clone(){return new s(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}t.ExtendedAttrs=s},1073:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Buffer=t.MAX_BUFFER_SIZE=void 0;const s=i(5639),r=i(6168),n=i(5451),o=i(6107),a=i(732),l=i(3055),h=i(8938),c=i(8158),d=i(6760);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=o.DEFAULT_ATTR_DATA.clone(),this.savedCharset=d.DEFAULT_CHARSET,this.markers=[],this._nullCell=l.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]),this._whitespaceCell=l.CellData.fromCharData([0,h.WHITESPACE_CELL_CHAR,h.WHITESPACE_CELL_WIDTH,h.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new r.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new s.CircularList(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 n.ExtendedAttrs),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 n.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new o.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const i=e+this._optionsService.rawOptions.scrollback;return i>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:i}fillViewportRows(e){if(0===this.lines.length){void 0===e&&(e=o.DEFAULT_ATTR_DATA);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 s.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){const i=this.getNullCell(o.DEFAULT_ATTR_DATA);let s=0;const r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols<e)for(let t=0;t<this.lines.length;t++)s+=+this.lines.get(t).resize(e,i);let n=0;if(this._rows<t)for(let s=this._rows;s<t;s++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||void 0!==this._optionsService.rawOptions.windowsPty.backend||void 0!==this._optionsService.rawOptions.windowsPty.buildNumber?this.lines.push(new o.BufferLine(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new o.BufferLine(e,i)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r<this.lines.maxLength){const e=this.lines.length-r;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),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 t=0;t<this.lines.length;t++)s+=+this.lines.get(t).resize(e,i);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),s>.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(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&"conpty"===e.backend&&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){const i=this._optionsService.rawOptions.reflowCursorLine,s=(0,a.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(o.DEFAULT_ATTR_DATA),i);if(s.length>0){const i=(0,a.reflowLargerCreateNewLayout)(this.lines,s);(0,a.reflowLargerApplyNewLayout)(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){const s=this.getNullCell(o.DEFAULT_ATTR_DATA);let r=i;for(;r-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new o.BufferLine(e,s))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){const i=this._optionsService.rawOptions.reflowCursorLine,s=this.getNullCell(o.DEFAULT_ATTR_DATA),r=[];let n=0;for(let l=this.lines.length-1;l>=0;l--){let h=this.lines.get(l);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;const c=[h];for(;h.isWrapped&&l>0;)h=this.lines.get(--l),c.unshift(h);if(!i){const e=this.ybase+this.y;if(e>=l&&e<l+c.length)continue}const d=c[c.length-1].getTrimmedLength(),u=(0,a.reflowSmallerGetNewLineLengths)(c,this._cols,e),_=u.length-c.length;let f;f=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+_):Math.max(0,this.lines.length-this.lines.maxLength+_);const p=[];for(let e=0;e<_;e++){const e=this.getBlankLine(o.DEFAULT_ATTR_DATA,!0);p.push(e)}p.length>0&&(r.push({start:l+c.length+n,newLines:p}),n+=p.length),c.push(...p);let g=u.length-1,m=u[g];0===m&&(g--,m=u[g]);let v=c.length-_-1,S=d;for(;v>=0;){const e=Math.min(S,m);if(void 0===c[g])break;if(c[g].copyCellsFrom(c[v],S-e,m-e,e,!0),m-=e,0===m&&(g--,m=u[g]),S-=e,0===S){v--;const e=Math.max(v,0);S=(0,a.getWrappedLineTrimmedLength)(c,e,this._cols)}}for(let t=0;t<c.length;t++)u[t]<e&&c[t].setCell(u[t],s);let b=_-f;for(;b-- >0;)0===this.ybase?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+n)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+_,this.ybase+t-1)}if(r.length>0){const e=[],t=[];for(let e=0;e<this.lines.length;e++)t.push(this.lines.get(e));const i=this.lines.length;let s=i-1,o=0,a=r[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n);let l=0;for(let h=Math.min(this.lines.maxLength-1,i+n-1);h>=0;h--)if(a&&a.start>s+l){for(let e=a.newLines.length-1;e>=0;e--)this.lines.set(h--,a.newLines[e]);h++,e.push({index:s+1,amount:a.newLines.length}),l+=a.newLines.length,a=r[++o]}else this.lines.set(h,t[s--]);let h=0;for(let t=e.length-1;t>=0;t--)e[t].index+=h,this.lines.onInsertEmitter.fire(e[t]),h+=e[t].amount;const c=Math.max(0,i+n-this.lines.maxLength);c>0&&this.lines.onTrimEmitter.fire(c)}}translateBufferLineToString(e,t,i=0,s){const r=this.lines.get(e);return r?r.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(null!=e?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(null==e&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(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){const t=new c.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim((e=>{t.line-=e,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((e=>{t.line>=e.index&&(t.line+=e.amount)}))),t.register(this.lines.onDelete((e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},6107:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;const s=i(5451),r=i(3055),n=i(8938),o=i(726);t.DEFAULT_ATTR_DATA=Object.freeze(new s.AttributeData);let a=0;class l{constructor(e,t,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const s=t||r.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let t=0;t<e;++t)this.setCell(t,s);this.length=e}get(e){const t=this._data[3*e+0],i=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:i?(0,o.stringFromCodePoint)(i):"",t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,t){this._data[3*e+1]=t[n.CHAR_DATA_ATTR_INDEX],t[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?(0,o.stringFromCodePoint)(2097151&t):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,t){return a=3*e,t.content=this._data[a+0],t.fg=this._data[a+1],t.bg=this._data[a+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg}setCellFromCodepoint(e,t,i,s){268435456&s.bg&&(this._extendedAttrs[e]=s.extended),this._data[3*e+0]=t|i<<22,this._data[3*e+1]=s.fg,this._data[3*e+2]=s.bg}addCodepointToCell(e,t,i){let s=this._data[3*e+0];2097152&s?this._combined[e]+=(0,o.stringFromCodePoint)(t):2097151&s?(this._combined[e]=(0,o.stringFromCodePoint)(2097151&s)+(0,o.stringFromCodePoint)(t),s&=-2097152,s|=2097152):s=t|1<<22,i&&(s&=-12582913,s|=i<<22),this._data[3*e+0]=s}insertCells(e,t,i){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodepoint(e-1,0,1,i),t<this.length-e){const s=new r.CellData;for(let i=this.length-e-t-1;i>=0;--i)this.setCell(e+t+i,this.loadCell(e+i,s));for(let s=0;s<t;++s)this.setCell(e+s,i)}else for(let t=e;t<this.length;++t)this.setCell(t,i);2===this.getWidth(this.length-1)&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(e,t,i){if(e%=this.length,t<this.length-e){const s=new r.CellData;for(let i=0;i<this.length-e-t;++i)this.setCell(e+i,this.loadCell(e+t+i,s));for(let e=this.length-t;e<this.length;++e)this.setCell(e,i)}else for(let t=e;t<this.length;++t)this.setCell(t,i);e&&2===this.getWidth(e-1)&&this.setCellFromCodepoint(e-1,0,1,i),0!==this.getWidth(e)||this.hasContent(e)||this.setCellFromCodepoint(e,0,1,i)}replaceCells(e,t,i,s=!1){if(s)for(e&&2===this.getWidth(e-1)&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,i),t<this.length&&2===this.getWidth(t-1)&&!this.isProtected(t)&&this.setCellFromCodepoint(t,0,1,i);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,i),e++;else for(e&&2===this.getWidth(e-1)&&this.setCellFromCodepoint(e-1,0,1,i),t<this.length&&2===this.getWidth(t-1)&&this.setCellFromCodepoint(t,0,1,i);e<t&&e<this.length;)this.setCell(e++,i)}resize(e,t){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const i=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*i)this._data=new Uint32Array(this._data.buffer,0,i);else{const e=new Uint32Array(i);e.set(this._data),this._data=e}for(let i=this.length;i<e;++i)this.setCell(i,t)}else{this._data=this._data.subarray(0,i);const t=Object.keys(this._combined);for(let i=0;i<t.length;i++){const s=parseInt(t[i],10);s>=e&&delete this._combined[s]}const s=Object.keys(this._extendedAttrs);for(let t=0;t<s.length;t++){const i=parseInt(s[t],10);i>=e&&delete this._extendedAttrs[i]}}return this.length=e,4*i*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,t=!1){if(t)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(const t in e._combined)this._combined[t]=e._combined[t];this._extendedAttrs={};for(const t in e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped}clone(){const e=new l(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const t in this._combined)e._combined[t]=this._combined[t];for(const t in this._extendedAttrs)e._extendedAttrs[t]=this._extendedAttrs[t];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,t,i,s,r){const n=e._data;if(r)for(let r=s-1;r>=0;r--){for(let e=0;e<3;e++)this._data[3*(i+r)+e]=n[3*(t+r)+e];268435456&n[3*(t+r)+2]&&(this._extendedAttrs[i+r]=e._extendedAttrs[t+r])}else for(let r=0;r<s;r++){for(let e=0;e<3;e++)this._data[3*(i+r)+e]=n[3*(t+r)+e];268435456&n[3*(t+r)+2]&&(this._extendedAttrs[i+r]=e._extendedAttrs[t+r])}const o=Object.keys(e._combined);for(let s=0;s<o.length;s++){const r=parseInt(o[s],10);r>=t&&(this._combined[r-t+i]=e._combined[r])}}translateToString(e,t,i,s){t=t??0,i=i??this.length,e&&(i=Math.min(i,this.getTrimmedLength())),s&&(s.length=0);let r="";for(;t<i;){const e=this._data[3*t+0],i=2097151&e,a=2097152&e?this._combined[t]:i?(0,o.stringFromCodePoint)(i):n.WHITESPACE_CELL_CHAR;if(r+=a,s)for(let e=0;e<a.length;++e)s.push(t);t+=e>>22||1}return s&&s.push(t),r}}t.BufferLine=l},9384:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=function(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)}},732:(e,t)=>{function i(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();const s=!e[t].hasContent(i-1)&&1===e[t].getWidth(i-1),r=2===e[t+1].getWidth(0);return s&&r?i-1:i}Object.defineProperty(t,"__esModule",{value:!0}),t.reflowLargerGetLinesToRemove=function(e,t,s,r,n,o){const a=[];for(let l=0;l<e.length-1;l++){let h=l,c=e.get(++h);if(!c.isWrapped)continue;const d=[e.get(l)];for(;h<e.length&&c.isWrapped;)d.push(c),c=e.get(++h);if(!o&&r>=l&&r<h){l+=d.length-1;continue}let u=0,_=i(d,u,t),f=1,p=0;for(;f<d.length;){const e=i(d,f,t),r=e-p,o=s-_,a=Math.min(r,o);d[u].copyCellsFrom(d[f],p,_,a,!1),_+=a,_===s&&(u++,_=0),p+=a,p===e&&(f++,p=0),0===_&&0!==u&&2===d[u-1].getWidth(s-1)&&(d[u].copyCellsFrom(d[u-1],s-1,_++,1,!1),d[u-1].setCell(s-1,n))}d[u].replaceCells(_,s,n);let g=0;for(let e=d.length-1;e>0&&(e>u||0===d[e].getTrimmedLength());e--)g++;g>0&&(a.push(l+d.length-g),a.push(g)),l+=d.length-1}return a},t.reflowLargerCreateNewLayout=function(e,t){const i=[];let s=0,r=t[s],n=0;for(let o=0;o<e.length;o++)if(r===o){const i=t[++s];e.onDeleteEmitter.fire({index:o-n,amount:i}),o+=i-1,n+=i,r=t[++s]}else i.push(o);return{layout:i,countRemoved:n}},t.reflowLargerApplyNewLayout=function(e,t){const i=[];for(let s=0;s<t.length;s++)i.push(e.get(t[s]));for(let t=0;t<i.length;t++)e.set(t,i[t]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,s){const r=[],n=e.map(((s,r)=>i(e,r,t))).reduce(((e,t)=>e+t));let o=0,a=0,l=0;for(;l<n;){if(n-l<s){r.push(n-l);break}o+=s;const h=i(e,a,t);o>h&&(o-=h,a++);const c=2===e[a].getWidth(o-1);c&&o--;const d=c?s-1:s;r.push(d),l+=d}return r},t.getWrappedLineTrimmedLength=i},4097:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;const s=i(7150),r=i(1073),n=i(802);class o extends s.Disposable{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new n.Emitter),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 r.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new r.Buffer(!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)}}t.BufferSet=o},3055:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const s=i(726),r=i(8938),n=i(5451);class o extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(e){const t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,s.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[r.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[r.CHAR_DATA_CHAR_INDEX].length){const i=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|e[r.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[r.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[r.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[r.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},8938:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=t.DEFAULT_COLOR<<9|256,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},8158:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;const s=i(802),r=i(7150);class n{get id(){return this._id}constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new s.Emitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,r.dispose)(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}}t.Marker=n,n._nextId=1},6760:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},3534:(e,t)=>{var i,s,r;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(e){e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="",e.BS="\b",e.HT="\t",e.LF="\n",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="",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""}(i||(t.C0=i={})),function(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=""}(s||(t.C1=s={})),function(e){e.ST=`${i.ESC}\\`}(r||(t.C1_ESCAPED=r={}))},706:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=function(e,t,i,n){const o={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?o.key=t?s.C0.ESC+"OA":s.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?o.key=t?s.C0.ESC+"OD":s.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?o.key=t?s.C0.ESC+"OC":s.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(o.key=t?s.C0.ESC+"OB":s.C0.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":s.C0.DEL,e.altKey&&(o.key=s.C0.ESC+o.key);break;case 9:if(e.shiftKey){o.key=s.C0.ESC+"[Z";break}o.key=s.C0.HT,o.cancel=!0;break;case 13:o.key=e.altKey?s.C0.ESC+s.C0.CR:s.C0.CR,o.cancel=!0;break;case 27:o.key=s.C0.ESC,e.altKey&&(o.key=s.C0.ESC+s.C0.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;o.key=a?s.C0.ESC+"[1;"+(a+1)+"D":t?s.C0.ESC+"OD":s.C0.ESC+"[D";break;case 39:if(e.metaKey)break;o.key=a?s.C0.ESC+"[1;"+(a+1)+"C":t?s.C0.ESC+"OC":s.C0.ESC+"[C";break;case 38:if(e.metaKey)break;o.key=a?s.C0.ESC+"[1;"+(a+1)+"A":t?s.C0.ESC+"OA":s.C0.ESC+"[A";break;case 40:if(e.metaKey)break;o.key=a?s.C0.ESC+"[1;"+(a+1)+"B":t?s.C0.ESC+"OB":s.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(o.key=s.C0.ESC+"[2~");break;case 46:o.key=a?s.C0.ESC+"[3;"+(a+1)+"~":s.C0.ESC+"[3~";break;case 36:o.key=a?s.C0.ESC+"[1;"+(a+1)+"H":t?s.C0.ESC+"OH":s.C0.ESC+"[H";break;case 35:o.key=a?s.C0.ESC+"[1;"+(a+1)+"F":t?s.C0.ESC+"OF":s.C0.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=s.C0.ESC+"[5;"+(a+1)+"~":o.key=s.C0.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=s.C0.ESC+"[6;"+(a+1)+"~":o.key=s.C0.ESC+"[6~";break;case 112:o.key=a?s.C0.ESC+"[1;"+(a+1)+"P":s.C0.ESC+"OP";break;case 113:o.key=a?s.C0.ESC+"[1;"+(a+1)+"Q":s.C0.ESC+"OQ";break;case 114:o.key=a?s.C0.ESC+"[1;"+(a+1)+"R":s.C0.ESC+"OR";break;case 115:o.key=a?s.C0.ESC+"[1;"+(a+1)+"S":s.C0.ESC+"OS";break;case 116:o.key=a?s.C0.ESC+"[15;"+(a+1)+"~":s.C0.ESC+"[15~";break;case 117:o.key=a?s.C0.ESC+"[17;"+(a+1)+"~":s.C0.ESC+"[17~";break;case 118:o.key=a?s.C0.ESC+"[18;"+(a+1)+"~":s.C0.ESC+"[18~";break;case 119:o.key=a?s.C0.ESC+"[19;"+(a+1)+"~":s.C0.ESC+"[19~";break;case 120:o.key=a?s.C0.ESC+"[20;"+(a+1)+"~":s.C0.ESC+"[20~";break;case 121:o.key=a?s.C0.ESC+"[21;"+(a+1)+"~":s.C0.ESC+"[21~";break;case 122:o.key=a?s.C0.ESC+"[23;"+(a+1)+"~":s.C0.ESC+"[23~";break;case 123:o.key=a?s.C0.ESC+"[24;"+(a+1)+"~":s.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(i&&!n||!e.altKey||e.metaKey)!i||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&1===e.key.length?o.key=e.key:e.key&&e.ctrlKey&&("_"===e.key&&(o.key=s.C0.US),"@"===e.key&&(o.key=s.C0.NUL)):65===e.keyCode&&(o.type=1);else{const t=r[e.keyCode],i=t?.[e.shiftKey?1:0];if(i)o.key=s.C0.ESC+i;else if(e.keyCode>=65&&e.keyCode<=90){const t=e.ctrlKey?e.keyCode-64:e.keyCode+32;let i=String.fromCharCode(t);e.shiftKey&&(i=i.toUpperCase()),o.key=s.C0.ESC+i}else if(32===e.keyCode)o.key=s.C0.ESC+(e.ctrlKey?s.C0.NUL:" ");else if("Dead"===e.key&&e.code.startsWith("Key")){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),o.key=s.C0.ESC+t,o.cancel=!0}}else e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?o.key=s.C0.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?o.key=s.C0.DEL:219===e.keyCode?o.key=s.C0.ESC:220===e.keyCode?o.key=s.C0.FS:221===e.keyCode&&(o.key=s.C0.GS)}return o};const s=i(3534),r={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:["'",'"']}},726:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let t=e[r];t>65535?(t-=65536,s+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):s+=String.fromCharCode(t)}return s},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){const i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){const i=e.charCodeAt(r++);56320<=i&&i<=57343?t[s++]=1024*(this._interim-55296)+i-56320+65536:(t[s++]=this._interim,t[s++]=i),this._interim=0}for(let n=r;n<i;++n){const r=e.charCodeAt(n);if(55296<=r&&r<=56319){if(++n>=i)return this._interim=r,s;const o=e.charCodeAt(n);56320<=o&&o<=57343?t[s++]=1024*(r-55296)+o-56320+65536:(t[s++]=r,t[s++]=o)}else 65279!==r&&(t[s++]=r)}return s}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){const i=e.length;if(!i)return 0;let s,r,n,o,a=0,l=0,h=0;if(this.interim[0]){let s=!1,r=this.interim[0];r&=192==(224&r)?31:224==(240&r)?15:7;let n,o=0;for(;(n=63&this.interim[++o])&&o<4;)r<<=6,r|=n;const l=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,c=l-o;for(;h<c;){if(h>=i)return 0;if(n=e[h++],128!=(192&n)){h--,s=!0;break}this.interim[o++]=n,r<<=6,r|=63&n}s||(2===l?r<128?h--:t[a++]=r:3===l?r<2048||r>=55296&&r<=57343||65279===r||(t[a++]=r):r<65536||r>1114111||(t[a++]=r)),this.interim.fill(0)}const c=i-4;let d=h;for(;d<i;){for(;!(!(d<c)||128&(s=e[d])||128&(r=e[d+1])||128&(n=e[d+2])||128&(o=e[d+3]));)t[a++]=s,t[a++]=r,t[a++]=n,t[a++]=o,d+=4;if(s=e[d++],s<128)t[a++]=s;else if(192==(224&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(l=(31&s)<<6|63&r,l<128){d--;continue}t[a++]=l}else if(224==(240&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(n=e[d++],128!=(192&n)){d--;continue}if(l=(15&s)<<12|(63&r)<<6|63&n,l<2048||l>=55296&&l<=57343||65279===l)continue;t[a++]=l}else if(240==(248&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(n=e[d++],128!=(192&n)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,this.interim[2]=n,a;if(o=e[d++],128!=(192&o)){d--;continue}if(l=(7&s)<<18|(63&r)<<12|(63&n)<<6|63&o,l<65536||l>1114111)continue;t[a++]=l}}return a}}},7428:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const s=i(6415),r=[[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]],n=[[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]];let o;t.UnicodeV6=class{constructor(){if(this.version="6",!o){o=new Uint8Array(65536),o.fill(1),o[0]=0,o.fill(0,1,32),o.fill(0,127,160),o.fill(2,4352,4448),o[9001]=2,o[9002]=2,o.fill(2,11904,42192),o[12351]=1,o.fill(2,44032,55204),o.fill(2,63744,64256),o.fill(2,65040,65050),o.fill(2,65072,65136),o.fill(2,65280,65377),o.fill(2,65504,65511);for(let e=0;e<r.length;++e)o.fill(0,r[e][0],r[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?o[e]:function(e,t){let i,s=0,r=t.length-1;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=s;)if(i=s+r>>1,e>t[i][1])s=i+1;else{if(!(e<t[i][0]))return!0;r=i-1}return!1}(e,n)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),r=0===i&&0!==t;if(r){const e=s.UnicodeService.extractWidth(t);0===e?r=!1:e>i&&(i=e)}return s.UnicodeService.createPropertyValue(0,i,r)}}},3562:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;const s=i(7150),r=i(802);class n extends s.Disposable{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 r.Emitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(void 0!==t&&this._syncCalls>t)return void(this._syncCalls=0);if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let i;for(this._isSyncWriting=!0;i=this._writeBuffer.shift();){this._action(i);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){const i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],s=this._action(e,t);if(s){const e=e=>performance.now()-i>=12?setTimeout((()=>this._innerWrite(0,e))):this._innerWrite(i,e);return void s.catch((e=>(queueMicrotask((()=>{throw e})),Promise.resolve(!1)))).then(e)}const r=this._callbacks[this._bufferOffset];if(r&&r(),this._bufferOffset++,this._pendingData-=e.length,performance.now()-i>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}t.WriteBuffer=n},8693:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseColor=function(e){if(!e)return;let t=e.toLowerCase();if(0===t.indexOf("rgb:")){t=t.slice(4);const e=i.exec(t);if(e){const t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(0===t.indexOf("#")&&(t=t.slice(1),s.exec(t)&&[3,6,9,12].includes(t.length))){const e=t.length/3,i=[0,0,0];for(let s=0;s<3;++s){const r=parseInt(t.slice(e*s,e*s+e),16);i[s]=1===e?r<<4:2===e?r:3===e?r>>4:r>>8}return i}},t.toRgbString=function(e,t=16){const[i,s,n]=e;return`rgb:${r(i,t)}/${r(s,t)}/${r(n,t)}`};const i=/^([\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})$/,s=/^[\da-f]+$/;function r(e,t){const i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}},1263:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},9823:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;const s=i(726),r=i(7262),n=i(1263),o=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);const i=this._handlers[e];return i.push(t),{dispose:()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,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=o,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t);else this._handlerFb(this._ident,"HOOK",t)}put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i);else this._handlerFb(this._ident,"PUT",(0,s.utf32ToString)(e,t,i))}unhook(e,t=!0){if(this._active.length){let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&!1===i){for(;s>=0&&(i=this._active[s].unhook(e),!0!==i);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",e);this._active=o,this._ident=0}};const a=new r.Params;a.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data="",this._params=a,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():a,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,s.utf32ToString)(e,t,i),this._data.length>n.PAYLOAD_LIMIT&&(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((e=>(this._params=a,this._data="",this._hitLimit=!1,e)));return this._params=a,this._data="",this._hitLimit=!1,t}}},6717:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;const s=i(7150),r=i(7262),n=i(1346),o=i(9823);class a{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|s}}t.TransitionTable=a;const l=160;t.VT500_TRANSITION_TABLE=function(){const e=new a(4095),t=Array.apply(null,Array(256)).map(((e,t)=>t)),i=(e,i)=>t.slice(e,i),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));const n=i(0,14);let o;for(o in e.setDefault(1,0),e.addMany(s,0,2,0),n)e.addMany([24,26,153,154],o,3,0),e.addMany(i(128,144),o,3,0),e.addMany(i(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(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(l,0,2,0),e.add(l,8,5,8),e.add(l,6,0,6),e.add(l,11,0,11),e.add(l,13,13,13),e}();class h extends s.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){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 r.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,i)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register((0,s.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this._register(new n.OscParser),this._dcsParser=this._register(new o.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>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 t=0;t<e.intermediates.length;++t){const s=e.intermediates.charCodeAt(t);if(32>s||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=s}}if(1!==e.final.length)throw new Error("final must be a single byte");const s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){const t=[];for(;e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){const i=this._identifier(e,[48,126]);void 0===this._escHandlers[i]&&(this._escHandlers[i]=[]);const s=this._escHandlers[i];return s.push(t),{dispose:()=>{const e=s.indexOf(t);-1!==e&&s.splice(e,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){const i=this._identifier(e);void 0===this._csiHandlers[i]&&(this._csiHandlers[i]=[]);const s=this._csiHandlers[i];return s.push(t),{dispose:()=>{const e=s.indexOf(t);-1!==e&&s.splice(e,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,0!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s,r=0,n=0,o=0;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(void 0===i||1===this._parseStack.state)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const t=this._parseStack.handlers;let n=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===i&&n>-1)for(;n>=0&&(s=t[n](this._params),!0!==s);n--)if(s instanceof Promise)return this._parseStack.handlerPos=n,s;this._parseStack.handlers=[];break;case 4:if(!1===i&&n>-1)for(;n>=0&&(s=t[n](),!0!==s);n--)if(s instanceof Promise)return this._parseStack.handlerPos=n,s;this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],s=this._dcsParser.unhook(24!==r&&26!==r,i),s)return s;27===r&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],s=this._oscParser.end(24!==r&&26!==r,i),s)return s;27===r&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let i=o;i<t;++i){switch(r=e[i],n=this._transitions.table[this.currentState<<8|(r<160?r:l)],n>>4){case 2:for(let s=i+1;;++s){if(s>=t||(r=e[s])<32||r>126&&r<l){this._printHandler(e,i,s),i=s-1;break}if(++s>=t||(r=e[s])<32||r>126&&r<l){this._printHandler(e,i,s),i=s-1;break}if(++s>=t||(r=e[s])<32||r>126&&r<l){this._printHandler(e,i,s),i=s-1;break}if(++s>=t||(r=e[s])<32||r>126&&r<l){this._printHandler(e,i,s),i=s-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:i,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const o=this._csiHandlers[this._collect<<8|r];let a=o?o.length-1:-1;for(;a>=0&&(s=o[a](this._params),!0!==s);a--)if(s instanceof Promise)return this._preserveStack(3,o,a,n,i),s;a<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do{switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}}while(++i<t&&(r=e[i])>47&&r<60);i--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:const h=this._escHandlers[this._collect<<8|r];let c=h?h.length-1:-1;for(;c>=0&&(s=h[c](),!0!==s);c--)if(s instanceof Promise)return this._preserveStack(4,h,c,n,i),s;c<0&&this._escHandlerFb(this._collect<<8|r),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|r,this._params);break;case 13:for(let s=i+1;;++s)if(s>=t||24===(r=e[s])||26===r||27===r||r>127&&r<l){this._dcsParser.put(e,i,s),i=s-1;break}break;case 14:if(s=this._dcsParser.unhook(24!==r&&26!==r),s)return this._preserveStack(6,[],0,n,i),s;27===r&&(n|=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 s=i+1;;s++)if(s>=t||(r=e[s])<32||r>127&&r<l){this._oscParser.put(e,i,s),i=s-1;break}break;case 6:if(s=this._oscParser.end(24!==r&&26!==r),s)return this._preserveStack(5,[],0,n,i),s;27===r&&(n|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&n}}}t.EscapeSequenceParser=h},1346:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;const s=i(1263),r=i(726),n=[];t.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);const i=this._handlers[e];return i.push(t),{dispose:()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,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=n}reset(){if(2===this._state)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=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,"START")}_put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i);else this._handlerFb(this._id,"PUT",(0,r.utf32ToString)(e,t,i))}start(){this.reset(),this._state=1}put(e,t,i){if(3!==this._state){if(1===this._state)for(;t<i;){const i=e[t++];if(59===i){this._state=2,this._start();break}if(i<48||57<i)return void(this._state=3);-1===this._id&&(this._id=0),this._id=10*this._id+i-48}2===this._state&&i-t>0&&this._put(e,t,i)}}end(e,t=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),this._active.length){let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&!1===i){for(;s>=0&&(i=this._active[s].end(e),!0!==i);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._id,"END",e);this._active=n,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,r.utf32ToString)(e,t,i),this._data.length>s.PAYLOAD_LIMIT&&(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((e=>(this._data="",this._hitLimit=!1,e)));return this._data="",this._hitLimit=!1,t}}},7262:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;const i=2147483647;class s{static fromArray(e){const t=new s;if(!e.length)return t;for(let i=Array.isArray(e[0])?1:0;i<e.length;++i){const s=e[i];if(Array.isArray(s))for(let e=0;e<s.length;++e)t.addSubParam(s[e]);else t.addParam(s)}return t}constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const e=new s(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){const e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);const i=this._subParamsIdx[t]>>8,s=255&this._subParamsIdx[t];s-i>0&&e.push(Array.prototype.slice.call(this._subParams,i,s))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>i?i:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>i?i:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){const t=this._subParamsIdx[e]>>8,i=255&this._subParamsIdx[e];return i-t>0?this._subParams.subarray(t,i):null}getSubParamsAll(){const e={};for(let t=0;t<this.length;++t){const i=this._subParamsIdx[t]>>8,s=255&this._subParamsIdx[t];s-i>0&&(e[t]=this._subParams.slice(i,s))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const s=this._digitIsSub?this._subParams:this.params,r=s[t-1];s[t-1]=~r?Math.min(10*r+e,i):e}}t.Params=s},3027:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){const i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(-1===t)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)}}},3235:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;const s=i(793),r=i(3055);t.BufferApiView=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){const t=this._buffer.lines.get(e);if(t)return new s.BufferLineApiView(t)}getNullCell(){return new r.CellData}}},793:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;const s=i(3055);t.BufferLineApiView=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 s.CellData)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}}},5101:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;const s=i(3235),r=i(7150),n=i(802);class o extends r.Disposable{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new n.Emitter),this.onBufferChange=this._onBufferChange.event,this._normal=new s.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new s.BufferApiView(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)}}t.BufferNamespaceApi=o},6097:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,(e=>t(e.toArray())))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,((e,i)=>t(e,i.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)}}},4335:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=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}}},9640:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;const n=i(7150),o=i(4097),a=i(6501),l=i(802);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let h=class extends n.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new l.Emitter),this.onResize=this._onResize.event,this._onScroll=this._register(new l.Emitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this._register(new o.BufferSet(e,this)),this._register(this.buffers.onBufferActivate((e=>{this._onScroll.fire(e.activeBuffer.ydisp)})))}resize(e,t){const i=this.cols!==e,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){const i=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===e.fg&&s.getBg(0)===e.bg||(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;const r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(0===i.scrollTop){const e=i.lines.isFull;n===i.lines.length-1?e?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),e?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const e=n-r+1;i.lines.shiftElements(r+1,e-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){const i=this.buffer;if(e<0){if(0===i.ydisp)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);const s=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),s!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};t.BufferService=h,t.BufferService=h=s([r(0,a.IOptionsService)],h)},5746:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=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)}}},7792:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;const n=i(6501),o=i(7150),a=i(802),l={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>32!==e.action},DRAG:{events:23,restrict:e=>32!==e.action||3!==e.button},ANY:{events:31,restrict:e=>!0}};function h(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?(i|=64,i|=e.action):(i|=3&e.button,4&e.button&&(i|=64),8&e.button&&(i|=128),32===e.action?i|=32:0!==e.action||t||(i|=3)),i}const c=String.fromCharCode,d={DEFAULT:e=>{const t=[h(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`[M${c(t[0])}${c(t[1])}${c(t[2])}`},SGR:e=>{const t=0===e.action&&4!==e.button?"m":"M";return`[<${h(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{const t=0===e.action&&4!==e.button?"m":"M";return`[<${h(e,!0)};${e.x};${e.y}${t}`}};let u=class extends o.Disposable{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new a.Emitter),this.onProtocolChange=this._onProtocolChange.event;for(const e of Object.keys(l))this.addProtocol(e,l[e]);for(const e of Object.keys(d))this.addEncoding(e,d[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return 0!==this._protocols[this._activeProtocol].events}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,i){if(0===e.deltaY||e.shiftKey)return 0;if(void 0===t||void 0===i)return 0;const s=t/i;let r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=s+0,Math.abs(e.deltaY)<50&&(r*=.3),this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_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)return!1;if(4===e.button&&32===e.action)return!1;if(3===e.button&&32!==e.action)return!1;if(4!==e.button&&(2===e.action||3===e.action))return!1;if(e.col++,e.row++,32===e.action&&this._lastEvent&&this._equalEvents(this._lastEvent,e,"SGR_PIXELS"===this._activeEncoding))return!1;if(!this._protocols[this._activeProtocol].restrict(e))return!1;const t=this._encodings[this._activeEncoding](e);return t&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x)return!1;if(e.y!==t.y)return!1}else{if(e.col!==t.col)return!1;if(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}};t.CoreMouseService=u,t.CoreMouseService=u=s([r(0,n.IBufferService),r(1,n.ICoreService),r(2,n.IOptionsService)],u)},4071:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;const n=i(7453),o=i(7150),a=i(6501),l=i(802),h=Object.freeze({insertMode:!1}),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0});let d=class extends o.Disposable{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new l.Emitter),this.onData=this._onData.event,this._onUserInput=this._register(new l.Emitter),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new l.Emitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new l.Emitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n.clone)(h),this.decPrivateModes=(0,n.clone)(c)}reset(){this.modes=(0,n.clone)(h),this.decPrivateModes=(0,n.clone)(c)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",(()=>e.split("").map((e=>e.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((e=>e.charCodeAt(0))))),this._onBinary.fire(e))}};t.CoreService=d,t.CoreService=d=s([r(0,a.IBufferService),r(1,a.ILogService),r(2,a.IOptionsService)],d)},4720:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;const s=i(4103),r=i(7150),n=i(3087),o=i(802);let a=0,l=0;class h extends r.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new n.SortedList((e=>e?.marker.line)),this._onDecorationRegistered=this._register(new o.Emitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new o.Emitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register((0,r.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;const t=new c(e);if(t){const e=t.marker.onDispose((()=>t.dispose())),i=t.onDispose((()=>{i.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())}));this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){let s=0,r=0;for(const n of this._decorations.getKeyIterator(t))s=n.options.x??0,r=s+(n.options.width??1),e>=s&&e<r&&(!i||(n.options.layer??"bottom")===i)&&(yield n)}forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,(t=>{a=t.options.x??0,l=a+(t.options.width??1),e>=a&&e<l&&(!i||(t.options.layer??"bottom")===i)&&s(t)}))}}t.DecorationService=h;class c extends r.DisposableStore{get backgroundColorRGB(){return null===this._cachedBg&&(this.options.backgroundColor?this._cachedBg=s.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return null===this._cachedFg&&(this.options.foregroundColor?this._cachedFg=s.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new o.Emitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new o.Emitter),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")}dispose(){this._onDispose.fire(),super.dispose()}}},6025:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;const s=i(6501),r=i(6201);class n{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(const[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=n,t.InstantiationService=class{constructor(){this._services=new n,this._services.set(s.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){const i=(0,r.getServiceDependencies)(e).sort(((e,t)=>e.index-t.index)),s=[];for(const t of i){const i=this._services.get(t.id);if(!i)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id._id}.`);s.push(i)}const n=i.length>0?i[0].index:t.length;if(t.length!==n)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${n+1} conflicts with ${t.length} static arguments`);return new e(...[...t,...s])}}},7276:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LogService=void 0,t.setTraceLogger=function(e){l=e},t.traceCall=function(e,t,i){if("function"!=typeof i.value)throw new Error("not supported");const s=i.value;i.value=function(...e){if(l.logLevel!==o.LogLevelEnum.TRACE)return s.apply(this,e);l.trace(`GlyphRenderer#${s.name}(${e.map((e=>JSON.stringify(e))).join(", ")})`);const t=s.apply(this,e);return l.trace(`GlyphRenderer#${s.name} return`,t),t}};const n=i(7150),o=i(6501),a={trace:o.LogLevelEnum.TRACE,debug:o.LogLevelEnum.DEBUG,info:o.LogLevelEnum.INFO,warn:o.LogLevelEnum.WARN,error:o.LogLevelEnum.ERROR,off:o.LogLevelEnum.OFF};let l,h=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=o.LogLevelEnum.OFF,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),l=this}_updateLogLevel(){this._logLevel=a[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+t,...i)}trace(e,...t){this._logLevel<=o.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=o.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=o.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=o.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=o.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};t.LogService=h,t.LogService=h=s([r(0,o.IOptionsService)],h)},56:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;const s=i(7150),r=i(701),n=i(802);t.DEFAULT_OPTIONS={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:r.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}};const o=["normal","bold","100","200","300","400","500","600","700","800","900"];class a extends s.Disposable{constructor(e){super(),this._onOptionChange=this._register(new n.Emitter),this.onOptionChange=this._onOptionChange.event;const i={...t.DEFAULT_OPTIONS};for(const t in e)if(t in i)try{const s=e[t];i[t]=this._sanitizeAndValidateOption(t,s)}catch(e){console.error(e)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register((0,s.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(e,t){return this.onOptionChange((i=>{i===e&&t(this.rawOptions[e])}))}onMultipleOptionChange(e,t){return this.onOptionChange((i=>{-1!==e.indexOf(i)&&t()}))}_setupOptions(){const e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);return this.rawOptions[e]},i=(e,i)=>{if(!(e in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);i=this._sanitizeAndValidateOption(e,i),this.rawOptions[e]!==i&&(this.rawOptions[e]=i,this._onOptionChange.fire(e))};for(const t in this.rawOptions){const s={get:e.bind(this,t),set:i.bind(this,t)};Object.defineProperty(this.options,t,s)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=t.DEFAULT_OPTIONS[e]),!function(e){return"block"===e||"underline"===e||"bar"===e}(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=t.DEFAULT_OPTIONS[e]);break;case"fontWeight":case"fontWeightBold":if("number"==typeof i&&1<=i&&i<=1e3)break;i=o.includes(i)?i:t.DEFAULT_OPTIONS[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&0!==i)throw new Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{}}return i}}t.OptionsService=a},8811:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;const n=i(6501);let o=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){const t=this._bufferService.buffer;if(void 0===e.id){const i=t.addMarker(t.ybase+t.y),s={data:e,id:this._nextId++,lines:[i]};return i.onDispose((()=>this._removeMarkerFromLink(s,i))),this._dataByLinkId.set(s.id,s),s.id}const i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;const n=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(o,n))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){const i=this._dataByLinkId.get(e);if(i&&i.lines.every((e=>e.line!==t))){const e=this._bufferService.buffer.addMarker(t);i.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(i,e)))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){const i=e.lines.indexOf(t);-1!==i&&(e.lines.splice(i,1),0===e.lines.length&&(void 0!==e.data.id&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};t.OscLinkService=o,t.OscLinkService=o=s([r(0,n.IBufferService)],o)},6201:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.serviceRegistry=void 0,t.getServiceDependencies=function(e){return e[s]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);const r=function(e,t,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,r){t[i]===t?t[s].push({id:e,index:r}):(t[s]=[{id:e,index:r}],t[i]=t)}(r,e,n)};return r._id=e,t.serviceRegistry.set(e,r),r};const i="di$target",s="di$dependencies";t.serviceRegistry=new Map},6501:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const s=i(6201);var r;t.IBufferService=(0,s.createDecorator)("BufferService"),t.ICoreMouseService=(0,s.createDecorator)("CoreMouseService"),t.ICoreService=(0,s.createDecorator)("CoreService"),t.ICharsetService=(0,s.createDecorator)("CharsetService"),t.IInstantiationService=(0,s.createDecorator)("InstantiationService"),function(e){e[e.TRACE=0]="TRACE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.OFF=5]="OFF"}(r||(t.LogLevelEnum=r={})),t.ILogService=(0,s.createDecorator)("LogService"),t.IOptionsService=(0,s.createDecorator)("OptionsService"),t.IOscLinkService=(0,s.createDecorator)("OscLinkService"),t.IUnicodeService=(0,s.createDecorator)("UnicodeService"),t.IDecorationService=(0,s.createDecorator)("DecorationService")},6415:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const s=i(7428),r=i(802);class n{static extractShouldJoin(e){return!!(1&e)}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,i=!1){return(16777215&e)<<3|(3&t)<<1|(i?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new r.Emitter,this.onChange=this._onChange.event;const e=new s.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0,i=0;const s=e.length;for(let r=0;r<s;++r){let o=e.charCodeAt(r);if(55296<=o&&o<=56319){if(++r>=s)return t+this.wcwidth(o);const i=e.charCodeAt(r);56320<=i&&i<=57343?o=1024*(o-55296)+i-56320+65536:t+=this.wcwidth(i)}const a=this.charProperties(o,i);let l=n.extractWidth(a);n.extractShouldJoin(a)&&(l-=n.extractWidth(i)),t+=l,i=a}return t}charProperties(e,t){return this._activeProvider.charProperties(e,t)}}t.UnicodeService=n},4333:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isAndroid=t.isElectron=t.isWebkitWebView=t.isSafari=t.isChrome=t.isWebKit=t.isFirefox=t.onDidChangeFullscreen=t.onDidChangeZoomLevel=void 0,t.addMatchMediaChangeListener=o,t.setZoomLevel=function(e,t){n.INSTANCE.setZoomLevel(e,t)},t.getZoomLevel=function(e){return n.INSTANCE.getZoomLevel(e)},t.getZoomFactor=function(e){return n.INSTANCE.getZoomFactor(e)},t.setZoomFactor=function(e,t){n.INSTANCE.setZoomFactor(e,t)},t.setFullscreen=function(e,t){n.INSTANCE.setFullscreen(e,t)},t.isFullscreen=function(e){return n.INSTANCE.isFullscreen(e)},t.isStandalone=function(){return l},t.isWCOEnabled=function(){return navigator?.windowControlsOverlay?.visible},t.getWCOBoundingRect=function(){return navigator?.windowControlsOverlay?.getTitlebarAreaRect()};const s=i(4693),r=i(802);class n{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new r.Emitter,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new r.Emitter,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}static{this.INSTANCE=new n}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;const i=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(i,e),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;const i=this.getWindowId(t);this.mapWindowIdToFullScreen.set(i,e),this._onDidChangeFullscreen.fire(i)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}}function o(e,t,i){"string"==typeof t&&(t=e.matchMedia(t)),t.addEventListener("change",i)}t.onDidChangeZoomLevel=n.INSTANCE.onDidChangeZoomLevel,t.onDidChangeFullscreen=n.INSTANCE.onDidChangeFullscreen;const a="object"==typeof navigator?navigator.userAgent:"";t.isFirefox=a.indexOf("Firefox")>=0,t.isWebKit=a.indexOf("AppleWebKit")>=0,t.isChrome=a.indexOf("Chrome")>=0,t.isSafari=!t.isChrome&&a.indexOf("Safari")>=0,t.isWebkitWebView=!t.isChrome&&!t.isSafari&&t.isWebKit,t.isElectron=a.indexOf("Electron/")>=0,t.isAndroid=a.indexOf("Android")>=0;let l=!1;if("function"==typeof s.mainWindow.matchMedia){const e=s.mainWindow.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=s.mainWindow.matchMedia("(display-mode: fullscreen)");l=e.matches,o(s.mainWindow,e,(({matches:e})=>{l&&t.matches||(l=e)}))}},7745:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&s(t,e,i);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserFeatures=t.KeyboardSupport=void 0;const o=n(i(4333)),a=i(4693),l=n(i(8163));var h;!function(e){e[e.Always=0]="Always",e[e.FullScreen=1]="FullScreen",e[e.None=2]="None"}(h||(t.KeyboardSupport=h={}));const c="object"==typeof navigator?navigator:{};t.BrowserFeatures={clipboard:{writeText:l.isNative||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(c&&c.clipboard&&c.clipboard.writeText),readText:l.isNative||!!(c&&c.clipboard&&c.clipboard.readText)},keyboard:l.isNative||o.isStandalone()?h.Always:c.keyboard||o.isSafari?h.FullScreen:h.None,touch:"ontouchstart"in a.mainWindow||c.maxTouchPoints>0,pointerEvents:a.mainWindow.PointerEvent&&("ontouchstart"in a.mainWindow||navigator.maxTouchPoints>0)}},7093:function(e,t,i){var s,r=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(t,e,i);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SafeTriangle=t.DragAndDropObserver=t.ModifierKeyEmitter=t.DetectedFullscreenMode=t.Namespace=t.EventHelper=t.EventType=t.sharedMutationObserver=t.Dimension=t.WindowIntervalTimer=t.scheduleAtNextAnimationFrame=t.runAtThisOrScheduleAtNextAnimationFrame=t.WindowIdleValue=t.addStandardDisposableGenericMouseUpListener=t.addStandardDisposableGenericMouseDownListener=t.addStandardDisposableListener=t.onDidUnregisterWindow=t.onWillUnregisterWindow=t.onDidRegisterWindow=t.hasWindow=t.getWindowById=t.getWindowId=t.getWindowsCount=t.getWindows=t.getDocument=t.getWindow=t.registerWindow=void 0,t.clearNode=function(e){for(;e.firstChild;)e.firstChild.remove()},t.clearNodeRecursively=function e(t){for(;t.firstChild;){const i=t.firstChild;i.remove(),e(i)}},t.addDisposableListener=C,t.addDisposableGenericMouseDownListener=w,t.addDisposableGenericMouseMoveListener=function(e,i,s){return C(e,g.isIOS&&l.BrowserFeatures.pointerEvents?t.EventType.POINTER_MOVE:t.EventType.MOUSE_MOVE,i,s)},t.addDisposableGenericMouseUpListener=E,t.runWhenWindowIdle=function(e,t,i){return(0,d._runWhenIdle)(e,t,i)},t.disposableWindowInterval=function(e,t,i,s){let r=0;const n=e.setInterval((()=>{r++,("number"==typeof s&&r>=s||!0===t())&&o.dispose()}),i),o=(0,p.toDisposable)((()=>{e.clearInterval(n)}));return o},t.measure=function(e,i){return(0,t.scheduleAtNextAnimationFrame)(e,i,1e4)},t.modify=function(e,i){return(0,t.scheduleAtNextAnimationFrame)(e,i,-1e4)},t.addDisposableThrottledListener=function(e,t,i,s,r){return new T(e,t,i,s,r)},t.getComputedStyle=k,t.getClientArea=function e(i,s){const r=(0,t.getWindow)(i),n=r.document;if(i!==n.body)return new O(i.clientWidth,i.clientHeight);if(g.isIOS&&r?.visualViewport)return new O(r.visualViewport.width,r.visualViewport.height);if(r?.innerWidth&&r.innerHeight)return new O(r.innerWidth,r.innerHeight);if(n.body&&n.body.clientWidth&&n.body.clientHeight)return new O(n.body.clientWidth,n.body.clientHeight);if(n.documentElement&&n.documentElement.clientWidth&&n.documentElement.clientHeight)return new O(n.documentElement.clientWidth,n.documentElement.clientHeight);if(s)return e(s);throw new Error("Unable to figure out browser width and height")},t.getTopLeftOffset=I,t.size=function(e,t,i){"number"==typeof t&&(e.style.width=`${t}px`),"number"==typeof i&&(e.style.height=`${i}px`)},t.position=function(e,t,i,s,r,n="absolute"){"number"==typeof t&&(e.style.top=`${t}px`),"number"==typeof i&&(e.style.right=`${i}px`),"number"==typeof s&&(e.style.bottom=`${s}px`),"number"==typeof r&&(e.style.left=`${r}px`),e.style.position=n},t.getDomNodePagePosition=function(e){const i=e.getBoundingClientRect(),s=(0,t.getWindow)(e);return{left:i.left+s.scrollX,top:i.top+s.scrollY,width:i.width,height:i.height}},t.getDomNodeZoomLevel=function(e){let t=e,i=1;do{const e=k(t).zoom;null!=e&&"1"!==e&&(i*=e),t=t.parentElement}while(null!==t&&t!==t.ownerDocument.documentElement);return i},t.getTotalWidth=P,t.getContentWidth=function(e){const t=M.getBorderLeftWidth(e)+M.getBorderRightWidth(e),i=M.getPaddingLeft(e)+M.getPaddingRight(e);return e.offsetWidth-t-i},t.getTotalScrollWidth=x,t.getContentHeight=function(e){const t=M.getBorderTopWidth(e)+M.getBorderBottomWidth(e),i=M.getPaddingTop(e)+M.getPaddingBottom(e);return e.offsetHeight-t-i},t.getTotalHeight=function(e){const t=M.getMarginTop(e)+M.getMarginBottom(e);return e.offsetHeight+t},t.getLargestChildWidth=function(e,t){const i=t.map((t=>Math.max(x(t),P(t))+function(e,t){if(null===e)return 0;const i=I(e),s=I(t);return i.left-s.left}(t,e)||0));return Math.max(...i)},t.isAncestor=B,t.setParentFlowTo=function(e,t){e.dataset[N]=t.id},t.isAncestorUsingFlowTo=function(e,t){let i=e;for(;i;){if(i===t)return!0;if(Q(i)){const e=U(i);if(e){i=e;continue}}i=i.parentNode}return!1},t.findParentWithClass=F,t.hasParentWithClass=function(e,t,i){return!!F(e,t,i)},t.isShadowRoot=W,t.isInShadowDOM=function(e){return!!H(e)},t.getShadowRoot=H,t.getActiveElement=K,t.isActiveElement=function(e){return K()===e},t.isAncestorOfActiveElement=function(e){return B(K(),e)},t.isActiveDocument=function(e){return e.ownerDocument===z()},t.getActiveDocument=z,t.getActiveWindow=function(){const e=z();return e.defaultView?.window??v.mainWindow},t.isGlobalStylesheet=function(e){return j.has(e)},t.createStyleSheet2=function(){return new $},t.createStyleSheet=V,t.cloneGlobalStylesheets=function(e){const t=new p.DisposableStore;for(const[i,s]of j)t.add(G(i,s,e));return t},t.createMetaElement=function(e=v.mainWindow.document.head){return q("meta",e)},t.createLinkElement=function(e=v.mainWindow.document.head){return q("link",e)},t.createCSSRule=function e(t,i,s=Y()){if(s&&i){s.sheet?.insertRule(`${t} {${i}}`,0);for(const r of j.get(s)??[])e(t,i,r)}},t.removeCSSRulesContainingSelector=function e(t,i=Y()){if(!i)return;const s=Z(i),r=[];for(let e=0;e<s.length;e++){const i=s[e];J(i)&&-1!==i.selectorText.indexOf(t)&&r.push(e)}for(let e=r.length-1;e>=0;e--)i.sheet?.deleteRule(r[e]);for(const s of j.get(i)??[])e(t,s)},t.isHTMLElement=Q,t.isHTMLAnchorElement=function(e){return e instanceof HTMLAnchorElement||e instanceof(0,t.getWindow)(e).HTMLAnchorElement},t.isHTMLSpanElement=function(e){return e instanceof HTMLSpanElement||e instanceof(0,t.getWindow)(e).HTMLSpanElement},t.isHTMLTextAreaElement=function(e){return e instanceof HTMLTextAreaElement||e instanceof(0,t.getWindow)(e).HTMLTextAreaElement},t.isHTMLInputElement=function(e){return e instanceof HTMLInputElement||e instanceof(0,t.getWindow)(e).HTMLInputElement},t.isHTMLButtonElement=function(e){return e instanceof HTMLButtonElement||e instanceof(0,t.getWindow)(e).HTMLButtonElement},t.isHTMLDivElement=function(e){return e instanceof HTMLDivElement||e instanceof(0,t.getWindow)(e).HTMLDivElement},t.isSVGElement=function(e){return e instanceof SVGElement||e instanceof(0,t.getWindow)(e).SVGElement},t.isMouseEvent=function(e){return e instanceof MouseEvent||e instanceof(0,t.getWindow)(e).MouseEvent},t.isKeyboardEvent=function(e){return e instanceof KeyboardEvent||e instanceof(0,t.getWindow)(e).KeyboardEvent},t.isPointerEvent=function(e){return e instanceof PointerEvent||e instanceof(0,t.getWindow)(e).PointerEvent},t.isDragEvent=function(e){return e instanceof DragEvent||e instanceof(0,t.getWindow)(e).DragEvent},t.isEventLike=function(e){const t=e;return!(!t||"function"!=typeof t.preventDefault||"function"!=typeof t.stopPropagation)},t.saveParentsScrollTop=function(e){const t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t},t.restoreParentsScrollTop=function(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode},t.trackFocus=function(e){return new ee(e)},t.after=function(e,t){return e.after(t),t},t.append=te,t.prepend=function(e,t){return e.insertBefore(t,e.firstChild),t},t.reset=function(e,...t){e.innerText="",te(e,...t)},t.$=ne,t.join=function(e,t){const i=[];return e.forEach(((e,s)=>{s>0&&(t instanceof Node?i.push(t.cloneNode()):i.push(document.createTextNode(t))),i.push(e)})),i},t.setVisibility=function(e,...t){e?oe(...t):ae(...t)},t.show=oe,t.hide=ae,t.removeTabIndexAndUpdateFocus=function(e){if(e&&e.hasAttribute("tabIndex")){if(e.ownerDocument.activeElement===e){const t=function(e){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(Q(e)&&e.hasAttribute("tabIndex"))return e;e=e.parentNode}return null}(e.parentElement);t?.focus()}e.removeAttribute("tabindex")}},t.finalHandler=function(e){return t=>{t.preventDefault(),t.stopPropagation(),e(t)}},t.domContentLoaded=function(e){return new Promise((t=>{if("complete"===e.document.readyState||e.document&&null!==e.document.body)t(void 0);else{const i=()=>{e.window.removeEventListener("DOMContentLoaded",i,!1),t()};e.window.addEventListener("DOMContentLoaded",i,!1)}}))},t.computeScreenAwareSize=function(e,t){const i=e.devicePixelRatio*t;return Math.max(1,Math.floor(i))/e.devicePixelRatio},t.windowOpenNoOpener=function(e){v.mainWindow.open(e,"_blank","noopener")},t.windowOpenPopup=function(e){const t=Math.floor(v.mainWindow.screenLeft+v.mainWindow.innerWidth/2-le/2),i=Math.floor(v.mainWindow.screenTop+v.mainWindow.innerHeight/2-he/2);v.mainWindow.open(e,"_blank",`width=${le},height=${he},top=${i},left=${t}`)},t.windowOpenWithSuccess=function(e,t=!0){const i=v.mainWindow.open();return!!i&&(t&&(i.opener=null),i.location.href=e,!0)},t.animate=function(e,i){const s=()=>{i(),r=(0,t.scheduleAtNextAnimationFrame)(e,s)};let r=(0,t.scheduleAtNextAnimationFrame)(e,s);return(0,p.toDisposable)((()=>r.dispose()))},t.asCSSPropertyValue=function(e){return`'${e.replace(/'/g,"%27")}'`},t.asCssValueWithDefault=function e(t,i){if(void 0!==t){const s=t.match(/^\s*var\((.+)\)$/);if(s){const t=s[1].split(",",2);return 2===t.length&&(i=e(t[1].trim(),i)),`var(${t[0]}, ${i})`}return t}return i},t.detectFullscreen=function(e){return e.document.fullscreenElement||e.document.webkitFullscreenElement||e.document.webkitIsFullScreen?{mode:ce.DOCUMENT,guess:!1}:e.innerHeight===e.screen.height?{mode:ce.BROWSER,guess:!1}:(g.isMacintosh||g.isLinux)&&e.outerHeight===e.screen.height&&e.outerWidth===e.screen.width?{mode:ce.BROWSER,guess:!0}:null},t.multibyteAwareBtoa=function(e){return btoa(function(e){const t=new Uint16Array(e.length);for(let i=0;i<t.length;i++)t[i]=e.charCodeAt(i);let i="";const s=new Uint8Array(t.buffer);for(let e=0;e<s.length;e++)i+=String.fromCharCode(s[e]);return i}(e))},t.getCookieValue=function(e){const t=document.cookie.match("(^|[^;]+)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():void 0},t.h=function(e,...t){let i,s;Array.isArray(t[0])?(i={},s=t[0]):(i=t[0]||{},s=t[1]);const r=_e.exec(e);if(!r||!r.groups)throw new Error("Bad use of h");const n=r.groups.tag||"div",o=document.createElement(n);r.groups.id&&(o.id=r.groups.id);const a=[];if(r.groups.class)for(const e of r.groups.class.split("."))""!==e&&a.push(e);if(void 0!==i.className)for(const e of i.className.split("."))""!==e&&a.push(e);a.length>0&&(o.className=a.join(" "));const l={};if(r.groups.name&&(l[r.groups.name]=o),s)for(const e of s)Q(e)?o.appendChild(e):"string"==typeof e?o.append(e):"root"in e&&(Object.assign(l,e),o.appendChild(e.root));for(const[e,t]of Object.entries(i))if("className"!==e)if("style"===e)for(const[e,i]of Object.entries(t))o.style.setProperty(fe(e),"number"==typeof i?i+"px":""+i);else"tabIndex"===e?o.tabIndex=t:o.setAttribute(fe(e),t.toString());return l.root=o,l},t.svgElem=function(e,...t){let i,s;Array.isArray(t[0])?(i={},s=t[0]):(i=t[0]||{},s=t[1]);const r=_e.exec(e);if(!r||!r.groups)throw new Error("Bad use of h");const n=r.groups.tag||"div",o=document.createElementNS("http://www.w3.org/2000/svg",n);r.groups.id&&(o.id=r.groups.id);const a=[];if(r.groups.class)for(const e of r.groups.class.split("."))""!==e&&a.push(e);if(void 0!==i.className)for(const e of i.className.split("."))""!==e&&a.push(e);a.length>0&&(o.className=a.join(" "));const l={};if(r.groups.name&&(l[r.groups.name]=o),s)for(const e of s)Q(e)?o.appendChild(e):"string"==typeof e?o.append(e):"root"in e&&(Object.assign(l,e),o.appendChild(e.root));for(const[e,t]of Object.entries(i))if("className"!==e)if("style"===e)for(const[e,i]of Object.entries(t))o.style.setProperty(fe(e),"number"==typeof i?i+"px":""+i);else"tabIndex"===e?o.tabIndex=t:o.setAttribute(fe(e),t.toString());return l.root=o,l},t.copyAttributes=pe,t.trackAttributes=function(e,i,s){pe(e,i,s);const r=new p.DisposableStore;return r.add(t.sharedMutationObserver.observe(e,r,{attributes:!0,attributeFilter:s})((t=>{for(const s of t)"attributes"===s.type&&s.attributeName&&ge(e,i,s.attributeName)}))),r};const a=o(i(4333)),l=i(7745),h=i(5394),c=i(5964),d=i(1758),u=i(9807),_=o(i(802)),f=i(7883),p=i(7150),g=o(i(8163)),m=i(6304),v=i(4693),S=i(7704);s=function(){const e=new Map;(0,v.ensureCodeWindow)(v.mainWindow,1);const i={window:v.mainWindow,disposables:new p.DisposableStore};e.set(v.mainWindow.vscodeWindowId,i);const s=new _.Emitter,r=new _.Emitter,n=new _.Emitter;return{onDidRegisterWindow:s.event,onWillUnregisterWindow:n.event,onDidUnregisterWindow:r.event,registerWindow(i){if(e.has(i.vscodeWindowId))return p.Disposable.None;const o=new p.DisposableStore,a={window:i,disposables:o.add(new p.DisposableStore)};return e.set(i.vscodeWindowId,a),o.add((0,p.toDisposable)((()=>{e.delete(i.vscodeWindowId),r.fire(i)}))),o.add(C(i,t.EventType.BEFORE_UNLOAD,(()=>{n.fire(i)}))),s.fire(a),o},getWindows:()=>e.values(),getWindowsCount:()=>e.size,getWindowId:e=>e.vscodeWindowId,hasWindow:t=>e.has(t),getWindowById:function(t,s){return("number"==typeof t?e.get(t):void 0)??(s?i:void 0)},getWindow(e){const t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;const i=e;return i?.view?i.view.window:v.mainWindow},getDocument(e){const i=e;return(0,t.getWindow)(i).document}}}(),t.registerWindow=s.registerWindow,t.getWindow=s.getWindow,t.getDocument=s.getDocument,t.getWindows=s.getWindows,t.getWindowsCount=s.getWindowsCount,t.getWindowId=s.getWindowId,t.getWindowById=s.getWindowById,t.hasWindow=s.hasWindow,t.onDidRegisterWindow=s.onDidRegisterWindow,t.onWillUnregisterWindow=s.onWillUnregisterWindow,t.onDidUnregisterWindow=s.onDidUnregisterWindow;class b{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!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 C(e,t,i,s){return new b(e,t,i,s)}function y(e,t){return function(i){return t(new c.StandardMouseEvent(e,i))}}function w(e,i,s){return C(e,g.isIOS&&l.BrowserFeatures.pointerEvents?t.EventType.POINTER_DOWN:t.EventType.MOUSE_DOWN,i,s)}function E(e,i,s){return C(e,g.isIOS&&l.BrowserFeatures.pointerEvents?t.EventType.POINTER_UP:t.EventType.MOUSE_UP,i,s)}t.addStandardDisposableListener=function(e,i,s,r){let n=s;return"click"===i||"mousedown"===i||"contextmenu"===i?n=y((0,t.getWindow)(e),s):"keydown"!==i&&"keypress"!==i&&"keyup"!==i||(n=function(e){return function(t){return e(new h.StandardKeyboardEvent(t))}}(s)),C(e,i,n,r)},t.addStandardDisposableGenericMouseDownListener=function(e,i,s){return w(e,y((0,t.getWindow)(e),i),s)},t.addStandardDisposableGenericMouseUpListener=function(e,i,s){return E(e,y((0,t.getWindow)(e),i),s)};class D extends d.AbstractIdleValue{constructor(e,t){super(e,t)}}t.WindowIdleValue=D;class L extends d.IntervalTimer{constructor(e){super(),this.defaultTarget=e&&(0,t.getWindow)(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}t.WindowIntervalTimer=L;class R{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){(0,u.onUnexpectedError)(e)}}static sort(e,t){return t.priority-e.priority}}!function(){const e=new Map,i=new Map,s=new Map,r=new Map;t.scheduleAtNextAnimationFrame=(n,o,a=0)=>{const l=(0,t.getWindowId)(n),h=new R(o,a);let c=e.get(l);return c||(c=[],e.set(l,c)),c.push(h),s.get(l)||(s.set(l,!0),n.requestAnimationFrame((()=>(t=>{s.set(t,!1);const n=e.get(t)??[];for(i.set(t,n),e.set(t,[]),r.set(t,!0);n.length>0;)n.sort(R.sort),n.shift().execute();r.set(t,!1)})(l)))),h},t.runAtThisOrScheduleAtNextAnimationFrame=(e,s,n)=>{const o=(0,t.getWindowId)(e);if(r.get(o)){const e=new R(s,n);let t=i.get(o);return t||(t=[],i.set(o,t)),t.push(e),e}return(0,t.scheduleAtNextAnimationFrame)(e,s,n)}}();const A=function(e,t){return t};class T extends p.Disposable{constructor(e,t,i,s=A,r=8){super();let n=null,o=0;const a=this._register(new d.TimeoutTimer),l=()=>{o=(new Date).getTime(),i(n),n=null};this._register(C(e,t,(e=>{n=s(n,e);const t=(new Date).getTime()-o;t>=r?(a.cancel(),l()):a.setIfNotSet(l,r-t)})))}}function k(e){return(0,t.getWindow)(e).getComputedStyle(e,null)}class M{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const s=k(e),r=s?s.getPropertyValue(t):"0";return M.convertToPixels(e,r)}static getBorderLeftWidth(e){return M.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return M.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return M.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return M.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return M.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return M.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return M.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return M.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return M.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return M.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return M.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return M.getDimension(e,"margin-bottom","marginBottom")}}class O{static{this.None=new O(0,0)}constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new O(e,t):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(e){return e instanceof O?e:new O(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&e.width===t.width&&e.height===t.height}}function I(e){let t=e.offsetParent,i=e.offsetTop,s=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==e.ownerDocument.body&&e!==e.ownerDocument.documentElement;){i-=e.scrollTop;const r=W(e)?null:k(e);r&&(s-="rtl"!==r.direction?e.scrollLeft:-e.scrollLeft),e===t&&(s+=M.getBorderLeftWidth(e),i+=M.getBorderTopWidth(e),i+=e.offsetTop,s+=e.offsetLeft,t=e.offsetParent)}return{left:s,top:i}}function P(e){const t=M.getMarginLeft(e)+M.getMarginRight(e);return e.offsetWidth+t}function x(e){const t=M.getMarginLeft(e)+M.getMarginRight(e);return e.scrollWidth+t}function B(e,t){return Boolean(t?.contains(e))}t.Dimension=O;const N="parentFlowToElementId";function U(e){const t=e.dataset[N];return"string"==typeof t?e.ownerDocument.getElementById(t):null}function F(e,t,i){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(i)if("string"==typeof i){if(e.classList.contains(i))return null}else if(e===i)return null;e=e.parentNode}return null}function W(e){return e&&!!e.host&&!!e.mode}function H(e){for(;e.parentNode;){if(e===e.ownerDocument?.body)return null;e=e.parentNode}return W(e)?e:null}function K(){let e=z().activeElement;for(;e?.shadowRoot;)e=e.shadowRoot.activeElement;return e}function z(){return(0,t.getWindowsCount)()<=1?v.mainWindow.document:Array.from((0,t.getWindows)()).map((({window:e})=>e.document)).find((e=>e.hasFocus()))??v.mainWindow.document}const j=new Map;class ${constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.innerText=e:this._styleSheet=V(v.mainWindow.document.head,(t=>t.innerText=e)))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}}function V(e=v.mainWindow.document.head,i,s){const r=document.createElement("style");if(r.type="text/css",r.media="screen",i?.(r),e.appendChild(r),s&&s.add((0,p.toDisposable)((()=>r.remove()))),e===v.mainWindow.document.head){const e=new Set;j.set(r,e);for(const{window:i,disposables:n}of(0,t.getWindows)()){if(i===v.mainWindow)continue;const t=n.add(G(r,e,i));s?.add(t)}}return r}function G(e,i,s){const r=new p.DisposableStore,n=e.cloneNode(!0);s.document.head.appendChild(n),r.add((0,p.toDisposable)((()=>n.remove())));for(const t of Z(e))n.sheet?.insertRule(t.cssText,n.sheet?.cssRules.length);return r.add(t.sharedMutationObserver.observe(e,r,{childList:!0})((()=>{n.textContent=e.textContent}))),i.add(n),r.add((0,p.toDisposable)((()=>i.delete(n)))),r}function q(e,t=v.mainWindow.document.head){const i=document.createElement(e);return t.appendChild(i),i}t.sharedMutationObserver=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));const r=(0,m.hash)(i);let n=s.get(r);if(n)n.users+=1;else{const o=new _.Emitter,a=new MutationObserver((e=>o.fire(e)));a.observe(e,i);const l=n={users:1,observer:a,onDidMutate:o.event};t.add((0,p.toDisposable)((()=>{l.users-=1,0===l.users&&(o.dispose(),a.disconnect(),s?.delete(r),0===s?.size&&this.mutationObservers.delete(e))}))),s.set(r,n)}return n.onDidMutate}};let X=null;function Y(){return X||(X=V()),X}function Z(e){return e?.sheet?.rules?e.sheet.rules:e?.sheet?.cssRules?e.sheet.cssRules:[]}function J(e){return"string"==typeof e.selectorText}function Q(e){return e instanceof HTMLElement||e instanceof(0,t.getWindow)(e).HTMLElement}t.EventType={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:a.isWebKit?"webkitAnimationStart":"animationstart",ANIMATION_END:a.isWebKit?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:a.isWebKit?"webkitAnimationIteration":"animationiteration"},t.EventHelper={stop:(e,t)=>(e.preventDefault(),t&&e.stopPropagation(),e)};class ee extends p.Disposable{static hasFocusWithin(e){if(Q(e)){const t=H(e);return B(t?t.activeElement:e.ownerDocument.activeElement,e)}{const t=e;return B(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new _.Emitter),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new _.Emitter),this.onDidBlur=this._onDidBlur.event;let i=ee.hasFocusWithin(e),s=!1;const r=()=>{s=!1,i||(i=!0,this._onDidFocus.fire())},n=()=>{i&&(s=!0,(Q(e)?(0,t.getWindow)(e):e).setTimeout((()=>{s&&(s=!1,i=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{ee.hasFocusWithin(e)!==i&&(i?n():r())},this._register(C(e,t.EventType.FOCUS,r,!0)),this._register(C(e,t.EventType.BLUR,n,!0)),Q(e)&&(this._register(C(e,t.EventType.FOCUS_IN,(()=>this._refreshStateHandler()))),this._register(C(e,t.EventType.FOCUS_OUT,(()=>this._refreshStateHandler()))))}refreshState(){this._refreshStateHandler()}}function te(e,...t){if(e.append(...t),1===t.length&&"string"!=typeof t[0])return t[0]}const ie=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var se;function re(e,t,i,...s){const r=ie.exec(t);if(!r)throw new Error("Bad use of emmet");const n=r[1]||"div";let o;return o=e!==se.HTML?document.createElementNS(e,n):document.createElement(n),r[3]&&(o.id=r[3]),r[4]&&(o.className=r[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach((([e,t])=>{void 0!==t&&(/^on\w+$/.test(e)?o[e]=t:"selected"===e?t&&o.setAttribute(e,"true"):o.setAttribute(e,t))})),o.append(...s),o}function ne(e,t,...i){return re(se.HTML,e,t,...i)}function oe(...e){for(const t of e)t.style.display="",t.removeAttribute("aria-hidden")}function ae(...e){for(const t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}!function(e){e.HTML="http://www.w3.org/1999/xhtml",e.SVG="http://www.w3.org/2000/svg"}(se||(t.Namespace=se={})),ne.SVG=function(e,t,...i){return re(se.SVG,e,t,...i)};const le=780,he=640;var ce;!function(e){e[e.DOCUMENT=1]="DOCUMENT",e[e.BROWSER=2]="BROWSER"}(ce||(t.DetectedFullscreenMode=ce={}));class de extends _.Emitter{constructor(){super(),this._subscriptions=new p.DisposableStore,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(_.Event.runAndSubscribe(t.onDidRegisterWindow,(({window:e,disposables:t})=>this.registerListeners(e,t)),{window:v.mainWindow,disposables:this._subscriptions}))}registerListeners(e,t){t.add(C(e,"keydown",(e=>{if(e.defaultPrevented)return;const t=new h.StandardKeyboardEvent(e);if(t.keyCode!==f.KeyCode.Alt||!e.repeat){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(t.keyCode===f.KeyCode.Alt)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}}),!0)),t.add(C(e,"keyup",(e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))}),!0)),t.add(C(e.document.body,"mousedown",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),t.add(C(e.document.body,"mouseup",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),t.add(C(e.document.body,"mousemove",(e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)}),!0)),t.add(C(e,"blur",(()=>{this.resetKeyStatus()})))}get keyStatus(){return this._keyStatus}get isModifierPressed(){return this._keyStatus.altKey||this._keyStatus.ctrlKey||this._keyStatus.metaKey||this._keyStatus.shiftKey}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return de.instance||(de.instance=new de),de.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}t.ModifierKeyEmitter=de;class ue extends p.Disposable{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(C(this.element,t.EventType.DRAG_START,(e=>{this.callbacks.onDragStart?.(e)}))),this.callbacks.onDrag&&this._register(C(this.element,t.EventType.DRAG,(e=>{this.callbacks.onDrag?.(e)}))),this._register(C(this.element,t.EventType.DRAG_ENTER,(e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter?.(e)}))),this._register(C(this.element,t.EventType.DRAG_OVER,(e=>{e.preventDefault(),this.callbacks.onDragOver?.(e,e.timeStamp-this.dragStartTime)}))),this._register(C(this.element,t.EventType.DRAG_LEAVE,(e=>{this.counter--,0===this.counter&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(e))}))),this._register(C(this.element,t.EventType.DRAG_END,(e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(e)}))),this._register(C(this.element,t.EventType.DROP,(e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(e)})))}}t.DragAndDropObserver=ue;const _e=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function fe(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function pe(e,t,i){for(const{name:s,value:r}of e.attributes)i&&!i.includes(s)||t.setAttribute(s,r)}function ge(e,t,i){const s=e.getAttribute(i);s?t.setAttribute(i,s):t.removeAttribute(i)}t.SafeTriangle=class{constructor(e,t,i){this.originX=e,this.originY=t,this.triangles=[];const{top:s,left:r,right:n,bottom:o}=i.getBoundingClientRect(),a=this.triangles;let l=0;a[l++]=r,a[l++]=s,a[l++]=n,a[l++]=s,a[l++]=r,a[l++]=s,a[l++]=r,a[l++]=o,a[l++]=n,a[l++]=s,a[l++]=n,a[l++]=o,a[l++]=r,a[l++]=o,a[l++]=n,a[l++]=o}contains(e,t){const{triangles:i,originX:s,originY:r}=this;for(let n=0;n<4;n++)if((0,S.isPointWithinTriangle)(e,t,s,r,i[2*n],i[2*n+1],i[2*n+2],i[2*n+3]))return!0;return!1}}},9675:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FastDomNode=void 0,t.createFastDomNode=function(e){return new i(e)};class i{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){const t=s(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=s(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=s(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=s(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=s(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=s(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=s(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){const t=s(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){const t=s(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){const t=s(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){const t=s(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){const t=s(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){const t=s(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=s(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 s(e){return"number"==typeof e?`${e}px`:e}t.FastDomNode=i},8328:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&s(t,e,i);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalPointerMoveMonitor=void 0;const o=n(i(7093)),a=i(7150);t.GlobalPointerMoveMonitor=class{constructor(){this._hooks=new a.DisposableStore,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;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=r;let n=e;try{e.setPointerCapture(t),this._hooks.add((0,a.toDisposable)((()=>{try{e.releasePointerCapture(t)}catch(e){}})))}catch(t){n=o.getWindow(e)}this._hooks.add(o.addDisposableListener(n,o.EventType.POINTER_MOVE,(e=>{e.buttons===i?(e.preventDefault(),this._pointerMoveCallback(e)):this.stopMonitoring(!0)}))),this._hooks.add(o.addDisposableListener(n,o.EventType.POINTER_UP,(e=>this.stopMonitoring(!0))))}}},6609:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IframeUtils=void 0,t.parentOriginHash=async function(e,t){if(!crypto.subtle)throw new Error("'crypto.subtle' is not available so webviews will not work. This is likely because the editor is not running in a secure context (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");const i=JSON.stringify({parentOrigin:e,salt:t}),s=(new TextEncoder).encode(i);return function(e){const t=Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("");return BigInt(`0x${t}`).toString(32).padStart(52,"0")}(await crypto.subtle.digest("sha-256",s))};const i=new WeakMap;function s(e){if(!e.parent||e.parent===e)return null;try{const t=e.location,i=e.parent.location;if("null"!==t.origin&&"null"!==i.origin&&t.origin!==i.origin)return null}catch(e){return null}return e.parent}t.IframeUtils=class{static getSameOriginWindowChain(e){let t=i.get(e);if(!t){t=[],i.set(e,t);let r,n=e;do{r=s(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r}while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0;const r=this.getSameOriginWindowChain(e);for(const e of r){const r=e.window.deref();if(i+=r?.scrollY??0,s+=r?.scrollX??0,r===t)break;if(!e.iframeElement)break;const n=e.iframeElement.getBoundingClientRect();i+=n.top,s+=n.left}return{top:i,left:s}}}},5394:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&s(t,e,i);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.StandardKeyboardEvent=void 0,t.printKeyboardEvent=function(e){const t=[];return e.ctrlKey&&t.push("ctrl"),e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.metaKey&&t.push("meta"),`modifiers: [${t.join(",")}], code: ${e.code}, keyCode: ${e.keyCode}, key: ${e.key}`},t.printStandardKeyboardEvent=function(e){const t=[];return e.ctrlKey&&t.push("ctrl"),e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.metaKey&&t.push("meta"),`modifiers: [${t.join(",")}], code: ${e.code}, keyCode: ${e.keyCode} ('${a.KeyCodeUtils.toString(e.keyCode)}')`};const o=n(i(4333)),a=i(7883),l=i(2811),h=n(i(8163)),c=h.isMacintosh?a.KeyMod.WinCtrl:a.KeyMod.CtrlCmd,d=a.KeyMod.Alt,u=a.KeyMod.Shift,_=h.isMacintosh?a.KeyMod.CtrlCmd:a.KeyMod.WinCtrl;t.StandardKeyboardEvent=class{constructor(e){this._standardKeyboardEventBrand=!0;const 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=t.getModifierState?.("AltGraph"),this.keyCode=function(e){if(e.charCode){const t=String.fromCharCode(e.charCode).toUpperCase();return a.KeyCodeUtils.fromString(t)}const t=e.keyCode;if(3===t)return a.KeyCode.PauseBreak;if(o.isFirefox)switch(t){case 59:return a.KeyCode.Semicolon;case 60:if(h.isLinux)return a.KeyCode.IntlBackslash;break;case 61:return a.KeyCode.Equal;case 107:return a.KeyCode.NumpadAdd;case 109:return a.KeyCode.NumpadSubtract;case 173:return a.KeyCode.Minus;case 224:if(h.isMacintosh)return a.KeyCode.Meta}else if(o.isWebKit){if(h.isMacintosh&&93===t)return a.KeyCode.Meta;if(!h.isMacintosh&&92===t)return a.KeyCode.Meta}return a.EVENT_KEY_CODE_MAP[t]||a.KeyCode.Unknown}(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===a.KeyCode.Ctrl,this.altKey=this.altKey||this.keyCode===a.KeyCode.Alt,this.shiftKey=this.shiftKey||this.keyCode===a.KeyCode.Shift,this.metaKey=this.metaKey||this.keyCode===a.KeyCode.Meta,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=a.KeyCode.Unknown;this.keyCode!==a.KeyCode.Ctrl&&this.keyCode!==a.KeyCode.Shift&&this.keyCode!==a.KeyCode.Alt&&this.keyCode!==a.KeyCode.Meta&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=c),this.altKey&&(t|=d),this.shiftKey&&(t|=u),this.metaKey&&(t|=_),t|=e,t}_computeKeyCodeChord(){let e=a.KeyCode.Unknown;return this.keyCode!==a.KeyCode.Ctrl&&this.keyCode!==a.KeyCode.Shift&&this.keyCode!==a.KeyCode.Alt&&this.keyCode!==a.KeyCode.Meta&&(e=this.keyCode),new l.KeyCodeChord(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}},5964:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&s(t,e,i);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.StandardWheelEvent=t.DragMouseEvent=t.StandardMouseEvent=void 0;const o=n(i(4333)),a=i(6609),l=n(i(8163));class h{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=0===t.button,this.middleButton=1===t.button,this.rightButton=2===t.button,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,"dblclick"===t.type&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,"number"==typeof t.pageX?(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);const i=a.IframeUtils.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}t.StandardMouseEvent=h,t.DragMouseEvent=class extends h{constructor(e,t){super(e,t),this.dataTransfer=t.dataTransfer}},t.StandardWheelEvent=class{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let s=!1;if(o.isChrome){const e=navigator.userAgent.match(/Chrome\/(\d+)/);s=(e?parseInt(e[1]):123)<=122}if(e){const t=e,i=e,r=e.view?.devicePixelRatio||1;if(void 0!==t.wheelDeltaY)this.deltaY=s?t.wheelDeltaY/(120*r):t.wheelDeltaY/120;else if(void 0!==i.VERTICAL_AXIS&&i.axis===i.VERTICAL_AXIS)this.deltaY=-i.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?o.isFirefox&&!l.isMacintosh?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(void 0!==t.wheelDeltaX)o.isSafari&&l.isWindows?this.deltaX=-t.wheelDeltaX/120:this.deltaX=s?t.wheelDeltaX/(120*r):t.wheelDeltaX/120;else if(void 0!==i.HORIZONTAL_AXIS&&i.axis===i.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?o.isFirefox&&!l.isMacintosh?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=s?e.wheelDelta/(120*r):e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}}},8594:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&s(t,e,i);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Gesture=t.EventType=void 0;const a=o(i(7093)),l=i(4693),h=o(i(3058)),c=i(4838),d=i(802),u=i(7150),_=i(6317);var f;!function(e){e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"}(f||(t.EventType=f={}));class p extends u.Disposable{static{this.SCROLL_FRICTION=-.005}static{this.HOLD_DELAY=700}static{this.CLEAR_TAP_COUNT_TIME=400}constructor(){super(),this.dispatched=!1,this.targets=new _.LinkedList,this.ignoreTargets=new _.LinkedList,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(d.Event.runAndSubscribe(a.onDidRegisterWindow,(({window:e,disposables:t})=>{t.add(a.addDisposableListener(e.document,"touchstart",(e=>this.onTouchStart(e)),{passive:!1})),t.add(a.addDisposableListener(e.document,"touchend",(t=>this.onTouchEnd(e,t)))),t.add(a.addDisposableListener(e.document,"touchmove",(e=>this.onTouchMove(e)),{passive:!1}))}),{window:l.mainWindow,disposables:this._store}))}static addTarget(e){if(!p.isTouchDevice())return u.Disposable.None;p.INSTANCE||(p.INSTANCE=(0,u.markAsSingleton)(new p));const t=p.INSTANCE.targets.push(e);return(0,u.toDisposable)(t)}static ignoreTarget(e){if(!p.isTouchDevice())return u.Disposable.None;p.INSTANCE||(p.INSTANCE=(0,u.markAsSingleton)(new p));const t=p.INSTANCE.ignoreTargets.push(e);return(0,u.toDisposable)(t)}static isTouchDevice(){return"ontouchstart"in l.mainWindow||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,s=e.targetTouches.length;i<s;i++){const s=e.targetTouches.item(i);this.activeTouches[s.identifier]={id:s.identifier,initialTarget:s.target,initialTimeStamp:t,initialPageX:s.pageX,initialPageY:s.pageY,rollingTimestamps:[t],rollingPageX:[s.pageX],rollingPageY:[s.pageY]};const r=this.newGestureEvent(f.Start,s.target);r.pageX=s.pageX,r.pageY=s.pageY,this.dispatchEvent(r)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,t){const i=Date.now(),s=Object.keys(this.activeTouches).length;for(let r=0,n=t.changedTouches.length;r<n;r++){const n=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("move of an UNKNOWN touch",n);continue}const o=this.activeTouches[n.identifier],a=Date.now()-o.initialTimeStamp;if(a<p.HOLD_DELAY&&Math.abs(o.initialPageX-h.tail(o.rollingPageX))<30&&Math.abs(o.initialPageY-h.tail(o.rollingPageY))<30){const e=this.newGestureEvent(f.Tap,o.initialTarget);e.pageX=h.tail(o.rollingPageX),e.pageY=h.tail(o.rollingPageY),this.dispatchEvent(e)}else if(a>=p.HOLD_DELAY&&Math.abs(o.initialPageX-h.tail(o.rollingPageX))<30&&Math.abs(o.initialPageY-h.tail(o.rollingPageY))<30){const e=this.newGestureEvent(f.Contextmenu,o.initialTarget);e.pageX=h.tail(o.rollingPageX),e.pageY=h.tail(o.rollingPageY),this.dispatchEvent(e)}else if(1===s){const t=h.tail(o.rollingPageX),s=h.tail(o.rollingPageY),r=h.tail(o.rollingTimestamps)-o.rollingTimestamps[0],n=t-o.rollingPageX[0],a=s-o.rollingPageY[0],l=[...this.targets].filter((e=>o.initialTarget instanceof Node&&e.contains(o.initialTarget)));this.inertia(e,l,i,Math.abs(n)/r,n>0?1:-1,t,Math.abs(a)/r,a>0?1:-1,s)}this.dispatchEvent(this.newGestureEvent(f.End,o.initialTarget)),delete this.activeTouches[n.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===f.Tap){const t=(new Date).getTime();let i=0;i=t-this._lastSetTapCountTime>p.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==f.Change&&e.type!==f.Contextmenu||(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;const t=[];for(const i of this.targets)if(i.contains(e.initialTarget)){let s=0,r=e.initialTarget;for(;r&&r!==i;)s++,r=r.parentElement;t.push([s,i])}t.sort(((e,t)=>e[0]-t[0]));for(const[i,s]of t)s.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,s,r,n,o,l,h){this.handle=a.scheduleAtNextAnimationFrame(e,(()=>{const a=Date.now(),c=a-i;let d=0,u=0,_=!0;s+=p.SCROLL_FRICTION*c,o+=p.SCROLL_FRICTION*c,s>0&&(_=!1,d=r*s*c),o>0&&(_=!1,u=l*o*c);const g=this.newGestureEvent(f.Change);g.translationX=d,g.translationY=u,t.forEach((e=>e.dispatchEvent(g))),_||this.inertia(e,t,a,s,r,n+d,o,l,h+u)}))}onTouchMove(e){const t=Date.now();for(let i=0,s=e.changedTouches.length;i<s;i++){const s=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("end of an UNKNOWN touch",s);continue}const r=this.activeTouches[s.identifier],n=this.newGestureEvent(f.Change,r.initialTarget);n.translationX=s.pageX-h.tail(r.rollingPageX),n.translationY=s.pageY-h.tail(r.rollingPageY),n.pageX=s.pageX,n.pageY=s.pageY,this.dispatchEvent(n),r.rollingPageX.length>3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(s.pageX),r.rollingPageY.push(s.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}t.Gesture=p,n([c.memoize],p,"isTouchDevice",null)},8801:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&s(t,e,i);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractScrollbar=void 0;const o=n(i(7093)),a=i(9675),l=i(8328),h=i(8974),c=i(79),d=i(8286),u=n(i(8163));class _ extends d.Widget{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 c.ScrollbarVisibilityController(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new l.GlobalPointerMoveMonitor),this._shouldRender=!0,this.domNode=(0,a.createFastDomNode)(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(o.addDisposableListener(this.domNode.domNode,o.EventType.POINTER_DOWN,(e=>this._domNodePointerDown(e))))}_createArrow(e){const t=this._register(new h.ScrollbarArrow(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=(0,a.createFastDomNode)(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"==typeof i&&this.slider.setWidth(i),"number"==typeof s&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(o.addDisposableListener(this.slider.domNode,o.EventType.POINTER_DOWN,(e=>{0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))}))),this.onclick(this.slider.domNode,(e=>{e.leftButton&&e.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){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);i<=r&&r<=s?0===e.button&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&"number"==typeof e.offsetX&&"number"==typeof e.offsetY)t=e.offsetX,i=e.offsetY;else{const s=o.getDomNodePagePosition(this.domNode.domNode);t=e.pageX-s.left,i=e.pageY-s.top}const s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!(e.target&&e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>{const r=this._sliderOrthogonalPointerPosition(e),n=Math.abs(r-i);if(u.isWindows&&n>140)return void this._setDesiredScrollPositionNow(s.getScrollPosition());const o=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(o))}),(()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()})),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const 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()}}t.AbstractScrollbar=_},151:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HorizontalScrollbar=void 0;const s=i(8801),r=i(8245),n=i(9881);class o extends s.AbstractScrollbar{constructor(e,t,i){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new r.ScrollbarState(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===n.ScrollbarVisibility.Hidden?0:t.horizontalScrollbarSize,t.vertical===n.ScrollbarVisibility.Hidden?0:t.verticalScrollbarSize,s.width,s.scrollWidth,o.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===n.ScrollbarVisibility.Hidden?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===n.ScrollbarVisibility.Hidden?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}t.HorizontalScrollbar=o},8234:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&s(t,e,i);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.DomScrollableElement=t.SmoothScrollableElement=t.ScrollableElement=t.AbstractScrollableElement=t.MouseWheelClassifier=void 0;const o=i(4333),a=n(i(7093)),l=i(9675),h=i(5964),c=i(151),d=i(5473),u=i(8286),_=i(1758),f=i(802),p=i(7150),g=n(i(8163)),m=i(9881);class v{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class S{static{this.INSTANCE=new S}constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(-1===this._front&&-1===this._rear)return!1;let e=1,t=0,i=1,s=this._rear;for(;;){const r=s===this._front?e:Math.pow(2,-i);if(e-=r,t+=this._memory[s].score*r,s===this._front)break;s=(this._capacity+s-1)%this._capacity,i++}return t<=.5}acceptStandardWheelEvent(e){if(o.isChrome){const t=a.getWindow(e.browserEvent),i=(0,o.getZoomFactor)(t);this.accept(Date.now(),e.deltaX*i,e.deltaY*i)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){let s=null;const r=new v(e,t,i);-1===this._front&&-1===this._rear?(this._memory[0]=r,this._front=0,this._rear=0):(s=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]=r),r.score=this._computeScore(r,s)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if(this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(i+=.25),t){const s=Math.abs(e.deltaX),r=Math.abs(e.deltaY),n=Math.abs(t.deltaX),o=Math.abs(t.deltaY),a=Math.max(Math.min(s,n),1),l=Math.max(Math.min(r,o),1),h=Math.max(s,n),c=Math.max(r,o);h%a==0&&c%l==0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}t.MouseWheelClassifier=S;class b extends u.Widget{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new f.Emitter),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new f.Emitter),this.onWillScroll=this._onWillScroll.event,this._options=function(e){const t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:void 0!==e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:m.ScrollbarVisibility.Auto,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:m.ScrollbarVisibility.Auto,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:void 0!==e.scrollByPage&&e.scrollByPage};return t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,g.isMacintosh&&(t.className+=" mac"),t}(t),this._scrollable=i,this._register(this._scrollable.onScroll((e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)})));const s={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new d.VerticalScrollbar(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new c.HorizontalScrollbar(this._scrollable,this._options,s)),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=(0,l.createFastDomNode)(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=(0,l.createFastDomNode)(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=(0,l.createFastDomNode)(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,(e=>this._onMouseOver(e))),this.onmouseleave(this._listenOnDomNode,(e=>this._onMouseLeave(e))),this._hideTimeout=this._register(new _.TimeoutTimer),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=(0,p.dispose)(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,g.isMacintosh&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontal&&(this._options.horizontal=e.horizontal),void 0!==e.vertical&&(this._options.vertical=e.vertical),void 0!==e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),void 0!==e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),void 0!==e.scrollByPage&&(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 h.StandardWheelEvent(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=(0,p.dispose)(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new h.StandardWheelEvent(e))};this._mouseWheelToDispose.push(a.addDisposableListener(this._listenOnDomNode,a.EventType.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;const t=S.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,r=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&r+s===0?r=s=0:Math.abs(s)>=Math.abs(r)?r=0:s=0),this._options.flipAxes&&([s,r]=[r,s]);const n=!g.isMacintosh&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!n||r||(r=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(r*=this._options.fastScrollSensitivity,s*=this._options.fastScrollSensitivity);const o=this._scrollable.getFutureScrollPosition();let a={};if(s){const e=50*s,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(a,t)}if(r){const e=50*r,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(a,t)}a=this._scrollable.validateScrollPosition(a),(o.scrollLeft!==a.scrollLeft||o.scrollTop!==a.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(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)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",r=t?" top":"",n=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${n}${r}${s}`)}}_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()),500)}}t.AbstractScrollableElement=b,t.ScrollableElement=class extends b{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new m.Scrollable({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>a.scheduleAtNextAnimationFrame(a.getWindow(e),t)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}},t.SmoothScrollableElement=class extends b{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}},t.DomScrollableElement=class extends b{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new m.Scrollable({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>a.scheduleAtNextAnimationFrame(a.getWindow(e),t)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll((e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.scrollLeft)}))),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}},8974:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&s(t,e,i);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ScrollbarArrow=t.ARROW_IMG_SIZE=void 0;const o=i(8328),a=i(8286),l=i(1758),h=n(i(7093));t.ARROW_IMG_SIZE=11;class c extends a.Widget{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",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=t.ARROW_IMG_SIZE+"px",this.domNode.style.height=t.ARROW_IMG_SIZE+"px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new o.GlobalPointerMoveMonitor),this._register(h.addStandardDisposableListener(this.bgDomNode,h.EventType.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._register(h.addStandardDisposableListener(this.domNode,h.EventType.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._pointerdownRepeatTimer=this._register(new h.WindowIntervalTimer),this._pointerdownScheduleRepeatTimer=this._register(new l.TimeoutTimer)}_arrowPointerDown(e){e.target&&e.target instanceof Element&&(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet((()=>{this._pointerdownRepeatTimer.cancelAndSet((()=>this._onActivate()),1e3/24,h.getWindow(e))}),200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>{}),(()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()})),e.preventDefault())}}t.ScrollbarArrow=c},8245:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ScrollbarState=void 0;class i{constructor(e,t,i,s,r,n){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=r,this._scrollPosition=n,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new i(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,s,r){const n=Math.max(0,i-e),o=Math.max(0,n-2*t),a=s>0&&s>i;if(!a)return{computedAvailableSize:Math.round(n),computedIsNeeded:a,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(20,Math.floor(i*o/s))),h=(o-l)/(s-i),c=r*h;return{computedAvailableSize:Math.round(n),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:h,computedSliderPosition:Math.round(c)}}_refreshComputedValues(){const e=i._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.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(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}}t.ScrollbarState=i},79:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ScrollbarVisibilityController=void 0;const s=i(1758),r=i(7150),n=i(9881);class o extends r.Disposable{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new s.TimeoutTimer)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility!==n.ScrollbarVisibility.Hidden&&(this._visibility===n.ScrollbarVisibility.Visible||this._rawShouldBeVisible)}_updateShouldBeVisible(){const 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(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet((()=>{this._domNode?.setClassName(this._visibleClassName)}),0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}}t.ScrollbarVisibilityController=o},5473:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerticalScrollbar=void 0;const s=i(8801),r=i(8245),n=i(9881);class o extends s.AbstractScrollbar{constructor(e,t,i){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new r.ScrollbarState(t.verticalHasArrows?t.arrowSize:0,t.vertical===n.ScrollbarVisibility.Hidden?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,o.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===n.ScrollbarVisibility.Hidden?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}t.VerticalScrollbar=o},8286:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&s(t,e,i);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=void 0;const o=n(i(7093)),a=i(5394),l=i(5964),h=i(8594),c=i(7150);class d extends c.Disposable{onclick(e,t){this._register(o.addDisposableListener(e,o.EventType.CLICK,(i=>t(new l.StandardMouseEvent(o.getWindow(e),i)))))}onmousedown(e,t){this._register(o.addDisposableListener(e,o.EventType.MOUSE_DOWN,(i=>t(new l.StandardMouseEvent(o.getWindow(e),i)))))}onmouseover(e,t){this._register(o.addDisposableListener(e,o.EventType.MOUSE_OVER,(i=>t(new l.StandardMouseEvent(o.getWindow(e),i)))))}onmouseleave(e,t){this._register(o.addDisposableListener(e,o.EventType.MOUSE_LEAVE,(i=>t(new l.StandardMouseEvent(o.getWindow(e),i)))))}onkeydown(e,t){this._register(o.addDisposableListener(e,o.EventType.KEY_DOWN,(e=>t(new a.StandardKeyboardEvent(e)))))}onkeyup(e,t){this._register(o.addDisposableListener(e,o.EventType.KEY_UP,(e=>t(new a.StandardKeyboardEvent(e)))))}oninput(e,t){this._register(o.addDisposableListener(e,o.EventType.INPUT,t))}onblur(e,t){this._register(o.addDisposableListener(e,o.EventType.BLUR,t))}onfocus(e,t){this._register(o.addDisposableListener(e,o.EventType.FOCUS,t))}onchange(e,t){this._register(o.addDisposableListener(e,o.EventType.CHANGE,t))}ignoreGesture(e){return h.Gesture.ignoreTarget(e)}}t.Widget=d},4693:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mainWindow=void 0,t.ensureCodeWindow=function(e,t){},t.mainWindow="object"==typeof window?window:globalThis},3058:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Permutation=t.CallbackIterable=t.ArrayQueue=t.booleanComparator=t.numberComparator=t.CompareResult=void 0,t.tail=function(e,t=0){return e[e.length-(1+t)]},t.tail2=function(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]},t.equals=function(e,t,i=(e,t)=>e===t){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(let s=0,r=e.length;s<r;s++)if(!i(e[s],t[s]))return!1;return!0},t.removeFastWithoutKeepingOrder=function(e,t){const i=e.length-1;t<i&&(e[t]=e[i]),e.pop()},t.binarySearch=function(e,t,i){return n(e.length,(s=>i(e[s],t)))},t.binarySearch2=n,t.quickSelect=function e(t,i,s){if((t|=0)>=i.length)throw new TypeError("invalid index");const r=i[Math.floor(i.length*Math.random())],n=[],o=[],a=[];for(const e of i){const t=s(e,r);t<0?n.push(e):t>0?o.push(e):a.push(e)}return t<n.length?e(t,n,s):t<n.length+a.length?a[0]:e(t-(n.length+a.length),o,s)},t.groupBy=function(e,t){const i=[];let s;for(const r of e.slice(0).sort(t))s&&0===t(s[0],r)?s.push(r):(s=[r],i.push(s));return i},t.groupAdjacentBy=function*(e,t){let i,s;for(const r of e)void 0!==s&&t(s,r)?i.push(r):(i&&(yield i),i=[r]),s=r;i&&(yield i)},t.forEachAdjacent=function(e,t){for(let i=0;i<=e.length;i++)t(0===i?void 0:e[i-1],i===e.length?void 0:e[i])},t.forEachWithNeighbors=function(e,t){for(let i=0;i<e.length;i++)t(0===i?void 0:e[i-1],e[i],i+1===e.length?void 0:e[i+1])},t.sortedDiff=o,t.delta=function(e,t,i){const s=o(e,t,i),r=[],n=[];for(const t of s)r.push(...e.slice(t.start,t.start+t.deleteCount)),n.push(...t.toInsert);return{removed:r,added:n}},t.top=function(e,t,i){if(0===i)return[];const s=e.slice(0,i).sort(t);return a(e,t,s,i,e.length),s},t.topAsync=function(e,t,i,r,n){return 0===i?Promise.resolve([]):new Promise(((o,l)=>{(async()=>{const o=e.length,l=e.slice(0,i).sort(t);for(let h=i,c=Math.min(i+r,o);h<o;h=c,c=Math.min(c+r,o)){if(h>i&&await new Promise((e=>setTimeout(e))),n&&n.isCancellationRequested)throw new s.CancellationError;a(e,t,l,h,c)}return l})().then(o,l)}))},t.coalesce=function(e){return e.filter((e=>!!e))},t.coalesceInPlace=function(e){let t=0;for(let i=0;i<e.length;i++)e[i]&&(e[t]=e[i],t+=1);e.length=t},t.move=function(e,t,i){e.splice(i,0,e.splice(t,1)[0])},t.isFalsyOrEmpty=function(e){return!Array.isArray(e)||0===e.length},t.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},t.distinct=function(e,t=e=>e){const i=new Set;return e.filter((e=>{const s=t(e);return!i.has(s)&&(i.add(s),!0)}))},t.uniqueFilter=function(e){const t=new Set;return i=>{const s=e(i);return!t.has(s)&&(t.add(s),!0)}},t.firstOrDefault=function(e,t){return e.length>0?e[0]:t},t.lastOrDefault=function(e,t){return e.length>0?e[e.length-1]:t},t.commonPrefixLength=function(e,t,i=(e,t)=>e===t){let s=0;for(let r=0,n=Math.min(e.length,t.length);r<n&&i(e[r],t[r]);r++)s++;return s},t.range=function(e,t){let i="number"==typeof t?e:0;"number"==typeof t?i=e:(i=0,t=e);const s=[];if(i<=t)for(let e=i;e<t;e++)s.push(e);else for(let e=i;e>t;e--)s.push(e);return s},t.index=function(e,t,i){return e.reduce(((e,s)=>(e[t(s)]=i?i(s):s,e)),Object.create(null))},t.insert=function(e,t){return e.push(t),()=>l(e,t)},t.remove=l,t.arrayInsert=function(e,t,i){const s=e.slice(0,t),r=e.slice(t);return s.concat(i,r)},t.shuffle=function(e,t){let i;if("number"==typeof t){let e=t;i=()=>{const t=179426549*Math.sin(e++);return t-Math.floor(t)}}else i=Math.random;for(let t=e.length-1;t>0;t-=1){const s=Math.floor(i()*(t+1)),r=e[t];e[t]=e[s],e[s]=r}},t.pushToStart=function(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))},t.pushToEnd=function(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))},t.pushMany=function(e,t){for(const i of t)e.push(i)},t.mapArrayOrNot=function(e,t){return Array.isArray(e)?e.map(t):t(e)},t.asArray=function(e){return Array.isArray(e)?e:[e]},t.getRandomElement=function(e){return e[Math.floor(Math.random()*e.length)]},t.insertInto=h,t.splice=function(e,t,i,s){const r=c(e,t);let n=e.splice(r,i);return void 0===n&&(n=[]),h(e,r,s),n},t.compareBy=function(e,t){return(i,s)=>t(e(i),e(s))},t.tieBreakComparators=function(...e){return(t,i)=>{for(const s of e){const e=s(t,i);if(!d.isNeitherLessOrGreaterThan(e))return e}return d.neitherLessOrGreaterThan}},t.reverseOrder=function(e){return(t,i)=>-e(t,i)};const s=i(9807),r=i(8297);function n(e,t){let i=0,s=e-1;for(;i<=s;){const e=(i+s)/2|0,r=t(e);if(r<0)i=e+1;else{if(!(r>0))return e;s=e-1}}return-(i+1)}function o(e,t,i){const s=[];function r(e,t,i){if(0===t&&0===i.length)return;const r=s[s.length-1];r&&r.start+r.deleteCount===e?(r.deleteCount+=t,r.toInsert.push(...i)):s.push({start:e,deleteCount:t,toInsert:i})}let n=0,o=0;for(;;){if(n===e.length){r(n,0,t.slice(o));break}if(o===t.length){r(n,e.length-n,[]);break}const s=e[n],a=t[o],l=i(s,a);0===l?(n+=1,o+=1):l<0?(r(n,1,[]),n+=1):l>0&&(r(n,0,[a]),o+=1)}return s}function a(e,t,i,s,n){for(const o=i.length;s<n;s++){const n=e[s];if(t(n,i[o-1])<0){i.pop();const e=(0,r.findFirstIdxMonotonousOrArrLen)(i,(e=>t(n,e)<0));i.splice(e,0,n)}}}function l(e,t){const i=e.indexOf(t);if(i>-1)return e.splice(i,1),t}function h(e,t,i){const s=c(e,t),r=e.length,n=i.length;e.length=r+n;for(let t=r-1;t>=s;t--)e[t+n]=e[t];for(let t=0;t<n;t++)e[t+s]=i[t]}function c(e,t){return t<0?Math.max(t+e.length,0):Math.min(t,e.length)}var d;!function(e){e.isLessThan=function(e){return e<0},e.isLessThanOrEqual=function(e){return e<=0},e.isGreaterThan=function(e){return e>0},e.isNeitherLessOrGreaterThan=function(e){return 0===e},e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0}(d||(t.CompareResult=d={})),t.numberComparator=(e,t)=>e-t,t.booleanComparator=(e,i)=>(0,t.numberComparator)(e?1:0,i?1:0),t.ArrayQueue=class{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(0!==this.length)return this.items[this.firstIdx]}peekLast(){if(0!==this.length)return this.items[this.lastIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}removeLast(){const e=this.items[this.lastIdx];return this.lastIdx--,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}};class u{static{this.empty=new u((e=>{}))}constructor(e){this.iterate=e}forEach(e){this.iterate((t=>(e(t),!0)))}toArray(){const e=[];return this.iterate((t=>(e.push(t),!0))),e}filter(e){return new u((t=>this.iterate((i=>!e(i)||t(i)))))}map(e){return new u((t=>this.iterate((i=>t(e(i))))))}some(e){let t=!1;return this.iterate((i=>(t=e(i),!t))),t}findFirst(e){let t;return this.iterate((i=>!e(i)||(t=i,!1))),t}findLast(e){let t;return this.iterate((i=>(e(i)&&(t=i),!0))),t}findLastMaxBy(e){let t,i=!0;return this.iterate((s=>((i||d.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0))),t}}t.CallbackIterable=u;class _{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort(((i,s)=>t(e[i],e[s])));return new _(i)}apply(e){return e.map(((t,i)=>e[this._indexMap[i]]))}inverse(){const e=this._indexMap.slice();for(let t=0;t<this._indexMap.length;t++)e[this._indexMap[t]]=t;return new _(e)}}t.Permutation=_},8297:(e,t)=>{function i(e,t,i=e.length-1){for(let s=i;s>=0;s--)if(t(e[s]))return s;return-1}function s(e,t,i=0,s=e.length){let r=i,n=s;for(;r<n;){const i=Math.floor((r+n)/2);t(e[i])?r=i+1:n=i}return r-1}function r(e,t,i=0,s=e.length){let r=i,n=s;for(;r<n;){const i=Math.floor((r+n)/2);t(e[i])?n=i:r=i+1}return r}Object.defineProperty(t,"__esModule",{value:!0}),t.MonotonousArray=void 0,t.findLast=function(e,t){const s=i(e,t);if(-1!==s)return e[s]},t.findLastIdx=i,t.findLastMonotonous=function(e,t){const i=s(e,t);return-1===i?void 0:e[i]},t.findLastIdxMonotonous=s,t.findFirstMonotonous=function(e,t){const i=r(e,t);return i===e.length?void 0:e[i]},t.findFirstIdxMonotonousOrArrLen=r,t.findFirstIdxMonotonous=function(e,t,i=0,s=e.length){const n=r(e,t,i,s);return n===e.length?-1:n},t.findFirstMax=o,t.findLastMax=function(e,t){if(0===e.length)return;let i=e[0];for(let s=1;s<e.length;s++){const r=e[s];t(r,i)>=0&&(i=r)}return i},t.findFirstMin=function(e,t){return o(e,((e,i)=>-t(e,i)))},t.findMaxIdx=function(e,t){if(0===e.length)return-1;let i=0;for(let s=1;s<e.length;s++)t(e[s],e[i])>0&&(i=s);return i},t.mapFindFirst=function(e,t){for(const i of e){const e=t(i);if(void 0!==e)return e}};class n{static{this.assertInvariants=!1}constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(n.assertInvariants){if(this._prevFindLastPredicate)for(const t of this._array)if(this._prevFindLastPredicate(t)&&!e(t))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.");this._prevFindLastPredicate=e}const t=s(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,-1===t?void 0:this._array[t]}}function o(e,t){if(0===e.length)return;let i=e[0];for(let s=1;s<e.length;s++){const r=e[s];t(r,i)>0&&(i=r)}return i}t.MonotonousArray=n},1758:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncIterableSource=t.CancelableAsyncIterableObject=t.AsyncIterableObject=t.LazyStatefulPromise=t.StatefulPromise=t.Promises=t.DeferredPromise=t.IntervalCounter=t.TaskSequentializer=t.GlobalIdleValue=t.AbstractIdleValue=t._runWhenIdle=t.runWhenGlobalIdle=t.ThrottledWorker=t.RunOnceWorker=t.ProcessTimeRunOnceScheduler=t.RunOnceScheduler=t.IntervalTimer=t.TimeoutTimer=t.LimitedQueue=t.Queue=t.Limiter=t.AutoOpenBarrier=t.Barrier=t.ThrottledDelayer=t.Delayer=t.SequencerByKey=t.Sequencer=t.Throttler=void 0,t.isThenable=c,t.createCancelablePromise=d,t.raceCancellation=function(e,t,i){return new Promise(((s,r)=>{const n=t.onCancellationRequested((()=>{n.dispose(),s(i)}));e.then(s,r).finally((()=>n.dispose()))}))},t.raceCancellationError=function(e,t){return new Promise(((i,s)=>{const n=t.onCancellationRequested((()=>{n.dispose(),s(new r.CancellationError)}));e.then(i,s).finally((()=>n.dispose()))}))},t.raceCancellablePromises=async function(e){let t=-1;const i=e.map(((e,i)=>e.then((e=>(t=i,e)))));try{return await Promise.race(i)}finally{e.forEach(((e,i)=>{i!==t&&e.cancel()}))}},t.raceTimeout=function(e,t,i){let s;const r=setTimeout((()=>{s?.(void 0),i?.()}),t);return Promise.race([e.finally((()=>clearTimeout(r))),new Promise((e=>s=e))])},t.asPromise=function(e){return new Promise(((t,i)=>{const s=e();c(s)?s.then(t,i):t(s)}))},t.promiseWithResolvers=u,t.timeout=g,t.disposableTimeout=function(e,t=0,i){const s=setTimeout((()=>{e(),i&&r.dispose()}),t),r=(0,o.toDisposable)((()=>{clearTimeout(s),i?.deleteAndLeak(r)}));return i?.add(r),r},t.sequence=function(e){const t=[];let i=0;const s=e.length;return Promise.resolve(null).then((function r(n){null!=n&&t.push(n);const o=i<s?e[i++]():null;return o?o.then(r):Promise.resolve(t)}))},t.first=function(e,t=e=>!!e,i=null){let s=0;const r=e.length,n=()=>{if(s>=r)return Promise.resolve(i);const o=e[s++];return Promise.resolve(o()).then((e=>t(e)?Promise.resolve(e):n()))};return n()},t.firstParallel=function(e,t=e=>!!e,i=null){if(0===e.length)return Promise.resolve(i);let s=e.length;const r=()=>{s=-1;for(const t of e)t.cancel?.()};return new Promise(((n,o)=>{for(const a of e)a.then((e=>{--s>=0&&t(e)?(r(),n(e)):0===s&&n(i)})).catch((e=>{--s>=0&&(r(),o(e))}))}))},t.retry=async function(e,t,i){let s;for(let r=0;r<i;r++)try{return await e()}catch(e){s=e,await g(t)}throw s},t.createCancelableAsyncIterable=function(e){const t=new s.CancellationTokenSource,i=e(t.token);return new A(t,(async e=>{const s=t.token.onCancellationRequested((()=>{s.dispose(),t.dispose(),e.reject(new r.CancellationError)}));try{for await(const s of i){if(t.token.isCancellationRequested)return;e.emitOne(s)}s.dispose(),t.dispose()}catch(i){s.dispose(),t.dispose(),e.reject(i)}}))};const s=i(8447),r=i(9807),n=i(802),o=i(7150),a=i(8163),l=i(5015),h=i(626);function c(e){return!!e&&"function"==typeof e.then}function d(e){const t=new s.CancellationTokenSource,i=e(t.token),n=new Promise(((e,s)=>{const n=t.token.onCancellationRequested((()=>{n.dispose(),s(new r.CancellationError)}));Promise.resolve(i).then((i=>{n.dispose(),t.dispose(),e(i)}),(e=>{n.dispose(),t.dispose(),s(e)}))}));return new class{cancel(){t.cancel(),t.dispose()}then(e,t){return n.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return n.finally(e)}}}function u(){let e,t;return{promise:new Promise(((i,s)=>{e=i,t=s})),resolve:e,reject:t}}class _{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const e=()=>{if(this.queuedPromise=null,this.isDisposed)return;const e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise((t=>{this.activePromise.then(e,e).then(t)}))}return new Promise(((e,t)=>{this.queuedPromise.then(e,t)}))}return this.activePromise=e(),new Promise(((e,t)=>{this.activePromise.then((t=>{this.activePromise=null,e(t)}),(e=>{this.activePromise=null,t(e)}))}))}dispose(){this.isDisposed=!0}}t.Throttler=_,t.Sequencer=class{constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then((()=>e()),(()=>e()))}},t.SequencerByKey=class{constructor(){this.promiseMap=new Map}queue(e,t){const i=(this.promiseMap.get(e)??Promise.resolve()).catch((()=>{})).then(t).finally((()=>{this.promiseMap.get(e)===i&&this.promiseMap.delete(e)}));return this.promiseMap.set(e,i),i}};class f{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(((e,t)=>{this.doResolve=e,this.doReject=t})).then((()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const e=this.task;return this.task=null,e()}})));const i=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=t===l.MicrotaskDelay?(e=>{let t=!0;return queueMicrotask((()=>{t&&(t=!1,e())})),{isTriggered:()=>t,dispose:()=>{t=!1}}})(i):((e,t)=>{let i=!0;const s=setTimeout((()=>{i=!1,t()}),e);return{isTriggered:()=>i,dispose:()=>{clearTimeout(s),i=!1}}})(t,i),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new r.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}}t.Delayer=f,t.ThrottledDelayer=class{constructor(e){this.delayer=new f(e),this.throttler=new _}trigger(e,t){return this.delayer.trigger((()=>this.throttler.queue(e)),t)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};class p{constructor(){this._isOpen=!1,this._promise=new Promise(((e,t)=>{this._completePromise=e}))}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}}function g(e,t){return t?new Promise(((i,s)=>{const n=setTimeout((()=>{o.dispose(),i()}),e),o=t.onCancellationRequested((()=>{clearTimeout(n),o.dispose(),s(new r.CancellationError)}))})):d((t=>g(e,t)))}t.Barrier=p,t.AutoOpenBarrier=class extends p{constructor(e){super(),this._timeout=setTimeout((()=>this.open()),e)}open(){clearTimeout(this._timeout),super.open()}};class m{constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new n.Emitter}whenIdle(){return this.size>0?n.Event.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise(((t,i)=>{this.outstandingPromises.push({factory:e,c:t,e:i}),this.consume()}))}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){const e=this.outstandingPromises.shift();this.runningPromises++;const t=e.factory();t.then(e.c,e.e),t.then((()=>this.consumed()),(()=>this.consumed()))}}consumed(){this._isDisposed||(this.runningPromises--,0==--this._size&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}}t.Limiter=m,t.Queue=class extends m{constructor(){super(1)}},t.LimitedQueue=class{constructor(){this.sequentializer=new C,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue((()=>this.sequentializer.run(this.tasks++,e()))):this.sequentializer.run(this.tasks++,e())}},t.TimeoutTimer=class{constructor(e,t){this._isDisposed=!1,this._token=-1,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new r.BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout((()=>{this._token=-1,e()}),t)}setIfNotSet(e,t){if(this._isDisposed)throw new r.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");-1===this._token&&(this._token=setTimeout((()=>{this._token=-1,e()}),t))}},t.IntervalTimer=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new r.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const s=i.setInterval((()=>{e()}),t);this.disposable=(0,o.toDisposable)((()=>{i.clearInterval(s),this.disposable=void 0}))}dispose(){this.cancel(),this.isDisposed=!0}};class v{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return-1!==this.timeoutToken}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner?.()}}t.RunOnceScheduler=v,t.ProcessTimeRunOnceScheduler=class{constructor(e,t){t%1e3!=0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${t}ms is not a multiple of 1000ms.`),this.runner=e,this.timeout=t,this.counter=0,this.intervalToken=-1,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=-1)}schedule(e=this.timeout){e%1e3!=0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(e/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return-1!==this.intervalToken}onInterval(){this.counter--,this.counter>0||(clearInterval(this.intervalToken),this.intervalToken=-1,this.runner?.())}},t.RunOnceWorker=class extends v{constructor(e,t){super(e,t),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){const e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}};class S extends o.Disposable{constructor(e,t){super(),this.options=e,this.handler=t,this.pendingWork=[],this.throttler=this._register(new o.MutableDisposable),this.disposed=!1}get pending(){return this.pendingWork.length}work(e){if(this.disposed)return!1;if("number"==typeof this.options.maxBufferedWork)if(this.throttler.value){if(this.pending+e.length>this.options.maxBufferedWork)return!1}else if(this.pending+e.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1;for(const t of e)this.pendingWork.push(t);return this.throttler.value||this.doWork(),!0}doWork(){this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&(this.throttler.value=new v((()=>{this.throttler.clear(),this.doWork()}),this.options.throttleDelay),this.throttler.value.schedule())}dispose(){super.dispose(),this.disposed=!0}}t.ThrottledWorker=S,"function"!=typeof globalThis.requestIdleCallback||"function"!=typeof globalThis.cancelIdleCallback?t._runWhenIdle=(e,t)=>{(0,a.setTimeout0)((()=>{if(i)return;const e=Date.now()+15,s={didTimeout:!0,timeRemaining:()=>Math.max(0,e-Date.now())};t(Object.freeze(s))}));let i=!1;return{dispose(){i||(i=!0)}}}:t._runWhenIdle=(e,t,i)=>{const s=e.requestIdleCallback(t,"number"==typeof i?{timeout:i}:void 0);let r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(s))}}},t.runWhenGlobalIdle=e=>(0,t._runWhenIdle)(globalThis,e);class b{constructor(e,i){this._didRun=!1,this._executor=()=>{try{this._value=i()}catch(e){this._error=e}finally{this._didRun=!0}},this._handle=(0,t._runWhenIdle)(e,(()=>this._executor()))}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}t.AbstractIdleValue=b,t.GlobalIdleValue=class extends b{constructor(e){super(globalThis,e)}};class C{isRunning(e){return"number"==typeof e?this._running?.taskId===e:!!this._running}get running(){return this._running?.promise}cancelRunning(){this._running?.cancel()}run(e,t,i){return this._running={taskId:e,cancel:()=>i?.(),promise:t},t.then((()=>this.doneRunning(e)),(()=>this.doneRunning(e))),t}doneRunning(e){this._running&&e===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){const e=this._queued;this._queued=void 0,e.run().then(e.promiseResolve,e.promiseReject)}}queue(e){if(this._queued)this._queued.run=e;else{const{promise:t,resolve:i,reject:s}=u();this._queued={run:e,promise:t,promiseResolve:i,promiseReject:s}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}}var y,w,E;t.TaskSequentializer=C,t.IntervalCounter=class{constructor(e,t=()=>Date.now()){this.interval=e,this.nowFn=t,this.lastIncrementTime=0,this.value=0}increment(){const e=this.nowFn();return e-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=e,this.value=0),this.value++,this.value}},function(e){e[e.Resolved=0]="Resolved",e[e.Rejected=1]="Rejected"}(y||(y={}));class D{get isRejected(){return this.outcome?.outcome===y.Rejected}get isResolved(){return this.outcome?.outcome===y.Resolved}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===y.Resolved?this.outcome?.value:void 0}constructor(){this.p=new Promise(((e,t)=>{this.completeCallback=e,this.errorCallback=t}))}complete(e){return new Promise((t=>{this.completeCallback(e),this.outcome={outcome:y.Resolved,value:e},t()}))}error(e){return new Promise((t=>{this.errorCallback(e),this.outcome={outcome:y.Rejected,value:e},t()}))}cancel(){return this.error(new r.CancellationError)}}t.DeferredPromise=D,function(e){e.settled=async function(e){let t;const i=await Promise.all(e.map((e=>e.then((e=>e),(e=>{t||(t=e)})))));if(void 0!==t)throw t;return i},e.withAsyncBody=function(e){return new Promise((async(t,i)=>{try{await e(t,i)}catch(e){i(e)}}))}}(w||(t.Promises=w={}));class L{get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(e){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=e.then((e=>(this._value=e,this._isResolved=!0,e)),(e=>{throw this._error=e,this._isResolved=!0,e}))}requireValue(){if(!this._isResolved)throw new r.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}}t.StatefulPromise=L,t.LazyStatefulPromise=class{constructor(e){this._compute=e,this._promise=new h.Lazy((()=>new L(this._compute())))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}},function(e){e[e.Initial=0]="Initial",e[e.DoneOK=1]="DoneOK",e[e.DoneError=2]="DoneError"}(E||(E={}));class R{static fromArray(e){return new R((t=>{t.emitMany(e)}))}static fromPromise(e){return new R((async t=>{t.emitMany(await e)}))}static fromPromises(e){return new R((async t=>{await Promise.all(e.map((async e=>t.emitOne(await e))))}))}static merge(e){return new R((async t=>{await Promise.all(e.map((async e=>{for await(const i of e)t.emitOne(i)})))}))}static{this.EMPTY=R.fromArray([])}constructor(e,t){this._state=E.Initial,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new n.Emitter,queueMicrotask((async()=>{const t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(this._state===E.DoneError)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===E.DoneOK)return{done:!0,value:void 0};await n.Event.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,t){return new R((async i=>{for await(const s of e)i.emitOne(t(s))}))}map(e){return R.map(this,e)}static filter(e,t){return new R((async i=>{for await(const s of e)t(s)&&i.emitOne(s)}))}filter(e){return R.filter(this,e)}static coalesce(e){return R.filter(e,(e=>!!e))}coalesce(){return R.coalesce(this)}static async toPromise(e){const t=[];for await(const i of e)t.push(i);return t}toPromise(){return R.toPromise(this)}emitOne(e){this._state===E.Initial&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===E.Initial&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===E.Initial&&(this._state=E.DoneOK,this._onStateChanged.fire())}reject(e){this._state===E.Initial&&(this._state=E.DoneError,this._error=e,this._onStateChanged.fire())}}t.AsyncIterableObject=R;class A extends R{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}t.CancelableAsyncIterableObject=A,t.AsyncIterableSource=class{constructor(e){let t,i;this._deferred=new D,this._asyncIterable=new R((e=>{if(!t)return i&&e.emitMany(i),this._errorFn=t=>e.reject(t),this._emitFn=t=>e.emitOne(t),this._deferred.p;e.reject(t)}),e),this._emitFn=e=>{i||(i=[]),i.push(e)},this._errorFn=e=>{t||(t=e)}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitFn(e)}}},8447:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0,t.cancelOnDispose=function(e){const t=new a;return e.add({dispose(){t.cancel()}}),t.token};const s=i(802),r=Object.freeze((function(e,t){const i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}));var n;!function(e){e.isCancellationToken=function(t){return t===e.None||t===e.Cancelled||t instanceof o||!(!t||"object"!=typeof t)&&"boolean"==typeof t.isCancellationRequested&&"function"==typeof t.onCancellationRequested},e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:s.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r})}(n||(t.CancellationToken=n={}));class o{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?r:(this._emitter||(this._emitter=new s.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class a{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token instanceof o&&this._token.cancel():this._token=n.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof o&&this._token.dispose():this._token=n.None}}t.CancellationTokenSource=a},4869:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.CharCode=void 0,function(e){e[e.Null=0]="Null",e[e.Backspace=8]="Backspace",e[e.Tab=9]="Tab",e[e.LineFeed=10]="LineFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.DoubleQuote=34]="DoubleQuote",e[e.Hash=35]="Hash",e[e.DollarSign=36]="DollarSign",e[e.PercentSign=37]="PercentSign",e[e.Ampersand=38]="Ampersand",e[e.SingleQuote=39]="SingleQuote",e[e.OpenParen=40]="OpenParen",e[e.CloseParen=41]="CloseParen",e[e.Asterisk=42]="Asterisk",e[e.Plus=43]="Plus",e[e.Comma=44]="Comma",e[e.Dash=45]="Dash",e[e.Period=46]="Period",e[e.Slash=47]="Slash",e[e.Digit0=48]="Digit0",e[e.Digit1=49]="Digit1",e[e.Digit2=50]="Digit2",e[e.Digit3=51]="Digit3",e[e.Digit4=52]="Digit4",e[e.Digit5=53]="Digit5",e[e.Digit6=54]="Digit6",e[e.Digit7=55]="Digit7",e[e.Digit8=56]="Digit8",e[e.Digit9=57]="Digit9",e[e.Colon=58]="Colon",e[e.Semicolon=59]="Semicolon",e[e.LessThan=60]="LessThan",e[e.Equals=61]="Equals",e[e.GreaterThan=62]="GreaterThan",e[e.QuestionMark=63]="QuestionMark",e[e.AtSign=64]="AtSign",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.OpenSquareBracket=91]="OpenSquareBracket",e[e.Backslash=92]="Backslash",e[e.CloseSquareBracket=93]="CloseSquareBracket",e[e.Caret=94]="Caret",e[e.Underline=95]="Underline",e[e.BackTick=96]="BackTick",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.OpenCurlyBrace=123]="OpenCurlyBrace",e[e.Pipe=124]="Pipe",e[e.CloseCurlyBrace=125]="CloseCurlyBrace",e[e.Tilde=126]="Tilde",e[e.NoBreakSpace=160]="NoBreakSpace",e[e.U_Combining_Grave_Accent=768]="U_Combining_Grave_Accent",e[e.U_Combining_Acute_Accent=769]="U_Combining_Acute_Accent",e[e.U_Combining_Circumflex_Accent=770]="U_Combining_Circumflex_Accent",e[e.U_Combining_Tilde=771]="U_Combining_Tilde",e[e.U_Combining_Macron=772]="U_Combining_Macron",e[e.U_Combining_Overline=773]="U_Combining_Overline",e[e.U_Combining_Breve=774]="U_Combining_Breve",e[e.U_Combining_Dot_Above=775]="U_Combining_Dot_Above",e[e.U_Combining_Diaeresis=776]="U_Combining_Diaeresis",e[e.U_Combining_Hook_Above=777]="U_Combining_Hook_Above",e[e.U_Combining_Ring_Above=778]="U_Combining_Ring_Above",e[e.U_Combining_Double_Acute_Accent=779]="U_Combining_Double_Acute_Accent",e[e.U_Combining_Caron=780]="U_Combining_Caron",e[e.U_Combining_Vertical_Line_Above=781]="U_Combining_Vertical_Line_Above",e[e.U_Combining_Double_Vertical_Line_Above=782]="U_Combining_Double_Vertical_Line_Above",e[e.U_Combining_Double_Grave_Accent=783]="U_Combining_Double_Grave_Accent",e[e.U_Combining_Candrabindu=784]="U_Combining_Candrabindu",e[e.U_Combining_Inverted_Breve=785]="U_Combining_Inverted_Breve",e[e.U_Combining_Turned_Comma_Above=786]="U_Combining_Turned_Comma_Above",e[e.U_Combining_Comma_Above=787]="U_Combining_Comma_Above",e[e.U_Combining_Reversed_Comma_Above=788]="U_Combining_Reversed_Comma_Above",e[e.U_Combining_Comma_Above_Right=789]="U_Combining_Comma_Above_Right",e[e.U_Combining_Grave_Accent_Below=790]="U_Combining_Grave_Accent_Below",e[e.U_Combining_Acute_Accent_Below=791]="U_Combining_Acute_Accent_Below",e[e.U_Combining_Left_Tack_Below=792]="U_Combining_Left_Tack_Below",e[e.U_Combining_Right_Tack_Below=793]="U_Combining_Right_Tack_Below",e[e.U_Combining_Left_Angle_Above=794]="U_Combining_Left_Angle_Above",e[e.U_Combining_Horn=795]="U_Combining_Horn",e[e.U_Combining_Left_Half_Ring_Below=796]="U_Combining_Left_Half_Ring_Below",e[e.U_Combining_Up_Tack_Below=797]="U_Combining_Up_Tack_Below",e[e.U_Combining_Down_Tack_Below=798]="U_Combining_Down_Tack_Below",e[e.U_Combining_Plus_Sign_Below=799]="U_Combining_Plus_Sign_Below",e[e.U_Combining_Minus_Sign_Below=800]="U_Combining_Minus_Sign_Below",e[e.U_Combining_Palatalized_Hook_Below=801]="U_Combining_Palatalized_Hook_Below",e[e.U_Combining_Retroflex_Hook_Below=802]="U_Combining_Retroflex_Hook_Below",e[e.U_Combining_Dot_Below=803]="U_Combining_Dot_Below",e[e.U_Combining_Diaeresis_Below=804]="U_Combining_Diaeresis_Below",e[e.U_Combining_Ring_Below=805]="U_Combining_Ring_Below",e[e.U_Combining_Comma_Below=806]="U_Combining_Comma_Below",e[e.U_Combining_Cedilla=807]="U_Combining_Cedilla",e[e.U_Combining_Ogonek=808]="U_Combining_Ogonek",e[e.U_Combining_Vertical_Line_Below=809]="U_Combining_Vertical_Line_Below",e[e.U_Combining_Bridge_Below=810]="U_Combining_Bridge_Below",e[e.U_Combining_Inverted_Double_Arch_Below=811]="U_Combining_Inverted_Double_Arch_Below",e[e.U_Combining_Caron_Below=812]="U_Combining_Caron_Below",e[e.U_Combining_Circumflex_Accent_Below=813]="U_Combining_Circumflex_Accent_Below",e[e.U_Combining_Breve_Below=814]="U_Combining_Breve_Below",e[e.U_Combining_Inverted_Breve_Below=815]="U_Combining_Inverted_Breve_Below",e[e.U_Combining_Tilde_Below=816]="U_Combining_Tilde_Below",e[e.U_Combining_Macron_Below=817]="U_Combining_Macron_Below",e[e.U_Combining_Low_Line=818]="U_Combining_Low_Line",e[e.U_Combining_Double_Low_Line=819]="U_Combining_Double_Low_Line",e[e.U_Combining_Tilde_Overlay=820]="U_Combining_Tilde_Overlay",e[e.U_Combining_Short_Stroke_Overlay=821]="U_Combining_Short_Stroke_Overlay",e[e.U_Combining_Long_Stroke_Overlay=822]="U_Combining_Long_Stroke_Overlay",e[e.U_Combining_Short_Solidus_Overlay=823]="U_Combining_Short_Solidus_Overlay",e[e.U_Combining_Long_Solidus_Overlay=824]="U_Combining_Long_Solidus_Overlay",e[e.U_Combining_Right_Half_Ring_Below=825]="U_Combining_Right_Half_Ring_Below",e[e.U_Combining_Inverted_Bridge_Below=826]="U_Combining_Inverted_Bridge_Below",e[e.U_Combining_Square_Below=827]="U_Combining_Square_Below",e[e.U_Combining_Seagull_Below=828]="U_Combining_Seagull_Below",e[e.U_Combining_X_Above=829]="U_Combining_X_Above",e[e.U_Combining_Vertical_Tilde=830]="U_Combining_Vertical_Tilde",e[e.U_Combining_Double_Overline=831]="U_Combining_Double_Overline",e[e.U_Combining_Grave_Tone_Mark=832]="U_Combining_Grave_Tone_Mark",e[e.U_Combining_Acute_Tone_Mark=833]="U_Combining_Acute_Tone_Mark",e[e.U_Combining_Greek_Perispomeni=834]="U_Combining_Greek_Perispomeni",e[e.U_Combining_Greek_Koronis=835]="U_Combining_Greek_Koronis",e[e.U_Combining_Greek_Dialytika_Tonos=836]="U_Combining_Greek_Dialytika_Tonos",e[e.U_Combining_Greek_Ypogegrammeni=837]="U_Combining_Greek_Ypogegrammeni",e[e.U_Combining_Bridge_Above=838]="U_Combining_Bridge_Above",e[e.U_Combining_Equals_Sign_Below=839]="U_Combining_Equals_Sign_Below",e[e.U_Combining_Double_Vertical_Line_Below=840]="U_Combining_Double_Vertical_Line_Below",e[e.U_Combining_Left_Angle_Below=841]="U_Combining_Left_Angle_Below",e[e.U_Combining_Not_Tilde_Above=842]="U_Combining_Not_Tilde_Above",e[e.U_Combining_Homothetic_Above=843]="U_Combining_Homothetic_Above",e[e.U_Combining_Almost_Equal_To_Above=844]="U_Combining_Almost_Equal_To_Above",e[e.U_Combining_Left_Right_Arrow_Below=845]="U_Combining_Left_Right_Arrow_Below",e[e.U_Combining_Upwards_Arrow_Below=846]="U_Combining_Upwards_Arrow_Below",e[e.U_Combining_Grapheme_Joiner=847]="U_Combining_Grapheme_Joiner",e[e.U_Combining_Right_Arrowhead_Above=848]="U_Combining_Right_Arrowhead_Above",e[e.U_Combining_Left_Half_Ring_Above=849]="U_Combining_Left_Half_Ring_Above",e[e.U_Combining_Fermata=850]="U_Combining_Fermata",e[e.U_Combining_X_Below=851]="U_Combining_X_Below",e[e.U_Combining_Left_Arrowhead_Below=852]="U_Combining_Left_Arrowhead_Below",e[e.U_Combining_Right_Arrowhead_Below=853]="U_Combining_Right_Arrowhead_Below",e[e.U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below=854]="U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below",e[e.U_Combining_Right_Half_Ring_Above=855]="U_Combining_Right_Half_Ring_Above",e[e.U_Combining_Dot_Above_Right=856]="U_Combining_Dot_Above_Right",e[e.U_Combining_Asterisk_Below=857]="U_Combining_Asterisk_Below",e[e.U_Combining_Double_Ring_Below=858]="U_Combining_Double_Ring_Below",e[e.U_Combining_Zigzag_Above=859]="U_Combining_Zigzag_Above",e[e.U_Combining_Double_Breve_Below=860]="U_Combining_Double_Breve_Below",e[e.U_Combining_Double_Breve=861]="U_Combining_Double_Breve",e[e.U_Combining_Double_Macron=862]="U_Combining_Double_Macron",e[e.U_Combining_Double_Macron_Below=863]="U_Combining_Double_Macron_Below",e[e.U_Combining_Double_Tilde=864]="U_Combining_Double_Tilde",e[e.U_Combining_Double_Inverted_Breve=865]="U_Combining_Double_Inverted_Breve",e[e.U_Combining_Double_Rightwards_Arrow_Below=866]="U_Combining_Double_Rightwards_Arrow_Below",e[e.U_Combining_Latin_Small_Letter_A=867]="U_Combining_Latin_Small_Letter_A",e[e.U_Combining_Latin_Small_Letter_E=868]="U_Combining_Latin_Small_Letter_E",e[e.U_Combining_Latin_Small_Letter_I=869]="U_Combining_Latin_Small_Letter_I",e[e.U_Combining_Latin_Small_Letter_O=870]="U_Combining_Latin_Small_Letter_O",e[e.U_Combining_Latin_Small_Letter_U=871]="U_Combining_Latin_Small_Letter_U",e[e.U_Combining_Latin_Small_Letter_C=872]="U_Combining_Latin_Small_Letter_C",e[e.U_Combining_Latin_Small_Letter_D=873]="U_Combining_Latin_Small_Letter_D",e[e.U_Combining_Latin_Small_Letter_H=874]="U_Combining_Latin_Small_Letter_H",e[e.U_Combining_Latin_Small_Letter_M=875]="U_Combining_Latin_Small_Letter_M",e[e.U_Combining_Latin_Small_Letter_R=876]="U_Combining_Latin_Small_Letter_R",e[e.U_Combining_Latin_Small_Letter_T=877]="U_Combining_Latin_Small_Letter_T",e[e.U_Combining_Latin_Small_Letter_V=878]="U_Combining_Latin_Small_Letter_V",e[e.U_Combining_Latin_Small_Letter_X=879]="U_Combining_Latin_Small_Letter_X",e[e.LINE_SEPARATOR=8232]="LINE_SEPARATOR",e[e.PARAGRAPH_SEPARATOR=8233]="PARAGRAPH_SEPARATOR",e[e.NEXT_LINE=133]="NEXT_LINE",e[e.U_CIRCUMFLEX=94]="U_CIRCUMFLEX",e[e.U_GRAVE_ACCENT=96]="U_GRAVE_ACCENT",e[e.U_DIAERESIS=168]="U_DIAERESIS",e[e.U_MACRON=175]="U_MACRON",e[e.U_ACUTE_ACCENT=180]="U_ACUTE_ACCENT",e[e.U_CEDILLA=184]="U_CEDILLA",e[e.U_MODIFIER_LETTER_LEFT_ARROWHEAD=706]="U_MODIFIER_LETTER_LEFT_ARROWHEAD",e[e.U_MODIFIER_LETTER_RIGHT_ARROWHEAD=707]="U_MODIFIER_LETTER_RIGHT_ARROWHEAD",e[e.U_MODIFIER_LETTER_UP_ARROWHEAD=708]="U_MODIFIER_LETTER_UP_ARROWHEAD",e[e.U_MODIFIER_LETTER_DOWN_ARROWHEAD=709]="U_MODIFIER_LETTER_DOWN_ARROWHEAD",e[e.U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING=722]="U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING",e[e.U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING=723]="U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING",e[e.U_MODIFIER_LETTER_UP_TACK=724]="U_MODIFIER_LETTER_UP_TACK",e[e.U_MODIFIER_LETTER_DOWN_TACK=725]="U_MODIFIER_LETTER_DOWN_TACK",e[e.U_MODIFIER_LETTER_PLUS_SIGN=726]="U_MODIFIER_LETTER_PLUS_SIGN",e[e.U_MODIFIER_LETTER_MINUS_SIGN=727]="U_MODIFIER_LETTER_MINUS_SIGN",e[e.U_BREVE=728]="U_BREVE",e[e.U_DOT_ABOVE=729]="U_DOT_ABOVE",e[e.U_RING_ABOVE=730]="U_RING_ABOVE",e[e.U_OGONEK=731]="U_OGONEK",e[e.U_SMALL_TILDE=732]="U_SMALL_TILDE",e[e.U_DOUBLE_ACUTE_ACCENT=733]="U_DOUBLE_ACUTE_ACCENT",e[e.U_MODIFIER_LETTER_RHOTIC_HOOK=734]="U_MODIFIER_LETTER_RHOTIC_HOOK",e[e.U_MODIFIER_LETTER_CROSS_ACCENT=735]="U_MODIFIER_LETTER_CROSS_ACCENT",e[e.U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR=741]="U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR",e[e.U_MODIFIER_LETTER_HIGH_TONE_BAR=742]="U_MODIFIER_LETTER_HIGH_TONE_BAR",e[e.U_MODIFIER_LETTER_MID_TONE_BAR=743]="U_MODIFIER_LETTER_MID_TONE_BAR",e[e.U_MODIFIER_LETTER_LOW_TONE_BAR=744]="U_MODIFIER_LETTER_LOW_TONE_BAR",e[e.U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR=745]="U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR",e[e.U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK=746]="U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK",e[e.U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK=747]="U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK",e[e.U_MODIFIER_LETTER_UNASPIRATED=749]="U_MODIFIER_LETTER_UNASPIRATED",e[e.U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD=751]="U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_UP_ARROWHEAD=752]="U_MODIFIER_LETTER_LOW_UP_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD=753]="U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD=754]="U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD",e[e.U_MODIFIER_LETTER_LOW_RING=755]="U_MODIFIER_LETTER_LOW_RING",e[e.U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT=756]="U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT",e[e.U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT=757]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT",e[e.U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT=758]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT",e[e.U_MODIFIER_LETTER_LOW_TILDE=759]="U_MODIFIER_LETTER_LOW_TILDE",e[e.U_MODIFIER_LETTER_RAISED_COLON=760]="U_MODIFIER_LETTER_RAISED_COLON",e[e.U_MODIFIER_LETTER_BEGIN_HIGH_TONE=761]="U_MODIFIER_LETTER_BEGIN_HIGH_TONE",e[e.U_MODIFIER_LETTER_END_HIGH_TONE=762]="U_MODIFIER_LETTER_END_HIGH_TONE",e[e.U_MODIFIER_LETTER_BEGIN_LOW_TONE=763]="U_MODIFIER_LETTER_BEGIN_LOW_TONE",e[e.U_MODIFIER_LETTER_END_LOW_TONE=764]="U_MODIFIER_LETTER_END_LOW_TONE",e[e.U_MODIFIER_LETTER_SHELF=765]="U_MODIFIER_LETTER_SHELF",e[e.U_MODIFIER_LETTER_OPEN_SHELF=766]="U_MODIFIER_LETTER_OPEN_SHELF",e[e.U_MODIFIER_LETTER_LOW_LEFT_ARROW=767]="U_MODIFIER_LETTER_LOW_LEFT_ARROW",e[e.U_GREEK_LOWER_NUMERAL_SIGN=885]="U_GREEK_LOWER_NUMERAL_SIGN",e[e.U_GREEK_TONOS=900]="U_GREEK_TONOS",e[e.U_GREEK_DIALYTIKA_TONOS=901]="U_GREEK_DIALYTIKA_TONOS",e[e.U_GREEK_KORONIS=8125]="U_GREEK_KORONIS",e[e.U_GREEK_PSILI=8127]="U_GREEK_PSILI",e[e.U_GREEK_PERISPOMENI=8128]="U_GREEK_PERISPOMENI",e[e.U_GREEK_DIALYTIKA_AND_PERISPOMENI=8129]="U_GREEK_DIALYTIKA_AND_PERISPOMENI",e[e.U_GREEK_PSILI_AND_VARIA=8141]="U_GREEK_PSILI_AND_VARIA",e[e.U_GREEK_PSILI_AND_OXIA=8142]="U_GREEK_PSILI_AND_OXIA",e[e.U_GREEK_PSILI_AND_PERISPOMENI=8143]="U_GREEK_PSILI_AND_PERISPOMENI",e[e.U_GREEK_DASIA_AND_VARIA=8157]="U_GREEK_DASIA_AND_VARIA",e[e.U_GREEK_DASIA_AND_OXIA=8158]="U_GREEK_DASIA_AND_OXIA",e[e.U_GREEK_DASIA_AND_PERISPOMENI=8159]="U_GREEK_DASIA_AND_PERISPOMENI",e[e.U_GREEK_DIALYTIKA_AND_VARIA=8173]="U_GREEK_DIALYTIKA_AND_VARIA",e[e.U_GREEK_DIALYTIKA_AND_OXIA=8174]="U_GREEK_DIALYTIKA_AND_OXIA",e[e.U_GREEK_VARIA=8175]="U_GREEK_VARIA",e[e.U_GREEK_OXIA=8189]="U_GREEK_OXIA",e[e.U_GREEK_DASIA=8190]="U_GREEK_DASIA",e[e.U_IDEOGRAPHIC_FULL_STOP=12290]="U_IDEOGRAPHIC_FULL_STOP",e[e.U_LEFT_CORNER_BRACKET=12300]="U_LEFT_CORNER_BRACKET",e[e.U_RIGHT_CORNER_BRACKET=12301]="U_RIGHT_CORNER_BRACKET",e[e.U_LEFT_BLACK_LENTICULAR_BRACKET=12304]="U_LEFT_BLACK_LENTICULAR_BRACKET",e[e.U_RIGHT_BLACK_LENTICULAR_BRACKET=12305]="U_RIGHT_BLACK_LENTICULAR_BRACKET",e[e.U_OVERLINE=8254]="U_OVERLINE",e[e.UTF8_BOM=65279]="UTF8_BOM",e[e.U_FULLWIDTH_SEMICOLON=65307]="U_FULLWIDTH_SEMICOLON",e[e.U_FULLWIDTH_COMMA=65292]="U_FULLWIDTH_COMMA"}(i||(t.CharCode=i={}))},9087:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.SetWithKey=void 0,t.groupBy=function(e,t){const i=Object.create(null);for(const s of e){const e=t(s);let r=i[e];r||(r=i[e]=[]),r.push(s)}return i},t.diffSets=function(e,t){const i=[],s=[];for(const s of e)t.has(s)||i.push(s);for(const i of t)e.has(i)||s.push(i);return{removed:i,added:s}},t.diffMaps=function(e,t){const i=[],s=[];for(const[s,r]of e)t.has(s)||i.push(r);for(const[i,r]of t)e.has(i)||s.push(r);return{removed:i,added:s}},t.intersection=function(e,t){const i=new Set;for(const s of t)e.has(s)&&i.add(s);return i};class s{static{i=Symbol.toStringTag}constructor(e,t){this.toKey=t,this._map=new Map,this[i]="SetWithKey";for(const t of e)this.add(t)}get size(){return this._map.size}add(e){const t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(const e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(const e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach((i=>e.call(t,i,i,this)))}[Symbol.iterator](){return this.values()}}t.SetWithKey=s},4838:(e,t)=>{function i(e){return(t,i,s)=>{let r=null,n=null;if("function"==typeof s.value?(r="value",n=s.value):"function"==typeof s.get&&(r="get",n=s.get),!n)throw new Error("not supported");s[r]=e(n,i)}}Object.defineProperty(t,"__esModule",{value:!0}),t.memoize=function(e,t,i){let s=null,r=null;if("function"==typeof i.value?(s="value",r=i.value,0!==r.length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof i.get&&(s="get",r=i.get),!r)throw new Error("not supported");const n=`$memoize$${t}`;i[s]=function(...e){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,e)}),this[n]}},t.debounce=function(e,t,s){return i(((i,r)=>{const n=`$debounce$${r}`,o=`$debounce$result$${r}`;return function(...r){this[o]||(this[o]=s?s():void 0),clearTimeout(this[n]),t&&(this[o]=t(this[o],...r),r=[this[o]]),this[n]=setTimeout((()=>{i.apply(this,r),this[o]=s?s():void 0}),e)}}))},t.throttle=function(e,t,s){return i(((i,r)=>{const n=`$throttle$timer$${r}`,o=`$throttle$result$${r}`,a=`$throttle$lastRun$${r}`,l=`$throttle$pending$${r}`;return function(...r){if(this[o]||(this[o]=s?s():void 0),null!==this[a]&&void 0!==this[a]||(this[a]=-Number.MAX_VALUE),t&&(this[o]=t(this[o],...r)),this[l])return;const h=this[a]+e;h<=Date.now()?(this[a]=Date.now(),i.apply(this,[this[o]]),this[o]=s?s():void 0):(this[l]=!0,this[n]=setTimeout((()=>{this[l]=!1,this[a]=Date.now(),i.apply(this,[this[o]]),this[o]=s?s():void 0}),h-Date.now()))}}))}},9807:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BugIndicatingError=t.ErrorNoTelemetry=t.ExpectedError=t.NotSupportedError=t.NotImplementedError=t.ReadonlyError=t.CancellationError=t.errorHandler=t.ErrorHandler=void 0,t.setUnexpectedErrorHandler=function(e){t.errorHandler.setUnexpectedErrorHandler(e)},t.isSigPipeError=function(e){if(!e||"object"!=typeof e)return!1;const t=e;return"EPIPE"===t.code&&"WRITE"===t.syscall?.toUpperCase()},t.onUnexpectedError=function(e){r(e)||t.errorHandler.onUnexpectedError(e)},t.onUnexpectedExternalError=function(e){r(e)||t.errorHandler.onUnexpectedExternalError(e)},t.transformErrorForSerialization=function(e){if(e instanceof Error){const{name:t,message:i}=e;return{$isError:!0,name:t,message:i,stack:e.stacktrace||e.stack,noTelemetry:c.isErrorNoTelemetry(e)}}return e},t.transformErrorFromSerialization=function(e){let t;return e.noTelemetry?t=new c:(t=new Error,t.name=e.name),t.message=e.message,t.stack=e.stack,t},t.isCancellationError=r,t.canceled=function(){const e=new Error(s);return e.name=e.message,e},t.illegalArgument=function(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")},t.illegalState=function(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")},t.getErrorMessage=function(e){return e?e.message?e.message:e.stack?e.stack.split("\n")[0]:String(e):"Error"};class i{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{if(e.stack){if(c.isErrorNoTelemetry(e))throw new c(e.message+"\n\n"+e.stack);throw new Error(e.message+"\n\n"+e.stack)}throw 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)}}t.ErrorHandler=i,t.errorHandler=new i;const s="Canceled";function r(e){return e instanceof n||e instanceof Error&&e.name===s&&e.message===s}class n extends Error{constructor(){super(s),this.name=this.message}}t.CancellationError=n;class o extends TypeError{constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}}t.ReadonlyError=o;class a extends Error{constructor(e){super("NotImplemented"),e&&(this.message=e)}}t.NotImplementedError=a;class l extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}t.NotSupportedError=l;class h extends Error{constructor(){super(...arguments),this.isExpected=!0}}t.ExpectedError=h;class c extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof c)return e;const t=new c;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return"CodeExpectedError"===e.name}}t.ErrorNoTelemetry=c;class d extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,d.prototype)}}t.BugIndicatingError=d},802:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueWithChangeEvent=t.Relay=t.EventBufferer=t.DynamicListEventMultiplexer=t.EventMultiplexer=t.MicrotaskEmitter=t.DebounceEmitter=t.PauseableEmitter=t.AsyncEmitter=t.createEventDeliveryQueue=t.Emitter=t.ListenerRefusalError=t.ListenerLeakError=t.EventProfiling=t.Event=void 0,t.setGlobalLeakWarningThreshold=function(e){const t=c;return c=e,{dispose(){c=t}}};const s=i(9807),r=i(8841),n=i(7150),o=i(6317),a=i(9725);var l;!function(e){function t(e){return(t,i=null,s)=>{let r,n=!1;return r=e((e=>{if(!n)return r?r.dispose():n=!0,t.call(i,e)}),null,s),n&&r.dispose(),r}}function i(e,t,i){return r(((i,s=null,r)=>e((e=>i.call(s,t(e))),null,r)),i)}function s(e,t,i){return r(((i,s=null,r)=>e((e=>t(e)&&i.call(s,e)),null,r)),i)}function r(e,t){let i;const s=new m({onWillAddFirstListener(){i=e(s.fire,s)},onDidRemoveLastListener(){i?.dispose()}});return t?.add(s),s.event}function o(e,t,i=100,s=!1,r=!1,n,o){let a,l,h,c,d=0;const u=new m({leakWarningThreshold:n,onWillAddFirstListener(){a=e((e=>{d++,l=t(l,e),s&&!h&&(u.fire(l),l=void 0),c=()=>{const e=l;l=void 0,h=void 0,(!s||d>1)&&u.fire(e),d=0},"number"==typeof i?(clearTimeout(h),h=setTimeout(c,i)):void 0===h&&(h=0,queueMicrotask(c))}))},onWillRemoveListener(){r&&d>0&&c?.()},onDidRemoveLastListener(){c=void 0,a.dispose()}});return o?.add(u),u.event}e.None=()=>n.Disposable.None,e.defer=function(e,t){return o(e,(()=>{}),0,void 0,!0,void 0,t)},e.once=t,e.map=i,e.forEach=function(e,t,i){return r(((i,s=null,r)=>e((e=>{t(e),i.call(s,e)}),null,r)),i)},e.filter=s,e.signal=function(e){return e},e.any=function(...e){return(t,i=null,s)=>{return r=(0,n.combinedDisposable)(...e.map((e=>e((e=>t.call(i,e)))))),(o=s)instanceof Array?o.push(r):o&&o.add(r),r;var r,o}},e.reduce=function(e,t,s,r){let n=s;return i(e,(e=>(n=t(n,e),n)),r)},e.debounce=o,e.accumulate=function(t,i=0,s){return e.debounce(t,((e,t)=>e?(e.push(t),e):[t]),i,void 0,!0,void 0,s)},e.latch=function(e,t=(e,t)=>e===t,i){let r,n=!0;return s(e,(e=>{const i=n||!t(e,r);return n=!1,r=e,i}),i)},e.split=function(t,i,s){return[e.filter(t,i,s),e.filter(t,(e=>!i(e)),s)]},e.buffer=function(e,t=!1,i=[],s){let r=i.slice(),n=e((e=>{r?r.push(e):a.fire(e)}));s&&s.add(n);const o=()=>{r?.forEach((e=>a.fire(e))),r=null},a=new m({onWillAddFirstListener(){n||(n=e((e=>a.fire(e))),s&&s.add(n))},onDidAddFirstListener(){r&&(t?setTimeout(o):o())},onDidRemoveLastListener(){n&&n.dispose(),n=null}});return s&&s.add(a),a.event},e.chain=function(e,t){return(i,s,r)=>{const n=t(new l);return e((function(e){const t=n.evaluate(e);t!==a&&i.call(s,t)}),void 0,r)}};const a=Symbol("HaltChainable");class l{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push((t=>(e(t),t))),this}filter(e){return this.steps.push((t=>e(t)?t:a)),this}reduce(e,t){let i=t;return this.steps.push((t=>(i=e(i,t),i))),this}latch(e=(e,t)=>e===t){let t,i=!0;return this.steps.push((s=>{const r=i||!e(s,t);return i=!1,t=s,r?s:a})),this}evaluate(e){for(const t of this.steps)if((e=t(e))===a)break;return e}}e.fromNodeEventEmitter=function(e,t,i=e=>e){const s=(...e)=>r.fire(i(...e)),r=new m({onWillAddFirstListener:()=>e.on(t,s),onDidRemoveLastListener:()=>e.removeListener(t,s)});return r.event},e.fromDOMEventEmitter=function(e,t,i=e=>e){const s=(...e)=>r.fire(i(...e)),r=new m({onWillAddFirstListener:()=>e.addEventListener(t,s),onDidRemoveLastListener:()=>e.removeEventListener(t,s)});return r.event},e.toPromise=function(e){return new Promise((i=>t(e)(i)))},e.fromPromise=function(e){const t=new m;return e.then((e=>{t.fire(e)}),(()=>{t.fire(void 0)})).finally((()=>{t.dispose()})),t.event},e.forward=function(e,t){return e((e=>t.fire(e)))},e.runAndSubscribe=function(e,t,i){return t(i),e((e=>t(e)))};class h{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1;const i={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};this.emitter=new m(i),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,0===this._counter&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}e.fromObservable=function(e,t){return new h(e,t).emitter.event},e.fromObservableLight=function(e){return(t,i,s)=>{let r=0,o=!1;const a={beginUpdate(){r++},endUpdate(){r--,0===r&&(e.reportChanges(),o&&(o=!1,t.call(i)))},handlePossibleChange(){},handleChange(){o=!0}};e.addObserver(a),e.reportChanges();const l={dispose(){e.removeObserver(a)}};return s instanceof n.DisposableStore?s.add(l):Array.isArray(s)&&s.push(l),l}}}(l||(t.Event=l={}));class h{static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${h._idPool++}`,h.all.add(this)}start(e){this._stopWatch=new a.StopWatch,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}t.EventProfiling=h;let c=-1;class d{static{this._idPool=1}constructor(e,t,i=(d._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){const i=this.threshold;if(i<=0||t<i)return;this._stacks||(this._stacks=new Map);const s=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=.5*i;const[e,s]=this.getMostFrequentStack(),r=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${s}):`;console.warn(r),console.warn(e);const n=new _(r,e);this._errorHandler(n)}return()=>{const t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[i,s]of this._stacks)(!e||t<s)&&(e=[i,s],t=s);return e}}class u{static create(){const e=new Error;return new u(e.stack??"")}constructor(e){this.value=e}print(){console.warn(this.value.split("\n").slice(2).join("\n"))}}class _ extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}}t.ListenerLeakError=_;class f extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}}t.ListenerRefusalError=f;let p=0;class g{constructor(e){this.value=e,this.id=p++}}class m{constructor(e){this._size=0,this._options=e,this._leakageMon=c>0||this._options?.leakWarningThreshold?new d(e?.onListenerError??s.onUnexpectedError,this._options?.leakWarningThreshold??c):void 0,this._perfMon=this._options?._profName?new h(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);const t=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],i=new f(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||s.onUnexpectedError)(i),n.Disposable.None}if(this._disposed)return n.Disposable.None;t&&(e=e.bind(t));const r=new g(e);let o;this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(r.stack=u.create(),o=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof g?(this._deliveryQueue??=new v,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;const a=(0,n.toDisposable)((()=>{o?.(),this._removeListener(r)}));return i instanceof n.DisposableStore?i.add(a):Array.isArray(i)&&i.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(1===this._size)return this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),void(this._size=0);const t=this._listeners,i=t.indexOf(e);if(-1===i)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[i]=void 0;const s=this._deliveryQueue.current===this;if(2*this._size<=t.length){let e=0;for(let i=0;i<t.length;i++)t[i]?t[e++]=t[i]:s&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;const i=this._options?.onListenerError||s.onUnexpectedError;if(i)try{e.value(t)}catch(e){i(e)}else e.value(t)}_deliverQueue(e){const t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof g)this._deliver(this._listeners,e);else{const t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}}t.Emitter=m,t.createEventDeliveryQueue=()=>new v;class v{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}t.AsyncEmitter=class extends m{async fireAsync(e,t,i){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new o.LinkedList),((e,t)=>{if(e instanceof g)t(e);else for(let i=0;i<e.length;i++){const s=e[i];s&&t(s)}})(this._listeners,(t=>this._asyncDeliveryQueue.push([t.value,e])));this._asyncDeliveryQueue.size>0&&!t.isCancellationRequested;){const[e,r]=this._asyncDeliveryQueue.shift(),n=[],o={...r,token:t,waitUntil:t=>{if(Object.isFrozen(n))throw new Error("waitUntil can NOT be called asynchronous");i&&(t=i(t,e)),n.push(t)}};try{e(o)}catch(e){(0,s.onUnexpectedError)(e);continue}Object.freeze(n),await Promise.allSettled(n).then((e=>{for(const t of e)"rejected"===t.status&&(0,s.onUnexpectedError)(t.reason)}))}}};class S extends m{get isPaused(){return 0!==this._isPaused}constructor(e){super(e),this._isPaused=0,this._eventQueue=new o.LinkedList,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}t.PauseableEmitter=S,t.DebounceEmitter=class extends S{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout((()=>{this._handle=void 0,this.resume()}),this._delay)),super.fire(e)}},t.MicrotaskEmitter=class extends m{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),1===this._queuedEvents.length&&queueMicrotask((()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach((e=>super.fire(e))),this._queuedEvents=[]})))}};class b{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new m({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),(0,n.toDisposable)((0,r.createSingleCallFunction)((()=>{this.hasListeners&&this.unhook(t);const e=this.events.indexOf(t);this.events.splice(e,1)})))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach((e=>this.hook(e)))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach((e=>this.unhook(e)))}hook(e){e.listener=e.event((e=>this.emitter.fire(e)))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(const e of this.events)e.listener?.dispose();this.events=[]}}t.EventMultiplexer=b,t.DynamicListEventMultiplexer=class{constructor(e,t,i,s){this._store=new n.DisposableStore;const r=this._store.add(new b),o=this._store.add(new n.DisposableMap);function a(e){o.set(e,r.add(s(e)))}for(const t of e)a(t);this._store.add(t((e=>{a(e)}))),this._store.add(i((e=>{o.deleteAndDispose(e)}))),this.event=r.event}dispose(){this._store.dispose()}},t.EventBufferer=class{constructor(){this.data=[]}wrapEvent(e,t,i){return(s,r,n)=>e((e=>{const n=this.data[this.data.length-1];if(!t)return void(n?n.buffers.push((()=>s.call(r,e))):s.call(r,e));const o=n;o?(o.items??=[],o.items.push(e),0===o.buffers.length&&n.buffers.push((()=>{o.reducedResult??=i?o.items.reduce(t,i):o.items.reduce(t),s.call(r,o.reducedResult)}))):s.call(r,t(i,e))}),void 0,n)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const i=e();return this.data.pop(),t.buffers.forEach((e=>e())),i}},t.Relay=class{constructor(){this.listening=!1,this.inputEvent=l.None,this.inputEventListener=n.Disposable.None,this.emitter=new m({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}},t.ValueWithChangeEvent=class{static const(e){return new C(e)}constructor(e){this._value=e,this._onDidChange=new m,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};class C{constructor(e){this.value=e,this.onDidChange=l.None}}},8841:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSingleCallFunction=function(e,t){const i=this;let s,r=!1;return function(){if(r)return s;if(r=!0,t)try{s=e.apply(i,arguments)}finally{t()}else s=e.apply(i,arguments);return s}}},6304:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,r)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&s(t,e,i);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.StringSHA1=t.Hasher=void 0,t.hash=function(e){return a(e,0)},t.doHash=a,t.numberHash=l,t.stringHash=h,t.toHexString=_;const o=n(i(1316));function a(e,t){switch(typeof e){case"object":return null===e?l(349,t):Array.isArray(e)?(i=e,s=l(104579,s=t),i.reduce(((e,t)=>a(t,e)),s)):function(e,t){return t=l(181387,t),Object.keys(e).sort().reduce(((t,i)=>(t=h(i,t),a(e[i],t))),t)}(e,t);case"string":return h(e,t);case"boolean":return function(e,t){return l(e?433:863,t)}(e,t);case"number":return l(e,t);case"undefined":return l(937,t);default:return l(617,t)}var i,s}function l(e,t){return(t<<5)-t+e|0}function h(e,t){t=l(149417,t);for(let i=0,s=e.length;i<s;i++)t=l(e.charCodeAt(i),t);return t}var c;function d(e,t,i=32){const s=i-t;return(e<<t|(~((1<<s)-1)&e)>>>s)>>>0}function u(e,t=0,i=e.byteLength,s=0){for(let r=0;r<i;r++)e[t+r]=s}function _(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join(""):function(e,t,i="0"){for(;e.length<t;)e=i+e;return e}((e>>>0).toString(16),t/4)}t.Hasher=class{constructor(){this._value=0}get value(){return this._value}hash(e){return this._value=a(e,this._value),this._value}},function(e){e[e.BLOCK_SIZE=64]="BLOCK_SIZE",e[e.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"}(c||(c={}));class f{static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(c.BLOCK_SIZE+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const i=this._buff;let s,r,n=this._buffLen,a=this._leftoverHighSurrogate;for(0!==a?(s=a,r=-1,a=0):(s=e.charCodeAt(0),r=0);;){let l=s;if(o.isHighSurrogate(s)){if(!(r+1<t)){a=s;break}{const t=e.charCodeAt(r+1);o.isLowSurrogate(t)?(r++,l=o.computeCodePoint(s,t)):l=c.UNICODE_REPLACEMENT}}else o.isLowSurrogate(s)&&(l=c.UNICODE_REPLACEMENT);if(n=this._push(i,n,l),r++,!(r<t))break;s=e.charCodeAt(r)}this._buffLen=n,this._leftoverHighSurrogate=a}_push(e,t,i){return i<128?e[t++]=i:i<2048?(e[t++]=192|(1984&i)>>>6,e[t++]=128|(63&i)>>>0):i<65536?(e[t++]=224|(61440&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0):(e[t++]=240|(1835008&i)>>>18,e[t++]=128|(258048&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0),t>=c.BLOCK_SIZE&&(this._step(),t-=c.BLOCK_SIZE,this._totalLen+=c.BLOCK_SIZE,e[0]=e[c.BLOCK_SIZE+0],e[1]=e[c.BLOCK_SIZE+1],e[2]=e[c.BLOCK_SIZE+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,c.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),_(this._h0)+_(this._h1)+_(this._h2)+_(this._h3)+_(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,u(this._buff,this._buffLen),this._buffLen>56&&(this._step(),u(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=f._bigBlock32,t=this._buffDV;for(let i=0;i<64;i+=4)e.setUint32(i,t.getUint32(i,!1),!1);for(let t=64;t<320;t+=4)e.setUint32(t,d(e.getUint32(t-12,!1)^e.getUint32(t-32,!1)^e.getUint32(t-56,!1)^e.getUint32(t-64,!1),1),!1);let i,s,r,n=this._h0,o=this._h1,a=this._h2,l=this._h3,h=this._h4;for(let t=0;t<80;t++)t<20?(i=o&a|~o&l,s=1518500249):t<40?(i=o^a^l,s=1859775393):t<60?(i=o&a|o&l|a&l,s=2400959708):(i=o^a^l,s=3395469782),r=d(n,5)+i+h+s+e.getUint32(4*t,!1)&4294967295,h=l,l=a,a=d(o,30),o=n,n=r;this._h0=this._h0+n&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+h&4294967295}}t.StringSHA1=f},4218:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.Iterable=void 0,function(e){function t(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]}e.is=t;const i=Object.freeze([]);function*s(e){yield e}e.empty=function(){return i},e.single=s,e.wrap=function(e){return t(e)?e:s(e)},e.from=function(e){return e||i},e.reverse=function*(e){for(let t=e.length-1;t>=0;t--)yield e[t]},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){let i=0;for(const s of e)if(t(s,i++))return!0;return!1},e.find=function(e,t){for(const i of e)if(t(i))return i},e.filter=function*(e,t){for(const i of e)t(i)&&(yield i)},e.map=function*(e,t){let i=0;for(const s of e)yield t(s,i++)},e.flatMap=function*(e,t){let i=0;for(const s of e)yield*t(s,i++)},e.concat=function*(...e){for(const t of e)yield*t},e.reduce=function(e,t,i){let s=i;for(const i of e)s=t(s,i);return s},e.slice=function*(e,t,i=e.length){for(t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);t<i;t++)yield e[t]},e.consume=function(t,i=Number.POSITIVE_INFINITY){const s=[];if(0===i)return[s,t];const r=t[Symbol.iterator]();for(let t=0;t<i;t++){const t=r.next();if(t.done)return[s,e.empty()];s.push(t.value)}return[s,{[Symbol.iterator]:()=>r}]},e.asyncToArray=async function(e){const t=[];for await(const i of e)t.push(i);return Promise.resolve(t)}}(i||(t.Iterable=i={}))},7883:(e,t)=>{var i,s;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyMod=t.KeyCodeUtils=t.ScanCodeUtils=t.NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE=t.EVENT_KEY_CODE_MAP=t.ScanCode=t.KeyCode=void 0,t.KeyChord=function(e,t){return(e|(65535&t)<<16>>>0)>>>0},function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.F20=78]="F20",e[e.F21=79]="F21",e[e.F22=80]="F22",e[e.F23=81]="F23",e[e.F24=82]="F24",e[e.NumLock=83]="NumLock",e[e.ScrollLock=84]="ScrollLock",e[e.Semicolon=85]="Semicolon",e[e.Equal=86]="Equal",e[e.Comma=87]="Comma",e[e.Minus=88]="Minus",e[e.Period=89]="Period",e[e.Slash=90]="Slash",e[e.Backquote=91]="Backquote",e[e.BracketLeft=92]="BracketLeft",e[e.Backslash=93]="Backslash",e[e.BracketRight=94]="BracketRight",e[e.Quote=95]="Quote",e[e.OEM_8=96]="OEM_8",e[e.IntlBackslash=97]="IntlBackslash",e[e.Numpad0=98]="Numpad0",e[e.Numpad1=99]="Numpad1",e[e.Numpad2=100]="Numpad2",e[e.Numpad3=101]="Numpad3",e[e.Numpad4=102]="Numpad4",e[e.Numpad5=103]="Numpad5",e[e.Numpad6=104]="Numpad6",e[e.Numpad7=105]="Numpad7",e[e.Numpad8=106]="Numpad8",e[e.Numpad9=107]="Numpad9",e[e.NumpadMultiply=108]="NumpadMultiply",e[e.NumpadAdd=109]="NumpadAdd",e[e.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=111]="NumpadSubtract",e[e.NumpadDecimal=112]="NumpadDecimal",e[e.NumpadDivide=113]="NumpadDivide",e[e.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",e[e.ABNT_C1=115]="ABNT_C1",e[e.ABNT_C2=116]="ABNT_C2",e[e.AudioVolumeMute=117]="AudioVolumeMute",e[e.AudioVolumeUp=118]="AudioVolumeUp",e[e.AudioVolumeDown=119]="AudioVolumeDown",e[e.BrowserSearch=120]="BrowserSearch",e[e.BrowserHome=121]="BrowserHome",e[e.BrowserBack=122]="BrowserBack",e[e.BrowserForward=123]="BrowserForward",e[e.MediaTrackNext=124]="MediaTrackNext",e[e.MediaTrackPrevious=125]="MediaTrackPrevious",e[e.MediaStop=126]="MediaStop",e[e.MediaPlayPause=127]="MediaPlayPause",e[e.LaunchMediaPlayer=128]="LaunchMediaPlayer",e[e.LaunchMail=129]="LaunchMail",e[e.LaunchApp2=130]="LaunchApp2",e[e.Clear=131]="Clear",e[e.MAX_VALUE=132]="MAX_VALUE"}(i||(t.KeyCode=i={})),function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.None=0]="None",e[e.Hyper=1]="Hyper",e[e.Super=2]="Super",e[e.Fn=3]="Fn",e[e.FnLock=4]="FnLock",e[e.Suspend=5]="Suspend",e[e.Resume=6]="Resume",e[e.Turbo=7]="Turbo",e[e.Sleep=8]="Sleep",e[e.WakeUp=9]="WakeUp",e[e.KeyA=10]="KeyA",e[e.KeyB=11]="KeyB",e[e.KeyC=12]="KeyC",e[e.KeyD=13]="KeyD",e[e.KeyE=14]="KeyE",e[e.KeyF=15]="KeyF",e[e.KeyG=16]="KeyG",e[e.KeyH=17]="KeyH",e[e.KeyI=18]="KeyI",e[e.KeyJ=19]="KeyJ",e[e.KeyK=20]="KeyK",e[e.KeyL=21]="KeyL",e[e.KeyM=22]="KeyM",e[e.KeyN=23]="KeyN",e[e.KeyO=24]="KeyO",e[e.KeyP=25]="KeyP",e[e.KeyQ=26]="KeyQ",e[e.KeyR=27]="KeyR",e[e.KeyS=28]="KeyS",e[e.KeyT=29]="KeyT",e[e.KeyU=30]="KeyU",e[e.KeyV=31]="KeyV",e[e.KeyW=32]="KeyW",e[e.KeyX=33]="KeyX",e[e.KeyY=34]="KeyY",e[e.KeyZ=35]="KeyZ",e[e.Digit1=36]="Digit1",e[e.Digit2=37]="Digit2",e[e.Digit3=38]="Digit3",e[e.Digit4=39]="Digit4",e[e.Digit5=40]="Digit5",e[e.Digit6=41]="Digit6",e[e.Digit7=42]="Digit7",e[e.Digit8=43]="Digit8",e[e.Digit9=44]="Digit9",e[e.Digit0=45]="Digit0",e[e.Enter=46]="Enter",e[e.Escape=47]="Escape",e[e.Backspace=48]="Backspace",e[e.Tab=49]="Tab",e[e.Space=50]="Space",e[e.Minus=51]="Minus",e[e.Equal=52]="Equal",e[e.BracketLeft=53]="BracketLeft",e[e.BracketRight=54]="BracketRight",e[e.Backslash=55]="Backslash",e[e.IntlHash=56]="IntlHash",e[e.Semicolon=57]="Semicolon",e[e.Quote=58]="Quote",e[e.Backquote=59]="Backquote",e[e.Comma=60]="Comma",e[e.Period=61]="Period",e[e.Slash=62]="Slash",e[e.CapsLock=63]="CapsLock",e[e.F1=64]="F1",e[e.F2=65]="F2",e[e.F3=66]="F3",e[e.F4=67]="F4",e[e.F5=68]="F5",e[e.F6=69]="F6",e[e.F7=70]="F7",e[e.F8=71]="F8",e[e.F9=72]="F9",e[e.F10=73]="F10",e[e.F11=74]="F11",e[e.F12=75]="F12",e[e.PrintScreen=76]="PrintScreen",e[e.ScrollLock=77]="ScrollLock",e[e.Pause=78]="Pause",e[e.Insert=79]="Insert",e[e.Home=80]="Home",e[e.PageUp=81]="PageUp",e[e.Delete=82]="Delete",e[e.End=83]="End",e[e.PageDown=84]="PageDown",e[e.ArrowRight=85]="ArrowRight",e[e.ArrowLeft=86]="ArrowLeft",e[e.ArrowDown=87]="ArrowDown",e[e.ArrowUp=88]="ArrowUp",e[e.NumLock=89]="NumLock",e[e.NumpadDivide=90]="NumpadDivide",e[e.NumpadMultiply=91]="NumpadMultiply",e[e.NumpadSubtract=92]="NumpadSubtract",e[e.NumpadAdd=93]="NumpadAdd",e[e.NumpadEnter=94]="NumpadEnter",e[e.Numpad1=95]="Numpad1",e[e.Numpad2=96]="Numpad2",e[e.Numpad3=97]="Numpad3",e[e.Numpad4=98]="Numpad4",e[e.Numpad5=99]="Numpad5",e[e.Numpad6=100]="Numpad6",e[e.Numpad7=101]="Numpad7",e[e.Numpad8=102]="Numpad8",e[e.Numpad9=103]="Numpad9",e[e.Numpad0=104]="Numpad0",e[e.NumpadDecimal=105]="NumpadDecimal",e[e.IntlBackslash=106]="IntlBackslash",e[e.ContextMenu=107]="ContextMenu",e[e.Power=108]="Power",e[e.NumpadEqual=109]="NumpadEqual",e[e.F13=110]="F13",e[e.F14=111]="F14",e[e.F15=112]="F15",e[e.F16=113]="F16",e[e.F17=114]="F17",e[e.F18=115]="F18",e[e.F19=116]="F19",e[e.F20=117]="F20",e[e.F21=118]="F21",e[e.F22=119]="F22",e[e.F23=120]="F23",e[e.F24=121]="F24",e[e.Open=122]="Open",e[e.Help=123]="Help",e[e.Select=124]="Select",e[e.Again=125]="Again",e[e.Undo=126]="Undo",e[e.Cut=127]="Cut",e[e.Copy=128]="Copy",e[e.Paste=129]="Paste",e[e.Find=130]="Find",e[e.AudioVolumeMute=131]="AudioVolumeMute",e[e.AudioVolumeUp=132]="AudioVolumeUp",e[e.AudioVolumeDown=133]="AudioVolumeDown",e[e.NumpadComma=134]="NumpadComma",e[e.IntlRo=135]="IntlRo",e[e.KanaMode=136]="KanaMode",e[e.IntlYen=137]="IntlYen",e[e.Convert=138]="Convert",e[e.NonConvert=139]="NonConvert",e[e.Lang1=140]="Lang1",e[e.Lang2=141]="Lang2",e[e.Lang3=142]="Lang3",e[e.Lang4=143]="Lang4",e[e.Lang5=144]="Lang5",e[e.Abort=145]="Abort",e[e.Props=146]="Props",e[e.NumpadParenLeft=147]="NumpadParenLeft",e[e.NumpadParenRight=148]="NumpadParenRight",e[e.NumpadBackspace=149]="NumpadBackspace",e[e.NumpadMemoryStore=150]="NumpadMemoryStore",e[e.NumpadMemoryRecall=151]="NumpadMemoryRecall",e[e.NumpadMemoryClear=152]="NumpadMemoryClear",e[e.NumpadMemoryAdd=153]="NumpadMemoryAdd",e[e.NumpadMemorySubtract=154]="NumpadMemorySubtract",e[e.NumpadClear=155]="NumpadClear",e[e.NumpadClearEntry=156]="NumpadClearEntry",e[e.ControlLeft=157]="ControlLeft",e[e.ShiftLeft=158]="ShiftLeft",e[e.AltLeft=159]="AltLeft",e[e.MetaLeft=160]="MetaLeft",e[e.ControlRight=161]="ControlRight",e[e.ShiftRight=162]="ShiftRight",e[e.AltRight=163]="AltRight",e[e.MetaRight=164]="MetaRight",e[e.BrightnessUp=165]="BrightnessUp",e[e.BrightnessDown=166]="BrightnessDown",e[e.MediaPlay=167]="MediaPlay",e[e.MediaRecord=168]="MediaRecord",e[e.MediaFastForward=169]="MediaFastForward",e[e.MediaRewind=170]="MediaRewind",e[e.MediaTrackNext=171]="MediaTrackNext",e[e.MediaTrackPrevious=172]="MediaTrackPrevious",e[e.MediaStop=173]="MediaStop",e[e.Eject=174]="Eject",e[e.MediaPlayPause=175]="MediaPlayPause",e[e.MediaSelect=176]="MediaSelect",e[e.LaunchMail=177]="LaunchMail",e[e.LaunchApp2=178]="LaunchApp2",e[e.LaunchApp1=179]="LaunchApp1",e[e.SelectTask=180]="SelectTask",e[e.LaunchScreenSaver=181]="LaunchScreenSaver",e[e.BrowserSearch=182]="BrowserSearch",e[e.BrowserHome=183]="BrowserHome",e[e.BrowserBack=184]="BrowserBack",e[e.BrowserForward=185]="BrowserForward",e[e.BrowserStop=186]="BrowserStop",e[e.BrowserRefresh=187]="BrowserRefresh",e[e.BrowserFavorites=188]="BrowserFavorites",e[e.ZoomToggle=189]="ZoomToggle",e[e.MailReply=190]="MailReply",e[e.MailForward=191]="MailForward",e[e.MailSend=192]="MailSend",e[e.MAX_VALUE=193]="MAX_VALUE"}(s||(t.ScanCode=s={}));class r{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()]||i.Unknown}}const n=new r,o=new r,a=new r;t.EVENT_KEY_CODE_MAP=new Array(230),t.NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE={};const l=[],h=Object.create(null),c=Object.create(null);var d,u;t.ScanCodeUtils={lowerCaseToEnum:e=>c[e]||s.None,toEnum:e=>h[e]||s.None,toString:e=>l[e]||"None"},function(e){e.toString=function(e){return n.keyCodeToStr(e)},e.fromString=function(e){return n.strToKeyCode(e)},e.toUserSettingsUS=function(e){return o.keyCodeToStr(e)},e.toUserSettingsGeneral=function(e){return a.keyCodeToStr(e)},e.fromUserSettings=function(e){return o.strToKeyCode(e)||a.strToKeyCode(e)},e.toElectronAccelerator=function(e){if(e>=i.Numpad0&&e<=i.NumpadDivide)return null;switch(e){case i.UpArrow:return"Up";case i.DownArrow:return"Down";case i.LeftArrow:return"Left";case i.RightArrow:return"Right"}return n.keyCodeToStr(e)}}(d||(t.KeyCodeUtils=d={})),function(e){e[e.CtrlCmd=2048]="CtrlCmd",e[e.Shift=1024]="Shift",e[e.Alt=512]="Alt",e[e.WinCtrl=256]="WinCtrl"}(u||(t.KeyMod=u={}))},2811:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResolvedKeybinding=t.ResolvedChord=t.Keybinding=t.ScanCodeChord=t.KeyCodeChord=void 0,t.decodeKeybinding=function(e,t){if("number"==typeof e){if(0===e)return null;const i=(65535&e)>>>0,s=(4294901760&e)>>>16;return new c(0!==s?[a(i,t),a(s,t)]:[a(i,t)])}{const i=[];for(let s=0;s<e.length;s++)i.push(a(e[s],t));return new c(i)}},t.createSimpleKeybinding=a;const s=i(9807),r=i(7883),n=i(8163);var o;function a(e,t){const i=!!(e&o.CtrlCmd),s=!!(e&o.WinCtrl),r=t===n.OperatingSystem.Macintosh?s:i,a=!!(e&o.Shift),h=!!(e&o.Alt),c=t===n.OperatingSystem.Macintosh?i:s,d=e&o.KeyCode;return new l(r,a,h,c,d)}!function(e){e[e.CtrlCmd=2048]="CtrlCmd",e[e.Shift=1024]="Shift",e[e.Alt=512]="Alt",e[e.WinCtrl=256]="WinCtrl",e[e.KeyCode=255]="KeyCode"}(o||(o={}));class l{constructor(e,t,i,s,r){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=s,this.keyCode=r}equals(e){return e instanceof l&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}getHashCode(){return`K${this.ctrlKey?"1":"0"}${this.shiftKey?"1":"0"}${this.altKey?"1":"0"}${this.metaKey?"1":"0"}${this.keyCode}`}isModifierKey(){return this.keyCode===r.KeyCode.Unknown||this.keyCode===r.KeyCode.Ctrl||this.keyCode===r.KeyCode.Meta||this.keyCode===r.KeyCode.Alt||this.keyCode===r.KeyCode.Shift}toKeybinding(){return new c([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===r.KeyCode.Ctrl||this.shiftKey&&this.keyCode===r.KeyCode.Shift||this.altKey&&this.keyCode===r.KeyCode.Alt||this.metaKey&&this.keyCode===r.KeyCode.Meta}}t.KeyCodeChord=l;class h{constructor(e,t,i,s,r){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=s,this.scanCode=r}equals(e){return e instanceof h&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.scanCode===e.scanCode}getHashCode(){return`S${this.ctrlKey?"1":"0"}${this.shiftKey?"1":"0"}${this.altKey?"1":"0"}${this.metaKey?"1":"0"}${this.scanCode}`}isDuplicateModifierCase(){return this.ctrlKey&&(this.scanCode===r.ScanCode.ControlLeft||this.scanCode===r.ScanCode.ControlRight)||this.shiftKey&&(this.scanCode===r.ScanCode.ShiftLeft||this.scanCode===r.ScanCode.ShiftRight)||this.altKey&&(this.scanCode===r.ScanCode.AltLeft||this.scanCode===r.ScanCode.AltRight)||this.metaKey&&(this.scanCode===r.ScanCode.MetaLeft||this.scanCode===r.ScanCode.MetaRight)}}t.ScanCodeChord=h;class c{constructor(e){if(0===e.length)throw(0,s.illegalArgument)("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;t++)0!==t&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(null===e)return!1;if(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}}t.Keybinding=c,t.ResolvedChord=class{constructor(e,t,i,s,r,n){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=s,this.keyLabel=r,this.keyAriaLabel=n}},t.ResolvedKeybinding=class{}},626:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Lazy=void 0,t.Lazy=class{constructor(e){this.executor=e,this._didRun=!1}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}},7150:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DisposableMap=t.ImmortalReference=t.AsyncReferenceCollection=t.ReferenceCollection=t.SafeDisposable=t.RefCountedDisposable=t.MandatoryMutableDisposable=t.MutableDisposable=t.Disposable=t.DisposableStore=t.DisposableTracker=void 0,t.setDisposableTracker=function(e){l=e},t.trackDisposable=c,t.markAsDisposed=d,t.markAsSingleton=function(e){return l?.markAsSingleton(e),e},t.isDisposable=_,t.dispose=f,t.disposeIfDisposable=function(e){for(const t of e)_(t)&&t.dispose();return[]},t.combinedDisposable=function(...e){const t=p((()=>f(e)));return function(e,t){if(l)for(const i of e)l.setParent(i,t)}(e,t),t},t.toDisposable=p,t.disposeOnReturn=function(e){const t=new g;try{e(t)}finally{t.dispose()}};const s=i(3058),r=i(9087),n=i(2608),o=i(8841),a=i(4218);let l=null;class h{constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let t=this.livingDisposables.get(e);return t||(t={parent:null,source:null,isSingleton:!1,value:e,idx:h.idx++},this.livingDisposables.set(e,t)),t}trackDisposable(e){const t=this.getDisposableData(e);t.source||(t.source=(new Error).stack)}setParent(e,t){this.getDisposableData(e).parent=t}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,t){const i=t.get(e);if(i)return i;const s=e.parent?this.getRootParent(this.getDisposableData(e.parent),t):e;return t.set(e,s),s}getTrackedDisposables(){const e=new Map;return[...this.livingDisposables.entries()].filter((([,t])=>null!==t.source&&!this.getRootParent(t,e).isSingleton)).flatMap((([e])=>e))}computeLeakingDisposables(e=10,t){let i;if(t)i=t;else{const e=new Map,t=[...this.livingDisposables.values()].filter((t=>null!==t.source&&!this.getRootParent(t,e).isSingleton));if(0===t.length)return;const s=new Set(t.map((e=>e.value)));if(i=t.filter((e=>!(e.parent&&s.has(e.parent)))),0===i.length)throw new Error("There are cyclic diposable chains!")}if(!i)return;function o(e){const t=e.source.split("\n").map((e=>e.trim().replace("at ",""))).filter((e=>""!==e));return function(e,t){for(;e.length>0&&t.some((t=>"string"==typeof t?t===e[0]:e[0].match(t)));)e.shift()}(t,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),t.reverse()}const a=new n.SetMap;for(const e of i){const t=o(e);for(let i=0;i<=t.length;i++)a.add(t.slice(0,i).join("\n"),e)}i.sort((0,s.compareBy)((e=>e.idx),s.numberComparator));let l="",h=0;for(const t of i.slice(0,e)){h++;const e=o(t),s=[];for(let t=0;t<e.length;t++){let n=e[t];n=`(shared with ${a.get(e.slice(0,t+1).join("\n")).size}/${i.length} leaks) at ${n}`;const l=a.get(e.slice(0,t).join("\n")),h=(0,r.groupBy)([...l].map((e=>o(e)[t])),(e=>e));delete h[e[t]];for(const[e,t]of Object.entries(h))s.unshift(` - stacktraces of ${t.length} other leaks continue with ${e}`);s.unshift(n)}l+=`\n\n\n==================== Leaking disposable ${h}/${i.length}: ${t.value.constructor.name} ====================\n${s.join("\n")}\n============================================================\n\n`}return i.length>e&&(l+=`\n\n\n... and ${i.length-e} more leaking disposables\n\n`),{leaks:i,details:l}}}function c(e){return l?.trackDisposable(e),e}function d(e){l?.markAsDisposed(e)}function u(e,t){l?.setParent(e,t)}function _(e){return"object"==typeof e&&null!==e&&"function"==typeof e.dispose&&0===e.dispose.length}function f(e){if(a.Iterable.is(e)){const t=[];for(const i of e)if(i)try{i.dispose()}catch(e){t.push(e)}if(1===t.length)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function p(e){const t=c({dispose:(0,o.createSingleCallFunction)((()=>{d(t),e()}))});return t}t.DisposableTracker=h;class g{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,c(this)}dispose(){this._isDisposed||(d(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(0!==this._toDispose.size)try{f(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return u(e,this),this._isDisposed?g.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(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),u(e,null))}}t.DisposableStore=g;class m{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new g,c(this),u(this._store,this)}dispose(){d(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}t.Disposable=m;class v{constructor(){this._isDisposed=!1,c(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&u(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,d(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){const e=this._value;return this._value=void 0,e&&u(e,null),e}}t.MutableDisposable=v,t.MandatoryMutableDisposable=class{constructor(e){this._disposable=new v,this._isDisposed=!1,this._disposable.value=e}get value(){return this._disposable.value}set value(e){this._isDisposed||e===this._disposable.value||(this._disposable.value=e)}dispose(){this._isDisposed=!0,this._disposable.dispose()}},t.RefCountedDisposable=class{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return 0==--this._counter&&this._disposable.dispose(),this}},t.SafeDisposable=class{constructor(){this.dispose=()=>{},this.unset=()=>{},this.isset=()=>!1,c(this)}set(e){let t=e;return this.unset=()=>t=void 0,this.isset=()=>void 0!==t,this.dispose=()=>{t&&(t(),t=void 0,d(this))},this}},t.ReferenceCollection=class{constructor(){this.references=new Map}acquire(e,...t){let i=this.references.get(e);i||(i={counter:0,object:this.createReferencedObject(e,...t)},this.references.set(e,i));const{object:s}=i,r=(0,o.createSingleCallFunction)((()=>{0==--i.counter&&(this.destroyReferencedObject(e,i.object),this.references.delete(e))}));return i.counter++,{object:s,dispose:r}}},t.AsyncReferenceCollection=class{constructor(e){this.referenceCollection=e}async acquire(e,...t){const i=this.referenceCollection.acquire(e,...t);try{return{object:await i.object,dispose:()=>i.dispose()}}catch(e){throw i.dispose(),e}}},t.ImmortalReference=class{constructor(e){this.object=e}dispose(){}};class S{constructor(){this._store=new Map,this._isDisposed=!1,c(this)}dispose(){d(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{f(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,t,i=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||this._store.get(e)?.dispose(),this._store.set(e,t)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){const t=this._store.get(e);return this._store.delete(e),t}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}t.DisposableMap=S},6317:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedList=void 0;class i{static{this.Undefined=new i(void 0)}constructor(e){this.element=e,this.next=i.Undefined,this.prev=i.Undefined}}class s{constructor(){this._first=i.Undefined,this._last=i.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===i.Undefined}clear(){let e=this._first;for(;e!==i.Undefined;){const t=e.next;e.prev=i.Undefined,e.next=i.Undefined,e=t}this._first=i.Undefined,this._last=i.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const s=new i(e);if(this._first===i.Undefined)this._first=s,this._last=s;else if(t){const e=this._last;this._last=s,s.prev=e,e.next=s}else{const e=this._first;this._first=s,s.next=e,e.prev=s}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(s))}}shift(){if(this._first!==i.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==i.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==i.Undefined&&e.next!==i.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===i.Undefined&&e.next===i.Undefined?(this._first=i.Undefined,this._last=i.Undefined):e.next===i.Undefined?(this._last=this._last.prev,this._last.next=i.Undefined):e.prev===i.Undefined&&(this._first=this._first.next,this._first.prev=i.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==i.Undefined;)yield e.element,e=e.next}}t.LinkedList=s},2608:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.SetMap=t.BidirectionalMap=t.CounterSet=t.Touch=void 0,t.getOrSet=function(e,t,i){let s=e.get(t);return void 0===s&&(s=i,e.set(t,s)),s},t.mapToString=function(e){const t=[];return e.forEach(((e,i)=>{t.push(`${i} => ${e}`)})),`Map(${e.size}) {${t.join(", ")}}`},t.setToString=function(e){const t=[];return e.forEach((e=>{t.push(e)})),`Set(${e.size}) {${t.join(", ")}}`},t.mapsStrictEqualIgnoreOrder=function(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(const[i,s]of e)if(!t.has(i)||t.get(i)!==s)return!1;for(const[i]of t)if(!e.has(i))return!1;return!0},function(e){e[e.None=0]="None",e[e.AsOld=1]="AsOld",e[e.AsNew=2]="AsNew"}(i||(t.Touch=i={})),t.CounterSet=class{constructor(){this.map=new Map}add(e){return this.map.set(e,(this.map.get(e)||0)+1),this}delete(e){let t=this.map.get(e)||0;return 0!==t&&(t--,0===t?this.map.delete(e):this.map.set(e,t),!0)}has(e){return this.map.has(e)}},t.BidirectionalMap=class{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return void 0!==t&&(this._m1.delete(e),this._m2.delete(t),!0)}forEach(e,t){this._m1.forEach(((i,s)=>{e.call(t,i,s,this)}))}keys(){return this._m1.keys()}values(){return this._m1.values()}},t.SetMap=class{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),0===i.size&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}get(e){return this.map.get(e)||new Set}}},7704:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SlidingWindowAverage=t.MovingAverage=t.Counter=void 0,t.clamp=function(e,t,i){return Math.min(Math.max(e,t),i)},t.rot=function(e,t){return(t+e%t)%t},t.isPointWithinTriangle=function(e,t,i,s,r,n,o,a){const l=o-i,h=a-s,c=r-i,d=n-s,u=e-i,_=t-s,f=l*l+h*h,p=l*c+h*d,g=l*u+h*_,m=c*c+d*d,v=c*u+d*_,S=1/(f*m-p*p),b=(m*g-p*v)*S,C=(f*v-p*g)*S;return b>=0&&C>=0&&b+C<1},t.Counter=class{constructor(){this._next=0}getNext(){return this._next++}},t.MovingAverage=class{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}},t.SlidingWindowAverage=class{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}},8163:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isAndroid=t.isEdge=t.isSafari=t.isFirefox=t.isChrome=t.OS=t.OperatingSystem=t.setTimeout0=t.setTimeout0IsFaster=t.translationsConfigFile=t.platformLocale=t.locale=t.Language=t.language=t.userAgent=t.platform=t.isCI=t.isMobile=t.isIOS=t.webWorkerOrigin=t.isWebWorker=t.isWeb=t.isElectron=t.isNative=t.isLinuxSnap=t.isLinux=t.isMacintosh=t.isWindows=t.Platform=t.LANGUAGE_DEFAULT=void 0,t.PlatformToString=function(e){switch(e){case C.Web:return"Web";case C.Mac:return"Mac";case C.Linux:return"Linux";case C.Windows:return"Windows"}},t.isLittleEndian=function(){if(!L){L=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);D=513===t[0]}return D},t.isBigSurOrNewer=function(e){return parseFloat(e)>=20},t.LANGUAGE_DEFAULT="en";let i,s,r,n=!1,o=!1,a=!1,l=!1,h=!1,c=!1,d=!1,u=!1,_=!1,f=!1,p=t.LANGUAGE_DEFAULT,g=t.LANGUAGE_DEFAULT;const m=globalThis;let v;void 0!==m.vscode&&void 0!==m.vscode.process?v=m.vscode.process:"undefined"!=typeof process&&"string"==typeof process?.versions?.node&&(v=process);const S="string"==typeof v?.versions?.electron,b=S&&"renderer"===v?.type;if("object"==typeof v){n="win32"===v.platform,o="darwin"===v.platform,a="linux"===v.platform,l=a&&!!v.env.SNAP&&!!v.env.SNAP_REVISION,d=S,_=!!v.env.CI||!!v.env.BUILD_ARTIFACTSTAGINGDIRECTORY,i=t.LANGUAGE_DEFAULT,p=t.LANGUAGE_DEFAULT;const e=v.env.VSCODE_NLS_CONFIG;if(e)try{const r=JSON.parse(e);i=r.userLocale,g=r.osLocale,p=r.resolvedLanguage||t.LANGUAGE_DEFAULT,s=r.languagePack?.translationsConfigFile}catch(e){}h=!0}else"object"!=typeof navigator||b?console.error("Unable to resolve platform."):(r=navigator.userAgent,n=r.indexOf("Windows")>=0,o=r.indexOf("Macintosh")>=0,u=(r.indexOf("Macintosh")>=0||r.indexOf("iPad")>=0||r.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,a=r.indexOf("Linux")>=0,f=r?.indexOf("Mobi")>=0,c=!0,p=globalThis._VSCODE_NLS_LANGUAGE||t.LANGUAGE_DEFAULT,i=navigator.language.toLowerCase(),g=i);var C;!function(e){e[e.Web=0]="Web",e[e.Mac=1]="Mac",e[e.Linux=2]="Linux",e[e.Windows=3]="Windows"}(C||(t.Platform=C={}));let y=C.Web;var w,E;o?y=C.Mac:n?y=C.Windows:a&&(y=C.Linux),t.isWindows=n,t.isMacintosh=o,t.isLinux=a,t.isLinuxSnap=l,t.isNative=h,t.isElectron=d,t.isWeb=c,t.isWebWorker=c&&"function"==typeof m.importScripts,t.webWorkerOrigin=t.isWebWorker?m.origin:void 0,t.isIOS=u,t.isMobile=f,t.isCI=_,t.platform=y,t.userAgent=r,t.language=p,function(e){e.value=function(){return t.language},e.isDefaultVariant=function(){return 2===t.language.length?"en"===t.language:t.language.length>=3&&"e"===t.language[0]&&"n"===t.language[1]&&"-"===t.language[2]},e.isDefault=function(){return"en"===t.language}}(w||(t.Language=w={})),t.locale=i,t.platformLocale=g,t.translationsConfigFile=s,t.setTimeout0IsFaster="function"==typeof m.postMessage&&!m.importScripts,t.setTimeout0=(()=>{if(t.setTimeout0IsFaster){const e=[];m.addEventListener("message",(t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i<s;i++){const s=e[i];if(s.id===t.data.vscodeScheduleAsyncWork)return e.splice(i,1),void s.callback()}}));let t=0;return i=>{const s=++t;e.push({id:s,callback:i}),m.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),function(e){e[e.Windows=1]="Windows",e[e.Macintosh=2]="Macintosh",e[e.Linux=3]="Linux"}(E||(t.OperatingSystem=E={})),t.OS=o||u?E.Macintosh:n?E.Windows:E.Linux;let D=!0,L=!1;t.isChrome=!!(t.userAgent&&t.userAgent.indexOf("Chrome")>=0),t.isFirefox=!!(t.userAgent&&t.userAgent.indexOf("Firefox")>=0),t.isSafari=!!(!t.isChrome&&t.userAgent&&t.userAgent.indexOf("Safari")>=0),t.isEdge=!!(t.userAgent&&t.userAgent.indexOf("Edg/")>=0),t.isAndroid=!!(t.userAgent&&t.userAgent.indexOf("Android")>=0)},9881:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SmoothScrollingOperation=t.SmoothScrollingUpdate=t.Scrollable=t.ScrollState=t.ScrollbarVisibility=void 0;const s=i(802),r=i(7150);var n;!function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"}(n||(t.ScrollbarVisibility=n={}));class o{constructor(e,t,i,s,r,n,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,i|=0,s|=0,r|=0,n|=0,o|=0),this.rawScrollLeft=s,this.rawScrollTop=o,t<0&&(t=0),s+t>i&&(s=i-t),s<0&&(s=0),r<0&&(r=0),o+r>n&&(o=n-r),o<0&&(o=0),this.width=t,this.scrollWidth=i,this.scrollLeft=s,this.height=r,this.scrollHeight=n,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new o(this._forceIntegerValues,void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new o(this._forceIntegerValues,this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,s=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,n=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,a=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:s,scrollLeftChanged:r,heightChanged:n,scrollHeightChanged:o,scrollTopChanged:a}}}t.ScrollState=o;class a extends r.Disposable{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new s.Emitter),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new o(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){const i=this._state.withScrollDimensions(e,t);this._setState(i,Boolean(this._smoothScrolling)),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;s=t?new c(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{const t=this._state.withScrollPosition(e);this._smoothScrolling=c.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))}hasPendingScrollAnimation(){return Boolean(this._smoothScrolling)}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);return this._setState(t,!0),this._smoothScrolling?e.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))):void 0}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}t.Scrollable=a;class l{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function h(e,t){const i=t-e;return function(t){return e+i*(1-(s=1-t,Math.pow(s,3)));var s}}t.SmoothScrollingUpdate=l;class c{constructor(e,t,i,s){this.from=e,this.to=t,this.duration=s,this.startTime=i,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(e,t,i){if(Math.abs(e-t)>2.5*i){let o,a;return e<t?(o=e+.75*i,a=t-.75*i):(o=e-.75*i,a=t+.75*i),s=h(e,o),r=h(a,t),n=.33,function(e){return e<n?s(e/n):r((e-n)/(1-n))}}var s,r,n;return h(e,t)}dispose(){null!==this.animationFrameDisposable&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const t=(e-this.startTime)/this.duration;if(t<1){const e=this.scrollLeft(t),i=this.scrollTop(t);return new l(e,i,!1)}return new l(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return c.start(e,t,i)}static start(e,t,i){i+=10;const s=Date.now()-10;return new c(e,t,s,i)}}t.SmoothScrollingOperation=c},9725:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StopWatch=void 0;const i=globalThis.performance&&"function"==typeof globalThis.performance.now;class s{static create(e){return new s(e)}constructor(e){this._now=i&&!1===e?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-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}}t.StopWatch=s},1316:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.noBreakWhitespace=t.CodePointIterator=void 0,t.isFalsyOrWhitespace=function(e){return!e||"string"!=typeof e||0===e.trim().length},t.format=function(e,...t){return 0===t.length?e:e.replace(n,(function(e,i){const s=parseInt(i,10);return isNaN(s)||s<0||s>=t.length?e:t[s]}))},t.format2=function(e,t){return 0===Object.keys(t).length?e:e.replace(o,((e,i)=>t[i]??e))},t.htmlAttributeEncodeValue=function(e){return e.replace(/[<>"'&]/g,(e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e}))},t.escape=function(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}}))},t.escapeRegExpCharacters=a,t.count=function(e,t){let i=0,s=e.indexOf(t);for(;-1!==s;)i++,s=e.indexOf(t,s+t.length);return i},t.truncate=function(e,t,i="…"){return e.length<=t?e:`${e.substr(0,t)}${i}`},t.truncateMiddle=function(e,t,i="…"){if(e.length<=t)return e;const s=Math.ceil(t/2)-i.length/2,r=Math.floor(t/2)-i.length/2;return`${e.substr(0,s)}${i}${e.substr(e.length-r)}`},t.trim=function(e,t=" "){return h(l(e,t),t)},t.ltrim=l,t.rtrim=h,t.convertSimple2RegExpPattern=function(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")},t.stripWildcards=function(e){return e.replace(/\*/g,"")},t.createRegExp=function(e,t,i={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=a(e)),i.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let s="";return i.global&&(s+="g"),i.matchCase||(s+="i"),i.multiline&&(s+="m"),i.unicode&&(s+="u"),new RegExp(e,s)},t.regExpLeadsToEndlessLoop=function(e){return"^"!==e.source&&"^$"!==e.source&&"$"!==e.source&&"^\\s*$"!==e.source&&!(!e.exec("")||0!==e.lastIndex)},t.splitLines=function(e){return e.split(/\r\n|\r|\n/)},t.splitLinesIncludeSeparators=function(e){const t=[],i=e.split(/(\r\n|\r|\n)/);for(let e=0;e<Math.ceil(i.length/2);e++)t.push(i[2*e]+(i[2*e+1]??""));return t},t.firstNonWhitespaceIndex=function(e){for(let t=0,i=e.length;t<i;t++){const i=e.charCodeAt(t);if(i!==s.CharCode.Space&&i!==s.CharCode.Tab)return t}return-1},t.getLeadingWhitespace=function(e,t=0,i=e.length){for(let r=t;r<i;r++){const i=e.charCodeAt(r);if(i!==s.CharCode.Space&&i!==s.CharCode.Tab)return e.substring(t,r)}return e.substring(t,i)},t.lastNonWhitespaceIndex=function(e,t=e.length-1){for(let i=t;i>=0;i--){const t=e.charCodeAt(i);if(t!==s.CharCode.Space&&t!==s.CharCode.Tab)return i}return-1},t.replaceAsync=function(e,t,i){const s=[];let r=0;for(const n of e.matchAll(t)){if(s.push(e.slice(r,n.index)),void 0===n.index)throw new Error("match.index should be defined");r=n.index+n[0].length,s.push(i(n[0],...n.slice(1),n.index,e,n.groups))}return s.push(e.slice(r)),Promise.all(s).then((e=>e.join("")))},t.compare=function(e,t){return e<t?-1:e>t?1:0},t.compareSubstring=c,t.compareIgnoreCase=function(e,t){return d(e,t,0,e.length,0,t.length)},t.compareSubstringIgnoreCase=d,t.isAsciiDigit=function(e){return e>=s.CharCode.Digit0&&e<=s.CharCode.Digit9},t.isLowerAsciiLetter=u,t.isUpperAsciiLetter=function(e){return e>=s.CharCode.A&&e<=s.CharCode.Z},t.equalsIgnoreCase=function(e,t){return e.length===t.length&&0===d(e,t)},t.startsWithIgnoreCase=function(e,t){const i=t.length;return!(t.length>e.length)&&0===d(e,t,0,i)},t.commonPrefixLength=function(e,t){const i=Math.min(e.length,t.length);let s;for(s=0;s<i;s++)if(e.charCodeAt(s)!==t.charCodeAt(s))return s;return i},t.commonSuffixLength=function(e,t){const i=Math.min(e.length,t.length);let s;const r=e.length-1,n=t.length-1;for(s=0;s<i;s++)if(e.charCodeAt(r-s)!==t.charCodeAt(n-s))return s;return i},t.isHighSurrogate=_,t.isLowSurrogate=f,t.computeCodePoint=p,t.getNextCodePoint=g;const s=i(4869),r=i(8960),n=/{(\d+)}/g,o=/{([^}]+)}/g;function a(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function l(e,t){if(!e||!t)return e;const i=t.length;if(0===i||0===e.length)return e;let s=0;for(;e.indexOf(t,s)===s;)s+=i;return e.substring(s)}function h(e,t){if(!e||!t)return e;const i=t.length,s=e.length;if(0===i||0===s)return e;let r=s,n=-1;for(;n=e.lastIndexOf(t,r-1),-1!==n&&n+i===r;){if(0===n)return"";r=n}return e.substring(0,r)}function c(e,t,i=0,s=e.length,r=0,n=t.length){for(;i<s&&r<n;i++,r++){const s=e.charCodeAt(i),n=t.charCodeAt(r);if(s<n)return-1;if(s>n)return 1}const o=s-i,a=n-r;return o<a?-1:o>a?1:0}function d(e,t,i=0,s=e.length,r=0,n=t.length){for(;i<s&&r<n;i++,r++){let o=e.charCodeAt(i),a=t.charCodeAt(r);if(o===a)continue;if(o>=128||a>=128)return c(e.toLowerCase(),t.toLowerCase(),i,s,r,n);u(o)&&(o-=32),u(a)&&(a-=32);const l=o-a;if(0!==l)return l}const o=s-i,a=n-r;return o<a?-1:o>a?1:0}function u(e){return e>=s.CharCode.a&&e<=s.CharCode.z}function _(e){return 55296<=e&&e<=56319}function f(e){return 56320<=e&&e<=57343}function p(e,t){return t-56320+(e-55296<<10)+65536}function g(e,t,i){const s=e.charCodeAt(i);if(_(s)&&i+1<t){const t=e.charCodeAt(i+1);if(f(t))return p(s,t)}return s}t.CodePointIterator=class{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=function(e,t){const i=e.charCodeAt(t-1);if(f(i)&&t>1){const s=e.charCodeAt(t-2);if(_(s))return p(s,i)}return i}(this._str,this._offset);return this._offset-=e>=r.Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN?2:1,e}nextCodePoint(){const e=g(this._str,this._len,this._offset);return this._offset+=e>=r.Constants.UNICODE_SUPPLEMENTARY_PLANE_BEGIN?2:1,e}eol(){return this._offset>=this._len}},t.noBreakWhitespace=" "},5015:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MicrotaskDelay=void 0,t.MicrotaskDelay=Symbol("MicrotaskDelay")},8960:(e,t)=>{var i;Object.defineProperty(t,"__esModule",{value:!0}),t.Constants=void 0,t.toUint8=function(e){return e<0?0:e>i.MAX_UINT_8?i.MAX_UINT_8:0|e},t.toUint32=function(e){return e<0?0:e>i.MAX_UINT_32?i.MAX_UINT_32:0|e},function(e){e[e.MAX_SAFE_SMALL_INTEGER=1073741824]="MAX_SAFE_SMALL_INTEGER",e[e.MIN_SAFE_SMALL_INTEGER=-1073741824]="MIN_SAFE_SMALL_INTEGER",e[e.MAX_UINT_8=255]="MAX_UINT_8",e[e.MAX_UINT_16=65535]="MAX_UINT_16",e[e.MAX_UINT_32=4294967295]="MAX_UINT_32",e[e.UNICODE_SUPPLEMENTARY_PLANE_BEGIN=65536]="UNICODE_SUPPLEMENTARY_PLANE_BEGIN"}(i||(t.Constants=i={}))}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var n=t[s]={exports:{}};return e[s].call(n.exports,n,n.exports,i),n.exports}var s={};return(()=>{var e=s;Object.defineProperty(e,"__esModule",{value:!0}),e.Terminal=void 0;const t=i(7721),r=i(1718),n=i(7150),o=i(3027),a=i(5101),l=i(6097),h=i(4335),c=["cols","rows"];let d=0;class u extends n.Disposable{constructor(e){super(),this._core=this._register(new r.CoreBrowserTerminal(e)),this._addonManager=this._register(new o.AddonManager),this._publicOptions={...this._core.options};const t=e=>this._core.options[e],i=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(const e in this._core.options){const s={get:t.bind(this,e),set:i.bind(this,e)};Object.defineProperty(this._publicOptions,e,s)}}_checkReadonlyOptions(e){if(c.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 l.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new h.UnicodeApi(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 a.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const e=this._core.coreService.decPrivateModes;let 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"}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(const 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,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}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\n",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 t.promptLabel.get()},set promptLabel(e){t.promptLabel.set(e)},get tooMuchOutput(){return t.tooMuchOutput.get()},set tooMuchOutput(e){t.tooMuchOutput.set(e)}}}_verifyIntegers(...e){for(d of e)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(d of e)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}e.Terminal=u})(),s})()));//# sourceMappingURL=xterm.js.map\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/behavior/ReferenceInputBehavior.java b/server-core/src/main/java/io/onedev/server/web/behavior/ReferenceInputBehavior.javaindex 9d31c0b416..7bd2e693e5 100644--- a/server-core/src/main/java/io/onedev/server/web/behavior/ReferenceInputBehavior.java+++ b/server-core/src/main/java/io/onedev/server/web/behavior/ReferenceInputBehavior.java@@ -76,10 +76,5 @@ public abstract class ReferenceInputBehavior extends InputAssistBehavior {return inputContent.lastIndexOf('#');}- @Override- protected boolean isSelectOnFocus() {- return false;- }-protected abstract Project getProject();}diff --git a/server-core/src/main/java/io/onedev/server/web/behavior/WorkspaceQueryBehavior.java b/server-core/src/main/java/io/onedev/server/web/behavior/WorkspaceQueryBehavior.javanew file mode 100644index 0000000000..a86b09867e--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/behavior/WorkspaceQueryBehavior.java@@ -0,0 +1,234 @@+package io.onedev.server.web.behavior;++import static io.onedev.server.web.translation.Translation._T;++import java.util.ArrayList;+import java.util.List;++import org.apache.commons.lang3.StringUtils;+import org.apache.wicket.Component;+import org.apache.wicket.model.IModel;+import org.jspecify.annotations.Nullable;++import com.google.common.base.Optional;++import io.onedev.commons.codeassist.FenceAware;+import io.onedev.commons.codeassist.InputCompletion;+import io.onedev.commons.codeassist.InputSuggestion;+import io.onedev.commons.codeassist.grammar.LexerRuleRefElementSpec;+import io.onedev.commons.codeassist.parser.Element;+import io.onedev.commons.codeassist.parser.ParseExpect;+import io.onedev.commons.codeassist.parser.TerminalExpect;+import io.onedev.commons.utils.ExplicitException;+import io.onedev.server.OneDev;+import io.onedev.server.ai.QueryDescriptions;+import io.onedev.server.model.AbstractEntity;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.Project;+import io.onedev.server.search.entity.workspace.WorkspaceQuery;+import io.onedev.server.search.entity.workspace.WorkspaceQueryLexer;+import io.onedev.server.search.entity.workspace.WorkspaceQueryParser;+import io.onedev.server.service.SettingService;+import io.onedev.server.util.DateUtils;+import io.onedev.server.web.behavior.inputassist.ANTLRAssistBehavior;+import io.onedev.server.web.behavior.inputassist.InputAssistBehavior;+import io.onedev.server.web.behavior.inputassist.NaturalLanguageTranslator;+import io.onedev.server.web.util.SuggestionUtils;++public class WorkspaceQueryBehavior extends ANTLRAssistBehavior {++ private final IModel<Project> projectModel;++ private final boolean withOrder;++ public WorkspaceQueryBehavior(boolean withOrder) {+ this(null, withOrder);+ }++ public WorkspaceQueryBehavior(@Nullable IModel<Project> projectModel, boolean withOrder) {+ super(WorkspaceQueryParser.class, "query", false);+ this.projectModel = projectModel;+ this.withOrder = withOrder;+ }++ @Override+ public void detach(Component component) {+ super.detach(component);+ if (projectModel != null)+ projectModel.detach();+ }++ @Nullable+ private Project getProject() {+ return projectModel != null ? projectModel.getObject() : null;+ }++ @Override+ protected List<InputSuggestion> suggest(TerminalExpect terminalExpect) {+ if (terminalExpect.getElementSpec() instanceof LexerRuleRefElementSpec) {+ LexerRuleRefElementSpec spec = (LexerRuleRefElementSpec) terminalExpect.getElementSpec();+ if (spec.getRuleName().equals("Quoted")) {+ return new FenceAware(codeAssist.getGrammar(), '"', '"') {++ @Override+ protected List<InputSuggestion> match(String matchWith) {+ Project project = getProject();+ ParseExpect criteriaValueExpect;+ if ("criteriaField".equals(spec.getLabel())) {+ List<String> fields = new ArrayList<>(Workspace.QUERY_FIELDS);+ if (project != null)+ fields.remove(Workspace.NAME_PROJECT);+ return SuggestionUtils.suggest(fields, matchWith);+ } else if ("orderField".equals(spec.getLabel())) {+ List<String> candidates = new ArrayList<>(Workspace.SORT_FIELDS.keySet());+ if (project != null)+ candidates.remove(Workspace.NAME_PROJECT);+ return SuggestionUtils.suggest(candidates, matchWith);+ } else if ((criteriaValueExpect = terminalExpect.findExpectByLabel("criteriaValue")) != null) {+ List<Element> fieldElements = criteriaValueExpect.getState().findMatchedElementsByLabel("criteriaField", true);+ List<Element> operatorElements = criteriaValueExpect.getState().findMatchedElementsByLabel("operator", true);+ if (fieldElements.isEmpty() && operatorElements.size() == 1) {+ String operatorName = StringUtils.normalizeSpace(operatorElements.get(0).getMatchedText());+ int operator = WorkspaceQuery.getOperator(operatorName);+ if (operator == WorkspaceQueryLexer.CreatedBy)+ return SuggestionUtils.suggestUsers(matchWith);+ } else if (!fieldElements.isEmpty() && operatorElements.size() == 1) {+ String operatorName = StringUtils.normalizeSpace(operatorElements.get(0).getMatchedText());+ int operator = WorkspaceQuery.getOperator(operatorName);+ String fieldName = WorkspaceQuery.getValue(fieldElements.get(0).getMatchedText());+ try {+ WorkspaceQuery.checkField(fieldName, operator);+ switch (fieldName) {+ case Workspace.NAME_PROJECT:+ if (!matchWith.contains("*"))+ return SuggestionUtils.suggestProjectPaths(matchWith);+ else+ return null;+ case Workspace.NAME_BRANCH:+ if (!matchWith.contains("*"))+ return SuggestionUtils.suggestBranches(project, matchWith);+ else+ return null;+ case Workspace.NAME_SPEC:+ if (project != null && !matchWith.contains("*"))+ return SuggestionUtils.suggestWorkspaceSpecs(project, matchWith);+ else+ return null;+ case Workspace.NAME_CREATE_DATE:+ case Workspace.NAME_ACTIVE_DATE:+ List<InputSuggestion> suggestions = SuggestionUtils.suggest(DateUtils.RELAX_DATE_EXAMPLES, matchWith);+ return !suggestions.isEmpty() ? suggestions : null;+ case AbstractEntity.NAME_NUMBER:+ return SuggestionUtils.suggestWorkspaces(project, matchWith, InputAssistBehavior.MAX_SUGGESTIONS);+ default:+ return new ArrayList<>();+ }+ } catch (ExplicitException ignored) {+ }+ }+ }+ return new ArrayList<>();+ }++ @Override+ protected String getFencingDescription() {+ return _T("value should be quoted");+ }++ }.suggest(terminalExpect);+ } else if (spec.getRuleName().equals("Fuzzy")) {+ return new FenceAware(codeAssist.getGrammar(), '~', '~') {++ @Override+ protected List<InputSuggestion> match(String matchWith) {+ return null;+ }++ @Override+ protected String getFencingDescription() {+ return _T("enclose with ~ to query branch");+ }++ }.suggest(terminalExpect);+ }+ }+ return null;+ }++ @Override+ protected boolean isFuzzySuggestion(InputCompletion suggestion) {+ return suggestion.getLabel().startsWith("~")+ && suggestion.getLabel().endsWith("~");+ }++ @Override+ protected Optional<String> describe(ParseExpect parseExpect, String suggestedLiteral) {+ if (!withOrder && suggestedLiteral.equals(WorkspaceQuery.getRuleName(WorkspaceQueryLexer.OrderBy)))+ return null;++ if (suggestedLiteral.equals(",")) {+ if (parseExpect.findExpectByLabel("orderOperator") != null)+ return Optional.of(_T("add another order"));+ else+ return Optional.of(_T("or match another value"));+ }++ parseExpect = parseExpect.findExpectByLabel("operator");+ if (parseExpect != null) {+ List<Element> fieldElements = parseExpect.getState().findMatchedElementsByLabel("criteriaField", false);+ if (!fieldElements.isEmpty()) {+ String fieldName = WorkspaceQuery.getValue(fieldElements.iterator().next().getMatchedText());+ try {+ WorkspaceQuery.checkField(fieldName, WorkspaceQuery.getOperator(suggestedLiteral));+ } catch (ExplicitException e) {+ return null;+ }+ }+ }+ return super.describe(parseExpect, suggestedLiteral);+ }++ @Override+ protected List<String> getHints(TerminalExpect terminalExpect) {+ List<String> hints = new ArrayList<>();+ if (terminalExpect.getElementSpec() instanceof LexerRuleRefElementSpec) {+ LexerRuleRefElementSpec spec = (LexerRuleRefElementSpec) terminalExpect.getElementSpec();+ if ("criteriaValue".equals(spec.getLabel())) {+ List<Element> fieldElements = terminalExpect.getState().findMatchedElementsByLabel("criteriaField", true);+ if (!fieldElements.isEmpty()) {+ String fieldName = WorkspaceQuery.getValue(fieldElements.get(0).getMatchedText());+ if (fieldName.equals(Workspace.NAME_PROJECT)) {+ hints.add(_T("Use '**', '*' or '?' for <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>path wildcard match</a>"));+ } else if (fieldName.equals(Workspace.NAME_BRANCH)) {+ hints.add(_T("Use '*' for wildcard match"));+ } else if (fieldName.equals(Workspace.NAME_SPEC)) {+ hints.add(_T("Use '*' for wildcard match"));+ }+ }+ }+ }+ if (getSettingService().getAiSetting().getLiteModelSetting() == null)+ hints.add(_T("<a href='/~administration/settings/lite-ai-model' target='_blank'>Set up AI</a> to query with natural language</a>"));+ return hints;+ }++ @Override+ protected NaturalLanguageTranslator getNaturalLanguageTranslator() {+ var liteModel = getSettingService().getAiSetting().getLiteModel();+ if (liteModel != null) {+ return new NaturalLanguageTranslator(liteModel) {+ @Override+ public String getQueryDescription() {+ return QueryDescriptions.getWorkspaceQueryDescription();+ }+ };+ } else {+ return null;+ }+ }++ private SettingService getSettingService() {+ return OneDev.getInstance(SettingService.class);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/behavior/inputassist/ANTLRAssistBehavior.java b/server-core/src/main/java/io/onedev/server/web/behavior/inputassist/ANTLRAssistBehavior.javaindex 05eeb2f089..354fcf2e20 100644--- a/server-core/src/main/java/io/onedev/server/web/behavior/inputassist/ANTLRAssistBehavior.java+++ b/server-core/src/main/java/io/onedev/server/web/behavior/inputassist/ANTLRAssistBehavior.java@@ -222,5 +222,5 @@ public abstract class ANTLRAssistBehavior extends InputAssistBehavior {elsereturn Optional.of(_T("space"));}-+}diff --git a/server-core/src/main/java/io/onedev/server/web/behavior/inputassist/InputAssistBehavior.java b/server-core/src/main/java/io/onedev/server/web/behavior/inputassist/InputAssistBehavior.javaindex 719d23d2e7..a3559ab958 100644--- a/server-core/src/main/java/io/onedev/server/web/behavior/inputassist/InputAssistBehavior.java+++ b/server-core/src/main/java/io/onedev/server/web/behavior/inputassist/InputAssistBehavior.java@@ -331,7 +331,7 @@ public abstract class InputAssistBehavior extends AbstractPostAjaxBehavior {}protected boolean isSelectOnFocus() {- return true;+ return false;}}\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/component/branch/BranchLink.java b/server-core/src/main/java/io/onedev/server/web/component/branch/BranchLink.javaindex 91672eb7b4..29ec114044 100644--- a/server-core/src/main/java/io/onedev/server/web/component/branch/BranchLink.java+++ b/server-core/src/main/java/io/onedev/server/web/component/branch/BranchLink.java@@ -16,10 +16,17 @@ import io.onedev.server.web.page.project.blob.ProjectBlobPage;public class BranchLink extends ViewStateAwarePageLink<Void> {private final ProjectAndBranch projectAndBranch;-++ private final boolean neverShowFQN;+public BranchLink(String id, ProjectAndBranch projectAndBranch) {- super(id, ProjectBlobPage.class, paramsOf(projectAndBranch));+ this(id, projectAndBranch, false);+ }++ public BranchLink(String id, ProjectAndBranch projectAndBranch, boolean neverShowFQN) {+ super(id, ProjectBlobPage.class, paramsOf(projectAndBranch));this.projectAndBranch = projectAndBranch;+ this.neverShowFQN = neverShowFQN;}private static PageParameters paramsOf(ProjectAndBranch projectAndBranch) {@@ -46,14 +53,18 @@ public class BranchLink extends ViewStateAwarePageLink<Void> {@Overridepublic IModel<?> getBody() {String label;- if (getPage() instanceof ProjectPage) {- ProjectPage page = (ProjectPage) getPage();- if (page.getProject().equals(projectAndBranch.getProject()))- label = projectAndBranch.getBranch();- else- label = projectAndBranch.getFQN();+ if (neverShowFQN) {+ label = projectAndBranch.getBranch();} else {- label = projectAndBranch.getFQN();+ if (getPage() instanceof ProjectPage) {+ ProjectPage page = (ProjectPage) getPage();+ if (page.getProject().equals(projectAndBranch.getProject()))+ label = projectAndBranch.getBranch();+ else+ label = projectAndBranch.getFQN();+ } else {+ label = projectAndBranch.getFQN();+ }}return Model.of(label);}diff --git a/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildFilterPanel.html b/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildFilterPanel.htmlindex f0179e57c4..8d36d15625 100644--- a/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildFilterPanel.html+++ b/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildFilterPanel.html@@ -13,10 +13,6 @@<label class="control-label"><wicket:t>Submitted By</wicket:t></label><input wicket:id="submittedBy" type="hidden" class="form-control"></div>- <div class="form-group">- <label class="control-label"><wicket:t>Label</wicket:t></label>- <input wicket:id="label" type="hidden" class="form-control">- </div><div class="form-group"><label class="control-label"><wicket:t>Ran On Agent</wicket:t></label><input wicket:id="ranAgent" type="hidden" class="form-control">@@ -33,4 +29,8 @@<input wicket:id="submittedBefore" type="text" class="form-control"></div></div>+ <div class="form-group">+ <label class="control-label"><wicket:t>Label</wicket:t></label>+ <input wicket:id="label" type="hidden" class="form-control">+ </div></wicket:extend>\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildListPanel.html b/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildListPanel.htmlindex 77f43d92cf..c3a3f7f43d 100644--- a/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildListPanel.html+++ b/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildListPanel.html@@ -44,7 +44,7 @@<div class="d-flex flex-wrap row-gap-2"><a wicket:id="link" class="text-nowrap mr-2"><svg wicket:id="icon" class="icon mr-1"></svg>- <span wicket:id="summary"></span>+ <span wicket:id="caption"></span></a><span wicket:id="labels"></span></div>diff --git a/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildListPanel.javaindex bf34a94727..8d2fc21e15 100644--- a/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildListPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/build/list/BuildListPanel.java@@ -942,6 +942,11 @@ public abstract class BuildListPanel extends Panel {target.add(saveQueryLink);}+ @Override+ protected boolean isSelectOnFocus() {+ return true;+ }+});queryInput.add(new AjaxFormComponentUpdatingBehavior("clear") {@@ -1041,25 +1046,25 @@ public abstract class BuildListPanel extends Panel {@Overridepublic Iterator<? extends Build> iterator(long first, long count) {try {- var subject = SecurityUtils.getSubject();- return getBuildService().query(subject, getProject(), queryModel.getObject(),- true, (int) first, (int) count).iterator();+ var query = queryModel.getObject();+ if (query != null) {+ return getBuildService().query(SecurityUtils.getSubject(), getProject(), query,+ true, (int) first, (int) count).iterator();+ }} catch (ExplicitException e) {error(e.getMessage());- return new ArrayList<Build>().iterator();}+ return new ArrayList<Build>().iterator();}@Overridepublic long calcSize() {- BuildQuery query = queryModel.getObject();- if (query != null) {- try {- var subject = SecurityUtils.getSubject();- return getBuildService().count(subject, getProject(), query.getCriteria());- } catch (ExplicitException e) {- error(e.getMessage());- }+ try {+ BuildQuery query = queryModel.getObject();+ if (query != null)+ return getBuildService().count(SecurityUtils.getSubject(), getProject(), query.getCriteria());+ } catch (ExplicitException e) {+ error(e.getMessage());}return 0;}@@ -1126,11 +1131,11 @@ public abstract class BuildListPanel extends Panel {}}));- link.add(new Label("summary", new AbstractReadOnlyModel<String>() {+ link.add(new Label("caption", new AbstractReadOnlyModel<String>() {@Overridepublic String getObject() {- return rowModel.getObject().getSummary(getProject());+ return rowModel.getObject().getCaption(getProject());}}));diff --git a/server-core/src/main/java/io/onedev/server/web/component/build/log/BuildLogPanel.html b/server-core/src/main/java/io/onedev/server/web/component/build/log/BuildLogPanel.htmldeleted file mode 100644index f4ee09c60f..0000000000--- a/server-core/src/main/java/io/onedev/server/web/component/build/log/BuildLogPanel.html+++ /dev/null@@ -1,3 +0,0 @@-<wicket:panel>- <pre class="build-log flex-grow-1 text-break mb-0 overflow-auto font-size-sm"></pre>-</wicket:panel>\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/component/build/log/build-log.js b/server-core/src/main/java/io/onedev/server/web/component/build/log/build-log.jsdeleted file mode 100644index 0c51cfbd77..0000000000--- a/server-core/src/main/java/io/onedev/server/web/component/build/log/build-log.js+++ /dev/null@@ -1,57 +0,0 @@-onedev.server.buildLog = {- appendLogEntries: function(containerId, logEntries) {- var $buildLog = $("#" + containerId + ">.build-log");- // parent scrollbar jumps as we remove/add log entries in chrome. Let's restore it afterwards- $buildLog.parents().each(function() {- $(this).data("buildLogScrollLeft", $(this).scrollLeft());- $(this).data("buildLogScrollTop", $(this).scrollTop());- });- for (var i=0; i<logEntries.length; i++)- $buildLog.append(onedev.server.jobLogEntry.render(logEntries[i], true));-- var $entries = $buildLog.children(".log-entry");-- var maxNumOfEntries = $buildLog.data("maxNumOfEntries");- var numOfEntriesToRemove = $entries.length - maxNumOfEntries;- if (numOfEntriesToRemove > 0) {- $entries.slice(0, numOfEntriesToRemove).remove();- if ($buildLog.children(".too-many-entries").length == 0)- $buildLog.prepend("<h6 class='too-many-entries text-info'>Too many logs, displaying recent " + maxNumOfEntries + "</h6>")- }- if ($entries.length == 0) {- if ($buildLog.children(".no-entries").length == 0)- $buildLog.prepend("<h6 class='no-entries text-info'>No logs</h6>");- } else {- $buildLog.children(".no-entries").remove();- }- $buildLog.trigger("resized");- $buildLog.scrollTop($buildLog[0].scrollHeight);- $buildLog.parents().each(function() {- $(this).scrollLeft($(this).data("buildLogScrollLeft"));- $(this).scrollTop($(this).data("buildLogScrollTop"));- });- },- buildUpdated: function(containerId, paused) {- var $buildLog = $("#" + containerId + ">.build-log");- $buildLog.find(".script-paused").remove();- if (paused) {- var $paused = $("<div class='script-paused font-weight-bolder border rounded px-2 py-1 mt-2 border-warning text-warning'>Script execution paused</div>");- $buildLog.append($paused);- var resumeCallback = $buildLog.data("resumeCallback");- if (resumeCallback) {- var $resumeLink = $("<a class='ml-2'>Resume</a>");- $paused.append($resumeLink);- $resumeLink.click(resumeCallback);- }- $paused[0].scrollIntoViewIfNeeded();- }- },- onDomReady: function(containerId, logEntries, maxNumOfEntries, buildPaused, resumeCallback) {- var $buildLog = $("#" + containerId + ">.build-log");- $buildLog.data("resumeCallback", resumeCallback);- $buildLog.data("maxNumOfEntries", maxNumOfEntries);- onedev.server.buildLog.appendLogEntries(containerId, logEntries);- onedev.server.buildLog.buildUpdated(containerId, buildPaused);- }-}-diff --git a/server-core/src/main/java/io/onedev/server/web/component/commandpalette/BuildParam.java b/server-core/src/main/java/io/onedev/server/web/component/commandpalette/BuildParam.javaindex 0c27116648..10a99e9f14 100644--- a/server-core/src/main/java/io/onedev/server/web/component/commandpalette/BuildParam.java+++ b/server-core/src/main/java/io/onedev/server/web/component/commandpalette/BuildParam.java@@ -44,7 +44,7 @@ public class BuildParam extends ParamSegment {List<Build> builds = buildService.query(SecurityUtils.getSubject(), project, query, false, 0, count);for (Build build: builds)- suggestions.put(build.getSummary(project), String.valueOf(build.getNumber()));+ suggestions.put(build.getCaption(project), String.valueOf(build.getNumber()));return suggestions;}diff --git a/server-core/src/main/java/io/onedev/server/web/component/comment/CommentInput.java b/server-core/src/main/java/io/onedev/server/web/component/comment/CommentInput.javaindex 69f035ea5f..4008cd8d20 100644--- a/server-core/src/main/java/io/onedev/server/web/component/comment/CommentInput.java+++ b/server-core/src/main/java/io/onedev/server/web/component/comment/CommentInput.java@@ -11,6 +11,7 @@ import io.onedev.server.service.IssueService;import io.onedev.server.service.PullRequestService;import io.onedev.server.service.UserService;import io.onedev.server.model.Build;+import io.onedev.server.model.Workspace;import io.onedev.server.model.Issue;import io.onedev.server.model.Project;import io.onedev.server.model.PullRequest;@@ -23,6 +24,7 @@ import io.onedev.server.util.Similarities;import io.onedev.server.web.component.markdown.AtWhoReferenceSupport;import io.onedev.server.web.component.markdown.MarkdownEditor;import io.onedev.server.web.component.markdown.UserMentionSupport;+import io.onedev.server.workspace.WorkspaceService;public abstract class CommentInput extends MarkdownEditor {@@ -108,6 +110,11 @@ public abstract class CommentInput extends MarkdownEditor {public List<Build> queryBuilds(Project project, String query, int count) {return OneDev.getInstance(BuildService.class).query(SecurityUtils.getSubject(), project, query, count);}++ @Override+ public List<Workspace> queryWorkspaces(Project project, String query, int count) {+ return OneDev.getInstance(WorkspaceService.class).query(SecurityUtils.getSubject(), project, query, count);+ }};}diff --git a/server-core/src/main/java/io/onedev/server/web/component/diff/text/PlainTextDiffPanel.java b/server-core/src/main/java/io/onedev/server/web/component/diff/text/PlainTextDiffPanel.javaindex f3144bcdac..57af8c22e4 100644--- a/server-core/src/main/java/io/onedev/server/web/component/diff/text/PlainTextDiffPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/diff/text/PlainTextDiffPanel.java@@ -96,7 +96,7 @@ public class PlainTextDiffPanel extends Panel {private String renderDiffs() {boolean hasChanges = diffBlocks.stream().anyMatch(block -> block.getOperation() != Operation.EQUAL);if (!hasChanges) {- return "<div class='alert alert-notice alert-light-warning'>" + _T("Nothing changed yet") + "</div>";+ return "<div class='text-muted text-center p-4'>" + _T("Nothing changed yet") + "</div>";}StringBuilder builder = new StringBuilder();diff --git a/server-core/src/main/java/io/onedev/server/web/component/draw/DrawCardPanel.java b/server-core/src/main/java/io/onedev/server/web/component/draw/DrawCardPanel.javaindex 5718698fb4..49034ec186 100644--- a/server-core/src/main/java/io/onedev/server/web/component/draw/DrawCardPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/draw/DrawCardPanel.java@@ -7,8 +7,8 @@ import org.jspecify.annotations.Nullable;public abstract class DrawCardPanel extends DrawPanel {- public DrawCardPanel(AjaxRequestTarget target, Placement placement, @Nullable String width) {- super(target, placement, width);+ public DrawCardPanel(AjaxRequestTarget target, Placement placement) {+ super(target, placement);add(AttributeAppender.append("class", "draw-card"));}diff --git a/server-core/src/main/java/io/onedev/server/web/component/draw/DrawPanel.java b/server-core/src/main/java/io/onedev/server/web/component/draw/DrawPanel.javaindex d1fb4af4b7..c3a1edee22 100644--- a/server-core/src/main/java/io/onedev/server/web/component/draw/DrawPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/draw/DrawPanel.java@@ -1,7 +1,5 @@package io.onedev.server.web.component.draw;-import org.jspecify.annotations.Nullable;-import org.apache.wicket.ajax.AjaxRequestTarget;import org.apache.wicket.behavior.AttributeAppender;import org.apache.wicket.markup.head.CssHeaderItem;@@ -14,11 +12,9 @@ public abstract class DrawPanel extends FloatingPanel {public enum Placement {LEFT, RIGHT}- public DrawPanel(AjaxRequestTarget target, Placement placement, @Nullable String width) {+ public DrawPanel(AjaxRequestTarget target, Placement placement) {super(target, null, false, false, Animation.valueOf(placement.name()));add(AttributeAppender.append("class", "draw draw-" + placement.name().toLowerCase()));- if (width != null)- add(AttributeAppender.append("style", "width: " + width).setSeparator(";"));}@Overridediff --git a/server-core/src/main/java/io/onedev/server/web/component/entity/nav/EntityNavPanel.java b/server-core/src/main/java/io/onedev/server/web/component/entity/nav/EntityNavPanel.javaindex 2dda004d7b..6b759514c2 100644--- a/server-core/src/main/java/io/onedev/server/web/component/entity/nav/EntityNavPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/entity/nav/EntityNavPanel.java@@ -65,7 +65,7 @@ public abstract class EntityNavPanel<T extends AbstractEntity> extends Panel {super.onComponentTag(tag);if (getCursor() == null || getCursor().getOffset() <= 0)tag.put("disabled", "disabled");- tag.put("title", MessageFormat.format(_T("Previous {0}"), _T(entityName)));+ tag.put("data-tippy-content", MessageFormat.format(_T("Previous {0}"), _T(entityName)));}@Override@@ -100,7 +100,7 @@ public abstract class EntityNavPanel<T extends AbstractEntity> extends Panel {super.onComponentTag(tag);if (getCursor() == null || getCursor().getOffset() >= getCursor().getCount()-1)tag.put("disabled", "disabled");- tag.put("title", MessageFormat.format(_T("Next {0}"), _T(entityName)));+ tag.put("data-tippy-content", MessageFormat.format(_T("Next {0}"), _T(entityName)));}@Override@@ -130,9 +130,9 @@ public abstract class EntityNavPanel<T extends AbstractEntity> extends Panel {@Overridepublic String getObject() {if (getCursor() != null)- return _T(entityName) + " " + (getCursor().getOffset() + 1) + "/" + getCursor().getCount();+ return (getCursor().getOffset() + 1) + "/" + getCursor().getCount();else- return _T(entityName) + " 1/1";+ return "1/1";}}));diff --git a/server-core/src/main/java/io/onedev/server/web/component/fileview/FileViewPanel.html b/server-core/src/main/java/io/onedev/server/web/component/fileview/FileViewPanel.htmlnew file mode 100644index 0000000000..b7f2f793d7--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/fileview/FileViewPanel.html@@ -0,0 +1,4 @@+<wicket:panel>+ <div wicket:id="notice" class="h-100 d-flex flex-grow-1 align-items-center justify-content-center text-muted text-center"></div>+ <div wicket:id="code" class="file-view-code"></div>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/component/fileview/FileViewPanel.java b/server-core/src/main/java/io/onedev/server/web/component/fileview/FileViewPanel.javanew file mode 100644index 0000000000..64c03ccdaf--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/fileview/FileViewPanel.java@@ -0,0 +1,64 @@+package io.onedev.server.web.component.fileview;++import static io.onedev.server.web.translation.Translation._T;+import static org.unbescape.javascript.JavaScriptEscape.escapeJavaScript;++import org.apache.wicket.markup.head.IHeaderResponse;+import org.apache.wicket.markup.head.JavaScriptHeaderItem;+import org.apache.wicket.markup.head.OnDomReadyHeaderItem;+import org.apache.wicket.markup.html.WebMarkupContainer;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.panel.GenericPanel;+import org.apache.wicket.model.IModel;++import io.onedev.server.util.ContentDetector;+import io.onedev.server.util.FileData;++public class FileViewPanel extends GenericPanel<FileData> {++ private static final long serialVersionUID = 1L;++ private String fileContent;++ public FileViewPanel(String id, IModel<FileData> model) {+ super(id, model);+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ FileData fileData = getModelObject();++ if (fileData.isPartial()) {+ add(new Label("notice", _T("File is too large to be displayed")));+ add(new WebMarkupContainer("code").setVisible(false));+ } else if (ContentDetector.isBinary(fileData.getContent(), fileData.getName())) {+ add(new Label("notice", _T("File is binary")));+ add(new WebMarkupContainer("code").setVisible(false));+ } else {+ add(new WebMarkupContainer("notice").setVisible(false));+ fileContent = ContentDetector.convertToText(fileData.getContent(), fileData.getName());+ if (fileContent == null)+ fileContent = new String(fileData.getContent());+ add(new WebMarkupContainer("code"));+ }++ setOutputMarkupId(true);+ }++ @Override+ public void renderHead(IHeaderResponse response) {+ super.renderHead(response);++ FileData fileData = getModelObject();+ if (!fileData.isPartial() && !ContentDetector.isBinary(fileData.getContent(), fileData.getName())) {+ response.render(JavaScriptHeaderItem.forReference(new FileViewResourceReference()));+ String script = String.format("onedev.server.fileView.onDomReady('%s', '%s', '%s');",+ getMarkupId(), escapeJavaScript(fileData.getName()),+ escapeJavaScript(fileContent));+ response.render(OnDomReadyHeaderItem.forScript(script));+ }+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/fileview/FileViewResourceReference.java b/server-core/src/main/java/io/onedev/server/web/component/fileview/FileViewResourceReference.javanew file mode 100644index 0000000000..5efa884ab8--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/fileview/FileViewResourceReference.java@@ -0,0 +1,26 @@+package io.onedev.server.web.component.fileview;++import java.util.List;++import org.apache.wicket.markup.head.HeaderItem;+import org.apache.wicket.markup.head.JavaScriptHeaderItem;++import io.onedev.server.web.asset.codemirror.CodeMirrorResourceReference;+import io.onedev.server.web.page.base.BaseDependentResourceReference;++public class FileViewResourceReference extends BaseDependentResourceReference {++ private static final long serialVersionUID = 1L;++ public FileViewResourceReference() {+ super(FileViewResourceReference.class, "file-view.js");+ }++ @Override+ public List<HeaderItem> getDependencies() {+ List<HeaderItem> dependencies = super.getDependencies();+ dependencies.add(JavaScriptHeaderItem.forReference(new CodeMirrorResourceReference()));+ return dependencies;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/fileview/file-view.js b/server-core/src/main/java/io/onedev/server/web/component/fileview/file-view.jsnew file mode 100644index 0000000000..d4300e2d38--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/fileview/file-view.js@@ -0,0 +1,29 @@+onedev.server.fileView = {+ onDomReady: function(containerId, fileName, fileContent) {+ var $container = $("#" + containerId);+ var $code = $container.find(".file-view-code");++ $container.css({display: "flex", flexDirection: "column", padding: 0, overflow: "hidden"});+ $code.css({flexGrow: 1, minHeight: 0});++ var cm = CodeMirror($code[0], {+ value: fileContent,+ readOnly: true,+ theme: "eclipse",+ lineNumbers: true,+ matchBrackets: true,+ foldGutter: true,+ scrollbarStyle: "simple",+ gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]+ });++ cm.setSize(null, "100%");++ var hasConflicts = /^<{7}\s/m.test(fileContent);+ if (hasConflicts) {+ onedev.server.codemirror.setConflictAwareModeByFileName(cm, fileName);+ } else {+ onedev.server.codemirror.setModeByFileName(cm, fileName);+ }+ }+};diff --git a/server-core/src/main/java/io/onedev/server/web/component/issue/list/IssueListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/issue/list/IssueListPanel.javaindex 2f48264cf3..0a31f78b2a 100644--- a/server-core/src/main/java/io/onedev/server/web/component/issue/list/IssueListPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/issue/list/IssueListPanel.java@@ -467,6 +467,11 @@ public abstract class IssueListPanel extends Panel {target.add(saveQueryLink);}+ @Override+ protected boolean isSelectOnFocus() {+ return true;+ }+});queryInput.add(new AjaxFormComponentUpdatingBehavior("clear") {diff --git a/server-core/src/main/java/io/onedev/server/web/component/job/RunJobLink.java b/server-core/src/main/java/io/onedev/server/web/component/job/RunJobLink.javaindex 55bcb4c2c7..7a139d252d 100644--- a/server-core/src/main/java/io/onedev/server/web/component/job/RunJobLink.java+++ b/server-core/src/main/java/io/onedev/server/web/component/job/RunJobLink.java@@ -3,7 +3,6 @@ package io.onedev.server.web.component.job;import com.google.common.base.Preconditions;import com.google.common.collect.Lists;import com.google.common.collect.Sets;-import io.onedev.server.OneDev;import io.onedev.server.buildspec.BuildSpec;import io.onedev.server.buildspec.job.Job;import io.onedev.server.buildspec.param.ParamUtils;@@ -36,8 +35,16 @@ import java.lang.reflect.InvocationTargetException;import java.util.*;import java.util.stream.Collectors;+import javax.inject.Inject;+public abstract class RunJobLink extends AjaxLink<Void> implements JobAuthorizationContextAware {+ @Inject+ private CommitInfoService commitInfoService;++ @Inject+ private JobService jobService;+private final String refName;private final ObjectId commitId;@@ -63,7 +70,7 @@ public abstract class RunJobLink extends AjaxLink<Void> implements JobAuthorizattry {BuildSpec buildSpec = Preconditions.checkNotNull(getProject().getBuildSpec(commitId));- Collection<ObjectId> descendants = OneDev.getInstance(CommitInfoService.class)+ Collection<ObjectId> descendants = commitInfoService.getDescendants(getProject().getId(), Sets.newHashSet(commitId));descendants.add(commitId);@@ -108,7 +115,7 @@ public abstract class RunJobLink extends AjaxLink<Void> implements JobAuthorizatjob, populatedParamBean, job.getParamSpecMap().keySet());List<Build> builds = new ArrayList<>();for (String refName : selectedRefNames) {- builds.add(getJobService().submit(user, getProject(), commitId, job.getName(),+ builds.add(jobService.submit(user, getProject(), commitId, job.getName(),paramMap, refName, getPullRequest(), null, _T("Submitted manually")));}if (builds.size() == 1)@@ -119,7 +126,7 @@ public abstract class RunJobLink extends AjaxLink<Void> implements JobAuthorizatvar user = SecurityUtils.getUser();for (var build: builds) {if (build.isFinished())- getJobService().resubmit(user, build, _T("Rebuild manually"));+ jobService.resubmit(user, build, _T("Rebuild manually"));}}@@ -140,12 +147,12 @@ public abstract class RunJobLink extends AjaxLink<Void> implements JobAuthorizat};} else {- Build build = getJobService().submit(user, getProject(), commitId, job.getName(),+ Build build = jobService.submit(user, getProject(), commitId, job.getName(),new HashMap<>(), refNames.iterator().next(), getPullRequest(), null,_T("Submitted manually"));setResponsePage(BuildDashboardPage.class, BuildDashboardPage.paramsOf(build));if (build.isFinished())- getJobService().resubmit(SecurityUtils.getUser(), build, _T("Rebuild manually"));+ jobService.resubmit(SecurityUtils.getUser(), build, _T("Rebuild manually"));}} else {new MessageModal(target) {@@ -161,10 +168,6 @@ public abstract class RunJobLink extends AjaxLink<Void> implements JobAuthorizatComponentContext.pop();}}-- private JobService getJobService() {- return OneDev.getInstance(JobService.class);- }@Overrideprotected void onConfigure() {diff --git a/server-core/src/main/java/io/onedev/server/web/component/job/joblist/JobListPanel.html b/server-core/src/main/java/io/onedev/server/web/component/job/joblist/JobListPanel.htmlindex e90304642f..88931c4d69 100644--- a/server-core/src/main/java/io/onedev/server/web/component/job/joblist/JobListPanel.html+++ b/server-core/src/main/java/io/onedev/server/web/component/job/joblist/JobListPanel.html@@ -2,7 +2,7 @@<div class="job-list"><div wicket:id="jobs" class="job"><div class="head text-nowrap d-flex align-items-center px-3 py-2 bg-light border-top">- <a wicket:id="name" class="name d-flex align-items-center"><b wicket:id="label"></b></a>+ <a wicket:id="name" class="name d-flex align-items-center mr-auto"><b wicket:id="label"></b></a><a wicket:id="showInList" class="ml-2 d-flex align-items-center" t:data-tippy-content="Show in build list"><wicket:svg href="unordered-list" class="icon"></wicket:svg></a><a wicket:id="run" class="run ml-2 d-flex align-items-center" t:data-tippy-content="Run this job"><wicket:svg href="play" class="icon"></wicket:svg></a></div>diff --git a/server-core/src/main/java/io/onedev/server/web/component/job/joblist/JobListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/job/joblist/JobListPanel.javaindex 004a15fa73..50f5c36b96 100644--- a/server-core/src/main/java/io/onedev/server/web/component/job/joblist/JobListPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/job/joblist/JobListPanel.java@@ -7,6 +7,8 @@ import java.util.HashMap;import java.util.List;import java.util.Optional;+import javax.inject.Inject;+import org.apache.wicket.ajax.AjaxRequestTarget;import org.apache.wicket.markup.head.CssHeaderItem;import org.apache.wicket.markup.head.IHeaderResponse;@@ -23,7 +25,6 @@ import org.jspecify.annotations.Nullable;import com.google.common.collect.Sets;-import io.onedev.server.OneDev;import io.onedev.server.buildspec.job.Job;import io.onedev.server.model.Build;import io.onedev.server.model.Build.Status;@@ -41,6 +42,9 @@ import io.onedev.server.web.page.project.builds.ProjectBuildsPage;public abstract class JobListPanel extends Panel implements ProjectScopedCommitAware {+ @Inject+ private BuildService buildService;+private final ObjectId commitId;private final String refName;@@ -141,7 +145,6 @@ public abstract class JobListPanel extends Panel implements ProjectScopedCommitA@Overrideprotected List<Build> load() {- BuildService buildService = OneDev.getInstance(BuildService.class);List<Build> builds = new ArrayList<>(buildService.query(getProject(),commitId, job.getName(), refName, Optional.ofNullable(getPullRequest()),null, new HashMap<>()));diff --git a/server-core/src/main/java/io/onedev/server/web/component/logging/LogPanel.html b/server-core/src/main/java/io/onedev/server/web/component/logging/LogPanel.htmlnew file mode 100644index 0000000000..6918eb6e64--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/logging/LogPanel.html@@ -0,0 +1,3 @@+<wicket:panel>+ <pre class="log flex-grow-1 text-break mb-0 overflow-auto font-size-sm"></pre>+</wicket:panel>\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/component/build/log/BuildLogPanel.java b/server-core/src/main/java/io/onedev/server/web/component/logging/LogPanel.javasimilarity index 50%rename from server-core/src/main/java/io/onedev/server/web/component/build/log/BuildLogPanel.javarename to server-core/src/main/java/io/onedev/server/web/component/logging/LogPanel.javaindex 8ef56f4ea4..d2469c6318 100644--- a/server-core/src/main/java/io/onedev/server/web/component/build/log/BuildLogPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/logging/LogPanel.java@@ -1,43 +1,46 @@-package io.onedev.server.web.component.build.log;+package io.onedev.server.web.component.logging;++import static java.util.stream.Collectors.toList;++import java.util.Collection;+import java.util.List;++import javax.inject.Inject;++import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;+import org.apache.wicket.markup.head.IHeaderResponse;+import org.apache.wicket.markup.head.JavaScriptHeaderItem;+import org.apache.wicket.markup.head.OnDomReadyHeaderItem;+import org.apache.wicket.markup.html.panel.Panel;+import org.jspecify.annotations.Nullable;import com.fasterxml.jackson.core.JsonProcessingException;import com.fasterxml.jackson.databind.ObjectMapper;import com.google.common.collect.Sets;+import io.onedev.server.OneDev;import io.onedev.server.buildspec.job.log.JobLogEntryEx;-import io.onedev.server.job.JobService;-import io.onedev.server.job.log.LogService;-import io.onedev.server.job.log.LogSnippet;-import io.onedev.server.model.Build;-import io.onedev.server.model.Build.Status;-import io.onedev.server.security.SecurityUtils;+import io.onedev.server.logging.LogService;+import io.onedev.server.logging.LogSnippet;+import io.onedev.server.logging.LoggingSupport;import io.onedev.server.web.behavior.AbstractPostAjaxBehavior;import io.onedev.server.web.behavior.ChangeObserver;import io.onedev.server.web.page.base.BasePage;-import org.apache.wicket.ajax.AjaxRequestTarget;-import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;-import org.apache.wicket.markup.head.IHeaderResponse;-import org.apache.wicket.markup.head.JavaScriptHeaderItem;-import org.apache.wicket.markup.head.OnDomReadyHeaderItem;-import org.apache.wicket.markup.html.panel.GenericPanel;-import org.apache.wicket.model.IModel;--import java.util.Collection;-import java.util.List;--import static io.onedev.server.model.Build.getDetailChangeObservable;-import static java.util.stream.Collectors.toList;-public class BuildLogPanel extends GenericPanel<Build> {+public abstract class LogPanel extends Panel {private static final int MAX_LOG_ENTRIES = 1000;+ @Inject+ private LogService logService;+private int nextOffset;private AbstractPostAjaxBehavior resumeBehavior;- public BuildLogPanel(String id, IModel<Build> model) {- super(id, model);+ public LogPanel(String id) {+ super(id);}@Override@@ -47,13 +50,12 @@ public class BuildLogPanel extends GenericPanel<Build> {add(new ChangeObserver() {private void appendRecentLogEntries(IPartialPageRequestHandler handler) {- List<JobLogEntryEx> logEntries = getLogService().readLogEntries(- getBuild().getProject().getId(), getBuild().getNumber(), nextOffset, 0);+ List<JobLogEntryEx> logEntries = logService.readLogEntries(getLoggingSupport(), nextOffset, 0);if (!logEntries.isEmpty()) {nextOffset += logEntries.size();- String script = String.format("onedev.server.buildLog.appendLogEntries('%s', %s);",+ String script = String.format("onedev.server.log.appendLogEntries('%s', %s);",getMarkupId(), asJSON(logEntries));handler.appendJavaScript(script);}@@ -66,47 +68,45 @@ public class BuildLogPanel extends GenericPanel<Build> {@Overridepublic Collection<String> findObservables() {- return Sets.newHashSet(Build.getLogChangeObservable(getBuild().getId()));+ return Sets.newHashSet(getLoggingSupport().getChangeObservable());}});- add(new ChangeObserver() {-- @Override- public void onObservableChanged(IPartialPageRequestHandler handler, Collection<String> changedObservables) {- handler.appendJavaScript(String.format(- "onedev.server.buildLog.buildUpdated('%s', %b)",- getMarkupId(), getBuild().isPaused()));- }-- @Override- public Collection<String> findObservables() {- return Sets.newHashSet(getDetailChangeObservable(getBuild().getId()));- }-- });-- if (SecurityUtils.canRunJob(getBuild().getProject(), getBuild().getJobName())) {- resumeBehavior = new AbstractPostAjaxBehavior() {+ if (getPauseSupport() != null) {+ add(new ChangeObserver() {++ @Override+ public void onObservableChanged(IPartialPageRequestHandler handler, Collection<String> changedObservables) {+ handler.appendJavaScript(String.format(+ "onedev.server.log.pauseUpdated('%s', %b)",+ getMarkupId(), getPauseSupport().isPaused()));+ }@Override- protected void respond(AjaxRequestTarget target) {- OneDev.getInstance(JobService.class).resume(getBuild());- BasePage page = (BasePage) getPage();- page.notifyObservableChange(target, getDetailChangeObservable(getBuild().getId()));+ public Collection<String> findObservables() {+ return Sets.newHashSet(getPauseSupport().getStatusChangeObservable());}- };- add(resumeBehavior);+ });++ if (getPauseSupport().canResume()) {+ resumeBehavior = new AbstractPostAjaxBehavior() {++ @Override+ protected void respond(AjaxRequestTarget target) {+ getPauseSupport().resume();+ BasePage page = (BasePage) getPage();+ page.notifyObservableChange(target, getPauseSupport().getStatusChangeObservable());+ }++ };+ add(resumeBehavior);+ }}-+setOutputMarkupId(true);}-- private LogService getLogService() {- return OneDev.getInstance(LogService.class);- }private String asJSON(List<JobLogEntryEx> entries) {entries = entries.stream().map(JobLogEntryEx::transformEmojis).collect(toList());@@ -121,10 +121,9 @@ public class BuildLogPanel extends GenericPanel<Build> {public void renderHead(IHeaderResponse response) {super.renderHead(response);- response.render(JavaScriptHeaderItem.forReference(new BuildLogResourceReference()));+ response.render(JavaScriptHeaderItem.forReference(new LogResourceReference()));- LogSnippet snippet = getLogService().readLogSnippetReversely(- getBuild().getProject().getId(), getBuild().getNumber(), MAX_LOG_ENTRIES+1);+ LogSnippet snippet = logService.readLogSnippetReversely(getLoggingSupport(), MAX_LOG_ENTRIES+1);nextOffset = snippet.offset + snippet.entries.size();@@ -134,13 +133,15 @@ public class BuildLogPanel extends GenericPanel<Build> {elseresumeCallback = "undefined";response.render(OnDomReadyHeaderItem.forScript(String.format(- "onedev.server.buildLog.onDomReady('%s', %s, %d, %b, %s);",+ "onedev.server.log.onDomReady('%s', %s, %d, %b, %s);",getMarkupId(), asJSON(snippet.entries), MAX_LOG_ENTRIES,- getBuild().getStatus() == Status.RUNNING && getBuild().isPaused(),+ getPauseSupport() != null && getPauseSupport().isPaused(),resumeCallback)));}- private Build getBuild() {- return getModelObject();- }+ protected abstract LoggingSupport getLoggingSupport();++ @Nullable+ protected abstract PauseSupport getPauseSupport();+}diff --git a/server-core/src/main/java/io/onedev/server/web/component/build/log/BuildLogResourceReference.java b/server-core/src/main/java/io/onedev/server/web/component/logging/LogResourceReference.javasimilarity index 73%rename from server-core/src/main/java/io/onedev/server/web/component/build/log/BuildLogResourceReference.javarename to server-core/src/main/java/io/onedev/server/web/component/logging/LogResourceReference.javaindex e97e249f44..b4dbb97242 100644--- a/server-core/src/main/java/io/onedev/server/web/component/build/log/BuildLogResourceReference.java+++ b/server-core/src/main/java/io/onedev/server/web/component/logging/LogResourceReference.java@@ -1,4 +1,4 @@-package io.onedev.server.web.component.build.log;+package io.onedev.server.web.component.logging;import java.util.List;@@ -10,12 +10,12 @@ import io.onedev.server.web.asset.joblogentry.JobLogEntryResourceReference;import io.onedev.server.web.page.base.BaseDependentCssResourceReference;import io.onedev.server.web.page.base.BaseDependentResourceReference;-public class BuildLogResourceReference extends BaseDependentResourceReference {+public class LogResourceReference extends BaseDependentResourceReference {private static final long serialVersionUID = 1L;- public BuildLogResourceReference() {- super(BuildLogResourceReference.class, "build-log.js");+ public LogResourceReference() {+ super(LogResourceReference.class, "log.js");}@Override@@ -23,7 +23,7 @@ public class BuildLogResourceReference extends BaseDependentResourceReference {List<HeaderItem> dependencies = super.getDependencies();dependencies.add(JavaScriptHeaderItem.forReference(new JobLogEntryResourceReference()));dependencies.add(CssHeaderItem.forReference(new BaseDependentCssResourceReference(- BuildLogResourceReference.class, "build-log.css")));+ LogResourceReference.class, "log.css")));return dependencies;}diff --git a/server-core/src/main/java/io/onedev/server/web/component/logging/PauseSupport.java b/server-core/src/main/java/io/onedev/server/web/component/logging/PauseSupport.javanew file mode 100644index 0000000000..a72f3c20c0--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/logging/PauseSupport.java@@ -0,0 +1,13 @@+package io.onedev.server.web.component.logging;++public interface PauseSupport {++ boolean isPaused();++ boolean canResume();++ void resume();++ String getStatusChangeObservable();++}\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/component/build/log/build-log.css b/server-core/src/main/java/io/onedev/server/web/component/logging/log.csssimilarity index 83%rename from server-core/src/main/java/io/onedev/server/web/component/build/log/build-log.cssrename to server-core/src/main/java/io/onedev/server/web/component/logging/log.cssindex 8cc82740c2..1d712705ff 100644--- a/server-core/src/main/java/io/onedev/server/web/component/build/log/build-log.css+++ b/server-core/src/main/java/io/onedev/server/web/component/logging/log.css@@ -1,4 +1,4 @@-.build-log {+.log {position: absolute;top: 0;left: 0;diff --git a/server-core/src/main/java/io/onedev/server/web/component/logging/log.js b/server-core/src/main/java/io/onedev/server/web/component/logging/log.jsnew file mode 100644index 0000000000..d78f1757b1--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/logging/log.js@@ -0,0 +1,58 @@+onedev.server.log = {+ appendLogEntries: function(containerId, logEntries) {+ var $log = $("#" + containerId + ">.log");+ // parent scrollbar jumps as we remove/add log entries in chrome. Let's restore it afterwards+ $log.parents().each(function() {+ $(this).data("logScrollLeft", $(this).scrollLeft());+ $(this).data("logScrollTop", $(this).scrollTop());+ });+ for (var i=0; i<logEntries.length; i++)+ $log.append(onedev.server.jobLogEntry.render(logEntries[i], true));++ var $entries = $log.children(".log-entry");++ var maxNumOfEntries = $log.data("maxNumOfEntries");+ var numOfEntriesToRemove = $entries.length - maxNumOfEntries;+ if (numOfEntriesToRemove > 0) {+ $entries.slice(0, numOfEntriesToRemove).remove();+ if ($log.children(".too-many-entries").length == 0)+ $log.prepend("<h6 class='too-many-entries text-info'>Too many logs, displaying recent " + maxNumOfEntries + "</h6>")+ }+ if ($entries.length == 0) {+ if ($log.children(".no-entries").length == 0)+ $log.prepend("<h6 class='no-entries text-info'>No logs</h6>");+ } else {+ $log.children(".no-entries").remove();+ }+ $log.trigger("resized");+ $log.scrollTop($log[0].scrollHeight);+ $log.parents().each(function() {+ $(this).scrollLeft($(this).data("logScrollLeft"));+ $(this).scrollTop($(this).data("logScrollTop"));+ });+ },+ pauseUpdated: function(containerId, paused) {+ var $log = $("#" + containerId + ">.log");+ $log.find(".script-paused").remove();+ if (paused) {+ var $paused = $("<div class='script-paused font-weight-bolder border rounded px-2 py-1 mt-2 border-warning text-warning'>Execution paused</div>");+ $log.append($paused);+ var resumeCallback = $log.data("resumeCallback");+ if (resumeCallback) {+ var $resumeLink = $("<a class='ml-2'>Resume</a>");+ $paused.append($resumeLink);+ $resumeLink.click(resumeCallback);+ }+ $paused[0].scrollIntoViewIfNeeded();+ }+ },+ onDomReady: function(containerId, logEntries, maxNumOfEntries, paused, resumeCallback) {+ var $log = $("#" + containerId + ">.log");+ $log.data("resumeCallback", resumeCallback);+ $log.data("maxNumOfEntries", maxNumOfEntries);+ onedev.server.log.appendLogEntries(containerId, logEntries);+ onedev.server.log.pauseUpdated(containerId, paused);+ }++}+diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/AtWhoReferenceSupport.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/AtWhoReferenceSupport.javaindex 48e6dffc07..1c505325ac 100644--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/AtWhoReferenceSupport.java+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/AtWhoReferenceSupport.java@@ -1,6 +1,7 @@package io.onedev.server.web.component.markdown;import io.onedev.server.model.Build;+import io.onedev.server.model.Workspace;import io.onedev.server.model.Issue;import io.onedev.server.model.Project;import io.onedev.server.model.PullRequest;@@ -17,5 +18,7 @@ public interface AtWhoReferenceSupport extends Serializable {List<Issue> queryIssues(Project project, String query, int count);List<Build> queryBuilds(Project project, String query, int count);++ List<Workspace> queryWorkspaces(Project project, String query, int count);}diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/JavascriptTranslations.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/JavascriptTranslations.javaindex 80bb706a48..e11f5dabee 100644--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/JavascriptTranslations.java+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/JavascriptTranslations.java@@ -32,6 +32,7 @@ public class JavascriptTranslations {map.put("pull-request-not-exist-or-access-denied", _T("Pull request not exist or access denied"));map.put("build-not-exist-or-access-denied", _T("Build not exist or access denied"));map.put("commit-not-exist-or-access-denied", _T("Commit not exist or access denied"));+ map.put("workspace-not-exist-or-access-denied", _T("Dev session not exist or access denied"));map.put("enter-description-here", _T("Enter description here"));return OneDev.getInstance(ObjectMapper.class).writeValueAsString(map);diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.html b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.htmlindex f25df6e24c..38e3745444 100644--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.html+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.html@@ -65,6 +65,7 @@<a wicket:id="issue" class="dropdown-item do-reference"><wicket:svg href="bug" class="icon mr-1"></wicket:svg> <wicket:t>Reference Issue</wicket:t></a><a wicket:id="pullRequest" class="dropdown-item do-reference" data-type="pr"><wicket:svg href="pull-request" class="icon mr-1"></wicket:svg> <wicket:t>Reference Pull Request</wicket:t></a><a wicket:id="build" class="dropdown-item do-reference" data-type="build"><wicket:svg href="play-circle" class="icon mr-1"></wicket:svg> <wicket:t>Reference Build</wicket:t></a>+ <a wicket:id="workspace" class="dropdown-item do-reference" data-type="workspace"><wicket:svg href="terminal" class="icon mr-1"></wicket:svg> <wicket:t>Reference Workspace</wicket:t></a></wicket:fragment><wicket:fragment wicket:id="actionMenuFrag"><a class="dropdown-item do-bold"><wicket:svg href="bold" class="icon mr-1"></wicket:svg> <wicket:t>Bold</wicket:t></a>diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.javaindex 1b07a25d87..b913ecadda 100644--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java@@ -59,6 +59,7 @@ import io.onedev.server.attachment.AttachmentSupport;import io.onedev.server.service.ProjectService;import io.onedev.server.markdown.MarkdownService;import io.onedev.server.model.Build;+import io.onedev.server.model.Workspace;import io.onedev.server.model.Issue;import io.onedev.server.model.Project;import io.onedev.server.model.PullRequest;@@ -224,7 +225,7 @@ public class MarkdownEditor extends FormComponentPanel<String> {return fragment;}- }.add(AttributeAppender.append("data-tippy-content", "Reference issue, build, or pull request")).setVisible(referenceSupport != null));+ }.add(AttributeAppender.append("data-tippy-content", "Reference issue, build, pull request, or workspace")).setVisible(referenceSupport != null));container.add(new DropdownLink("actionMenuTrigger") {@@ -480,6 +481,16 @@ public class MarkdownEditor extends FormComponentPanel<String> {referenceMap.put("searchKey", build.getNumber() + " " + StringUtils.deleteWhitespace(title));referenceList.add(referenceMap);}+ } else if ("workspace".equals(type)) {+ for (Workspace workspace: referenceSupport.queryWorkspaces(project, query, ATWHO_LIMIT)) {+ Map<String, String> referenceMap = new HashMap<>();+ referenceMap.put("type", "workspace");+ referenceMap.put("reference", workspace.getReference().toString(currentProject));+ String title = workspace.getUser().getDisplayName() + " on " + workspace.getBranch() + " for " + workspace.getSpecName();+ referenceMap.put("title", title);+ referenceMap.put("searchKey", workspace.getNumber() + " " + StringUtils.deleteWhitespace(title));+ referenceList.add(referenceMap);+ }}}@@ -571,16 +582,19 @@ public class MarkdownEditor extends FormComponentPanel<String> {var issueItem = new WebMarkupContainer("issue");var pullRequestItem = new WebMarkupContainer("pullRequest");var buildItem = new WebMarkupContainer("build");+ var workspaceItem = new WebMarkupContainer("workspace");var projectKey = referenceSupport.getCurrentProject().getKey();if (projectKey != null) {var keyAppender = AttributeAppender.append("data-key", projectKey);issueItem.add(keyAppender);pullRequestItem.add(keyAppender);buildItem.add(keyAppender);+ workspaceItem.add(keyAppender);}fragment.add(issueItem);fragment.add(pullRequestItem);fragment.add(buildItem);+ fragment.add(workspaceItem);}@Overridediff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownViewer.java b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownViewer.javaindex ae8bee987e..0045723aa9 100644--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownViewer.java+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownViewer.java@@ -28,6 +28,7 @@ import org.unbescape.javascript.JavaScriptEscape;import io.onedev.commons.utils.StringUtils;import io.onedev.server.entityreference.BuildReference;+import io.onedev.server.entityreference.WorkspaceReference;import io.onedev.server.entityreference.EntityReference;import io.onedev.server.entityreference.IssueReference;import io.onedev.server.entityreference.PullRequestReference;@@ -51,6 +52,7 @@ import io.onedev.server.web.component.build.status.BuildStatusIcon;import io.onedev.server.web.component.svg.SpriteImage;import io.onedev.server.web.page.project.ProjectPage;import io.onedev.server.web.page.project.blob.render.BlobRenderContext;+import io.onedev.server.workspace.WorkspaceService;public class MarkdownViewer extends GenericPanel<String> {@@ -97,6 +99,9 @@ public class MarkdownViewer extends GenericPanel<String> {@Injectprivate ProjectService projectService;++ @Inject+ private WorkspaceService workspaceService;private final IModel<String> renderedModel = new LoadableDetachableModel<String>() {@@ -301,8 +306,20 @@ public class MarkdownViewer extends GenericPanel<String> {target.appendJavaScript("onedev.server.markdown.renderCommitTooltip();");}break;- default:- throw new RuntimeException("Unrecognized reference type: " + referenceType);+ case "workspace":+ var workspaceRef = WorkspaceReference.of(referenceId, null);+ var workspace = workspaceService.find(workspaceRef.getProject(), workspaceRef.getNumber());+ if (workspace != null && SecurityUtils.canReadCode(workspace.getProject())) {+ String title = workspace.getUser().getDisplayName() + " on " + workspace.getBranch() + " for " + workspace.getSpecName() + " (" + workspace.getStatus().name() + ")";+ String script = String.format("onedev.server.markdown.renderWorkspaceTooltip('%s');",+ JavaScriptEscape.escapeJavaScript(title));+ target.appendJavaScript(script);+ } else {+ target.appendJavaScript("onedev.server.markdown.renderWorkspaceTooltip();");+ }+ break;+ default:+ throw new RuntimeException("Unrecognized reference type: " + referenceType);}}diff --git a/server-core/src/main/java/io/onedev/server/web/component/markdown/markdown.js b/server-core/src/main/java/io/onedev/server/web/component/markdown/markdown.jsindex bf0ab93f31..af5e9b0422 100644--- a/server-core/src/main/java/io/onedev/server/web/component/markdown/markdown.js+++ b/server-core/src/main/java/io/onedev/server/web/component/markdown/markdown.js@@ -512,17 +512,15 @@ onedev.server.markdown = {function matchReference(atChar) {var input = $input.val().substring(0, $input.caret());var match;- if (atChar === '#')- match = new RegExp("(^|\\W+)((?<type>pull\\s*request|pr|issue|build)\\s+)?(?<project>" + projectPathPattern + ")?#(?<query>\\S*)$", 'gi').exec(input);- else- match = new RegExp("(^|\\W+)((?<type>pull\\s*request|pr|issue|build)\\s+)?(?<project>" + projectKeyPattern + ")-(?<query>\\S*)$", 'gi').exec(input);+ if (atChar === '#')+ match = new RegExp("(^|\\W+)((?<type>pull\\s*request|pr|issue|build|workspace)\\s+)?(?<project>" + projectPathPattern + ")?#(?<query>\\S*)$", 'gi').exec(input);+ else+ match = new RegExp("(^|\\W+)((?<type>pull\\s*request|pr|issue|build|workspace)\\s+)?(?<project>" + projectKeyPattern + ")-(?<query>\\S*)$", 'gi').exec(input);if (match) {var index = match.index + match[1].length;if (match[2])index += match[2].length;var type = match.groups.type;- if (type)- type = type.replace(/\s+/g, '').toLowerCase();return {type: type,project: match.groups.project,@@ -1211,6 +1209,8 @@ onedev.server.markdown = {referenceType = "user";} else if ($reference.hasClass("commit")) {referenceType = "commit";+ } else if ($reference.hasClass("workspace")) {+ referenceType = "workspace";}if (referenceType) {var $tooltip = $("<div id='reference-tooltip'>" + onedev.server.markdown.translations["loading"] + "</div>");@@ -1278,6 +1278,16 @@ onedev.server.markdown = {}$tooltip.align({placement: $tooltip.data("alignment"), target: {element: $tooltip.data("trigger")}});},+ renderWorkspaceTooltip: function(title) {+ var $tooltip = $("#reference-tooltip");+ if (title) {+ $tooltip.empty().append("<span class='title'></span>");+ $tooltip.find(".title").text(title);+ } else {+ $tooltip.empty().append("<i>" + onedev.server.markdown.translations["workspace-not-exist-or-access-denied"] + "</i>");+ }+ $tooltip.align({placement: $tooltip.data("alignment"), target: {element: $tooltip.data("trigger")}});+ },renderUserTooltip: function(avatarUrl, name) {var $tooltip = $("#reference-tooltip");$tooltip.empty().append("" +diff --git a/server-core/src/main/java/io/onedev/server/web/component/pack/list/PackFilterPanel.html b/server-core/src/main/java/io/onedev/server/web/component/pack/list/PackFilterPanel.htmlindex 291dcbc889..be5f33de9b 100644--- a/server-core/src/main/java/io/onedev/server/web/component/pack/list/PackFilterPanel.html+++ b/server-core/src/main/java/io/onedev/server/web/component/pack/list/PackFilterPanel.html@@ -3,10 +3,6 @@<label class="control-label"><wicket:t>Type</wicket:t></label><input wicket:id="type" type="hidden" class="form-control"></div>- <div class="form-group">- <label class="control-label"><wicket:t>Label</wicket:t></label>- <input wicket:id="label" type="hidden" class="form-control">- </div><div class="form-group"><label class="control-label"><wicket:t>Published After</wicket:t></label><div class="clearable-wrapper">@@ -27,4 +23,8 @@<label class="control-label"><wicket:t>Published By User</wicket:t></label><input wicket:id="publishedByUser" type="hidden" class="form-control"></div>+ <div class="form-group">+ <label class="control-label"><wicket:t>Label</wicket:t></label>+ <input wicket:id="label" type="hidden" class="form-control">+ </div></wicket:extend>\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/component/pack/list/PackListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/pack/list/PackListPanel.javaindex c42299664b..6e02a18c0a 100644--- a/server-core/src/main/java/io/onedev/server/web/component/pack/list/PackListPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/pack/list/PackListPanel.java@@ -516,6 +516,11 @@ public abstract class PackListPanel extends Panel {target.add(saveQueryLink);}+ @Override+ protected boolean isSelectOnFocus() {+ return true;+ }+});queryInput.add(new AjaxFormComponentUpdatingBehavior("clear") {@@ -562,23 +567,25 @@ public abstract class PackListPanel extends Panel {@Overridepublic Iterator<? extends Pack> iterator(long first, long count) {try {- return getPackService().query(SecurityUtils.getSubject(), getProject(), queryModel.getObject(),- true, (int) first, (int) count).iterator();+ var query = queryModel.getObject();+ if (query != null) {+ return getPackService().query(SecurityUtils.getSubject(), getProject(), query,+ true, (int) first, (int) count).iterator();+ }} catch (ExplicitException e) {error(e.getMessage());- return new ArrayList<Pack>().iterator();}+ return new ArrayList<Pack>().iterator();}@Overridepublic long calcSize() {- PackQuery query = queryModel.getObject();- if (query != null) {- try {+ try {+ PackQuery query = queryModel.getObject();+ if (query != null)return getPackService().count(SecurityUtils.getSubject(), getProject(), query.getCriteria());- } catch (ExplicitException e) {- error(e.getMessage());- }+ } catch (ExplicitException e) {+ error(e.getMessage());}return 0;}diff --git a/server-core/src/main/java/io/onedev/server/web/component/project/forkoption/ForkOptionPanel.java b/server-core/src/main/java/io/onedev/server/web/component/project/forkoption/ForkOptionPanel.javaindex ac3a0be239..93acbab214 100644--- a/server-core/src/main/java/io/onedev/server/web/component/project/forkoption/ForkOptionPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/project/forkoption/ForkOptionPanel.java@@ -142,6 +142,7 @@ public abstract class ForkOptionPanel extends Panel {newProject.getBuildSetting().setNamedQueries(getProject().getBuildSetting().getNamedQueries());newProject.setPackSetting(getProject().getPackSetting());newProject.setPullRequestSetting(getProject().getPullRequestSetting());+ newProject.setWorkspaceSetting(getProject().getWorkspaceSetting());newProject.setNamedCommitQueries(getProject().getNamedCommitQueries());newProject.setIssueSetting(getProject().getIssueSetting());newProject.setNamedCodeCommentQueries(getProject().getNamedCodeCommentQueries());diff --git a/server-core/src/main/java/io/onedev/server/web/component/project/info/ProjectInfoPanel.java b/server-core/src/main/java/io/onedev/server/web/component/project/info/ProjectInfoPanel.javaindex aef2c74f53..2d1790a45c 100644--- a/server-core/src/main/java/io/onedev/server/web/component/project/info/ProjectInfoPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/project/info/ProjectInfoPanel.java@@ -217,7 +217,7 @@ public abstract class ProjectInfoPanel extends Panel {getClusterService().submitToServer(server, () -> {try {getProjectService().requestToSyncReplica(projectId, activeServer);- } catch (Exception e) {+ } catch (Throwable e) {logger.error(MessageFormat.format("Error requestig to sync replica of project with id \"{0}\"", projectId), e);}return null;diff --git a/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectFilterPanel.html b/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectFilterPanel.htmlindex 7da8edb33f..b8692bd2e1 100644--- a/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectFilterPanel.html+++ b/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectFilterPanel.html@@ -27,10 +27,6 @@<label class="control-label"><wicket:t>Ownered By</wicket:t></label><input wicket:id="ownedBy" type="hidden" class="form-control"></div>- <div class="form-group">- <label class="control-label"><wicket:t>Label</wicket:t></label>- <input wicket:id="label" type="hidden" class="form-control">- </div><div class="form-group"><label class="control-label"><wicket:t>Active Since</wicket:t></label><div class="clearable-wrapper">@@ -43,4 +39,8 @@<input wicket:id="notActiveSince" type="text" class="form-control"></div></div>+ <div class="form-group">+ <label class="control-label"><wicket:t>Label</wicket:t></label>+ <input wicket:id="label" type="hidden" class="form-control">+ </div></wicket:extend>\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.html b/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.htmlindex 668c77d6d3..167772de69 100644--- a/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.html+++ b/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.html@@ -51,6 +51,7 @@<div class="d-flex flex-wrap project-summary"><div wicket:id="codeStats" class="code-stats mt-2 d-flex align-items-center flex-wrap mr-3"></div><div wicket:id="pullRequestStats" class="pull-request-stats mt-2 d-flex align-items-center flex-wrap"></div>+ <div wicket:id="workspaceStats" class="workspace-stats mt-2 d-flex align-items-center flex-wrap mr-3"></div></div><div class="d-flex flex-wrap project-summary"><div wicket:id="issueStats" class="issue-stats mt-2 d-flex align-items-center flex-wrap mr-3"></div>diff --git a/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.javaindex 61fa688585..a0e5869108 100644--- a/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/project/list/ProjectListPanel.java@@ -15,6 +15,8 @@ import java.util.List;import java.util.Map;import java.util.Objects;+import javax.inject.Inject;+import org.apache.commons.lang3.StringUtils;import org.apache.wicket.Component;import org.apache.wicket.Session;@@ -58,6 +60,7 @@ import io.onedev.server.imports.ProjectImporterContribution;import io.onedev.server.model.Build;import io.onedev.server.model.Project;import io.onedev.server.model.PullRequest;+import io.onedev.server.model.Workspace;import io.onedev.server.model.support.administration.GlobalIssueSetting;import io.onedev.server.search.entity.EntityQuery;import io.onedev.server.search.entity.EntitySort;@@ -74,10 +77,12 @@ import io.onedev.server.service.PackService;import io.onedev.server.service.ProjectService;import io.onedev.server.service.PullRequestService;import io.onedev.server.service.SettingService;+import io.onedev.server.workspace.WorkspaceService;import io.onedev.server.util.ProjectBuildStatusStat;import io.onedev.server.util.ProjectIssueStateStat;import io.onedev.server.util.ProjectPackTypeStat;import io.onedev.server.util.ProjectPullRequestStatusStat;+import io.onedev.server.util.ProjectWorkspaceStatusStat;import io.onedev.server.util.facade.ProjectFacade;import io.onedev.server.web.WebConstants;import io.onedev.server.web.WebSession;@@ -100,6 +105,7 @@ import io.onedev.server.web.component.project.stats.code.CodeStatsPanel;import io.onedev.server.web.component.project.stats.issue.IssueStatsPanel;import io.onedev.server.web.component.project.stats.pack.PackStatsPanel;import io.onedev.server.web.component.project.stats.pullrequest.PullRequestStatsPanel;+import io.onedev.server.web.component.project.stats.workspace.WorkspaceStatsPanel;import io.onedev.server.web.component.savedquery.SavedQueriesClosed;import io.onedev.server.web.component.savedquery.SavedQueriesOpened;import io.onedev.server.web.component.sortedit.SortEditPanel;@@ -121,6 +127,30 @@ public class ProjectListPanel extends Panel {private final int expectedCount;+ @Inject+ private ProjectService projectService;++ @Inject+ private AuditService auditService;++ @Inject+ private IssueService issueService;++ @Inject+ private BuildService buildService;++ @Inject+ private PackService packService;++ @Inject+ private PullRequestService pullRequestService;++ @Inject+ private WorkspaceService workspaceService;++ @Inject+ private SettingService settingService;+private final IModel<ProjectQuery> queryModel = new LoadableDetachableModel<>() {@Override@@ -141,7 +171,7 @@ public class ProjectListPanel extends Panel {List<Project> projects = new ArrayList<>();for (Component row : (WebMarkupContainer) projectsTable.get("body").get("rows"))projects.add((Project) row.getDefaultModelObject());- return OneDev.getInstance(IssueService.class).queryStateStats(SecurityUtils.getSubject(), projects);+ return issueService.queryStateStats(SecurityUtils.getSubject(), projects);}};@@ -154,7 +184,7 @@ public class ProjectListPanel extends Panel {List<Project> projects = new ArrayList<>();for (Component row : (WebMarkupContainer) projectsTable.get("body").get("rows"))projects.add((Project) row.getDefaultModelObject());- return OneDev.getInstance(BuildService.class).queryStatusStats(projects);+ return buildService.queryStatusStats(projects);}};@@ -167,7 +197,7 @@ public class ProjectListPanel extends Panel {List<Project> projects = new ArrayList<>();for (Component row : (WebMarkupContainer) projectsTable.get("body").get("rows"))projects.add((Project) row.getDefaultModelObject());- return OneDev.getInstance(PackService.class).queryTypeStats(projects);+ return packService.queryTypeStats(projects);}};@@ -180,11 +210,24 @@ public class ProjectListPanel extends Panel {List<Project> projects = new ArrayList<>();for (Component row : (WebMarkupContainer) projectsTable.get("body").get("rows"))projects.add((Project) row.getDefaultModelObject());- return OneDev.getInstance(PullRequestService.class).queryStatusStats(projects);+ return pullRequestService.queryStatusStats(projects);}};-++ private final IModel<List<ProjectWorkspaceStatusStat>> workspaceStatsModel =+ new LoadableDetachableModel<>() {++ @Override+ protected List<ProjectWorkspaceStatusStat> load() {+ List<Project> projects = new ArrayList<>();+ for (Component row : (WebMarkupContainer) projectsTable.get("body").get("rows"))+ projects.add((Project) row.getDefaultModelObject());+ return workspaceService.queryStatusStats(projects);+ }++ };+private Component countLabel;private DataTable<Project, Void> projectsTable;@@ -207,17 +250,10 @@ public class ProjectListPanel extends Panel {this.expectedCount = expectedCount;}- private ProjectService getProjectService() {- return OneDev.getInstance(ProjectService.class);- }-- private AuditService getAuditService() {- return OneDev.getInstance(AuditService.class);- }-@Overrideprotected void onDetach() {pullRequestStatsModel.detach();+ workspaceStatsModel.detach();buildStatsModel.detach();issueStatsModel.detach();queryStringModel.detach();@@ -250,9 +286,9 @@ public class ProjectListPanel extends Panel {for (var project: Project.getIndependents(projects)) {var oldAuditContent = VersionedXmlDoc.fromBean(project).toXML();if (project.getParent() != null)- getAuditService().audit(project.getParent(), "deleted child project \"" + project.getName() + "\"", oldAuditContent, null);+ auditService.audit(project.getParent(), "deleted child project \"" + project.getName() + "\"", oldAuditContent, null);else- getAuditService().audit(null, "deleted root project \"" + project.getName() + "\"", oldAuditContent, null);+ auditService.audit(null, "deleted root project \"" + project.getName() + "\"", oldAuditContent, null);}}@@ -421,7 +457,7 @@ public class ProjectListPanel extends Panel {errorMessage = MessageFormat.format(_T("Can not move project \"{0}\" to be under itself or its descendants"), eachProject);break;} else {- Project projectWithSameName = getProjectService().find(project, eachProject.getName());+ Project projectWithSameName = projectService.find(project, eachProject.getName());if (projectWithSameName != null && !projectWithSameName.equals(eachProject)) {errorMessage = MessageFormat.format(_T("A child project with name \"{0}\" already exists under \"{1}\""), eachProject.getName(), project.getPath());break;@@ -435,7 +471,7 @@ public class ProjectListPanel extends Panel {new ConfirmModalPanel(target) {private Project getTargetProject() {- return getProjectService().load(projectId);+ return projectService.load(projectId);}@Override@@ -447,12 +483,12 @@ public class ProjectListPanel extends Panel {for (var project: projects) {oldAuditContents.put(project.getId(), project.getParent()!=null? project.getParent().getPath() : null);}- getProjectService().move(projects, getTargetProject());+ projectService.move(projects, getTargetProject());for (var project: projects) {var oldAuditContent = oldAuditContents.get(project.getId());var newAuditContent = project.getParent()!=null? project.getParent().getPath() : null;if (!Objects.equals(oldAuditContent, newAuditContent))- getAuditService().audit(project, "changed parent", oldAuditContent, newAuditContent);+ auditService.audit(project, "changed parent", oldAuditContent, newAuditContent);}target.add(countLabel);target.add(body);@@ -521,7 +557,7 @@ public class ProjectListPanel extends Panel {errorMessage = MessageFormat.format(_T("Project manage privilege required to modify \"{0}\""), eachProject);break;} else {- Project projectWithSameName = getProjectService().findByPath(eachProject.getName());+ Project projectWithSameName = projectService.findByPath(eachProject.getName());if (projectWithSameName != null && !projectWithSameName.equals(eachProject)) {errorMessage = MessageFormat.format(_T("A root project with name \"{0}\" already exists"), eachProject.getName());break;@@ -543,11 +579,11 @@ public class ProjectListPanel extends Panel {for (var project: projects) {oldAuditContents.put(project.getId(), project.getParent()!=null? project.getParent().getPath() : null);}- getProjectService().move(projects, null);+ projectService.move(projects, null);for (var project: projects) {var oldAuditContent = oldAuditContents.get(project.getId());if (oldAuditContent != null)- getAuditService().audit(project, "changed parent", oldAuditContent, null);+ auditService.audit(project, "changed parent", oldAuditContent, null);}target.add(countLabel);target.add(body);@@ -627,7 +663,7 @@ public class ProjectListPanel extends Panel {projects.add(project);observables.add(project.getDeleteChangeObservable());}- getProjectService().delete(projects);+ projectService.delete(projects);auditDeletions(projects);selectionColumn.getSelections().clear();target.add(countLabel);@@ -711,7 +747,7 @@ public class ProjectListPanel extends Panel {errorMessage = MessageFormat.format(_T("Can not move project \"{0}\" to be under itself or its descendants"), eachProject);break;} else {- Project projectWithSameName = getProjectService().find(project, eachProject.getName());+ Project projectWithSameName = projectService.find(project, eachProject.getName());if (projectWithSameName != null && !projectWithSameName.equals(eachProject)) {errorMessage = MessageFormat.format(_T("A child project with name \"{0}\" already exists under \"{1}\""), eachProject.getName(), project.getPath());break;@@ -725,7 +761,7 @@ public class ProjectListPanel extends Panel {new ConfirmModalPanel(target) {private Project getTargetProject() {- return getProjectService().load(projectId);+ return projectService.load(projectId);}@Override@@ -737,12 +773,12 @@ public class ProjectListPanel extends Panel {for (var project: projects) {oldAuditContents.put(project.getId(), project.getParent()!=null? project.getParent().getPath() : null);}- getProjectService().move(projects, getTargetProject());+ projectService.move(projects, getTargetProject());for (var project: projects) {var oldAuditContent = oldAuditContents.get(project.getId());var newAuditContent = project.getParent()!=null? project.getParent().getPath() : null;if (!Objects.equals(oldAuditContent, newAuditContent))- getAuditService().audit(project, "changed parent", oldAuditContent, newAuditContent);+ auditService.audit(project, "changed parent", oldAuditContent, newAuditContent);}dataProvider.detach();target.add(countLabel);@@ -812,7 +848,7 @@ public class ProjectListPanel extends Panel {errorMessage = MessageFormat.format(_T("Project manage privilege required to modify \"{0}\""), eachProject);break;} else {- Project projectWithSameName = getProjectService().findByPath(eachProject.getName());+ Project projectWithSameName = projectService.findByPath(eachProject.getName());if (projectWithSameName != null && !projectWithSameName.equals(eachProject)) {errorMessage = MessageFormat.format(_T("A root project with name \"{0}\" already exists"), eachProject.getName());break;@@ -835,11 +871,11 @@ public class ProjectListPanel extends Panel {for (var project: projects) {oldAuditContents.put(project.getId(), project.getParent()!=null? project.getParent().getPath() : null);}- getProjectService().move(projects, null);+ projectService.move(projects, null);for (var project: projects) {var oldAuditContent = oldAuditContents.get(project.getId());if (oldAuditContent != null)- getAuditService().audit(project, "changed parent", oldAuditContent, null);+ auditService.audit(project, "changed parent", oldAuditContent, null);}dataProvider.detach();@@ -924,7 +960,7 @@ public class ProjectListPanel extends Panel {projects.add(project);observables.add(project.getDeleteChangeObservable());}- getProjectService().delete(projects);+ projectService.delete(projects);auditDeletions(projects);dataProvider.detach();selectionColumn.getSelections().clear();@@ -1054,6 +1090,11 @@ public class ProjectListPanel extends Panel {target.add(saveQueryLink);}+ @Override+ protected boolean isSelectOnFocus() {+ return true;+ }+});queryInput.add(new AjaxFormComponentUpdatingBehavior("clear") {@@ -1112,7 +1153,7 @@ public class ProjectListPanel extends Panel {try {ProjectQuery query = queryModel.getObject();if (query != null)- return getProjectService().query(SecurityUtils.getSubject(), query, true, (int) first, (int) count).iterator();+ return projectService.query(SecurityUtils.getSubject(), query, true, (int) first, (int) count).iterator();} catch (ExplicitException e) {error(e.getMessage());}@@ -1124,7 +1165,7 @@ public class ProjectListPanel extends Panel {try {ProjectQuery query = queryModel.getObject();if (query != null)- return getProjectService().count(SecurityUtils.getSubject(), query.getCriteria());+ return projectService.count(SecurityUtils.getSubject(), query.getCriteria());} catch (ExplicitException e) {error(e.getMessage());}@@ -1138,7 +1179,7 @@ public class ProjectListPanel extends Panel {@Overrideprotected Project load() {- return getProjectService().load(projectId);+ return projectService.load(projectId);}};@@ -1215,6 +1256,25 @@ public class ProjectListPanel extends Panel {fragment.add(new WebMarkupContainer("codeStats").setVisible(false));fragment.add(new WebMarkupContainer("pullRequestStats").setVisible(false));}+ if (project.isCodeManagement() && SecurityUtils.canWriteCode(project)+ && !project.getHierarchyWorkspaceSpecs().isEmpty()) {+ fragment.add(new WorkspaceStatsPanel("workspaceStats", rowModel,+ new LoadableDetachableModel<>() {++ @Override+ protected Map<Workspace.Status, Long> load() {+ Map<Workspace.Status, Long> statusCounts = new LinkedHashMap<>();+ for (ProjectWorkspaceStatusStat stats : workspaceStatsModel.getObject()) {+ if (stats.getProjectId().equals(projectId))+ statusCounts.put(stats.getWorkspaceStatus(), stats.getStatusCount());+ }+ return statusCounts;+ }++ }));+ } else {+ fragment.add(new WebMarkupContainer("workspaceStats").setVisible(false));+ }if (project.isIssueManagement()) {fragment.add(new IssueStatsPanel("issueStats", rowModel, new LoadableDetachableModel<>() {@@ -1222,7 +1282,7 @@ public class ProjectListPanel extends Panel {@Overrideprotected Map<Integer, Long> load() {Map<Integer, Long> stateCounts = new LinkedHashMap<>();- GlobalIssueSetting issueSetting = OneDev.getInstance(SettingService.class).getIssueSetting();+ GlobalIssueSetting issueSetting = settingService.getIssueSetting();for (ProjectIssueStateStat stats : issueStatsModel.getObject()) {if (stats.getProjectId().equals(projectId)&& stats.getStateOrdinal() >= 0@@ -1273,6 +1333,7 @@ public class ProjectListPanel extends Panel {fragment.add(new WebMarkupContainer("noStorage").setVisible(false));} else {fragment.add(new WebMarkupContainer("codeStats").setVisible(false));+ fragment.add(new WebMarkupContainer("workspaceStats").setVisible(false));fragment.add(new WebMarkupContainer("pullRequestStats").setVisible(false));fragment.add(new WebMarkupContainer("issueStats").setVisible(false));fragment.add(new WebMarkupContainer("buildStats").setVisible(false));diff --git a/server-core/src/main/java/io/onedev/server/web/component/project/stats/workspace/WorkspaceStatsPanel.html b/server-core/src/main/java/io/onedev/server/web/component/project/stats/workspace/WorkspaceStatsPanel.htmlnew file mode 100644index 0000000000..171d662781--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/project/stats/workspace/WorkspaceStatsPanel.html@@ -0,0 +1,7 @@+<wicket:panel>+ <wicket:svg href="workspace" class="icon mr-2"></wicket:svg>+ <a wicket:id="workspaces" class="mr-2"><span wicket:id="label"></span></a>+ <wicket:container wicket:id="statuses">+ <a wicket:id="link" class="mr-2"><span wicket:id="label"></span></a>+ </wicket:container>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/component/project/stats/workspace/WorkspaceStatsPanel.java b/server-core/src/main/java/io/onedev/server/web/component/project/stats/workspace/WorkspaceStatsPanel.javanew file mode 100644index 0000000000..c4e4e86a9f--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/project/stats/workspace/WorkspaceStatsPanel.java@@ -0,0 +1,130 @@+package io.onedev.server.web.component.project.stats.workspace;++import static io.onedev.server.web.translation.Translation._T;++import java.util.ArrayList;+import java.util.List;+import java.util.Map;++import org.apache.wicket.behavior.AttributeAppender;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.link.BookmarkablePageLink;+import org.apache.wicket.markup.html.link.Link;+import org.apache.wicket.markup.html.list.ListItem;+import org.apache.wicket.markup.html.list.ListView;+import org.apache.wicket.markup.html.panel.Panel;+import org.apache.wicket.model.IModel;+import org.apache.wicket.model.LoadableDetachableModel;+import org.apache.wicket.request.mapper.parameter.PageParameters;++import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.Workspace.Status;+import io.onedev.server.search.entity.workspace.ActiveCriteria;+import io.onedev.server.search.entity.workspace.ErrorCriteria;+import io.onedev.server.search.entity.workspace.PendingCriteria;+import io.onedev.server.search.entity.workspace.WorkspaceQuery;+import io.onedev.server.util.criteria.Criteria;+import io.onedev.server.web.page.project.workspaces.ProjectWorkspacesPage;++public class WorkspaceStatsPanel extends Panel {++ private final IModel<Project> projectModel;++ private final IModel<Map<Status, Long>> statsModel;++ public WorkspaceStatsPanel(String id, IModel<Project> projectModel, IModel<Map<Status, Long>> statsModel) {+ super(id);++ this.projectModel = projectModel;+ this.statsModel = statsModel;+ }++ private long getTotalCount() {+ return getStats().values().stream().mapToLong(Long::longValue).sum();+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ PageParameters params = ProjectWorkspacesPage.paramsOf(getProject(), 0);+ Link<Void> workspacesLink = new BookmarkablePageLink<Void>("workspaces", ProjectWorkspacesPage.class, params);+ workspacesLink.add(new Label("label", new LoadableDetachableModel<String>() {++ @Override+ protected String load() {+ return getTotalCount() + " " + _T("workspaces");+ }++ }));+ add(workspacesLink);++ add(new ListView<Map.Entry<Status, Long>>("statuses",+ new LoadableDetachableModel<List<Map.Entry<Status, Long>>>() {++ @Override+ protected List<Map.Entry<Status, Long>> load() {+ return new ArrayList<>(getStats().entrySet());+ }++ }) {++ @Override+ protected void populateItem(ListItem<Map.Entry<Status, Long>> item) {+ Map.Entry<Status, Long> entry = item.getModelObject();+ Criteria<Workspace> criteria;+ if (entry.getKey() == Status.PENDING) {+ criteria = new PendingCriteria();+ } else if (entry.getKey() == Status.ACTIVE) {+ criteria = new ActiveCriteria();+ } else {+ criteria = new ErrorCriteria();+ }+ WorkspaceQuery query = new WorkspaceQuery(criteria);+ PageParameters params = ProjectWorkspacesPage.paramsOf(getProject(), query.toString(), 0);+ Link<Void> statusLink = new BookmarkablePageLink<Void>("link", ProjectWorkspacesPage.class, params);+ String statusName = entry.getKey().toString();+ statusLink.add(new Label("label", entry.getValue() + " " + _T(statusName)));++ String cssClass;+ switch (entry.getKey()) {+ case ACTIVE:+ cssClass = "link-success";+ break;+ case ERROR:+ cssClass = "link-danger";+ break;+ default:+ cssClass = "link-warning";+ break;+ }+ statusLink.add(AttributeAppender.append("class", cssClass));+ item.add(statusLink);+ }++ });+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(getTotalCount() != 0);+ }++ @Override+ protected void onDetach() {+ projectModel.detach();+ statsModel.detach();+ super.onDetach();+ }++ private Project getProject() {+ return projectModel.getObject();+ }++ private Map<Status, Long> getStats() {+ return statsModel.getObject();+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/pullrequest/list/PullRequestFilterPanel.html b/server-core/src/main/java/io/onedev/server/web/component/pullrequest/list/PullRequestFilterPanel.htmlindex d4ca5182d2..35095b36c3 100644--- a/server-core/src/main/java/io/onedev/server/web/component/pullrequest/list/PullRequestFilterPanel.html+++ b/server-core/src/main/java/io/onedev/server/web/component/pullrequest/list/PullRequestFilterPanel.html@@ -11,10 +11,6 @@<label class="control-label">Assigned To</label><input wicket:id="assignedTo" type="hidden" class="form-control"></div>- <div class="form-group">- <label class="control-label">Label</label>- <input wicket:id="label" type="hidden" class="form-control">- </div><div class="form-group"><label class="control-label">Active Since</label><div class="clearable-wrapper">@@ -27,4 +23,8 @@<input wicket:id="notActiveSince" type="text" class="form-control"></div></div>+ <div class="form-group">+ <label class="control-label">Label</label>+ <input wicket:id="label" type="hidden" class="form-control">+ </div></wicket:extend>\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/component/pullrequest/list/PullRequestListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/pullrequest/list/PullRequestListPanel.javaindex b10785a65e..f036d3e263 100644--- a/server-core/src/main/java/io/onedev/server/web/component/pullrequest/list/PullRequestListPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/pullrequest/list/PullRequestListPanel.java@@ -820,6 +820,11 @@ public abstract class PullRequestListPanel extends Panel {target.add(saveQueryLink);}+ @Override+ protected boolean isSelectOnFocus() {+ return true;+ }+});queryInput.add(new AjaxFormComponentUpdatingBehavior("clear") {diff --git a/server-core/src/main/java/io/onedev/server/web/component/symboltooltip/SymbolTooltipPanel.java b/server-core/src/main/java/io/onedev/server/web/component/symboltooltip/SymbolTooltipPanel.javaindex 82c38c39f2..b8f7e7542d 100644--- a/server-core/src/main/java/io/onedev/server/web/component/symboltooltip/SymbolTooltipPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/symboltooltip/SymbolTooltipPanel.java@@ -96,8 +96,12 @@ public abstract class SymbolTooltipPanel extends Panel {@Injectprivate SettingService settingService;- @Inject- private ObjectMapper objectMapper;+ private static final ObjectMapper objectMapper = new ObjectMapper();++ static {+ objectMapper.addMixIn(PlanarRange.class, IgnorePlanarRangeMixin.class);+ objectMapper.addMixIn(LinearRange.class, IgnoreLinearRangeMixin.class);+ }public SymbolTooltipPanel(String id) {super(id);@@ -337,10 +341,7 @@ public abstract class SymbolTooltipPanel extends Panel {var liteModel = settingService.getAiSetting().getLiteModel();int index;try {- ObjectMapper mapperCopy = objectMapper.copy();- mapperCopy.addMixIn(PlanarRange.class, IgnorePlanarRangeMixin.class);- mapperCopy.addMixIn(LinearRange.class, IgnoreLinearRangeMixin.class);- var jsonOfSymbolHits = mapperCopy.writeValueAsString(symbolHits);+ var jsonOfSymbolHits = objectMapper.writeValueAsString(symbolHits);var symbolContext = getSymbolContext(symbolPosition, SYMBOL_BEGIN, SYMBOL_END, OMITTED_LINES,START_CONTEXT_SIZE, BEFORE_CONTEXT_SIZE, AFTER_CONTEXT_SIZE);@@ -351,7 +352,7 @@ public abstract class SymbolTooltipPanel extends Panel {"symbolContext", Joiner.on('\n').join(symbolContext.getContextLines()),"note", String.format("Symbol is between %s and %s in the context", SYMBOL_BEGIN, SYMBOL_END));- var jsonOfSymbolOccurrence = mapperCopy.writeValueAsString(occurrenceMap);+ var jsonOfSymbolOccurrence = objectMapper.writeValueAsString(occurrenceMap);var systemMessage = new SystemMessage("""You are familiar with various programming languages. Given a json object of symboloccurrence information, and a json array of possible symbol definitions, pleasediff --git a/server-core/src/main/java/io/onedev/server/web/component/taskbutton/TaskButton.java b/server-core/src/main/java/io/onedev/server/web/component/taskbutton/TaskButton.javaindex 24add9d591..2fdd146175 100644--- a/server-core/src/main/java/io/onedev/server/web/component/taskbutton/TaskButton.java+++ b/server-core/src/main/java/io/onedev/server/web/component/taskbutton/TaskButton.java@@ -31,7 +31,7 @@ import io.onedev.commons.utils.TaskLogger;import io.onedev.commons.utils.WordUtils;import io.onedev.server.buildspec.job.log.JobLogEntry;import io.onedev.server.buildspec.job.log.JobLogEntryEx;-import io.onedev.server.job.log.StyleBuilder;+import io.onedev.server.logging.StyleBuilder;import io.onedev.server.web.component.modal.ModalPanel;import io.onedev.server.web.component.taskbutton.TaskResult.PlainMessage;diff --git a/server-core/src/main/java/io/onedev/server/web/component/terminal/ShellExit.java b/server-core/src/main/java/io/onedev/server/web/component/terminal/ShellExit.javanew file mode 100644index 0000000000..97dc1bac91--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/terminal/ShellExit.java@@ -0,0 +1,7 @@+package io.onedev.server.web.component.terminal;++import org.apache.wicket.protocol.ws.api.message.IWebSocketPushMessage;++public class ShellExit implements IWebSocketPushMessage {++}\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/component/terminal/TerminalPanel.html b/server-core/src/main/java/io/onedev/server/web/component/terminal/TerminalPanel.htmlnew file mode 100644index 0000000000..0deb397936--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/terminal/TerminalPanel.html@@ -0,0 +1,3 @@+<wicket:panel>+ <div class="terminal d-flex flex-column flex-grow-1 h-100 resize-aware bg-black"></div>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/component/terminal/TerminalPanel.java b/server-core/src/main/java/io/onedev/server/web/component/terminal/TerminalPanel.javanew file mode 100644index 0000000000..184dc8e963--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/terminal/TerminalPanel.java@@ -0,0 +1,102 @@+package io.onedev.server.web.component.terminal;++import org.apache.wicket.Application;+import org.apache.wicket.Session;+import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;+import org.apache.wicket.event.IEvent;+import org.apache.wicket.markup.head.IHeaderResponse;+import org.apache.wicket.markup.head.JavaScriptHeaderItem;+import org.apache.wicket.markup.head.OnDomReadyHeaderItem;+import org.apache.wicket.markup.html.panel.Panel;+import org.apache.wicket.protocol.ws.api.IWebSocketConnection;+import org.apache.wicket.protocol.ws.api.WebSocketBehavior;+import org.apache.wicket.protocol.ws.api.WebSocketRequestHandler;+import org.apache.wicket.protocol.ws.api.event.WebSocketPushPayload;+import org.apache.wicket.protocol.ws.api.message.ClosedMessage;+import org.apache.wicket.protocol.ws.api.message.ConnectedMessage;+import org.apache.wicket.protocol.ws.api.message.TextMessage;+import org.apache.wicket.protocol.ws.api.registry.PageIdKey;+import org.apache.wicket.protocol.ws.api.registry.SimpleWebSocketConnectionRegistry;++import io.onedev.commons.utils.StringUtils;++public abstract class TerminalPanel extends Panel {++ private static final long serialVersionUID = 1L;++ public TerminalPanel(String id) {+ super(id);+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ add(new WebSocketBehavior() {++ @Override+ protected void onConnect(ConnectedMessage message) {+ IWebSocketConnection connection = new SimpleWebSocketConnectionRegistry().getConnection(+ message.getApplication(), message.getSessionId(), message.getKey());+ if (connection != null)+ onConnectionOpen(connection);+ }++ @Override+ protected void onClose(ClosedMessage message) {+ IWebSocketConnection connection = new SimpleWebSocketConnectionRegistry().getConnection(+ message.getApplication(), message.getSessionId(), message.getKey());+ if (connection != null)+ onConnectionClose(connection);+ }++ @Override+ protected void onMessage(WebSocketRequestHandler handler, TextMessage message) {+ IWebSocketConnection connection = new SimpleWebSocketConnectionRegistry().getConnection(+ Application.get(), Session.get().getId(), new PageIdKey(getPage().getPageId()));+ if (connection != null) {+ if (message.getText().startsWith("SHELL_INPUT:")) {+ String data = message.getText().substring("SHELL_INPUT:".length());+ writeToStdin(connection, data);+ } else if (message.getText().startsWith("TERMINAL_RESIZE:")) {+ String size = message.getText().substring("TERMINAL_RESIZE:".length());+ int rows = Integer.parseInt(StringUtils.substringBefore(size, ","));+ int cols = Integer.parseInt(StringUtils.substringAfter(size, ","));+ onResized(connection, rows, cols);+ }+ }+ }++ });++ setOutputMarkupId(true);+ }++ @Override+ public void onEvent(IEvent<?> event) {+ super.onEvent(event);+ if (event.getPayload() instanceof WebSocketPushPayload payload) {+ if (payload.getMessage() instanceof ShellExit)+ onShellExit(payload.getHandler());+ }+ }++ @Override+ public void renderHead(IHeaderResponse response) {+ super.renderHead(response);+ response.render(JavaScriptHeaderItem.forReference(new TerminalResourceReference()));+ var script = String.format("onedev.server.terminal.onDomReady('%s');", getMarkupId());+ response.render(OnDomReadyHeaderItem.forScript(script));+ }++ protected abstract void onConnectionOpen(IWebSocketConnection connection);++ protected abstract void onConnectionClose(IWebSocketConnection connection);++ protected abstract void writeToStdin(IWebSocketConnection connection, String data);++ protected abstract void onResized(IWebSocketConnection connection, int rows, int cols);++ protected abstract void onShellExit(IPartialPageRequestHandler handler);++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/terminal/TerminalResourceReference.java b/server-core/src/main/java/io/onedev/server/web/component/terminal/TerminalResourceReference.javanew file mode 100644index 0000000000..5d2ad40756--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/terminal/TerminalResourceReference.java@@ -0,0 +1,26 @@+package io.onedev.server.web.component.terminal;++import java.util.List;++import org.apache.wicket.markup.head.HeaderItem;+import org.apache.wicket.markup.head.JavaScriptHeaderItem;++import io.onedev.server.web.asset.xterm.XtermResourceReference;+import io.onedev.server.web.page.base.BaseDependentResourceReference;++public class TerminalResourceReference extends BaseDependentResourceReference {++ private static final long serialVersionUID = 1L;++ public TerminalResourceReference() {+ super(TerminalResourceReference.class, "terminal.js");+ }++ @Override+ public List<HeaderItem> getDependencies() {+ List<HeaderItem> dependencies = super.getDependencies();+ dependencies.add(JavaScriptHeaderItem.forReference(new XtermResourceReference()));+ return dependencies;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/terminal/terminal.js b/server-core/src/main/java/io/onedev/server/web/component/terminal/terminal.jsnew file mode 100644index 0000000000..5d1f69ca7c--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/terminal/terminal.js@@ -0,0 +1,107 @@+onedev.server.terminal = {+ onDomReady: function(containerId) {+ var hasLiveOutput = false;+ var replaying = false;+ var suppressInputUntil = 0;+ var pendingOutputs = [];+ var sizeReady = false;+ var fitScheduled = false;+ var $terminal = $("#" + containerId).children(".terminal");+ var xterm = new Terminal({+ fontSize: 14,+ fontFamily: "Consolas, 'Liberation Mono', 'Menlo, Courier', monospace"+ });+ var fitAddon = new window.FitAddon.FitAddon();+ xterm.loadAddon(fitAddon);++ try {+ var webglAddon = new window.WebglAddon.WebglAddon();+ webglAddon.onContextLoss(function() {+ webglAddon.dispose();+ });+ xterm.loadAddon(webglAddon);+ } catch (e) {+ console.warn("Error loading webgl addon", e);+ }++ xterm.open($terminal[0]);++ var flushPendingOutputs = function() {+ if (!sizeReady)+ return;+ while (pendingOutputs.length != 0)+ xterm.write(pendingOutputs.shift());+ };++ var ensureSizeReady = function() {+ if (fitScheduled)+ return;+ fitScheduled = true;+ window.requestAnimationFrame(function() {+ fitScheduled = false;+ fitAddon.fit();+ if (xterm.rows > 0 && xterm.cols > 0) {+ sizeReady = true;+ flushPendingOutputs();+ sendResize();+ } else {+ ensureSizeReady();+ }+ });+ };++ var isLikelyAutoResponse = function(data) {+ return data.indexOf("\u001b[") != -1 || data.indexOf("\u009b") != -1 || data.indexOf("rgb:") != -1;+ };+ xterm.onData(function(data) {+ if (replaying)+ return;+ if (new Date().getTime() < suppressInputUntil && isLikelyAutoResponse(data))+ return;+ Wicket.WebSocket.send("SHELL_INPUT:" + data);+ });++ var wsReady = false;+ var sendResize = function() {+ if (wsReady && xterm.rows > 0 && xterm.cols > 0)+ Wicket.WebSocket.send("TERMINAL_RESIZE:" + xterm.rows + "," + xterm.cols);+ };++ xterm.onResize(function(size) {+ sizeReady = size.rows > 0 && size.cols > 0;+ flushPendingOutputs();+ sendResize();+ });+ $terminal.on("resized", function() {+ sizeReady = false;+ ensureSizeReady();+ });+ ensureSizeReady();++ Wicket.Event.subscribe("/websocket/open", function() {+ wsReady = true;+ ensureSizeReady();+ });+ Wicket.Event.subscribe("/websocket/message", function(jqEvent, message) {+ if (message == "TERMINAL_REPLAY_START") {+ replaying = true;+ } else if (message == "TERMINAL_REPLAY_END") {+ replaying = false;+ suppressInputUntil = new Date().getTime() + 300;+ } else if (message.startsWith("SHELL_OUTPUT:")) {+ if (!hasLiveOutput && !replaying) {+ hasLiveOutput = true;+ ensureSizeReady();+ }+ var base64 = message.substring("SHELL_OUTPUT:".length);+ var bytes = Uint8Array.from(atob(base64), function(c) { return c.charCodeAt(0); });+ if (sizeReady) {+ xterm.write(bytes);+ } else {+ pendingOutputs.push(bytes);+ ensureSizeReady();+ }+ }+ });+ }+}diff --git a/server-core/src/main/java/io/onedev/server/web/component/user/querywatch/DevSessionQueryWatchesPanel.html b/server-core/src/main/java/io/onedev/server/web/component/user/querywatch/DevSessionQueryWatchesPanel.htmlnew file mode 100644index 0000000000..6542cfc678--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/user/querywatch/DevSessionQueryWatchesPanel.html@@ -0,0 +1,11 @@+<wicket:panel>+ <div class="mb-3">+ <a wicket:id="deleteSelected" class="btn btn-danger"><wicket:t>Delete Selected</wicket:t></a>+ </div>+ <table wicket:id="queries" class="table table-condensed"></table>+ <wicket:fragment wicket:id="linkFrag">+ <a wicket:id="link">+ <span wicket:id="label"></span>+ </a>+ </wicket:fragment>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/component/user/querywatch/QueryWatchesPanel.java b/server-core/src/main/java/io/onedev/server/web/component/user/querywatch/QueryWatchesPanel.javaindex eefde22d37..dc8a287e85 100644--- a/server-core/src/main/java/io/onedev/server/web/component/user/querywatch/QueryWatchesPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/component/user/querywatch/QueryWatchesPanel.java@@ -26,6 +26,8 @@ public abstract class QueryWatchesPanel extends GenericPanel<User> {public static final String TAB_PACK = "pack";+ public static final String TAB_DEV_SESSION = "workspace";+public static final String TAB_COMMIT = "commit";private final String tabName;@@ -73,6 +75,14 @@ public abstract class QueryWatchesPanel extends GenericPanel<User> {};tabs.add(packTab);+ var workspaceTab = new AjaxActionTab(Model.of(_T("Workspace")), null) {+ @Override+ protected void onSelect(AjaxRequestTarget target, Component tabLink) {+ onTabSelected(target, TAB_DEV_SESSION);+ }+ };+ tabs.add(workspaceTab);+var commitTab = new AjaxActionTab(Model.of(_T("Commit")), null) {@Overrideprotected void onSelect(AjaxRequestTarget target, Component tabLink) {@@ -93,6 +103,9 @@ public abstract class QueryWatchesPanel extends GenericPanel<User> {} else if (tabName.equals(TAB_PACK)) {packTab.setSelected(true);add(new PackQueryWatchesPanel("content", getModel()));+ } else if (tabName.equals(TAB_DEV_SESSION)) {+ workspaceTab.setSelected(true);+ add(new WorkspaceQueryWatchesPanel("content", getModel()));} else if (tabName.equals(TAB_COMMIT)) {commitTab.setSelected(true);add(new CommitQueryWatchesPanel("content", getModel()));diff --git a/server-core/src/main/java/io/onedev/server/web/component/user/querywatch/WorkspaceQueryWatchesPanel.java b/server-core/src/main/java/io/onedev/server/web/component/user/querywatch/WorkspaceQueryWatchesPanel.javanew file mode 100644index 0000000000..99301c4289--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/user/querywatch/WorkspaceQueryWatchesPanel.java@@ -0,0 +1,263 @@+package io.onedev.server.web.component.user.querywatch;++import static io.onedev.server.model.support.NamedQuery.COMMON_NAME_PREFIX;+import static io.onedev.server.model.support.NamedQuery.PERSONAL_NAME_PREFIX;+import static io.onedev.server.web.translation.Translation._T;++import java.io.Serializable;+import java.util.ArrayList;+import java.util.Iterator;+import java.util.List;++import org.jspecify.annotations.Nullable;++import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;+import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;+import org.apache.wicket.markup.ComponentTag;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.link.BookmarkablePageLink;+import org.apache.wicket.markup.html.link.Link;+import org.apache.wicket.markup.html.panel.Fragment;+import org.apache.wicket.markup.html.panel.GenericPanel;+import org.apache.wicket.markup.repeater.Item;+import org.apache.wicket.model.IModel;+import org.apache.wicket.model.LoadableDetachableModel;+import org.apache.wicket.model.Model;++import io.onedev.server.OneDev;+import io.onedev.server.service.AuditService;+import io.onedev.server.service.ProjectService;+import io.onedev.server.service.SettingService;+import io.onedev.server.service.UserService;+import io.onedev.server.model.User;+import io.onedev.server.model.support.NamedQuery;+import io.onedev.server.persistence.TransactionService;+import io.onedev.server.web.component.datatable.DefaultDataTable;+import io.onedev.server.web.component.datatable.selectioncolumn.SelectionColumn;+import io.onedev.server.web.page.workspaces.WorkspaceListPage;+import io.onedev.server.web.page.project.dashboard.ProjectDashboardPage;+import io.onedev.server.web.page.project.workspaces.ProjectWorkspacesPage;+import io.onedev.server.web.page.user.UserPage;+import io.onedev.server.web.util.ConfirmClickModifier;+import io.onedev.server.workspace.WorkspaceQueryPersonalizationService;++class WorkspaceQueryWatchesPanel extends GenericPanel<User> {++ private static final long serialVersionUID = 1L;++ private SelectionColumn<QueryInfo, Void> selectionColumn;++ private final IModel<List<QueryInfo>> queryInfosModel = new LoadableDetachableModel<>() {++ @Override+ protected List<QueryInfo> load() {+ List<QueryInfo> queryInfos = new ArrayList<>();+ var workspaceSetting = getSettingService().getWorkspaceSetting();+ for (var name : getUser().getWorkspaceQuerySubscriptions()) {+ NamedQuery query;+ if (name.startsWith(COMMON_NAME_PREFIX))+ query = workspaceSetting.getNamedQuery(name.substring(COMMON_NAME_PREFIX.length()));+ else+ query = getUser().getWorkspaceQuery(name.substring(PERSONAL_NAME_PREFIX.length()));++ if (query != null)+ queryInfos.add(new QueryInfo(name, query.getQuery(), null));+ }+ for (var personalization : getUser().getWorkspaceQueryPersonalizations()) {+ for (var name : personalization.getQuerySubscriptions()) {+ NamedQuery query;+ if (name.startsWith(COMMON_NAME_PREFIX))+ query = personalization.getProject().getNamedWorkspaceQuery(name.substring(COMMON_NAME_PREFIX.length()));+ else+ query = personalization.getQuery(name.substring(PERSONAL_NAME_PREFIX.length()));+ if (query != null)+ queryInfos.add(new QueryInfo(name, query.getQuery(), personalization.getProject().getId()));+ }+ }+ return queryInfos;+ }+ };++ public WorkspaceQueryWatchesPanel(String id, IModel<User> model) {+ super(id, model);+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ var deleteSelected = new Link<Void>("deleteSelected") {++ @Override+ public void onClick() {+ OneDev.getInstance(TransactionService.class).run(() -> {+ var auditService = OneDev.getInstance(AuditService.class);+ for (IModel<QueryInfo> each : selectionColumn.getSelections()) {+ var queryInfo = each.getObject();+ if (queryInfo.projectId == null) {+ getUser().getWorkspaceQuerySubscriptions().remove(queryInfo.name);+ if (getPage() instanceof UserPage)+ auditService.audit(null, "unwatched workspace query \"" + queryInfo.name + "\" in account \"" + getUser().getName() + "\"", null, null);+ } else {+ for (var personalization : getUser().getWorkspaceQueryPersonalizations()) {+ if (personalization.getProject().getId().equals(queryInfo.projectId)) {+ personalization.getQuerySubscriptions().remove(queryInfo.name);+ getWorkspaceQueryPersonalizationService().createOrUpdate(personalization);+ if (getPage() instanceof UserPage)+ auditService.audit(null, "unwatched workspace query \"" + queryInfo.name + "\" in account \"" + getUser().getName() + "\" in project \"" + personalization.getProject().getPath() + "\"", null, null);+ }+ }+ }+ }+ getUserService().update(getUser(), null);+ });+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setEnabled(!selectionColumn.getSelections().isEmpty());+ setVisible(!queryInfosModel.getObject().isEmpty());+ }++ @Override+ protected void onComponentTag(ComponentTag tag) {+ super.onComponentTag(tag);+ if (!isEnabled()) {+ tag.put("disabled", "disabled");+ tag.put("data-tippy-content", _T("Please select query watches to delete"));+ }+ }++ }.add(new ConfirmClickModifier(_T("Do you really want to delete selected query watches?"))).setOutputMarkupId(true);++ add(deleteSelected);++ List<IColumn<QueryInfo, Void>> columns = new ArrayList<>();++ selectionColumn = new SelectionColumn<QueryInfo, Void>() {++ @Override+ protected void onSelectionChange(AjaxRequestTarget target) {+ target.add(deleteSelected);+ }++ };+ columns.add(selectionColumn);++ columns.add(new AbstractColumn<>(Model.of("Name")) {++ @Override+ public void populateItem(Item<ICellPopulator<QueryInfo>> cellItem, String componentId,+ IModel<QueryInfo> rowModel) {+ var name = rowModel.getObject().name;+ if (name.startsWith(COMMON_NAME_PREFIX))+ name = name.substring(COMMON_NAME_PREFIX.length()) + " (" + _T("common") + ")";+ else+ name = name.substring(PERSONAL_NAME_PREFIX.length()) + " (" + _T("personal") + ")";++ var fragment = new Fragment(componentId, "linkFrag", WorkspaceQueryWatchesPanel.this);+ var projectId = rowModel.getObject().projectId;+ if (projectId != null) {+ var project = getProjectService().load(projectId);+ var link = new BookmarkablePageLink<Void>("link", ProjectWorkspacesPage.class, ProjectWorkspacesPage.paramsOf(project, rowModel.getObject().query, 1));+ link.add(new Label("label", name));+ fragment.add(link);+ } else {+ var link = new BookmarkablePageLink<Void>("link", WorkspaceListPage.class, WorkspaceListPage.paramsOf(rowModel.getObject().query, 1));+ link.add(new Label("label", name));+ fragment.add(link);+ }+ cellItem.add(fragment);+ }+ });++ columns.add(new AbstractColumn<>(Model.of("Project")) {++ @Override+ public void populateItem(Item<ICellPopulator<QueryInfo>> cellItem, String componentId,+ IModel<QueryInfo> rowModel) {+ var projectId = rowModel.getObject().projectId;+ if (projectId != null) {+ var project = getProjectService().load(projectId);+ var fragment = new Fragment(componentId, "linkFrag", WorkspaceQueryWatchesPanel.this);+ var link = new BookmarkablePageLink<Void>("link", ProjectDashboardPage.class, ProjectDashboardPage.paramsOf(project));+ link.add(new Label("label", project.getPath()));+ fragment.add(link);+ cellItem.add(fragment);+ } else {+ cellItem.add(new Label(componentId, "<i>" + _T("Global") + "</i>").setEscapeModelStrings(false));+ }+ }+ });++ var dataProvider = new SortableDataProvider<QueryInfo, Void>() {++ @Override+ public Iterator<? extends QueryInfo> iterator(long first, long count) {+ List<QueryInfo> queryInfos = queryInfosModel.getObject();+ if (first + count > queryInfos.size())+ return queryInfos.subList((int) first, queryInfos.size()).iterator();+ else+ return queryInfos.subList((int) first, (int) (first + count)).iterator();+ }++ @Override+ public long size() {+ return queryInfosModel.getObject().size();+ }++ @Override+ public IModel<QueryInfo> model(QueryInfo object) {+ return Model.of(object);+ }++ };++ add(new DefaultDataTable<>("queries", columns, dataProvider, Integer.MAX_VALUE, null));+ }++ @Override+ protected void onDetach() {+ queryInfosModel.detach();+ super.onDetach();+ }++ private ProjectService getProjectService() {+ return OneDev.getInstance(ProjectService.class);+ }++ private SettingService getSettingService() {+ return OneDev.getInstance(SettingService.class);+ }++ private WorkspaceQueryPersonalizationService getWorkspaceQueryPersonalizationService() {+ return OneDev.getInstance(WorkspaceQueryPersonalizationService.class);+ }++ private UserService getUserService() {+ return OneDev.getInstance(UserService.class);+ }++ private User getUser() {+ return getModelObject();+ }++ private static class QueryInfo implements Serializable {++ final String name;++ final String query;++ final Long projectId;++ QueryInfo(String name, String query, @Nullable Long projectId) {+ this.name = name;+ this.query = query;+ this.projectId = projectId;+ }+ }+}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/CreateWorkspaceLink.java b/server-core/src/main/java/io/onedev/server/web/component/workspace/CreateWorkspaceLink.javanew file mode 100644index 0000000000..b12e2a62d4--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/CreateWorkspaceLink.java@@ -0,0 +1,50 @@+package io.onedev.server.web.component.workspace;++import java.util.UUID;++import javax.inject.Inject;++import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.markup.html.AjaxLink;++import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;+import io.onedev.server.security.SecurityUtils;+import io.onedev.server.web.page.project.workspaces.detail.dashboard.WorkspaceDashboardPage;+import io.onedev.server.workspace.WorkspaceService;++public abstract class CreateWorkspaceLink extends AjaxLink<Void> {++ @Inject+ private WorkspaceService workspaceService;++ private final String branch;++ public CreateWorkspaceLink(String componentId, String branch) {+ super(componentId);+ this.branch = branch;+ }++ protected abstract Project getProject();++ protected abstract String getSpecName();++ @Override+ public void onClick(AjaxRequestTarget target) {+ var workspace = new Workspace();+ workspace.setProject(getProject());+ workspace.setUser(SecurityUtils.getUser());+ workspace.setBranch(branch);+ workspace.setSpecName(getSpecName());+ workspace.setToken(UUID.randomUUID().toString());+ workspaceService.create(workspace);+ setResponsePage(WorkspaceDashboardPage.class, WorkspaceDashboardPage.paramsOf(workspace));+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(SecurityUtils.canWriteCode(getProject()));+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/invalidspec/InvalidWorkspaceSpecIcon.html b/server-core/src/main/java/io/onedev/server/web/component/workspace/invalidspec/InvalidWorkspaceSpecIcon.htmlnew file mode 100644index 0000000000..2789204f62--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/invalidspec/InvalidWorkspaceSpecIcon.html@@ -0,0 +1,3 @@+<wicket:panel>+ <wicket:svg href="warning-o" class="icon icon-sm"></wicket:svg>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/invalidspec/InvalidWorkspaceSpecIcon.java b/server-core/src/main/java/io/onedev/server/web/component/workspace/invalidspec/InvalidWorkspaceSpecIcon.javanew file mode 100644index 0000000000..b6e6e431ab--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/invalidspec/InvalidWorkspaceSpecIcon.java@@ -0,0 +1,39 @@+package io.onedev.server.web.component.workspace.invalidspec;++import static io.onedev.server.web.translation.Translation._T;++import org.apache.wicket.markup.ComponentTag;+import org.apache.wicket.markup.html.panel.GenericPanel;+import org.apache.wicket.model.IModel;++import io.onedev.server.model.Workspace;++public class InvalidWorkspaceSpecIcon extends GenericPanel<Workspace> {++ private static final long serialVersionUID = 1L;++ public InvalidWorkspaceSpecIcon(String id, IModel<Workspace> workspaceModel) {+ super(id, workspaceModel);+ }++ private Workspace getWorkspace() {+ return getModelObject();+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ var workspace = getWorkspace();+ var specName = workspace.getSpecName();+ setVisible(workspace.getProject().getHierarchyWorkspaceSpecs().stream()+ .noneMatch(s -> s.getName().equals(specName)));+ }++ @Override+ protected void onComponentTag(ComponentTag tag) {+ super.onComponentTag(tag);+ tag.put("data-tippy-content",+ _T("Spec not found in workspace project hierarchy"));+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/list/WorkspaceFilterPanel.html b/server-core/src/main/java/io/onedev/server/web/component/workspace/list/WorkspaceFilterPanel.htmlnew file mode 100644index 0000000000..a13c8478a6--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/list/WorkspaceFilterPanel.html@@ -0,0 +1,28 @@+<wicket:extend>+ <div class="form-group">+ <label class="control-label"><wicket:t>Status</wicket:t></label>+ <input wicket:id="status" type="hidden" class="form-control">+ </div>+ <div class="form-group">+ <label class="control-label"><wicket:t>Created By</wicket:t></label>+ <input wicket:id="createdBy" type="hidden" class="form-control">+ </div>+ <div class="form-group">+ <label class="control-label"><wicket:t>Created After</wicket:t></label>+ <div class="clearable-wrapper">+ <input wicket:id="createdAfter" type="text" class="form-control">+ </div>+ </div>+ <div class="form-group">+ <label class="control-label"><wicket:t>Created Before</wicket:t></label>+ <div class="clearable-wrapper">+ <input wicket:id="createdBefore" type="text" class="form-control">+ </div>+ </div>+ <wicket:enclosure>+ <div class="form-group">+ <label class="control-label"><wicket:t>Spec</wicket:t></label>+ <input wicket:id="spec" type="hidden" class="form-control">+ </div>+ </wicket:enclosure>+</wicket:extend>diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/list/WorkspaceFilterPanel.java b/server-core/src/main/java/io/onedev/server/web/component/workspace/list/WorkspaceFilterPanel.javanew file mode 100644index 0000000000..0b11d60f82--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/list/WorkspaceFilterPanel.java@@ -0,0 +1,281 @@+package io.onedev.server.web.component.workspace.list;++import static io.onedev.server.search.entity.workspace.WorkspaceQueryLexer.Is;+import static io.onedev.server.search.entity.workspace.WorkspaceQueryLexer.IsSince;+import static io.onedev.server.search.entity.workspace.WorkspaceQueryLexer.IsUntil;+import static java.util.stream.Collectors.toList;++import java.util.ArrayList;+import java.util.Arrays;+import java.util.Collection;+import java.util.Collections;+import java.util.Date;+import java.util.List;+import java.util.Objects;+import java.util.function.Predicate;++import javax.inject.Inject;++import org.apache.wicket.AttributeModifier;+import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;+import org.apache.wicket.model.IModel;+import org.apache.wicket.model.LoadableDetachableModel;++import io.onedev.server.model.Project;+import io.onedev.server.model.User;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.support.workspace.spec.WorkspaceSpec;+import io.onedev.server.search.entity.EntityQuery;+import io.onedev.server.search.entity.workspace.ActiveCriteria;+import io.onedev.server.search.entity.workspace.CreateDateCriteria;+import io.onedev.server.search.entity.workspace.CreatedByCriteria;+import io.onedev.server.search.entity.workspace.CreatedByUserCriteria;+import io.onedev.server.search.entity.workspace.ErrorCriteria;+import io.onedev.server.search.entity.workspace.PendingCriteria;+import io.onedev.server.search.entity.workspace.SpecCriteria;+import io.onedev.server.search.entity.workspace.StatusCriteria;+import io.onedev.server.service.UserService;+import io.onedev.server.util.DateUtils;+import io.onedev.server.util.criteria.Criteria;+import io.onedev.server.web.component.datepicker.DatePicker;+import io.onedev.server.web.component.filteredit.FilterEditPanel;+import io.onedev.server.web.component.stringchoice.StringMultiChoice;+import io.onedev.server.web.component.user.choice.UserMultiChoice;++abstract class WorkspaceFilterPanel extends FilterEditPanel<Workspace> {++ @Inject+ private UserService userService;++ public WorkspaceFilterPanel(String id, IModel<EntityQuery<Workspace>> queryModel) {+ super(id, queryModel);+ }++ protected abstract Project getProject();++ @Override+ protected void onInitialize() {+ super.onInitialize();++ var statusChoice = new StringMultiChoice("status", new IModel<Collection<String>>() {++ @Override+ public void detach() {+ }++ @Override+ public Collection<String> getObject() {+ var criterias = getMatchingCriterias(getModelObject().getCriteria(), StatusCriteria.class, null);+ return criterias.stream().map(it -> it.getStatus().name()).collect(toList());+ }++ @Override+ public void setObject(Collection<String> object) {+ var criterias = new ArrayList<Criteria<Workspace>>();+ for (String status : object) {+ if (status.equals(Workspace.Status.PENDING.name())) {+ criterias.add(new PendingCriteria());+ } else if (status.equals(Workspace.Status.ACTIVE.name())) {+ criterias.add(new ActiveCriteria());+ } else {+ criterias.add(new ErrorCriteria());+ }+ }+ Criteria<Workspace> rootCriteria = Criteria.orCriterias(criterias);+ var query = getModelObject();+ query.setCriteria(setMatchingCriteria(query.getCriteria(), StatusCriteria.class, rootCriteria, null));+ getModel().setObject(query);+ }++ }, new LoadableDetachableModel<List<String>>() {++ @Override+ protected List<String> load() {+ return Arrays.stream(Workspace.Status.values()).map(it -> it.name()).collect(toList());+ }++ }, false);+ statusChoice.add(new AjaxFormComponentUpdatingBehavior("change") {++ @Override+ protected void onUpdate(AjaxRequestTarget target) {+ }++ });+ add(statusChoice);++ var createdByChoice = new UserMultiChoice("createdBy", new IModel<Collection<User>>() {++ @Override+ public void detach() {+ }++ @Override+ public Collection<User> getObject() {+ var criterias = getMatchingCriterias(getModelObject().getCriteria(), CreatedByCriteria.class, null);+ return criterias.stream().map(it -> it.getCreator()).filter(Objects::nonNull).collect(toList());+ }++ @Override+ public void setObject(Collection<User> object) {+ var criteria = Criteria.orCriterias(object.stream().map(it -> new CreatedByUserCriteria(it)).collect(toList()));+ var query = getModelObject();+ query.setCriteria(setMatchingCriteria(query.getCriteria(), CreatedByUserCriteria.class, criteria, null));+ getModel().setObject(query);+ }++ }, new LoadableDetachableModel<List<User>>() {++ @Override+ protected List<User> load() {+ var users = userService.query().stream().filter(it -> !it.isDisabled()).collect(toList());+ var cache = userService.cloneCache();+ users.sort(cache.comparingDisplayName(new ArrayList<>()));+ return users;+ }++ }) {++ @Override+ protected void onInitialize() {+ super.onInitialize();+ getSettings().setPlaceholder("");+ }++ };+ createdByChoice.add(new AjaxFormComponentUpdatingBehavior("change") {++ @Override+ protected void onUpdate(AjaxRequestTarget target) {+ }++ });+ add(createdByChoice);++ var specChoice = new StringMultiChoice("spec", new IModel<Collection<String>>() {++ @Override+ public void detach() {+ }++ @Override+ public Collection<String> getObject() {+ var criterias = getMatchingCriterias(getModelObject().getCriteria(), SpecCriteria.class, null);+ return criterias.stream().map(SpecCriteria::getValue).collect(toList());+ }++ @Override+ public void setObject(Collection<String> object) {+ var criterias = Criteria.orCriterias(object.stream()+ .map(it -> new SpecCriteria(it, Is)).collect(toList()));+ var query = getModelObject();+ query.setCriteria(setMatchingCriteria(query.getCriteria(), SpecCriteria.class, criterias, null));+ getModel().setObject(query);+ }++ }, new LoadableDetachableModel<List<String>>() {++ @Override+ protected List<String> load() {+ var project = getProject();+ if (project == null)+ return new ArrayList<>();+ var names = new ArrayList<>(project.getHierarchyWorkspaceSpecs().stream()+ .map(WorkspaceSpec::getName)+ .collect(toList()));+ Collections.sort(names);+ return names;+ }++ }, false) {++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(getProject() != null);+ }++ };+ specChoice.add(new AjaxFormComponentUpdatingBehavior("change") {++ @Override+ protected void onUpdate(AjaxRequestTarget target) {+ }++ });+ add(specChoice);+++ var createdAfterPicker = new DatePicker("createdAfter", new IModel<Date>() {++ @Override+ public void detach() {+ }++ private Predicate<CreateDateCriteria> getPredicate() {+ return t -> t.getOperator() == IsSince;+ }++ @Override+ public Date getObject() {+ var criterias = getMatchingCriterias(getModelObject().getCriteria(), CreateDateCriteria.class, getPredicate());+ return criterias.isEmpty() ? null : criterias.get(0).getDate();+ }++ @Override+ public void setObject(Date object) {+ var criteria = object != null ? new CreateDateCriteria(DateUtils.formatDate(object), IsSince) : null;+ var query = getModelObject();+ query.setCriteria(setMatchingCriteria(query.getCriteria(), CreateDateCriteria.class, criteria, getPredicate()));+ getModel().setObject(query);+ }++ }, false);+ createdAfterPicker.add(new AjaxFormComponentUpdatingBehavior("change") {++ @Override+ protected void onUpdate(AjaxRequestTarget target) {+ }++ });+ add(createdAfterPicker);++ var createdBeforePicker = new DatePicker("createdBefore", new IModel<Date>() {++ @Override+ public void detach() {+ }++ private Predicate<CreateDateCriteria> getPredicate() {+ return t -> t.getOperator() == IsUntil;+ }++ @Override+ public Date getObject() {+ var criterias = getMatchingCriterias(getModelObject().getCriteria(), CreateDateCriteria.class, getPredicate());+ return criterias.isEmpty() ? null : criterias.get(0).getDate();+ }++ @Override+ public void setObject(Date object) {+ var criteria = object != null ? new CreateDateCriteria(DateUtils.formatDate(object), IsUntil) : null;+ var query = getModelObject();+ query.setCriteria(setMatchingCriteria(query.getCriteria(), CreateDateCriteria.class, criteria, getPredicate()));+ getModel().setObject(query);+ }++ }, false);+ createdBeforePicker.add(new AjaxFormComponentUpdatingBehavior("change") {++ @Override+ protected void onUpdate(AjaxRequestTarget target) {+ }++ });+ add(createdBeforePicker);++ add(AttributeModifier.append("class", "no-autofocus"));+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/list/WorkspaceListPanel.html b/server-core/src/main/java/io/onedev/server/web/component/workspace/list/WorkspaceListPanel.htmlnew file mode 100644index 0000000000..0447ec13ee--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/list/WorkspaceListPanel.html@@ -0,0 +1,55 @@+<wicket:panel>+ <div class="workspace-list card no-autofocus">+ <div class="card-body">+ <div class="d-flex mb-4">+ <form wicket:id="query" class="clearable-wrapper flex-grow-1">+ <div class="input-group">+ <input wicket:id="input" spellcheck="false" autocomplete="off" class="form-control" t:placeholder="Query/order workspaces">+ <span class="input-group-append">+ <button wicket:id="submit" type="submit" class="btn btn-icon btn-outline-secondary" t:data-tippy-content="Query"><wicket:svg href="magnify" class="icon"></wicket:svg></button>+ </span>+ </div>+ </form>+ <a wicket:id="createWorkspace" class="btn btn-primary btn-icon flex-shrink-0 ml-3" t:data-tippy-content="Create Workspace"><wicket:svg href="plus" class="icon"/></a>+ </div>+ <div class="mb-4">+ <a wicket:id="showSavedQueries" class="show-saved-queries text-gray d-inline-block mb-2 mr-4 text-nowrap">+ <wicket:svg href="eye" class="icon"></wicket:svg> <wicket:t>Show Saved Queries</wicket:t>+ </a>+ <a wicket:id="saveQuery" class="save-query text-gray d-inline-block mb-2 mr-4 text-nowrap">+ <wicket:svg href="save" class="icon"></wicket:svg> <wicket:t>Save Query</wicket:t>+ </a>+ <a wicket:id="filter" class="filter text-gray mr-4 mb-2 d-inline-block text-nowrap">+ <wicket:svg href="filter" class="icon"></wicket:svg> <wicket:t>Filter</wicket:t>+ </a>+ <a wicket:id="orderBy" class="order-by text-gray mr-4 mb-2 d-inline-block text-nowrap">+ <wicket:svg href="sort" class="icon"></wicket:svg> <wicket:t>Order By</wicket:t>+ </a>+ <a wicket:id="operations" class="operations text-gray mr-4 mb-2 d-inline-block text-nowrap">+ <wicket:svg href="ellipsis-circle" class="icon"></wicket:svg> <wicket:t>Operations</wicket:t>+ </a>+ <span wicket:id="count" class="float-right text-gray"></span>+ </div>+ <div wicket:id="body">+ <div wicket:id="feedback"></div>+ <table wicket:id="workspaces" class="table"></table>+ </div>+ </div>+ </div>+ <wicket:fragment wicket:id="workspaceFrag">+ <a wicket:id="link">+ <svg wicket:id="icon" class="icon mr-1"></svg>+ <span wicket:id="label"></span>+ </a>+ </wicket:fragment>+ <wicket:fragment wicket:id="branchFrag">+ <a wicket:id="branch"></a>+ </wicket:fragment>+ <wicket:fragment wicket:id="userFrag">+ <a wicket:id="link"></a>+ </wicket:fragment>+ <wicket:fragment wicket:id="specFrag">+ <span wicket:id="label"></span>+ <span wicket:id="invalidSpec" class="text-warning ml-1"></span>+ </wicket:fragment>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/list/WorkspaceListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/workspace/list/WorkspaceListPanel.javanew file mode 100644index 0000000000..2a00ccf969--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/list/WorkspaceListPanel.java@@ -0,0 +1,783 @@+package io.onedev.server.web.component.workspace.list;++import static io.onedev.server.model.Workspace.SORT_FIELDS;+import static io.onedev.server.web.translation.Translation._T;++import java.text.MessageFormat;+import java.util.ArrayList;+import java.util.Collection;+import java.util.Iterator;+import java.util.LinkedHashMap;+import java.util.List;+import java.util.Map;++import org.apache.commons.lang3.StringUtils;+import org.apache.wicket.Component;+import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.ajax.markup.html.form.AjaxButton;+import org.apache.wicket.behavior.AttributeAppender;+import org.apache.wicket.event.Broadcast;+import org.apache.wicket.event.IEvent;+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;+import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;+import org.apache.wicket.feedback.FencedFeedbackPanel;+import org.apache.wicket.markup.ComponentTag;+import org.apache.wicket.markup.html.WebMarkupContainer;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.form.Form;+import org.apache.wicket.markup.html.form.TextField;+import org.apache.wicket.markup.html.panel.Fragment;+import org.apache.wicket.markup.html.panel.Panel;+import org.apache.wicket.markup.repeater.Item;+import org.apache.wicket.markup.repeater.OddEvenItem;+import org.apache.wicket.model.AbstractReadOnlyModel;+import org.apache.wicket.model.IModel;+import org.apache.wicket.model.LoadableDetachableModel;+import org.apache.wicket.model.Model;+import org.apache.wicket.request.cycle.RequestCycle;+import org.jspecify.annotations.Nullable;++import io.onedev.commons.utils.ExplicitException;+import io.onedev.server.OneDev;+import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.support.workspace.spec.WorkspaceSpec;+import io.onedev.server.search.entity.EntityQuery;+import io.onedev.server.search.entity.EntitySort;+import io.onedev.server.search.entity.EntitySort.Direction;+import io.onedev.server.search.entity.workspace.FuzzyCriteria;+import io.onedev.server.search.entity.workspace.WorkspaceQuery;+import io.onedev.server.security.SecurityUtils;+import io.onedev.server.security.permission.WriteCode;+import io.onedev.server.service.ProjectService;+import io.onedev.server.util.DateUtils;+import io.onedev.server.util.ProjectAndBranch;+import io.onedev.server.web.WebConstants;+import io.onedev.server.web.WebSession;+import io.onedev.server.web.behavior.WorkspaceQueryBehavior;+import io.onedev.server.web.component.branch.BranchLink;+import io.onedev.server.web.component.branch.picker.BranchSelector;+import io.onedev.server.web.component.datatable.DefaultDataTable;+import io.onedev.server.web.component.datatable.selectioncolumn.SelectionColumn;+import io.onedev.server.web.component.floating.AlignPlacement;+import io.onedev.server.web.component.floating.Alignment;+import io.onedev.server.web.component.floating.ComponentTarget;+import io.onedev.server.web.component.floating.FloatingPanel;+import io.onedev.server.web.component.link.ActionablePageLink;+import io.onedev.server.web.component.link.DropdownLink;+import io.onedev.server.web.component.menu.MenuItem;+import io.onedev.server.web.component.menu.MenuLink;+import io.onedev.server.web.component.modal.confirm.ConfirmModalPanel;+import io.onedev.server.web.component.project.selector.ProjectSelector;+import io.onedev.server.web.component.savedquery.SavedQueriesClosed;+import io.onedev.server.web.component.savedquery.SavedQueriesOpened;+import io.onedev.server.web.component.sortedit.SortEditPanel;+import io.onedev.server.web.component.user.ident.Mode;+import io.onedev.server.web.component.user.ident.UserIdentPanel;+import io.onedev.server.web.component.workspace.invalidspec.InvalidWorkspaceSpecIcon;+import io.onedev.server.web.component.workspace.specselector.WorkspaceSpecSelector;+import io.onedev.server.web.component.workspace.status.WorkspaceStatusIcon;+import io.onedev.server.web.page.project.workspaces.detail.dashboard.WorkspaceDashboardPage;+import io.onedev.server.web.util.Cursor;+import io.onedev.server.web.util.LoadableDetachableDataProvider;+import io.onedev.server.web.util.QuerySaveSupport;+import io.onedev.server.web.util.paginghistory.PagingHistorySupport;+import io.onedev.server.workspace.WorkspaceService;++public abstract class WorkspaceListPanel extends Panel {++ private final IModel<String> queryStringModel;++ private final IModel<WorkspaceQuery> queryModel = new LoadableDetachableModel<>() {+ @Override+ protected WorkspaceQuery load() {+ return parse(queryStringModel.getObject());+ }+ };++ private Component countLabel;++ private DataTable<Workspace, Void> workspacesTable;++ private SelectionColumn<Workspace, Void> selectionColumn;++ private LoadableDetachableDataProvider<Workspace, Void> dataProvider;++ private TextField<String> queryInput;++ private Component createWorkspaceLink;++ private WebMarkupContainer body;++ private Component saveQueryLink;++ private boolean querySubmitted = true;++ public WorkspaceListPanel(String id, IModel<String> queryModel) {+ super(id);+ this.queryStringModel = queryModel;+ }++ private WorkspaceService getWorkspaceService() {+ return OneDev.getInstance(WorkspaceService.class);+ }++ private ProjectService getProjectService() {+ return OneDev.getInstance(ProjectService.class);+ }++ @Nullable+ private WorkspaceQuery parse(@Nullable String queryString) {+ WorkspaceQuery parsedQuery;+ try {+ parsedQuery = WorkspaceQuery.parse(getProject(), queryString, true);+ } catch (Exception e) {+ getFeedbackMessages().clear();+ if (e instanceof ExplicitException) {+ error(e.getMessage());+ return null;+ } else {+ info(_T("Performing fuzzy query. Enclose search text with '~' to add more conditions, for instance: ~branch name~ and \"Status\" is \"STARTED\""));+ parsedQuery = new WorkspaceQuery(new FuzzyCriteria(queryString));+ }+ }+ return parsedQuery;+ }++ @Override+ protected void onDetach() {+ queryStringModel.detach();+ queryModel.detach();+ super.onDetach();+ }++ @Nullable+ protected abstract Project getProject();++ @Nullable+ protected PagingHistorySupport getPagingHistorySupport() {+ return null;+ }++ @Nullable+ protected QuerySaveSupport getQuerySaveSupport() {+ return null;+ }++ private void doQuery(AjaxRequestTarget target) {+ workspacesTable.setCurrentPage(0);+ target.add(countLabel);+ target.add(body);+ if (selectionColumn != null)+ selectionColumn.getSelections().clear();+ querySubmitted = true;+ if (SecurityUtils.getAuthUser() != null && getQuerySaveSupport() != null)+ target.add(saveQueryLink);+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ add(new AjaxLink<Void>("showSavedQueries") {++ @Override+ public void onEvent(IEvent<?> event) {+ super.onEvent(event);+ if (event.getPayload() instanceof SavedQueriesClosed) {+ ((SavedQueriesClosed) event.getPayload()).getHandler().add(this);+ }+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(getQuerySaveSupport() != null && !getQuerySaveSupport().isSavedQueriesVisible());+ }++ @Override+ public void onClick(AjaxRequestTarget target) {+ send(getPage(), Broadcast.BREADTH, new SavedQueriesOpened(target));+ target.add(this);+ }++ }.setOutputMarkupPlaceholderTag(true));++ add(saveQueryLink = new AjaxLink<Void>("saveQuery") {++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setEnabled(querySubmitted && queryModel.getObject() != null);+ setVisible(SecurityUtils.getAuthUser() != null && getQuerySaveSupport() != null);+ }++ @Override+ protected void onComponentTag(ComponentTag tag) {+ super.onComponentTag(tag);+ configure();+ if (!isEnabled())+ tag.append("class", "disabled", " ");+ if (!querySubmitted)+ tag.put("data-tippy-content", _T("Query not submitted"));+ else if (queryModel.getObject() == null)+ tag.put("data-tippy-content", _T("Can not save malformed query"));+ }++ @Override+ public void onClick(AjaxRequestTarget target) {+ getQuerySaveSupport().onSaveQuery(target, queryModel.getObject().toString());+ }++ }.setOutputMarkupPlaceholderTag(true));++ add(new MenuLink("operations") {++ @Override+ protected List<MenuItem> getMenuItems(FloatingPanel dropdown) {+ List<MenuItem> menuItems = new ArrayList<>();++ menuItems.add(new MenuItem() {++ @Override+ public String getLabel() {+ return _T("Delete Selected Workspaces");+ }++ @Override+ public WebMarkupContainer newLink(String id) {+ return new AjaxLink<Void>(id) {++ @Override+ public void onClick(AjaxRequestTarget target) {+ dropdown.close();++ new ConfirmModalPanel(target) {++ @Override+ protected void onConfirm(AjaxRequestTarget target) {+ Collection<Workspace> workspaces = new ArrayList<>();+ for (IModel<Workspace> each : selectionColumn.getSelections())+ workspaces.add(each.getObject());+ getWorkspaceService().delete(workspaces);+ target.add(countLabel);+ target.add(body);+ selectionColumn.getSelections().clear();+ }++ @Override+ protected String getConfirmMessage() {+ return _T("Type <code>yes</code> below to delete selected workspaces");+ }++ @Override+ protected String getConfirmInput() {+ return "yes";+ }++ };+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setEnabled(!selectionColumn.getSelections().isEmpty());+ }++ @Override+ protected void onComponentTag(ComponentTag tag) {+ super.onComponentTag(tag);+ configure();+ if (!isEnabled()) {+ tag.put("disabled", "disabled");+ tag.put("data-tippy-content", _T("Please select workspaces to delete"));+ }+ }++ };+ }++ });++ menuItems.add(new MenuItem() {++ @Override+ public String getLabel() {+ return _T("Delete All Queried Workspaces");+ }++ @Override+ public WebMarkupContainer newLink(String id) {+ return new AjaxLink<Void>(id) {++ @SuppressWarnings("unchecked")+ @Override+ public void onClick(AjaxRequestTarget target) {+ dropdown.close();++ new ConfirmModalPanel(target) {++ @Override+ protected void onConfirm(AjaxRequestTarget target) {+ Collection<Workspace> workspaces = new ArrayList<>();+ for (Iterator<Workspace> it = (Iterator<Workspace>) dataProvider.iterator(0, workspacesTable.getItemCount()); it.hasNext(); )+ workspaces.add(it.next());+ getWorkspaceService().delete(workspaces);+ dataProvider.detach();+ target.add(countLabel);+ target.add(body);+ selectionColumn.getSelections().clear();+ }++ @Override+ protected String getConfirmMessage() {+ return _T("Type <code>yes</code> below to delete all queried workspaces");+ }++ @Override+ protected String getConfirmInput() {+ return "yes";+ }++ };+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setEnabled(workspacesTable.getItemCount() != 0);+ }++ @Override+ protected void onComponentTag(ComponentTag tag) {+ super.onComponentTag(tag);+ configure();+ if (!isEnabled()) {+ tag.put("disabled", "disabled");+ tag.put("data-tippy-content", _T("No workspaces to delete"));+ }+ }++ };+ }++ });++ return menuItems;+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(getProject() != null && SecurityUtils.canManageWorkspaces(getProject()));+ }++ });++ add(new DropdownLink("filter") {++ @Override+ protected Component newContent(String id, FloatingPanel dropdown) {+ return new WorkspaceFilterPanel(id, new IModel<>() {++ @Override+ public void detach() {+ }++ @Override+ public WorkspaceQuery getObject() {+ var query = parse(queryStringModel.getObject());+ return query != null ? query : new WorkspaceQuery();+ }++ @Override+ public void setObject(EntityQuery<Workspace> object) {+ WorkspaceListPanel.this.getFeedbackMessages().clear();+ queryStringModel.setObject(object.toString());+ var target = RequestCycle.get().find(AjaxRequestTarget.class);+ target.add(queryInput);+ doQuery(target);+ }++ }) {++ @Override+ protected Project getProject() {+ return WorkspaceListPanel.this.getProject();+ }++ };+ }++ });++ add(new DropdownLink("orderBy") {++ @Override+ protected Component newContent(String id, FloatingPanel dropdown) {+ Map<String, Direction> sortFields = new LinkedHashMap<>();+ for (var entry : SORT_FIELDS.entrySet())+ sortFields.put(entry.getKey(), entry.getValue().getDefaultDirection());+ if (getProject() != null)+ sortFields.remove(Workspace.NAME_PROJECT);++ return new SortEditPanel<Workspace>(id, sortFields, new IModel<>() {++ @Override+ public void detach() {+ }++ @Override+ public List<EntitySort> getObject() {+ var query = parse(queryStringModel.getObject());+ return query != null ? query.getSorts() : new ArrayList<>();+ }++ @Override+ public void setObject(List<EntitySort> object) {+ WorkspaceQuery query = parse(queryStringModel.getObject());+ WorkspaceListPanel.this.getFeedbackMessages().clear();+ if (query == null)+ query = new WorkspaceQuery();+ query.setSorts(object);+ queryStringModel.setObject(query.toString());+ AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class);+ target.add(queryInput);+ doQuery(target);+ }++ });+ }++ });++ queryInput = new TextField<>("input", queryStringModel);+ queryInput.add(new WorkspaceQueryBehavior(+ new AbstractReadOnlyModel<>() {+ @Override+ public Project getObject() {+ return getProject();+ }+ }, true) {++ @Override+ protected void onInput(AjaxRequestTarget target, String inputContent) {+ WorkspaceListPanel.this.getFeedbackMessages().clear();+ querySubmitted = StringUtils.trimToEmpty(queryStringModel.getObject())+ .equals(StringUtils.trimToEmpty(inputContent));+ target.add(saveQueryLink);+ }++ @Override+ protected boolean isSelectOnFocus() {+ return true;+ }++ });++ queryInput.add(new AjaxFormComponentUpdatingBehavior("clear") {+ @Override+ protected void onUpdate(AjaxRequestTarget target) {+ doQuery(target);+ }+ });++ Form<?> queryForm = new Form<Void>("query");+ queryForm.add(queryInput);+ queryForm.add(new AjaxButton("submit") {+ @Override+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {+ super.onSubmit(target, form);+ WorkspaceListPanel.this.getFeedbackMessages().clear();+ doQuery(target);+ }+ });+ add(queryForm);++ if (getProject() == null) {+ add(createWorkspaceLink = new DropdownLink("createWorkspace") {++ @Override+ protected Component newContent(String id, FloatingPanel dropdown) {+ return new ProjectSelector(id, new LoadableDetachableModel<>() {++ @Override+ protected List<Project> load() {+ List<Project> projects = new ArrayList<>(SecurityUtils.getAuthorizedProjects(new WriteCode()));+ projects.removeIf(p -> p.getHierarchyWorkspaceSpecs().isEmpty());+ projects.sort(getProjectService().cloneCache().comparingPath());+ return projects;+ }++ }) {+ @Override+ protected String getTitle() {+ return _T("Select Project");+ }++ @Override+ protected void onSelect(AjaxRequestTarget target, Project project) {+ dropdown.close();+ newBranchSelector(target, project);+ }++ }.add(AttributeAppender.append("class", "no-current"));+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(SecurityUtils.getAuthUser() != null);+ }++ });+ } else {+ add(createWorkspaceLink = new AjaxLink<Void>("createWorkspace") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ newBranchSelector(target, getProject());+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(SecurityUtils.getAuthUser() != null);+ }++ });+ }++ add(countLabel = new Label("count", new AbstractReadOnlyModel<String>() {+ @Override+ public String getObject() {+ if (dataProvider.size() > 1)+ return MessageFormat.format(_T("found {0} workspaces"), dataProvider.size());+ else+ return _T("found 1 workspace");+ }+ }) {+ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(dataProvider.size() != 0);+ }+ }.setOutputMarkupPlaceholderTag(true));++ dataProvider = new LoadableDetachableDataProvider<>() {++ @Override+ public Iterator<? extends Workspace> iterator(long first, long count) {+ try {+ var query = queryModel.getObject();+ if (query != null) {+ return getWorkspaceService().query(SecurityUtils.getSubject(), getProject(),+ query, (int) first, (int) count).iterator();+ }+ } catch (ExplicitException e) {+ error(e.getMessage());+ }+ return new ArrayList<Workspace>().iterator();+ }++ @Override+ public long calcSize() {+ try {+ WorkspaceQuery query = queryModel.getObject();+ if (query != null)+ return getWorkspaceService().count(SecurityUtils.getSubject(), getProject(),+ query.getCriteria());+ } catch (ExplicitException e) {+ error(e.getMessage());+ }+ return 0;+ }++ @Override+ public IModel<Workspace> model(Workspace object) {+ Long workspaceId = object.getId();+ return new LoadableDetachableModel<>() {+ @Override+ protected Workspace load() {+ return getWorkspaceService().load(workspaceId);+ }+ };+ }++ };++ body = new WebMarkupContainer("body");+ add(body.setOutputMarkupId(true));++ body.add(new FencedFeedbackPanel("feedback", this));++ List<IColumn<Workspace, Void>> columns = new ArrayList<>();++ if (getProject() != null && SecurityUtils.canWriteCode(getProject()))+ columns.add(selectionColumn = new SelectionColumn<>());++ columns.add(new AbstractColumn<>(Model.of(_T("Workspace"))) {++ @Override+ public String getCssClass() {+ return "workspace";+ }++ @Override+ public void populateItem(Item<ICellPopulator<Workspace>> cellItem, String componentId,+ IModel<Workspace> rowModel) {+ Fragment fragment = new Fragment(componentId, "workspaceFrag", WorkspaceListPanel.this);+ Workspace workspace = rowModel.getObject();+ var link = new ActionablePageLink("link", WorkspaceDashboardPage.class,+ WorkspaceDashboardPage.paramsOf(workspace)) {++ @Override+ protected void doBeforeNav(AjaxRequestTarget target) {+ OddEvenItem<?> row = cellItem.findParent(OddEvenItem.class);+ Cursor cursor = new Cursor(queryModel.getObject().toString(), (int) workspacesTable.getItemCount(),+ (int) workspacesTable.getCurrentPage() * WebConstants.PAGE_SIZE + row.getIndex(), getProject());+ WebSession.get().setWorkspaceCursor(cursor);+ }+ };++ link.add(new WorkspaceStatusIcon("icon", new AbstractReadOnlyModel<>() {+ @Override+ public Workspace.Status getObject() {+ return rowModel.getObject().getStatus();+ }+ }));+ link.add(new Label("label", workspace.getReference().toString(getProject())));++ fragment.add(link);+ cellItem.add(fragment);+ }+ });++ columns.add(new AbstractColumn<>(Model.of(_T("User"))) {++ @Override+ public String getCssClass() {+ return "user d-none d-md-table-cell";+ }++ @Override+ public void populateItem(Item<ICellPopulator<Workspace>> cellItem, String componentId,+ IModel<Workspace> rowModel) {+ Fragment fragment = new Fragment(componentId, "userFrag", WorkspaceListPanel.this);+ fragment.add(new UserIdentPanel("link", rowModel.getObject().getUser(), Mode.AVATAR_AND_NAME));+ cellItem.add(fragment);+ }+ });++ columns.add(new AbstractColumn<>(Model.of(_T("Branch"))) {++ @Override+ public String getCssClass() {+ return "branch d-none d-md-table-cell";+ }++ @Override+ public void populateItem(Item<ICellPopulator<Workspace>> cellItem, String componentId,+ IModel<Workspace> rowModel) {+ Fragment fragment = new Fragment(componentId, "branchFrag", WorkspaceListPanel.this);+ Workspace workspace = rowModel.getObject();+ fragment.add(new BranchLink("branch",+ new ProjectAndBranch(workspace.getProject(), workspace.getBranch()), true));+ cellItem.add(fragment);+ }+ });++ columns.add(new AbstractColumn<>(Model.of(_T("Spec"))) {++ @Override+ public String getCssClass() {+ return "spec d-none d-md-table-cell";+ }++ @Override+ public void populateItem(Item<ICellPopulator<Workspace>> cellItem, String componentId,+ IModel<Workspace> rowModel) {+ Fragment fragment = new Fragment(componentId, "specFrag", WorkspaceListPanel.this);+ Workspace workspace = rowModel.getObject();+ fragment.add(new Label("label", workspace.getSpecName()));+ fragment.add(new InvalidWorkspaceSpecIcon("invalidSpec", rowModel));++ cellItem.add(fragment);+ }++ });++ columns.add(new AbstractColumn<>(Model.of(_T("Created"))) {++ @Override+ public String getCssClass() {+ return "date d-none d-xl-table-cell";+ }++ @Override+ public void populateItem(Item<ICellPopulator<Workspace>> cellItem, String componentId,+ IModel<Workspace> rowModel) {+ cellItem.add(new Label(componentId, DateUtils.formatAge(rowModel.getObject().getCreateDate())));+ }+ });++ body.add(workspacesTable = new DefaultDataTable<>("workspaces", columns, dataProvider,+ WebConstants.PAGE_SIZE, getPagingHistorySupport()));++ setOutputMarkupId(true);+ }++ private void newBranchSelector(AjaxRequestTarget target, Project project) {+ var projectId = project.getId();++ var placement = new AlignPlacement(100, 100, 100, 0, 0);+ Alignment alignment = new Alignment(new ComponentTarget(createWorkspaceLink), placement);+ new FloatingPanel(target, alignment, true, true, null) {++ private Project getSelectedProject() {+ return getProjectService().load(projectId);+ }++ @Override+ protected Component newContent(String id) {+ return new BranchSelector(id, new LoadableDetachableModel<>() {+ @Override+ protected Project load() {+ return getSelectedProject();+ }+ }, null) {++ @Override+ protected void onSelect(AjaxRequestTarget target, String branch) {+ close();++ new FloatingPanel(target, alignment, true, true, null) {++ @Override+ protected Component newContent(String id) {+ return new WorkspaceSpecSelector(id, branch) {+ @Override+ protected void onSelect(AjaxRequestTarget target, WorkspaceSpec spec) {+ close();+ }++ @Override+ protected Project getProject() {+ return getSelectedProject();+ }+ };+ }++ };+ }+ };+ }++ };+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/minilist/MiniWorkspaceListCssResourceReference.java b/server-core/src/main/java/io/onedev/server/web/component/workspace/minilist/MiniWorkspaceListCssResourceReference.javanew file mode 100644index 0000000000..b7c336da55--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/minilist/MiniWorkspaceListCssResourceReference.java@@ -0,0 +1,13 @@+package io.onedev.server.web.component.workspace.minilist;++import io.onedev.server.web.page.base.BaseDependentCssResourceReference;++public class MiniWorkspaceListCssResourceReference extends BaseDependentCssResourceReference {++ private static final long serialVersionUID = 1L;++ public MiniWorkspaceListCssResourceReference() {+ super(MiniWorkspaceListCssResourceReference.class, "mini-workspace-list.css");+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/minilist/MiniWorkspaceListPanel.html b/server-core/src/main/java/io/onedev/server/web/component/workspace/minilist/MiniWorkspaceListPanel.htmlnew file mode 100644index 0000000000..403d23a49a--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/minilist/MiniWorkspaceListPanel.html@@ -0,0 +1,21 @@+<wicket:panel>+ <div wicket:id="content" class="mini-workspace-list"></div>+ <wicket:fragment wicket:id="hasWorkspacesFrag">+ <div class="has-workspaces">+ <wicket:enclosure child="showInList">+ <div class="head d-flex align-items-center py-3 px-3 border-bottom">+ <h6 class="mb-0 mr-4"><wicket:t>Workspaces</wicket:t></h6>+ <a wicket:id="showInList" class="show-in-list" t:data-tippy-content="Show in workspace list"><wicket:svg href="unordered-list" class="icon"></wicket:svg></a>+ </div>+ </wicket:enclosure>+ <div class="body py-2">+ <div wicket:id="workspaces">+ <a wicket:id="workspace" class="workspace d-flex align-items-center bg-hover-light text-hover-gray-dark px-3 py-2">+ <svg wicket:id="status" class="status mr-2"></svg>+ <span wicket:id="title" class="title"></span>+ </a>+ </div>+ </div>+ </div>+ </wicket:fragment>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/minilist/MiniWorkspaceListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/workspace/minilist/MiniWorkspaceListPanel.javanew file mode 100644index 0000000000..704d439ca7--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/minilist/MiniWorkspaceListPanel.java@@ -0,0 +1,88 @@+package io.onedev.server.web.component.workspace.minilist;++import static io.onedev.server.web.translation.Translation._T;++import java.util.List;++import org.apache.wicket.Component;+import org.apache.wicket.behavior.AttributeAppender;+import org.apache.wicket.markup.head.CssHeaderItem;+import org.apache.wicket.markup.head.IHeaderResponse;+import org.apache.wicket.markup.html.WebMarkupContainer;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.link.BookmarkablePageLink;+import org.apache.wicket.markup.html.link.Link;+import org.apache.wicket.markup.html.list.ListItem;+import org.apache.wicket.markup.html.list.ListView;+import org.apache.wicket.markup.html.panel.Fragment;+import org.apache.wicket.markup.html.panel.GenericPanel;+import org.apache.wicket.model.IModel;+import org.apache.wicket.model.LoadableDetachableModel;++import io.onedev.server.OneDev;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.Workspace.Status;+import io.onedev.server.web.component.workspace.status.WorkspaceStatusIcon;+import io.onedev.server.web.page.project.workspaces.detail.dashboard.WorkspaceDashboardPage;+import io.onedev.server.workspace.WorkspaceService;++public class MiniWorkspaceListPanel extends GenericPanel<List<Workspace>> {++ public MiniWorkspaceListPanel(String id, IModel<List<Workspace>> model) {+ super(id, model);+ }++ protected List<Workspace> getWorkspaces() {+ return getModelObject();+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ if (!getWorkspaces().isEmpty()) {+ Fragment fragment = new Fragment("content", "hasWorkspacesFrag", this);+ fragment.add(newListLink("showInList"));++ fragment.add(new ListView<Workspace>("workspaces", getModel()) {++ @Override+ protected void populateItem(ListItem<Workspace> item) {+ Workspace workspace = item.getModelObject();++ Link<Void> workspaceLink = new BookmarkablePageLink<Void>("workspace",+ WorkspaceDashboardPage.class, WorkspaceDashboardPage.paramsOf(workspace));++ Long workspaceId = workspace.getId();+ workspaceLink.add(new WorkspaceStatusIcon("status", new LoadableDetachableModel<Status>() {++ @Override+ protected Status load() {+ return OneDev.getInstance(WorkspaceService.class).load(workspaceId).getStatus();+ }++ }));++ String title = "#" + workspace.getNumber() + " (" + workspace.getUser().getDisplayName() + ")";+ workspaceLink.add(new Label("title", title));+ item.add(workspaceLink);+ }++ });+ add(fragment);+ } else {+ add(new Label("content", _T("No workspaces")).add(AttributeAppender.append("class", "no-workspaces font-italic mx-5 my-4 text-nowrap")));+ }+ }++ @Override+ public void renderHead(IHeaderResponse response) {+ super.renderHead(response);+ response.render(CssHeaderItem.forReference(new MiniWorkspaceListCssResourceReference()));+ }++ protected Component newListLink(String componentId) {+ return new WebMarkupContainer(componentId).setVisible(false);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/minilist/mini-workspace-list.css b/server-core/src/main/java/io/onedev/server/web/component/workspace/minilist/mini-workspace-list.cssnew file mode 100644index 0000000000..e3680e809d--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/minilist/mini-workspace-list.css@@ -0,0 +1,3 @@+.workspace-spec-list .no-workspaces {+ margin: 0.5rem 1rem !important;+}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/speclist/WorkspaceSpecListPanel.html b/server-core/src/main/java/io/onedev/server/web/component/workspace/speclist/WorkspaceSpecListPanel.htmlnew file mode 100644index 0000000000..74a52c1bb4--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/speclist/WorkspaceSpecListPanel.html@@ -0,0 +1,14 @@+<wicket:panel>+ <div class="workspace-spec-list">+ <div wicket:id="specs" class="spec">+ <div class="head text-nowrap d-flex align-items-center px-3 py-2 bg-light border-top">+ <b wicket:id="name" class="mr-auto"></b>+ <a wicket:id="showInList" class="ml-2 d-flex align-items-center" t:data-tippy-content="Show in workspace list"><wicket:svg href="unordered-list" class="icon"></wicket:svg></a>+ <a wicket:id="create" class="ml-2 d-flex align-items-center" t:data-tippy-content="Create workspace with this spec"><wicket:svg href="plus" class="icon"></wicket:svg></a>+ </div>+ <div class="body">+ <div wicket:id="detail"></div>+ </div>+ </div>+ </div>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/speclist/WorkspaceSpecListPanel.java b/server-core/src/main/java/io/onedev/server/web/component/workspace/speclist/WorkspaceSpecListPanel.javanew file mode 100644index 0000000000..4fad1a250f--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/speclist/WorkspaceSpecListPanel.java@@ -0,0 +1,125 @@+package io.onedev.server.web.component.workspace.speclist;++import static io.onedev.server.search.entity.workspace.WorkspaceQueryLexer.Is;++import java.util.ArrayList;+import java.util.Comparator;+import java.util.List;++import javax.inject.Inject;++import org.apache.wicket.markup.html.WebMarkupContainer;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.link.BookmarkablePageLink;+import org.apache.wicket.markup.html.panel.Panel;+import org.apache.wicket.markup.repeater.RepeatingView;+import org.apache.wicket.model.LoadableDetachableModel;++import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.support.workspace.spec.WorkspaceSpec;+import io.onedev.server.search.entity.workspace.BranchCriteria;+import io.onedev.server.search.entity.workspace.ProjectCriteria;+import io.onedev.server.search.entity.workspace.SpecCriteria;+import io.onedev.server.search.entity.workspace.WorkspaceQuery;+import io.onedev.server.security.SecurityUtils;+import io.onedev.server.util.criteria.Criteria;+import io.onedev.server.web.component.workspace.CreateWorkspaceLink;+import io.onedev.server.web.component.workspace.minilist.MiniWorkspaceListPanel;+import io.onedev.server.web.page.project.workspaces.ProjectWorkspacesPage;+import io.onedev.server.workspace.WorkspaceService;++public abstract class WorkspaceSpecListPanel extends Panel {++ @Inject+ private WorkspaceService workspaceService;++ private final String branch;++ public WorkspaceSpecListPanel(String id, String branch) {+ super(id);+ this.branch = branch;+ }++ protected abstract Project getProject();++ @Override+ protected void onInitialize() {+ super.onInitialize();++ RepeatingView specsView = new RepeatingView("specs");+ add(specsView);+ for (WorkspaceSpec spec : getProject().getHierarchyWorkspaceSpecs()) {+ WebMarkupContainer specItem = new WebMarkupContainer(specsView.newChildId());+ specItem.add(new Label("name", spec.getName()));+ String specName = spec.getName();++ List<Workspace> workspaces = queryWorkspaces(specName);++ String queryString = buildWorkspaceQueryString(specName);+ specItem.add(new BookmarkablePageLink<Void>("showInList", ProjectWorkspacesPage.class,+ ProjectWorkspacesPage.paramsOf(getProject(), queryString, 0)) {++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(!workspaces.isEmpty());+ }++ });++ specItem.add(new CreateWorkspaceLink("create", branch) {++ @Override+ protected Project getProject() {+ return WorkspaceSpecListPanel.this.getProject();+ }++ @Override+ protected String getSpecName() {+ return specName;+ }++ });++ var workspacesModel = new LoadableDetachableModel<List<Workspace>>() {++ @Override+ protected List<Workspace> load() {+ return queryWorkspaces(specName);+ }++ };+ specItem.add(new MiniWorkspaceListPanel("detail", workspacesModel));++ specItem.setOutputMarkupId(true);+ specsView.add(specItem);+ }+ }++ private Criteria<Workspace> buildWorkspaceCriteria(String specName) {+ return Criteria.andCriterias(List.of(+ new ProjectCriteria(getProject().getPath(), Is),+ new SpecCriteria(specName, Is),+ new BranchCriteria(branch, Is)));+ }++ private List<Workspace> queryWorkspaces(String specName) {+ var query = new WorkspaceQuery(buildWorkspaceCriteria(specName));+ var workspaces = new ArrayList<>(workspaceService.query(+ SecurityUtils.getSubject(), getProject(), query, 0, Integer.MAX_VALUE));+ workspaces.sort(Comparator.comparing(Workspace::getNumber));+ return workspaces;+ }++ private String buildWorkspaceQueryString(String specName) {+ return new WorkspaceQuery(buildWorkspaceCriteria(specName)).toString();+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(!getProject().getHierarchyWorkspaceSpecs().isEmpty());+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/specselector/WorkspaceSpecSelector.html b/server-core/src/main/java/io/onedev/server/web/component/workspace/specselector/WorkspaceSpecSelector.htmlnew file mode 100644index 0000000000..5686879b39--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/specselector/WorkspaceSpecSelector.html@@ -0,0 +1,15 @@+<wicket:panel>+ <div class="workspace-spec-selector py-4 px-3">+ <div class="mb-3 font-weight-bold font-size-lg border-bottom pb-3"><wicket:t>Select Spec</wicket:t></div>+ <div class="d-flex align-items-center">+ <input wicket:id="search" class="form-control form-control-sm spec" t:placeholder="Search spec"></input>+ <wicket:svg href="magnify" class="icon text-muted icon-magnify"></wicket:svg>+ </div>+ <ul wicket:id="specs" class="list-unstyled specs overflow-auto mb-0 mt-3">+ <li wicket:id="specs" class="spec selectable">+ <a wicket:id="link"><span wicket:id="label"></span></a>+ </li>+ </ul>+ <div wicket:id="noSpecs" class="no-specs mb-0 mt-4"><div class="alert alert-notice alert-light-warning"><wicket:t>No specs found</wicket:t></div></div>+ </div>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/specselector/WorkspaceSpecSelector.java b/server-core/src/main/java/io/onedev/server/web/component/workspace/specselector/WorkspaceSpecSelector.javanew file mode 100644index 0000000000..3e63539311--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/specselector/WorkspaceSpecSelector.java@@ -0,0 +1,188 @@+package io.onedev.server.web.component.workspace.specselector;++import java.util.ArrayList;+import java.util.List;+import java.util.UUID;++import org.apache.wicket.Component;+import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.behavior.AttributeAppender;+import org.apache.wicket.markup.head.CssHeaderItem;+import org.apache.wicket.markup.head.IHeaderResponse;+import org.apache.wicket.markup.head.JavaScriptHeaderItem;+import org.apache.wicket.markup.head.OnDomReadyHeaderItem;+import org.apache.wicket.markup.html.WebMarkupContainer;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.form.TextField;+import org.apache.wicket.markup.html.panel.Panel;+import org.apache.wicket.markup.repeater.RepeatingView;+import org.apache.wicket.model.IModel;+import org.apache.wicket.model.LoadableDetachableModel;+import org.apache.wicket.model.Model;++import io.onedev.server.OneDev;+import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.support.workspace.spec.WorkspaceSpec;+import io.onedev.server.security.SecurityUtils;+import io.onedev.server.web.WebConstants;+import io.onedev.server.web.asset.selectbytyping.SelectByTypingResourceReference;+import io.onedev.server.web.behavior.InputChangeBehavior;+import io.onedev.server.web.behavior.infinitescroll.InfiniteScrollBehavior;+import io.onedev.server.web.page.project.workspaces.detail.dashboard.WorkspaceDashboardPage;+import io.onedev.server.workspace.WorkspaceService;++public abstract class WorkspaceSpecSelector extends Panel {++ private final String branch;++ private final IModel<List<WorkspaceSpec>> specsModel = new LoadableDetachableModel<>() {+ @Override+ protected List<WorkspaceSpec> load() {+ List<WorkspaceSpec> specs = new ArrayList<>();+ for (var spec : getProject().getHierarchyWorkspaceSpecs()) {+ if (searchInput == null || spec.getName().toLowerCase().contains(searchInput.toLowerCase()))+ specs.add(spec);+ }+ return specs;+ }+ };++ private RepeatingView specsView;++ private TextField<String> searchField;++ private String searchInput;++ public WorkspaceSpecSelector(String id, String branch) {+ super(id);+ this.branch = branch;+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ var specsContainer = new WebMarkupContainer("specs") {++ @Override+ protected void onBeforeRender() {+ specsView = new RepeatingView("specs");+ int index = 0;+ for (var spec : getSpecs()) {+ Component item = newItem(specsView.newChildId(), spec);+ if (index == 0)+ item.add(AttributeAppender.append("class", "active"));+ specsView.add(item);+ if (++index >= WebConstants.PAGE_SIZE)+ break;+ }+ addOrReplace(specsView);+ super.onBeforeRender();+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(!getSpecs().isEmpty());+ }+ };+ specsContainer.setOutputMarkupPlaceholderTag(true);+ add(specsContainer);++ specsContainer.add(new InfiniteScrollBehavior(WebConstants.PAGE_SIZE) {++ @Override+ protected void appendMore(AjaxRequestTarget target, int offset, int count) {+ for (int i = offset; i < offset + count; i++) {+ if (i >= getSpecs().size())+ break;+ var spec = getSpecs().get(i);+ Component item = newItem(specsView.newChildId(), spec);+ specsView.add(item);+ String script = String.format("$('#%s').append('<li id=\"%s\"></li>');",+ specsContainer.getMarkupId(), item.getMarkupId());+ target.prependJavaScript(script);+ target.add(item);+ }+ }++ });++ var noSpecsContainer = new WebMarkupContainer("noSpecs") {+ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(getSpecs().isEmpty());+ }+ };+ noSpecsContainer.setOutputMarkupPlaceholderTag(true);+ add(noSpecsContainer);++ searchField = new TextField<>("search", Model.of(""));+ add(searchField);+ searchField.add(new InputChangeBehavior() {++ @Override+ protected void onInputChange(AjaxRequestTarget target) {+ searchInput = searchField.getInput();+ target.add(specsContainer);+ target.add(noSpecsContainer);+ }++ });+ }++ private Component newItem(String componentId, WorkspaceSpec spec) {+ WebMarkupContainer item = new WebMarkupContainer(componentId);+ String specName = spec.getName();++ var link = new AjaxLink<Void>("link") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ var workspaceService = OneDev.getInstance(WorkspaceService.class);+ var workspace = new Workspace();+ workspace.setProject(getProject());+ workspace.setUser(SecurityUtils.getUser());+ workspace.setBranch(branch);+ workspace.setSpecName(specName);+ workspace.setToken(UUID.randomUUID().toString());+ workspaceService.create(workspace);+ onSelect(target, spec);+ setResponsePage(WorkspaceDashboardPage.class, WorkspaceDashboardPage.paramsOf(workspace));+ }++ };+ link.add(new Label("label", spec.getName()));+ item.add(link);++ return item;+ }++ @Override+ protected void onDetach() {+ super.onDetach();+ specsModel.detach();+ }++ private List<WorkspaceSpec> getSpecs() {+ return specsModel.getObject();+ }++ @Override+ public void renderHead(IHeaderResponse response) {+ super.renderHead(response);+ response.render(JavaScriptHeaderItem.forReference(new SelectByTypingResourceReference()));+ response.render(CssHeaderItem.forReference(new WorkspaceSpecSelectorCssResourceReference()));+ String script = String.format("$('#%s').selectByTyping($('#%s'));", searchField.getMarkupId(), getMarkupId());+ response.render(OnDomReadyHeaderItem.forScript(script));+ }++ protected abstract Project getProject();++ protected void onSelect(AjaxRequestTarget target, WorkspaceSpec spec) {+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/specselector/WorkspaceSpecSelectorCssResourceReference.java b/server-core/src/main/java/io/onedev/server/web/component/workspace/specselector/WorkspaceSpecSelectorCssResourceReference.javanew file mode 100644index 0000000000..efb4fc91c7--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/specselector/WorkspaceSpecSelectorCssResourceReference.java@@ -0,0 +1,9 @@+package io.onedev.server.web.component.workspace.specselector;++import io.onedev.server.web.page.base.BaseDependentCssResourceReference;++public class WorkspaceSpecSelectorCssResourceReference extends BaseDependentCssResourceReference {+ public WorkspaceSpecSelectorCssResourceReference() {+ super(WorkspaceSpecSelectorCssResourceReference.class, "workspace-spec-selector.css");+ }+}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/specselector/workspace-spec-selector.css b/server-core/src/main/java/io/onedev/server/web/component/workspace/specselector/workspace-spec-selector.cssnew file mode 100644index 0000000000..3e144885d9--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/specselector/workspace-spec-selector.css@@ -0,0 +1,13 @@+.workspace-spec-selector .specs, .workspace-spec-selector .no-specs {+ height: 400px;+}++.workspace-spec-selector {+ min-width: 250px;+}+.workspace-spec-selector input {+ padding-right: 2rem;+}+.workspace-spec-selector input+.icon {+ margin-left: -1.8rem;+}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/status/WorkspaceStatusCssResourceReference.java b/server-core/src/main/java/io/onedev/server/web/component/workspace/status/WorkspaceStatusCssResourceReference.javanew file mode 100644index 0000000000..8a29727185--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/status/WorkspaceStatusCssResourceReference.java@@ -0,0 +1,13 @@+package io.onedev.server.web.component.workspace.status;++import io.onedev.server.web.page.base.BaseDependentCssResourceReference;++public class WorkspaceStatusCssResourceReference extends BaseDependentCssResourceReference {++ private static final long serialVersionUID = 1L;++ public WorkspaceStatusCssResourceReference() {+ super(WorkspaceStatusCssResourceReference.class, "workspace-status.css");+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/status/WorkspaceStatusIcon.java b/server-core/src/main/java/io/onedev/server/web/component/workspace/status/WorkspaceStatusIcon.javanew file mode 100644index 0000000000..478a952f65--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/status/WorkspaceStatusIcon.java@@ -0,0 +1,100 @@+package io.onedev.server.web.component.workspace.status;++import java.util.Collection;++import org.apache.wicket.behavior.AttributeAppender;+import org.apache.wicket.markup.head.CssHeaderItem;+import org.apache.wicket.markup.head.IHeaderResponse;+import org.apache.wicket.model.AbstractReadOnlyModel;+import org.apache.wicket.model.IModel;+import org.apache.wicket.model.LoadableDetachableModel;+import org.jspecify.annotations.Nullable;++import com.google.common.collect.Sets;++import io.onedev.server.model.Workspace.Status;+import io.onedev.server.web.behavior.ChangeObserver;+import io.onedev.server.web.component.svg.SpriteImage;++public class WorkspaceStatusIcon extends SpriteImage {++ private static final long serialVersionUID = 1L;++ private final IModel<Status> model;++ public WorkspaceStatusIcon(String id, IModel<Status> model) {+ super(id, new LoadableDetachableModel<String>() {++ @Override+ protected String load() {+ return getIconHref(model.getObject());+ }++ });+ this.model = model;+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ add(AttributeAppender.append("class", new AbstractReadOnlyModel<String>() {++ @Override+ public String getObject() {+ return getIconClass(model.getObject());+ }++ }));++ add(new ChangeObserver() {++ @Override+ public Collection<String> findObservables() {+ return getChangeObservables();+ }++ });++ setOutputMarkupId(true);+ }++ @Override+ protected void onDetach() {+ model.detach();+ super.onDetach();+ }++ protected Collection<String> getChangeObservables() {+ return Sets.newHashSet();+ }++ @Override+ public void renderHead(IHeaderResponse response) {+ super.renderHead(response);+ response.render(CssHeaderItem.forReference(new WorkspaceStatusCssResourceReference()));+ }++ public static String getIconHref(@Nullable Status status) {+ if (status == null)+ return "dot";+ switch (status) {+ case PENDING:+ return "target";+ case ACTIVE:+ return "tick-circle-o";+ case ERROR:+ return "times-circle-o";+ default:+ throw new RuntimeException("Unexpected workspace status: " + status);+ }+ }++ public static String getIconClass(@Nullable Status status) {+ if (status != null)+ return "icon flex-shrink-0 workspace-status-" + status.name().toLowerCase();+ else+ return "icon flex-shrink-0 workspace-status-none";+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/component/workspace/status/workspace-status.css b/server-core/src/main/java/io/onedev/server/web/component/workspace/status/workspace-status.cssnew file mode 100644index 0000000000..5a73f056aa--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/component/workspace/status/workspace-status.css@@ -0,0 +1,15 @@+.workspace-status-pending {+ color: var(--warning) !important;+}+.workspace-status-active {+ color: var(--success) !important;+}+.workspace-status-error {+ color: var(--danger) !important;+}+.workspace-status-none {+ color: #CCC !important;+}+.dark-mode .workspace-status-none {+ color: var(--dark-mode-gray) !important;+}diff --git a/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/jobdependency/JobDependencyListViewPanel.java b/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/jobdependency/JobDependencyListViewPanel.javaindex 035f24e049..cf07d88ab2 100644--- a/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/jobdependency/JobDependencyListViewPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/jobdependency/JobDependencyListViewPanel.java@@ -82,7 +82,7 @@ class JobDependencyListViewPanel extends Panel {@Overridepublic void onClick(AjaxRequestTarget target) {- new DrawCardPanel(target, DrawPanel.Placement.RIGHT, null) {+ new DrawCardPanel(target, DrawPanel.Placement.RIGHT) {@Overrideprotected Component newTitle(String componentId) {diff --git a/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/postbuildaction/PostBuildActionListViewPanel.java b/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/postbuildaction/PostBuildActionListViewPanel.javaindex cf96be5712..d100f07f74 100644--- a/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/postbuildaction/PostBuildActionListViewPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/postbuildaction/PostBuildActionListViewPanel.java@@ -77,7 +77,7 @@ class PostBuildActionListViewPanel extends Panel {@Overridepublic void onClick(AjaxRequestTarget target) {- new DrawCardPanel(target, DrawPanel.Placement.RIGHT, null) {+ new DrawCardPanel(target, DrawPanel.Placement.RIGHT) {@Overrideprotected Component newTitle(String componentId) {diff --git a/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/projectdependency/ProjectDependencyListViewPanel.java b/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/projectdependency/ProjectDependencyListViewPanel.javaindex 34d22dc9fb..65b3ed816f 100644--- a/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/projectdependency/ProjectDependencyListViewPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/projectdependency/ProjectDependencyListViewPanel.java@@ -79,7 +79,7 @@ class ProjectDependencyListViewPanel extends Panel {@Overridepublic void onClick(AjaxRequestTarget target) {- new DrawCardPanel(target, DrawPanel.Placement.RIGHT, null) {+ new DrawCardPanel(target, DrawPanel.Placement.RIGHT) {@Overrideprotected Component newTitle(String componentId) {diff --git a/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/trigger/JobTriggerListViewPanel.java b/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/trigger/JobTriggerListViewPanel.javaindex c21263b778..fb49cca088 100644--- a/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/trigger/JobTriggerListViewPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/editable/buildspec/job/trigger/JobTriggerListViewPanel.java@@ -72,7 +72,7 @@ class JobTriggerListViewPanel extends Panel {@Overridepublic void onClick(AjaxRequestTarget target) {- new DrawCardPanel(target, DrawPanel.Placement.RIGHT, null) {+ new DrawCardPanel(target, DrawPanel.Placement.RIGHT) {@Overrideprotected Component newTitle(String componentId) {diff --git a/server-core/src/main/java/io/onedev/server/web/editable/buildspec/param/spec/ParamSpecListViewPanel.java b/server-core/src/main/java/io/onedev/server/web/editable/buildspec/param/spec/ParamSpecListViewPanel.javaindex 3adf648c17..918c4e824b 100644--- a/server-core/src/main/java/io/onedev/server/web/editable/buildspec/param/spec/ParamSpecListViewPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/editable/buildspec/param/spec/ParamSpecListViewPanel.java@@ -84,7 +84,7 @@ class ParamSpecListViewPanel extends Panel {@Overridepublic void onClick(AjaxRequestTarget target) {- new DrawCardPanel(target, DrawPanel.Placement.RIGHT, null) {+ new DrawCardPanel(target, DrawPanel.Placement.RIGHT) {@Overrideprotected Component newTitle(String componentId) {diff --git a/server-core/src/main/java/io/onedev/server/web/editable/buildspec/step/StepListViewPanel.java b/server-core/src/main/java/io/onedev/server/web/editable/buildspec/step/StepListViewPanel.javaindex c46358cac2..79fc77f043 100644--- a/server-core/src/main/java/io/onedev/server/web/editable/buildspec/step/StepListViewPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/editable/buildspec/step/StepListViewPanel.java@@ -75,7 +75,7 @@ class StepListViewPanel extends Panel {@Overridepublic void onClick(AjaxRequestTarget target) {- new DrawCardPanel(target, DrawPanel.Placement.RIGHT, null) {+ new DrawCardPanel(target, DrawPanel.Placement.RIGHT) {@Overrideprotected Component newTitle(String componentId) {diff --git a/server-core/src/main/java/io/onedev/server/web/editable/servicelocator/ServiceLocatorListViewPanel.java b/server-core/src/main/java/io/onedev/server/web/editable/servicelocator/ServiceLocatorListViewPanel.javaindex dacc70a6f5..0fe92aa0bc 100644--- a/server-core/src/main/java/io/onedev/server/web/editable/servicelocator/ServiceLocatorListViewPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/editable/servicelocator/ServiceLocatorListViewPanel.java@@ -175,7 +175,7 @@ class ServiceLocatorListViewPanel extends Panel {@Overridepublic void onClick(AjaxRequestTarget target) {- new DrawCardPanel(target, Placement.RIGHT, null) {+ new DrawCardPanel(target, Placement.RIGHT) {@Overrideprotected Component newTitle(String componentId) {diff --git a/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigCssResourceReference.java b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigCssResourceReference.javanew file mode 100644index 0000000000..0e4e08949f--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigCssResourceReference.java@@ -0,0 +1,13 @@+package io.onedev.server.web.editable.userconfig;++import io.onedev.server.web.page.base.BaseDependentCssResourceReference;++public class UserConfigCssResourceReference extends BaseDependentCssResourceReference {++ private static final long serialVersionUID = 1L;++ public UserConfigCssResourceReference() {+ super(UserConfigCssResourceReference.class, "userconfig.css");+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigEditPanel.html b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigEditPanel.htmlnew file mode 100644index 0000000000..cd318ba8d8--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigEditPanel.html@@ -0,0 +1,16 @@+<wicket:panel>+ <form wicket:id="form" class="user-config-edit leave-confirm">+ <div class="modal-header">+ <h5 id="modal-title" class="modal-title">User Config</h5>+ <button wicket:id="close" type="button" class="close"><wicket:svg href="times" class="icon"/></button>+ </div>+ <div class="modal-body">+ <div wicket:id="feedback" class="mb-4"></div>+ <div wicket:id="editor"></div>+ </div>+ <div class="modal-footer">+ <input wicket:id="save" type="submit" class="dirty-aware btn btn-primary" t:value="Save">+ <a wicket:id="cancel" class="btn btn-secondary">Cancel</a>+ </div>+ </form>+</wicket:panel>\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigEditPanel.java b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigEditPanel.javanew file mode 100644index 0000000000..ff55cb0d39--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigEditPanel.java@@ -0,0 +1,110 @@+package io.onedev.server.web.editable.userconfig;++import java.util.List;++import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.ajax.markup.html.form.AjaxButton;+import org.apache.wicket.feedback.FencedFeedbackPanel;+import org.apache.wicket.markup.html.form.Form;+import org.apache.wicket.markup.html.panel.Panel;+import org.apache.wicket.request.cycle.RequestCycle;++import io.onedev.server.model.support.workspace.spec.UserConfig;+import io.onedev.server.web.ajaxlistener.ConfirmLeaveListener;+import io.onedev.server.web.editable.BeanContext;+import io.onedev.server.web.editable.BeanEditor;++abstract class UserConfigEditPanel extends Panel {++ private final List<UserConfig> configs;++ private final int configIndex;++ public UserConfigEditPanel(String id, List<UserConfig> configs, int configIndex) {+ super(id);++ this.configs = configs;+ this.configIndex = configIndex;+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ UserConfig config;+ if (configIndex != -1)+ config = configs.get(configIndex);+ else+ config = new UserConfig();++ Form<?> form = new Form<Void>("form") {++ @Override+ protected void onError() {+ super.onError();+ RequestCycle.get().find(AjaxRequestTarget.class).add(this);+ }++ };++ form.add(new FencedFeedbackPanel("feedback", form));++ form.add(new AjaxLink<Void>("close") {++ @Override+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {+ super.updateAjaxAttributes(attributes);+ attributes.getAjaxCallListeners().add(new ConfirmLeaveListener(UserConfigEditPanel.this));+ }++ @Override+ public void onClick(AjaxRequestTarget target) {+ onCancel(target);+ }++ });++ BeanEditor editor = BeanContext.edit("editor", config);+ form.add(editor);+ form.add(new AjaxButton("save") {++ @Override+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {+ super.onSubmit(target, form);++ if (configIndex != -1) {+ configs.set(configIndex, config);+ } else {+ configs.add(config);+ }+ onSave(target);+ }++ });++ form.add(new AjaxLink<Void>("cancel") {++ @Override+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {+ super.updateAjaxAttributes(attributes);+ attributes.getAjaxCallListeners().add(new ConfirmLeaveListener(UserConfigEditPanel.this));+ }++ @Override+ public void onClick(AjaxRequestTarget target) {+ onCancel(target);+ }++ });+ form.setOutputMarkupId(true);++ add(form);+ }++ protected abstract void onSave(AjaxRequestTarget target);++ protected abstract void onCancel(AjaxRequestTarget target);++}diff --git a/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListEditPanel.html b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListEditPanel.htmlnew file mode 100644index 0000000000..d2622bea8e--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListEditPanel.html@@ -0,0 +1,12 @@+<wicket:panel>+ <div class="user-config-list">+ <table wicket:id="configs" class="table-hover"></table>+ <div class="foot">+ <a wicket:id="addNew" t:data-tippy-content="Add new user config" class="btn btn-light btn-hover-primary btn-block"><wicket:svg href="plus" class="icon"></wicket:svg></a>+ </div>+ </div>+ <wicket:fragment wicket:id="actionColumnFrag">+ <a wicket:id="edit" class="btn btn-light btn-hover-primary btn-xs btn-icon mr-1" t:data-tippy-content="Edit"><wicket:svg href="edit" class="icon"></wicket:svg></a>+ <a wicket:id="delete" class="btn btn-light btn-hover-danger btn-xs btn-icon" t:data-tippy-content="Delete"><wicket:svg href="trash" class="icon"></wicket:svg></a>+ </wicket:fragment>+</wicket:panel>\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListEditPanel.java b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListEditPanel.javanew file mode 100644index 0000000000..8e88a1f079--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListEditPanel.java@@ -0,0 +1,215 @@+package io.onedev.server.web.editable.userconfig;++import static io.onedev.server.web.translation.Translation._T;++import java.io.Serializable;+import java.util.ArrayList;+import java.util.List;++import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.Component;+import org.apache.wicket.event.IEvent;+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;+import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;+import org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar;+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;+import org.apache.wicket.extensions.markup.html.repeater.data.table.NoRecordsToolbar;+import org.apache.wicket.markup.ComponentTag;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.panel.Fragment;+import org.apache.wicket.markup.repeater.Item;+import org.apache.wicket.markup.repeater.data.IDataProvider;+import org.apache.wicket.markup.repeater.data.ListDataProvider;+import org.apache.wicket.model.IModel;+import org.apache.wicket.model.Model;+import org.apache.wicket.util.convert.ConversionException;++import io.onedev.server.model.support.workspace.spec.UserConfig;+import io.onedev.server.util.CollectionUtils;+import io.onedev.server.web.behavior.NoRecordsBehavior;+import io.onedev.server.web.behavior.sortable.SortBehavior;+import io.onedev.server.web.behavior.sortable.SortPosition;+import io.onedev.server.web.component.modal.ModalLink;+import io.onedev.server.web.component.modal.ModalPanel;+import io.onedev.server.web.component.svg.SpriteImage;+import io.onedev.server.web.editable.PropertyDescriptor;+import io.onedev.server.web.editable.PropertyEditor;+import io.onedev.server.web.editable.PropertyUpdating;++class UserConfigListEditPanel extends PropertyEditor<List<Serializable>> {++ private final List<UserConfig> configs;++ public UserConfigListEditPanel(String id, PropertyDescriptor propertyDescriptor, IModel<List<Serializable>> model) {+ super(id, propertyDescriptor, model);++ configs = new ArrayList<>();+ for (Serializable each: model.getObject()) {+ configs.add((UserConfig) each);+ }+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();+ add(new ModalLink("addNew") {++ @Override+ protected Component newContent(String id, ModalPanel modal) {+ return new UserConfigEditPanel(id, configs, -1) {++ @Override+ protected void onCancel(AjaxRequestTarget target) {+ modal.close();+ }++ @Override+ protected void onSave(AjaxRequestTarget target) {+ markFormDirty(target);+ modal.close();+ onPropertyUpdating(target);+ target.add(UserConfigListEditPanel.this);+ }++ };+ }++ });++ List<IColumn<UserConfig, Void>> columns = new ArrayList<>();++ columns.add(new AbstractColumn<UserConfig, Void>(Model.of("")) {++ @Override+ public void populateItem(Item<ICellPopulator<UserConfig>> cellItem, String componentId, IModel<UserConfig> rowModel) {+ cellItem.add(new SpriteImage(componentId, "grip") {++ @Override+ protected void onComponentTag(ComponentTag tag) {+ super.onComponentTag(tag);+ tag.setName("svg");+ tag.put("class", "icon drag-indicator");+ }++ });+ }++ @Override+ public String getCssClass() {+ return "minimum actions";+ }++ });++ columns.add(new AbstractColumn<UserConfig, Void>(Model.of(_T("Path"))) {++ @Override+ public void populateItem(Item<ICellPopulator<UserConfig>> cellItem, String componentId, IModel<UserConfig> rowModel) {+ cellItem.add(new Label(componentId, rowModel.getObject().getPath()));+ }++ });++ columns.add(new AbstractColumn<UserConfig, Void>(Model.of("")) {++ @Override+ public void populateItem(Item<ICellPopulator<UserConfig>> cellItem, String componentId, IModel<UserConfig> rowModel) {+ Fragment fragment = new Fragment(componentId, "actionColumnFrag", UserConfigListEditPanel.this);+ fragment.add(new ModalLink("edit") {++ @Override+ protected Component newContent(String id, ModalPanel modal) {+ return new UserConfigEditPanel(id, configs, cellItem.findParent(Item.class).getIndex()) {++ @Override+ protected void onCancel(AjaxRequestTarget target) {+ modal.close();+ }++ @Override+ protected void onSave(AjaxRequestTarget target) {+ markFormDirty(target);+ modal.close();+ onPropertyUpdating(target);+ target.add(UserConfigListEditPanel.this);+ }++ };+ }++ });++ fragment.add(new AjaxLink<Void>("delete") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ markFormDirty(target);+ configs.remove(rowModel.getObject());+ onPropertyUpdating(target);+ target.add(UserConfigListEditPanel.this);+ }++ });+ cellItem.add(fragment);+ }++ @Override+ public String getCssClass() {+ return "minimum actions";+ }++ });++ IDataProvider<UserConfig> dataProvider = new ListDataProvider<UserConfig>() {++ @Override+ protected List<UserConfig> getData() {+ return configs;+ }++ };++ DataTable<UserConfig, Void> dataTable;+ add(dataTable = new DataTable<UserConfig, Void>("configs", columns, dataProvider, Integer.MAX_VALUE));+ dataTable.addTopToolbar(new HeadersToolbar<Void>(dataTable, null));+ dataTable.addBottomToolbar(new NoRecordsToolbar(dataTable, Model.of(_T("Unspecified"))));+ dataTable.add(new NoRecordsBehavior());++ dataTable.add(new SortBehavior() {++ @Override+ protected void onSort(AjaxRequestTarget target, SortPosition from, SortPosition to) {+ CollectionUtils.move(configs, from.getItemIndex(), to.getItemIndex());+ onPropertyUpdating(target);+ target.add(UserConfigListEditPanel.this);+ }++ }.sortable("tbody"));+ }++ @Override+ public void onEvent(IEvent<?> event) {+ super.onEvent(event);++ if (event.getPayload() instanceof PropertyUpdating) {+ event.stop();+ onPropertyUpdating(((PropertyUpdating)event.getPayload()).getHandler());+ }+ }++ @Override+ protected List<Serializable> convertInputToValue() throws ConversionException {+ List<Serializable> value = new ArrayList<>();+ for (UserConfig each: configs)+ value.add(each);+ return value;+ }++ @Override+ public boolean needExplicitSubmit() {+ return true;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListEditSupport.java b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListEditSupport.javanew file mode 100644index 0000000000..9572aad8de--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListEditSupport.java@@ -0,0 +1,67 @@+package io.onedev.server.web.editable.userconfig;++import java.io.Serializable;+import java.lang.reflect.AnnotatedElement;+import java.util.List;++import org.apache.wicket.Component;+import org.apache.wicket.model.IModel;++import io.onedev.server.model.support.workspace.spec.UserConfig;+import io.onedev.server.util.ReflectionUtils;+import io.onedev.server.web.editable.EditSupport;+import io.onedev.server.web.editable.EmptyValueLabel;+import io.onedev.server.web.editable.PropertyContext;+import io.onedev.server.web.editable.PropertyDescriptor;+import io.onedev.server.web.editable.PropertyEditor;+import io.onedev.server.web.editable.PropertyViewer;++public class UserConfigListEditSupport implements EditSupport {++ @Override+ public PropertyContext<?> getEditContext(PropertyDescriptor descriptor) {+ if (List.class.isAssignableFrom(descriptor.getPropertyClass())) {+ Class<?> elementClass = ReflectionUtils.getCollectionElementClass(descriptor.getPropertyGetter().getGenericReturnType());+ if (elementClass == UserConfig.class) {+ return new PropertyContext<List<Serializable>>(descriptor) {++ @Override+ public PropertyViewer renderForView(String componentId, final IModel<List<Serializable>> model) {+ return new PropertyViewer(componentId, descriptor) {++ @Override+ protected Component newContent(String id, PropertyDescriptor propertyDescriptor) {+ if (model.getObject() != null) {+ return new UserConfigListViewPanel(id, model.getObject());+ } else {+ return new EmptyValueLabel(id) {++ @Override+ protected AnnotatedElement getElement() {+ return propertyDescriptor.getPropertyGetter();+ }++ };+ }+ }++ };+ }++ @Override+ public PropertyEditor<List<Serializable>> renderForEdit(String componentId, IModel<List<Serializable>> model) {+ return new UserConfigListEditPanel(componentId, descriptor, model);+ }++ };+ }+ }+ return null;+ }++ @Override+ public int getPriority() {+ return 0;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListViewPanel.html b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListViewPanel.htmlnew file mode 100644index 0000000000..6c16eca094--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListViewPanel.html@@ -0,0 +1,8 @@+<wicket:panel>+ <div class="user-config-list">+ <table wicket:id="configs" class="table-hover"></table>+ </div>+ <wicket:fragment wicket:id="showDetailFrag">+ <a wicket:id="link"><wicket:svg href="ellipsis" class="icon align-middle"/></a>+ </wicket:fragment>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListViewPanel.java b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListViewPanel.javanew file mode 100644index 0000000000..1f6895451f--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/UserConfigListViewPanel.java@@ -0,0 +1,133 @@+package io.onedev.server.web.editable.userconfig;++import static io.onedev.server.web.translation.Translation._T;++import java.io.Serializable;+import java.util.ArrayList;+import java.util.List;++import org.apache.wicket.Component;+import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.behavior.AttributeAppender;+import org.apache.wicket.markup.head.CssHeaderItem;+import org.apache.wicket.markup.head.IHeaderResponse;+import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;+import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;+import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;+import org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar;+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;+import org.apache.wicket.extensions.markup.html.repeater.data.table.NoRecordsToolbar;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.panel.Fragment;+import org.apache.wicket.markup.html.panel.Panel;+import org.apache.wicket.markup.repeater.Item;+import org.apache.wicket.markup.repeater.data.IDataProvider;+import org.apache.wicket.markup.repeater.data.ListDataProvider;+import org.apache.wicket.model.IModel;+import org.apache.wicket.model.Model;++import io.onedev.server.model.support.workspace.spec.UserConfig;+import io.onedev.server.web.behavior.NoRecordsBehavior;+import io.onedev.server.web.component.draw.DrawCardPanel;+import io.onedev.server.web.component.draw.DrawPanel;+import io.onedev.server.web.editable.BeanContext;++class UserConfigListViewPanel extends Panel {++ private final List<UserConfig> configs = new ArrayList<>();++ public UserConfigListViewPanel(String id, List<Serializable> elements) {+ super(id);++ for (Serializable each: elements)+ configs.add((UserConfig) each);+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ List<IColumn<UserConfig, Void>> columns = new ArrayList<>();++ columns.add(new AbstractColumn<UserConfig, Void>(Model.of(_T("Path"))) {++ @Override+ public void populateItem(Item<ICellPopulator<UserConfig>> cellItem, String componentId, IModel<UserConfig> rowModel) {+ cellItem.add(new Label(componentId, rowModel.getObject().getPath()));+ }++ });++ columns.add(new AbstractColumn<UserConfig, Void>(Model.of("")) {++ @Override+ public void populateItem(Item<ICellPopulator<UserConfig>> cellItem, String componentId, IModel<UserConfig> rowModel) {+ int configIndex = cellItem.findParent(Item.class).getIndex();+ Fragment fragment = new Fragment(componentId, "showDetailFrag", UserConfigListViewPanel.this);+ fragment.add(new AjaxLink<Void>("link") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ new DrawCardPanel(target, DrawPanel.Placement.RIGHT) {++ @Override+ protected void onInitialize() {+ super.onInitialize();+ add(AttributeAppender.append("class", "user-config"));+ }++ @Override+ protected Component newTitle(String componentId) {+ return new Label(componentId, configs.get(configIndex).getPath());+ }++ @Override+ protected Component newBody(String id) {+ return BeanContext.view(id, configs.get(configIndex));+ }++ };+ }++ });++ cellItem.add(fragment);+ }++ @Override+ public String getCssClass() {+ return "ellipsis text-right";+ }++ });++ IDataProvider<UserConfig> dataProvider = new ListDataProvider<UserConfig>() {++ @Override+ protected List<UserConfig> getData() {+ return configs;+ }++ };++ add(new DataTable<UserConfig, Void>("configs", columns, dataProvider, Integer.MAX_VALUE) {++ @Override+ protected void onInitialize() {+ super.onInitialize();+ addTopToolbar(new HeadersToolbar<Void>(this, null));+ addBottomToolbar(new NoRecordsToolbar(this, Model.of(_T("Unspecified"))));+ add(new NoRecordsBehavior());+ }++ });+ }++ @Override+ public void renderHead(IHeaderResponse response) {+ super.renderHead(response);+ response.render(CssHeaderItem.forReference(new UserConfigCssResourceReference()));+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/editable/userconfig/userconfig.css b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/userconfig.cssnew file mode 100644index 0000000000..a4a4b5bdd8--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/editable/userconfig/userconfig.css@@ -0,0 +1,5 @@+@media(min-width: 768px) {+.user-config.floating.draw {+ width: 600px;+}+}diff --git a/server-core/src/main/java/io/onedev/server/web/editable/workspace/WorkspaceQueryEditSupport.java b/server-core/src/main/java/io/onedev/server/web/editable/workspace/WorkspaceQueryEditSupport.javanew file mode 100644index 0000000000..47d0662b97--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/editable/workspace/WorkspaceQueryEditSupport.java@@ -0,0 +1,85 @@+package io.onedev.server.web.editable.workspace;++import java.lang.reflect.AnnotatedElement;+import java.lang.reflect.Method;++import org.apache.wicket.Component;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.model.AbstractReadOnlyModel;+import org.apache.wicket.model.IModel;++import io.onedev.server.annotation.WorkspaceQuery;+import io.onedev.server.model.Project;+import io.onedev.server.web.behavior.WorkspaceQueryBehavior;+import io.onedev.server.web.behavior.inputassist.InputAssistBehavior;+import io.onedev.server.web.editable.EditSupport;+import io.onedev.server.web.editable.EmptyValueLabel;+import io.onedev.server.web.editable.PropertyContext;+import io.onedev.server.web.editable.PropertyDescriptor;+import io.onedev.server.web.editable.PropertyEditor;+import io.onedev.server.web.editable.PropertyViewer;+import io.onedev.server.web.editable.string.StringPropertyEditor;++public class WorkspaceQueryEditSupport implements EditSupport {++ @Override+ public PropertyContext<?> getEditContext(PropertyDescriptor descriptor) {+ Method propertyGetter = descriptor.getPropertyGetter();+ WorkspaceQuery workspaceQuery = propertyGetter.getAnnotation(WorkspaceQuery.class);+ if (workspaceQuery != null) {+ if (propertyGetter.getReturnType() != String.class) {+ throw new RuntimeException("Annotation 'WorkspaceQuery' should be applied to property "+ + "with type 'String'");+ }+ return new PropertyContext<String>(descriptor) {++ @Override+ public PropertyViewer renderForView(String componentId, final IModel<String> model) {+ return new PropertyViewer(componentId, descriptor) {++ @Override+ protected Component newContent(String id, PropertyDescriptor propertyDescriptor) {+ String query = model.getObject();+ if (query != null) {+ return new Label(id, query);+ } else {+ return new EmptyValueLabel(id) {++ @Override+ protected AnnotatedElement getElement() {+ return propertyDescriptor.getPropertyGetter();+ }++ };+ }+ }++ };+ }++ @Override+ public PropertyEditor<String> renderForEdit(String componentId, IModel<String> model) {+ InputAssistBehavior inputAssist = new WorkspaceQueryBehavior(new AbstractReadOnlyModel<>() {++ @Override+ public Project getObject() {+ return Project.get();+ }++ }, workspaceQuery.withOrder());++ return new StringPropertyEditor(componentId, descriptor, model).setInputAssist(inputAssist);+ }++ };+ } else {+ return null;+ }+ }++ @Override+ public int getPriority() {+ return DEFAULT_PRIORITY;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/mapper/BaseUrlMapper.java b/server-core/src/main/java/io/onedev/server/web/mapper/BaseUrlMapper.javaindex 99b79a4033..a457e1cee2 100644--- a/server-core/src/main/java/io/onedev/server/web/mapper/BaseUrlMapper.java+++ b/server-core/src/main/java/io/onedev/server/web/mapper/BaseUrlMapper.java@@ -33,6 +33,7 @@ import io.onedev.server.web.page.admin.emailtemplates.ServiceDeskIssueOpenFailedimport io.onedev.server.web.page.admin.emailtemplates.ServiceDeskIssueOpenedTemplatePage;import io.onedev.server.web.page.admin.emailtemplates.StopwatchOverdueTemplatePage;import io.onedev.server.web.page.admin.emailtemplates.UserInvitationTemplatePage;+import io.onedev.server.web.page.admin.emailtemplates.WorkspaceNotificationTemplatePage;import io.onedev.server.web.page.admin.gpgsigningkey.GpgSigningKeyPage;import io.onedev.server.web.page.admin.gpgtrustedkeys.GpgTrustedKeysPage;import io.onedev.server.web.page.admin.groovyscript.GroovyScriptListPage;@@ -70,6 +71,7 @@ import io.onedev.server.web.page.admin.usermanagement.InvitationListPage;import io.onedev.server.web.page.admin.usermanagement.NewInvitationPage;import io.onedev.server.web.page.admin.usermanagement.NewUserPage;import io.onedev.server.web.page.admin.usermanagement.UserListPage;+import io.onedev.server.web.page.admin.workspaceprovisioner.WorkspaceProvisionersPage;import io.onedev.server.web.page.builds.BuildListPage;import io.onedev.server.web.page.error.PageNotFoundErrorPage;import io.onedev.server.web.page.help.IncompatibilitiesPage;@@ -153,9 +155,15 @@ import io.onedev.server.web.page.project.setting.general.GeneralProjectSettingPaimport io.onedev.server.web.page.project.setting.pluginsettings.ContributedProjectSettingPage;import io.onedev.server.web.page.project.setting.servicedesk.ServiceDeskSettingPage;import io.onedev.server.web.page.project.setting.webhook.WebHooksPage;+import io.onedev.server.web.page.project.setting.workspacespec.WorkspaceSpecsPage;import io.onedev.server.web.page.project.stats.code.CodeContribsPage;import io.onedev.server.web.page.project.stats.code.SourceLinesPage;import io.onedev.server.web.page.project.tags.ProjectTagsPage;+import io.onedev.server.web.page.project.workspaces.ProjectWorkspacesPage;+import io.onedev.server.web.page.project.workspaces.detail.changes.WorkspaceChangesPage;+import io.onedev.server.web.page.project.workspaces.detail.dashboard.WorkspaceDashboardPage;+import io.onedev.server.web.page.project.workspaces.detail.log.WorkspaceLogPage;+import io.onedev.server.web.page.project.workspaces.detail.terminal.WorkspaceTerminalPage;import io.onedev.server.web.page.pullrequests.PullRequestListPage;import io.onedev.server.web.page.security.CreateUserFromInvitationPage;import io.onedev.server.web.page.security.EmailAddressVerificationPage;@@ -182,6 +190,7 @@ import io.onedev.server.web.page.user.querywatch.UserQueryWatchesPage;import io.onedev.server.web.page.user.sshkeys.UserSshKeysPage;import io.onedev.server.web.page.user.ssoaccounts.UserSsoAccountsPage;import io.onedev.server.web.page.user.twofactorauthentication.UserTwoFactorAuthenticationPage;+import io.onedev.server.web.page.workspaces.WorkspaceListPage;import io.onedev.server.web.resource.AgentLibResourceReference;import io.onedev.server.web.resource.AgentLogResourceReference;import io.onedev.server.web.resource.AgentResourceReference;@@ -212,6 +221,7 @@ public class BaseUrlMapper extends CompoundRequestMapper {add(new BasePageMapper("~pulls", PullRequestListPage.class));add(new BasePageMapper("~builds", BuildListPage.class));add(new BasePageMapper("~packages", PackListPage.class));+ add(new BasePageMapper("~workspaces", WorkspaceListPage.class));addAdministrationPages();addUserPages();addMyPages();@@ -337,6 +347,8 @@ public class BaseUrlMapper extends CompoundRequestMapper {BuildNotificationTemplatePage.class));add(new BasePageMapper("~administration/settings/email-templates/pack-notification",PackNotificationTemplatePage.class));+ add(new BasePageMapper("~administration/settings/email-templates/workspace-notification",+ WorkspaceNotificationTemplatePage.class));add(new BasePageMapper("~administration/settings/email-templates/commit-notification",CommitNotificationTemplatePage.class));add(new BasePageMapper("~administration/settings/email-templates/issue-notification-unsubscribed",@@ -377,6 +389,7 @@ public class BaseUrlMapper extends CompoundRequestMapper {add(new BasePageMapper("~administration/agents/${agent}/builds", AgentBuildsPage.class));add(new BasePageMapper("~administration/agents/${agent}/log", AgentLogPage.class));add(new BasePageMapper("~administration/settings/job-executors", JobExecutorsPage.class));+ add(new BasePageMapper("~administration/settings/workspace-provisioners", WorkspaceProvisionersPage.class));add(new BasePageMapper("~administration/settings/groovy-scripts", GroovyScriptListPage.class));add(new BasePageMapper("~administration/settings/issue-fields", IssueFieldListPage.class));@@ -457,6 +470,12 @@ public class BaseUrlMapper extends CompoundRequestMapper {add(new ProjectPageMapper("${project}/~packages", ProjectPacksPage.class));add(new ProjectPageMapper("${project}/~packages/${pack}", PackDetailPage.class));++ add(new ProjectPageMapper("${project}/~workspaces", ProjectWorkspacesPage.class));+ add(new ProjectPageMapper("${project}/~workspaces/${workspace}", WorkspaceDashboardPage.class));+ add(new ProjectPageMapper("${project}/~workspaces/${workspace}/terminals/${shell}", WorkspaceTerminalPage.class));+ add(new ProjectPageMapper("${project}/~workspaces/${workspace}/changes", WorkspaceChangesPage.class));+ add(new ProjectPageMapper("${project}/~workspaces/${workspace}/log", WorkspaceLogPage.class));add(new ProjectPageMapper("${project}/~children", ProjectChildrenPage.class));@@ -477,6 +496,7 @@ public class BaseUrlMapper extends CompoundRequestMapper {add(new ProjectPageMapper("${project}/~settings/service-desk", ServiceDeskSettingPage.class));add(new ProjectPageMapper("${project}/~settings/web-hooks", WebHooksPage.class));add(new ProjectPageMapper("${project}/~settings/ai", ProjectAiSettingPage.class));+ add(new ProjectPageMapper("${project}/~settings/workspace-spec", WorkspaceSpecsPage.class));add(new ProjectPageMapper("${project}/~settings/${" + ContributedProjectSettingPage.PARAM_SETTING + "}",ContributedProjectSettingPage.class));add(new ProjectPageMapper("${project}/~no-storage", NoProjectStoragePage.class));diff --git a/server-core/src/main/java/io/onedev/server/web/page/admin/administration.css b/server-core/src/main/java/io/onedev/server/web/page/admin/administration.cssindex 4d78419612..588ce63681 100644--- a/server-core/src/main/java/io/onedev/server/web/page/admin/administration.css+++ b/server-core/src/main/java/io/onedev/server/web/page/admin/administration.css@@ -7,29 +7,36 @@width: 50%;}-.job-executor>.card-header .toggle {+.job-executor>.card-header .toggle,+.workspace-provisioner>.card-header .toggle {vertical-align: bottom;}-.job-executor>.card-header .toggle>.icon {+.job-executor>.card-header .toggle>.icon,+.workspace-provisioner>.card-header .toggle>.icon {width: 30px;height: 30px;margin-top: 2px;margin-left: -8px;}-.job-executor>.card-header .badge {+.job-executor>.card-header .badge,+.workspace-provisioner>.card-header .badge {font-size: 0.9rem;}-.job-executor>.card-body {+.job-executor>.card-body,+.workspace-provisioner>.card-body {display: none;}-.job-executor.expanded>.card-header .toggle>.icon {+.job-executor.expanded>.card-header .toggle>.icon,+.workspace-provisioner.expanded>.card-header .toggle>.icon {transform: rotate(0deg);}-.job-executor.expanded>.card-body {+.job-executor.expanded>.card-body,+.workspace-provisioner.expanded>.card-body {display: block;}-.job-executor>.card-body .bean-viewer .type-description {+.job-executor>.card-body .bean-viewer .type-description,+.workspace-provisioner>.card-body .bean-viewer .type-description {display: none;}diff --git a/server-core/src/main/java/io/onedev/server/web/page/admin/emailtemplates/WorkspaceNotificationTemplatePage.java b/server-core/src/main/java/io/onedev/server/web/page/admin/emailtemplates/WorkspaceNotificationTemplatePage.javanew file mode 100644index 0000000000..07ecf72d7e--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/admin/emailtemplates/WorkspaceNotificationTemplatePage.java@@ -0,0 +1,42 @@+package io.onedev.server.web.page.admin.emailtemplates;++import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_DEV_SESSION_NOTIFICATION;+import static io.onedev.server.web.translation.Translation._T;++import java.text.MessageFormat;+import java.util.Map;++import org.apache.wicket.Component;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.request.mapper.parameter.PageParameters;++import io.onedev.server.util.CollectionUtils;++public class WorkspaceNotificationTemplatePage extends AbstractSimpleNotificationTemplatePage {++ public WorkspaceNotificationTemplatePage(PageParameters params) {+ super(params);+ }++ @Override+ protected String getPropertyName() {+ return PROP_DEV_SESSION_NOTIFICATION;+ }++ @Override+ protected String getHelpText() {+ return MessageFormat.format(_T("A {0} used as body of workspace notification email"), GROOVY_TEMPLATE_LINK);+ }++ @Override+ protected Map<String, String> getVariableHelp() {+ return CollectionUtils.newLinkedHashMap("workspace",+ _T("represents the <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Workspace.java' target='_blank'>workspace</a> object to be notified"));+ }++ @Override+ protected Component newTopbarTitle(String componentId) {+ return new Label(componentId, _T("Workspace Notification Template"));+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/admin/issuesetting/linkspec/LinkSpecEditPanel.java b/server-core/src/main/java/io/onedev/server/web/page/admin/issuesetting/linkspec/LinkSpecEditPanel.javaindex dfe0c89f7b..f15076a30b 100644--- a/server-core/src/main/java/io/onedev/server/web/page/admin/issuesetting/linkspec/LinkSpecEditPanel.java+++ b/server-core/src/main/java/io/onedev/server/web/page/admin/issuesetting/linkspec/LinkSpecEditPanel.java@@ -106,14 +106,12 @@ abstract class LinkSpecEditPanel extends GenericPanel<LinkSpec> {var linkSpecService = OneDev.getInstance(LinkSpecService.class);var auditService = OneDev.getInstance(AuditService.class);LinkSpec specWithSameName = linkSpecService.find(getSpec().getName());- if (getSpec().isNew() && specWithSameName != null- || !getSpec().isNew() && specWithSameName != null && !specWithSameName.equals(getSpec())) {+ if (specWithSameName != null && !specWithSameName.equals(getSpec())) {editor.error(new Path(new PathNode.Named("name")), _T("Name already used by another link"));target.add(form);} else if (getSpec().getOpposite() != null) {specWithSameName = linkSpecService.find(getSpec().getOpposite().getName());- if (getSpec().isNew() && specWithSameName != null- || !getSpec().isNew() && specWithSameName != null && !specWithSameName.equals(getSpec())) {+ if (specWithSameName != null && !specWithSameName.equals(getSpec())) {String errorMessage = _T("Name already used by another link");editor.error(new Path(new PathNode.Named("opposite"), new PathNode.Named("name")), errorMessage);target.add(form);diff --git a/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerBean.java b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerBean.javanew file mode 100644index 0000000000..c2f7d7b05d--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerBean.java@@ -0,0 +1,27 @@+package io.onedev.server.web.page.admin.workspaceprovisioner;++import java.io.Serializable;++import javax.validation.constraints.NotNull;++import io.onedev.server.annotation.Editable;+import io.onedev.server.model.support.administration.workspaceprovisioner.WorkspaceProvisioner;++@Editable+public class WorkspaceProvisionerBean implements Serializable {++ private static final long serialVersionUID = 1L;++ private WorkspaceProvisioner provisioner;++ @Editable(name="Type")+ @NotNull+ public WorkspaceProvisioner getProvisioner() {+ return provisioner;+ }++ public void setProvisioner(WorkspaceProvisioner provisioner) {+ this.provisioner = provisioner;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerEditPanel.html b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerEditPanel.htmlnew file mode 100644index 0000000000..d330f6e5ac--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerEditPanel.html@@ -0,0 +1,8 @@+<wicket:panel>+ <form wicket:id="form" class="leave-confirm">+ <div wicket:id="feedback"></div>+ <div wicket:id="editor" class="mb-4"></div>+ <button wicket:id="save" type="submit" class="btn btn-primary dirty-aware mr-1"><wicket:t>Save</wicket:t></button>+ <button wicket:id="cancel" class="btn btn-secondary"><wicket:t>Cancel</wicket:t></button>+ </form>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerEditPanel.java b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerEditPanel.javanew file mode 100644index 0000000000..d26254cf3e--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerEditPanel.java@@ -0,0 +1,113 @@+package io.onedev.server.web.page.admin.workspaceprovisioner;++import static io.onedev.server.web.translation.Translation._T;++import java.util.List;++import org.apache.commons.lang3.SerializationUtils;+import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.ajax.markup.html.form.AjaxButton;+import org.apache.wicket.feedback.FencedFeedbackPanel;+import org.apache.wicket.markup.html.form.Form;+import org.apache.wicket.markup.html.panel.Panel;+import org.jspecify.annotations.Nullable;++import io.onedev.server.model.support.administration.workspaceprovisioner.WorkspaceProvisioner;+import io.onedev.server.util.Path;+import io.onedev.server.util.PathNode;+import io.onedev.server.web.editable.BeanContext;+import io.onedev.server.web.editable.BeanEditor;++abstract class WorkspaceProvisionerEditPanel extends Panel {++ private final List<WorkspaceProvisioner> provisioners;++ private final int provisonerIndex;++ public WorkspaceProvisionerEditPanel(String id, List<WorkspaceProvisioner> provisioners, int provisonerIndex) {+ super(id);+ this.provisioners = provisioners;+ this.provisonerIndex = provisonerIndex;+ }++ @Nullable+ private WorkspaceProvisioner getProvisioner(String name) {+ for (WorkspaceProvisioner provisioner : provisioners) {+ if (provisioner.getName().equals(name))+ return provisioner;+ }+ return null;+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ WorkspaceProvisionerBean bean = new WorkspaceProvisionerBean();+ if (provisonerIndex != -1)+ bean.setProvisioner(SerializationUtils.clone(provisioners.get(provisonerIndex)));++ BeanEditor editor = BeanContext.edit("editor", bean);++ AjaxButton saveButton = new AjaxButton("save") {++ @Override+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {+ super.onSubmit(target, form);++ WorkspaceProvisioner provisioner = bean.getProvisioner();+ if (provisonerIndex != -1) {+ WorkspaceProvisioner oldProvisioner = provisioners.get(provisonerIndex);+ if (!provisioner.getName().equals(oldProvisioner.getName()) && getProvisioner(provisioner.getName()) != null) {+ editor.error(new Path(new PathNode.Named("provisioner"), new PathNode.Named("name")),+ _T("This name has already been used by another workspace provisioner"));+ }+ } else if (getProvisioner(provisioner.getName()) != null) {+ editor.error(new Path(new PathNode.Named("provisioner"), new PathNode.Named("name")),+ _T("This name has already been used by another workspace provisioner"));+ }++ if (editor.isValid()) {+ if (provisonerIndex != -1)+ provisioners.set(provisonerIndex, provisioner);+ else+ provisioners.add(provisioner);+ onSave(target);+ } else {+ target.add(form);+ }+ }++ @Override+ protected void onError(AjaxRequestTarget target, Form<?> form) {+ super.onError(target, form);+ target.add(form);+ }++ };++ AjaxLink<Void> cancelButton = new AjaxLink<Void>("cancel") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ onCancel(target);+ }++ };++ Form<?> form = new Form<Void>("form");+ form.add(new FencedFeedbackPanel("feedback", form));+ form.add(editor);+ form.add(saveButton);+ form.add(cancelButton);++ add(form);+ setOutputMarkupId(true);+ }++ protected abstract void onSave(AjaxRequestTarget target);++ protected abstract void onCancel(AjaxRequestTarget target);++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerPanel.html b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerPanel.htmlnew file mode 100644index 0000000000..88e7c9f664--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerPanel.html@@ -0,0 +1,30 @@+<wicket:panel>+ <div class="workspace-provisioner card">+ <div class="card-header">+ <div class="card-title">+ <a class="toggle" onclick="$(this).closest('.workspace-provisioner').toggleClass('expanded');"><wicket:svg href="arrow4" class="icon rotate-270"/></a>+ <span class="drag-indicator mr-2">+ <wicket:svg href="grip" class="icon icon-lg"></wicket:svg>+ </span>+ <span wicket:id="name" class="name mr-3"></span>+ <a wicket:id="edit" t:data-tippy-content="Edit this provisioner" onclick="$(this).closest('.workspace-provisioner').addClass('expanded');" class="btn btn-light btn-xs btn-icon btn-hover-primary text-muted mr-2">+ <wicket:svg href="edit" class="icon"/>+ </a>+ <a wicket:id="delete" t:data-tippy-content="Delete this provisioner" class="btn btn-light btn-xs btn-icon btn-hover-danger text-muted mr-4">+ <wicket:svg href="trash" class="icon"/>+ </a>+ <span wicket:id="disabled" class="badge badge-light-warning"><wicket:t>Disabled</wicket:t></span>+ </div>+ <div class="card-toolbar">+ <span class="switch switch-sm switch-primary mb-n2">+ <label>+ <input wicket:id="enable" type="checkbox">+ </label>+ </span>+ </div>+ </div>+ <div class="card-body">+ <div wicket:id="provisioner"></div>+ </div>+ </div>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerPanel.java b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerPanel.javanew file mode 100644index 0000000000..685d2390b1--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionerPanel.java@@ -0,0 +1,125 @@+package io.onedev.server.web.page.admin.workspaceprovisioner;++import static io.onedev.server.web.translation.Translation._T;++import java.util.List;++import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;+import org.apache.wicket.behavior.AttributeAppender;+import org.apache.wicket.markup.html.WebMarkupContainer;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.panel.Panel;+import org.apache.wicket.model.LoadableDetachableModel;+import org.apache.wicket.model.Model;++import io.onedev.server.model.support.administration.workspaceprovisioner.WorkspaceProvisioner;+import io.onedev.server.web.ajaxlistener.ConfirmClickListener;+import io.onedev.server.web.editable.BeanContext;++abstract class WorkspaceProvisionerPanel extends Panel {++ private final List<WorkspaceProvisioner> provisioners;++ private final int provisionerIndex;++ public WorkspaceProvisionerPanel(String id, List<WorkspaceProvisioner> provisioners, int provisionerIndex) {+ super(id);+ this.provisioners = provisioners;+ this.provisionerIndex = provisionerIndex;+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ add(new Label("name", getProvisioner().getName()));++ add(new AjaxLink<Void>("edit") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ WorkspaceProvisionerEditPanel editor = new WorkspaceProvisionerEditPanel("provisioner", provisioners, provisionerIndex) {++ @Override+ protected void onSave(AjaxRequestTarget target) {+ WorkspaceProvisionerPanel.this.onSave(target);+ }++ @Override+ protected void onCancel(AjaxRequestTarget target) {+ WorkspaceProvisionerPanel.this.onCancel(target);+ }++ };+ WorkspaceProvisionerPanel.this.replace(editor);+ target.add(editor);+ }++ });++ add(new AjaxLink<Void>("delete") {++ @Override+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {+ super.updateAjaxAttributes(attributes);+ attributes.getAjaxCallListeners().add(new ConfirmClickListener(_T("Do you really want to delete this provisioner?")));+ }++ @Override+ public void onClick(AjaxRequestTarget target) {+ onDelete(target);+ }++ });++ add(new WebMarkupContainer("disabled") {++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(!getProvisioner().isEnabled());+ }++ });++ add(new AjaxCheckBox("enable", Model.of(getProvisioner().isEnabled())) {++ @Override+ protected void onUpdate(AjaxRequestTarget target) {+ getProvisioner().setEnabled(!getProvisioner().isEnabled());+ onSave(target);+ target.add(WorkspaceProvisionerPanel.this);+ }++ });++ var bean = new WorkspaceProvisionerBean();+ bean.setProvisioner(getProvisioner());+ add(BeanContext.view("provisioner", bean).setOutputMarkupId(true));++ add(AttributeAppender.append("class", new LoadableDetachableModel<String>() {++ @Override+ protected String load() {+ return !getProvisioner().isEnabled() ? "disabled" : "";+ }++ }));++ setOutputMarkupId(true);+ }++ private WorkspaceProvisioner getProvisioner() {+ return provisioners.get(provisionerIndex);+ }++ protected abstract void onDelete(AjaxRequestTarget target);++ protected abstract void onSave(AjaxRequestTarget target);++ protected abstract void onCancel(AjaxRequestTarget target);++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionersPage.html b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionersPage.htmlnew file mode 100644index 0000000000..d10f8cd000--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionersPage.html@@ -0,0 +1,34 @@+<wicket:extend>+ <div class="workspace-provisioners">+ <div class="body">+ <div wicket:id="workspaceProvisionerSetting">+ <div wicket:id="noProvisioners" class="alert alert-info mb-5">+ <wicket:t>No workspace provisioners defined</wicket:t>+ </div>+ <ul class="list-unstyled">+ <li wicket:id="provisioners" class="provisioner mb-5"><div wicket:id="provisioner"></div></li>+ </ul>+ <div wicket:id="newProvisioner"></div>+ </div>+ </div>+ </div>+ <wicket:fragment wicket:id="editNewFrag">+ <div class="provisioner card">+ <div class="card-header">+ <div class="card-title"><wicket:t>Edit Provisioner</wicket:t></div>+ </div>+ <div class="card-body">+ <div wicket:id="editor"></div>+ </div>+ </div>+ </wicket:fragment>+ <wicket:fragment wicket:id="addNewLinkFrag">+ <div class="card">+ <div class="card-header">+ <div class="card-title">+ <a wicket:id="link" class="add-new d-flex align-items-center"><wicket:svg href="plus-circle-o" class="icon mr-2"></wicket:svg> <span><wicket:t>Add Provisioner</wicket:t></span></a>+ </div>+ </div>+ </div>+ </wicket:fragment>+</wicket:extend>diff --git a/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionersPage.java b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionersPage.javanew file mode 100644index 0000000000..d449016754--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/admin/workspaceprovisioner/WorkspaceProvisionersPage.java@@ -0,0 +1,160 @@+package io.onedev.server.web.page.admin.workspaceprovisioner;++import static io.onedev.server.web.translation.Translation._T;++import java.util.List;++import org.apache.wicket.Component;+import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.markup.html.WebMarkupContainer;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.list.ListItem;+import org.apache.wicket.markup.html.list.ListView;+import org.apache.wicket.markup.html.panel.Fragment;+import org.apache.wicket.model.AbstractReadOnlyModel;+import org.apache.wicket.request.mapper.parameter.PageParameters;++import io.onedev.server.OneDev;+import io.onedev.server.data.migration.VersionedXmlDoc;+import io.onedev.server.model.support.administration.workspaceprovisioner.WorkspaceProvisioner;+import io.onedev.server.service.SettingService;+import io.onedev.server.util.CollectionUtils;+import io.onedev.server.web.behavior.sortable.SortBehavior;+import io.onedev.server.web.behavior.sortable.SortPosition;+import io.onedev.server.web.page.admin.AdministrationPage;++public class WorkspaceProvisionersPage extends AdministrationPage {++ private List<WorkspaceProvisioner> provisioners;++ private WebMarkupContainer container;++ public WorkspaceProvisionersPage(PageParameters params) {+ super(params);+ provisioners = getSettingService().getWorkspaceProvisioners();+ }++ private SettingService getSettingService() {+ return OneDev.getInstance(SettingService.class);+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ container = new WebMarkupContainer("workspaceProvisionerSetting");+ container.setOutputMarkupId(true);+ add(container);++ container.add(new ListView<>("provisioners", new AbstractReadOnlyModel<List<WorkspaceProvisioner>>() {++ @Override+ public List<WorkspaceProvisioner> getObject() {+ return getSettingService().getWorkspaceProvisioners();+ }++ }) {++ @Override+ protected void populateItem(ListItem<WorkspaceProvisioner> item) {+ var oldAuditContent = VersionedXmlDoc.fromBean(item.getModelObject()).toXML();+ item.add(new WorkspaceProvisionerPanel("provisioner", provisioners, item.getIndex()) {++ @Override+ protected void onDelete(AjaxRequestTarget target) {+ var provisioner = provisioners.remove(item.getIndex());+ var oldAuditContent = VersionedXmlDoc.fromBean(provisioner).toXML();+ getSettingService().saveWorkspaceProvisioners(provisioners);+ auditService.audit(null, "deleted workspace provisioner \"" + provisioner.getName() + "\"", oldAuditContent, null);+ target.add(container);+ }++ @Override+ protected void onSave(AjaxRequestTarget target) {+ var provisioner = provisioners.get(item.getIndex());+ var newAuditContent = VersionedXmlDoc.fromBean(provisioner).toXML();+ auditService.audit(null, "changed workspace provisioner \"" + provisioner.getName() + "\"", oldAuditContent, newAuditContent);+ getSettingService().saveWorkspaceProvisioners(provisioners);+ target.add(container);+ }++ @Override+ protected void onCancel(AjaxRequestTarget target) {+ target.add(container);+ }++ });+ }++ });++ container.add(new SortBehavior() {++ @Override+ protected void onSort(AjaxRequestTarget target, SortPosition from, SortPosition to) {+ var oldAuditContent = VersionedXmlDoc.fromBean(provisioners).toXML();+ CollectionUtils.move(provisioners, from.getItemIndex(), to.getItemIndex());+ var newAuditContent = VersionedXmlDoc.fromBean(provisioners).toXML();+ getSettingService().saveWorkspaceProvisioners(provisioners);+ auditService.audit(null, "changed order of workspace provisioners", oldAuditContent, newAuditContent);+ target.add(container);+ }++ }.items("li.provisioner").handle(".card-header"));++ container.add(newAddNewFrag());+ container.add(new WebMarkupContainer("noProvisioners") {++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(getSettingService().getWorkspaceProvisioners().isEmpty());+ }++ });+ }++ private Component newAddNewFrag() {+ Fragment fragment = new Fragment("newProvisioner", "addNewLinkFrag", this);+ fragment.add(new AjaxLink<Void>("link") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ Fragment fragment = new Fragment("newProvisioner", "editNewFrag", getPage());+ fragment.setOutputMarkupId(true);+ fragment.add(new WorkspaceProvisionerEditPanel("editor", provisioners, -1) {++ @Override+ protected void onSave(AjaxRequestTarget target) {+ getSettingService().saveWorkspaceProvisioners(provisioners);+ container.replace(newAddNewFrag());+ var provisioner = provisioners.get(provisioners.size() - 1);+ var newAuditContent = VersionedXmlDoc.fromBean(provisioner).toXML();+ auditService.audit(null, "added workspace provisioner \"" + provisioner.getName() + "\"", null, newAuditContent);+ target.add(container);+ }++ @Override+ protected void onCancel(AjaxRequestTarget target) {+ Component newAddNewFrag = newAddNewFrag();+ container.replace(newAddNewFrag);+ target.add(newAddNewFrag);+ }++ });+ container.replace(fragment);+ target.add(fragment);+ }++ });+ fragment.setOutputMarkupId(true);+ return fragment;+ }++ @Override+ protected Component newTopbarTitle(String componentId) {+ return new Label(componentId, _T("Workspace Provisioners"));+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/layout/LayoutPage.java b/server-core/src/main/java/io/onedev/server/web/page/layout/LayoutPage.javaindex 9f717a3b93..51f113d5aa 100644--- a/server-core/src/main/java/io/onedev/server/web/page/layout/LayoutPage.java+++ b/server-core/src/main/java/io/onedev/server/web/page/layout/LayoutPage.java@@ -109,6 +109,7 @@ import io.onedev.server.web.page.admin.emailtemplates.CommitNotificationTemplateimport io.onedev.server.web.page.admin.emailtemplates.EmailVerificationTemplatePage;import io.onedev.server.web.page.admin.emailtemplates.IssueNotificationTemplatePage;import io.onedev.server.web.page.admin.emailtemplates.IssueNotificationUnsubscribedTemplatePage;+import io.onedev.server.web.page.admin.emailtemplates.WorkspaceNotificationTemplatePage;import io.onedev.server.web.page.admin.emailtemplates.PackNotificationTemplatePage;import io.onedev.server.web.page.admin.emailtemplates.PasswordResetTemplatePage;import io.onedev.server.web.page.admin.emailtemplates.PullRequestNotificationTemplatePage;@@ -151,6 +152,7 @@ import io.onedev.server.web.page.admin.usermanagement.InvitationListPage;import io.onedev.server.web.page.admin.usermanagement.NewInvitationPage;import io.onedev.server.web.page.admin.usermanagement.NewUserPage;import io.onedev.server.web.page.admin.usermanagement.UserListPage;+import io.onedev.server.web.page.admin.workspaceprovisioner.WorkspaceProvisionersPage;import io.onedev.server.web.page.base.BasePage;import io.onedev.server.web.page.help.IncompatibilitiesPage;import io.onedev.server.web.page.my.MyPage;@@ -286,8 +288,10 @@ public abstract class LayoutPage extends BasePage {administrationMenuItems.add(new SidebarMenuItem.SubMenu(null, _T("Issue Settings"), issueSettingMenuItems));- administrationMenuItems.add(new SidebarMenuItem.Page(null, _T("Job Executors"),- JobExecutorsPage.class, new PageParameters()));+ administrationMenuItems.add(new SidebarMenuItem.Page(null, _T("Job Executors"),+ JobExecutorsPage.class, new PageParameters()));+ administrationMenuItems.add(new SidebarMenuItem.Page(null, _T("Workspace Provisioners"),+ WorkspaceProvisionersPage.class, new PageParameters()));administrationMenuItems.add(new SidebarMenuItem.Page(null, _T("Agents"),AgentListPage.class, AgentListPage.paramsOf(0), Lists.newArrayList(AgentDetailPage.class)));@@ -319,7 +323,10 @@ public abstract class LayoutPage extends BasePage {BuildNotificationTemplatePage.class, new PageParameters()));emailTemplatesMenuItems.add(new SidebarMenuItem.Page(null, _T("Package Notification"),- PackNotificationTemplatePage.class, new PageParameters()));+ PackNotificationTemplatePage.class, new PageParameters()));++ emailTemplatesMenuItems.add(new SidebarMenuItem.Page(null, _T("Workspace Notification"),+ WorkspaceNotificationTemplatePage.class, new PageParameters()));emailTemplatesMenuItems.add(new SidebarMenuItem.Page(null, _T("Commit Notification"),CommitNotificationTemplatePage.class, new PageParameters()));diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/ProjectPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/ProjectPage.javaindex 01529a3215..276e1e1984 100644--- a/server-core/src/main/java/io/onedev/server/web/page/project/ProjectPage.java+++ b/server-core/src/main/java/io/onedev/server/web/page/project/ProjectPage.java@@ -81,6 +81,8 @@ import io.onedev.server.web.page.project.issues.iteration.IterationEditPage;import io.onedev.server.web.page.project.issues.iteration.IterationListPage;import io.onedev.server.web.page.project.issues.iteration.NewIterationPage;import io.onedev.server.web.page.project.issues.list.ProjectIssueListPage;+import io.onedev.server.web.page.project.workspaces.ProjectWorkspacesPage;+import io.onedev.server.web.page.project.workspaces.detail.WorkspaceDetailPage;import io.onedev.server.web.page.project.packs.ProjectPacksPage;import io.onedev.server.web.page.project.packs.detail.PackDetailPage;import io.onedev.server.web.page.project.pullrequests.InvalidPullRequestPage;@@ -108,6 +110,7 @@ import io.onedev.server.web.page.project.setting.general.GeneralProjectSettingPaimport io.onedev.server.web.page.project.setting.pluginsettings.ContributedProjectSettingPage;import io.onedev.server.web.page.project.setting.servicedesk.ServiceDeskSettingPage;import io.onedev.server.web.page.project.setting.webhook.WebHooksPage;+import io.onedev.server.web.page.project.setting.workspacespec.WorkspaceSpecsPage;import io.onedev.server.web.page.project.stats.code.CodeContribsPage;import io.onedev.server.web.page.project.stats.code.SourceLinesPage;import io.onedev.server.web.page.project.tags.ProjectTagsPage;@@ -252,7 +255,14 @@ public abstract class ProjectPage extends LayoutPage implements ProjectAware {ProjectPacksPage.class, ProjectPacksPage.paramsOf(getProject(), 0),Lists.newArrayList(PackDetailPage.class)));}-++ if (getProject().isCodeManagement() && SecurityUtils.canWriteCode(getProject())+ && !getProject().getHierarchyWorkspaceSpecs().isEmpty()) {+ menuItems.add(new SidebarMenuItem.Page("workspace", _T("Workspaces"),+ ProjectWorkspacesPage.class, ProjectWorkspacesPage.paramsOf(getProject(), 0),+ Lists.newArrayList(WorkspaceDetailPage.class)));+ }+List<SidebarMenuItem> statsMenuItems = new ArrayList<>();if (getProject().isCodeManagement() && SecurityUtils.canReadCode(getProject())) {@@ -312,7 +322,9 @@ public abstract class ProjectPage extends LayoutPage implements ProjectAware {CacheManagementPage.class, CacheManagementPage.paramsOf(getProject())));settingMenuItems.add(new SidebarMenuItem.SubMenu(null, _T("Build"), buildSettingMenuItems));-+ settingMenuItems.add(new SidebarMenuItem.Page(null, _T("Workspace Specs"),+ WorkspaceSpecsPage.class, WorkspaceSpecsPage.paramsOf(getProject())));+if (getSettingService().getServiceDeskSetting() != null && getProject().isIssueManagement()) {settingMenuItems.add(new SidebarMenuItem.Page(null, _T("Service Desk"),ServiceDeskSettingPage.class, ServiceDeskSettingPage.paramsOf(getProject())));diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.html b/server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.htmlindex c3b2a54621..735ff017a9 100644--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.html+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.html@@ -4,6 +4,7 @@<div class="d-flex flex-wrap align-items-center"><a wicket:id="revisionPicker" class="revision-picker mr-3 py-2"></a><a wicket:id="buildStatus" class="build-status mr-3 py-2"></a>+ <a wicket:id="workspaces" t:data-tippy-content="Workspaces on this branch" class="mr-3 py-2"><wicket:svg href="workspace" class="icon"/> <wicket:svg href="arrow" class="rotate-90 icon"/></a><div wicket:id="blobNavigator" class="blob-navigator mr-3 py-2"></div></div><div wicket:id="blobOperations" class="py-2">diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.javaindex de1a7583b9..555ef59823 100644--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java@@ -119,6 +119,7 @@ import io.onedev.server.web.component.menu.MenuLink;import io.onedev.server.web.component.modal.ModalLink;import io.onedev.server.web.component.modal.ModalPanel;import io.onedev.server.web.component.revision.RevisionPicker;+import io.onedev.server.web.component.workspace.speclist.WorkspaceSpecListPanel;import io.onedev.server.web.page.project.ProjectPage;import io.onedev.server.web.page.project.blob.navigator.BlobNavigator;import io.onedev.server.web.page.project.blob.render.BlobRenderContext;@@ -192,7 +193,7 @@ public class ProjectBlobPage extends ProjectPage implements BlobRenderContext,@Injectprivate SettingService settingService;-+@Injectprivate PullRequestService pullRequestService;@@ -271,8 +272,9 @@ public class ProjectBlobPage extends ProjectPage implements BlobRenderContext,super.onInitialize();newRevisionPicker(null);- newCommitStatus(null);- newBlobNavigator(null);+ newCommitStatusLink(null);+ newWorkspacesLink(null);+ newBlobNavigator(null);newBlobOperations(null);add(revisionIndexing = new WebMarkupContainer("revisionIndexing") {@@ -901,10 +903,10 @@ public class ProjectBlobPage extends ProjectPage implements BlobRenderContext,replaceState(target, url.toString(), state);}- private void newCommitStatus(@Nullable AjaxRequestTarget target) {- Component commitStatus;+ private void newCommitStatusLink(@Nullable AjaxRequestTarget target) {+ Component commitStatusLink;if (resolvedRevision != null) {- commitStatus = new CommitStatusLink("buildStatus", resolvedRevision, getRefName()) {+ commitStatusLink = new CommitStatusLink("buildStatus", resolvedRevision, getRefName()) {@Overrideprotected Project getProject() {@@ -918,19 +920,55 @@ public class ProjectBlobPage extends ProjectPage implements BlobRenderContext,};} else {- commitStatus = new WebMarkupContainer("buildStatus").add(AttributeAppender.append("class", "d-none"));+ commitStatusLink = new WebMarkupContainer("buildStatus").add(AttributeAppender.append("class", "d-none"));}- commitStatus.setOutputMarkupPlaceholderTag(true);+ commitStatusLink.setOutputMarkupPlaceholderTag(true);if (target != null) {- replace(commitStatus);- target.add(commitStatus);+ replace(commitStatusLink);+ target.add(commitStatusLink);} else {- add(commitStatus);+ add(commitStatusLink);}}+ private void newWorkspacesLink(@Nullable AjaxRequestTarget target) {+ var workspacesLink = new DropdownLink("workspaces") {++ @Override+ protected Component newContent(String id, FloatingPanel dropdown) {+ var currentRefName = getRefName();+ var currentBranch = currentRefName != null ? GitUtils.ref2branch(currentRefName) : "main";+ return new WorkspaceSpecListPanel(id, currentBranch) {++ @Override+ protected Project getProject() {+ return ProjectBlobPage.this.getProject();+ }++ };+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(isOnBranch() && SecurityUtils.canWriteCode(getProject())+ && !getProject().getHierarchyWorkspaceSpecs().isEmpty());+ }++ };++ workspacesLink.setOutputMarkupPlaceholderTag(true);++ if (target != null) {+ replace(workspacesLink);+ target.add(workspacesLink);+ } else {+ add(workspacesLink);+ }+ }+private void newBuildSupportNote(@Nullable AjaxRequestTarget target) {Component buildSupportNote = new WebMarkupContainer("buildSupportNote") {@@ -1065,7 +1103,7 @@ public class ProjectBlobPage extends ProjectPage implements BlobRenderContext,resolvedRevision = getProject().getRevCommit(state.blobIdent.revision, true).copy();newRevisionPicker(target);- newCommitStatus(target);+ newCommitStatusLink(target);target.add(revisionIndexing);newBlobNavigator(target);newBlobOperations(target);@@ -1260,6 +1298,7 @@ public class ProjectBlobPage extends ProjectPage implements BlobRenderContext,state.requestId = null;newSearchResult(target, null);onResolvedRevisionChange(target);+ newWorkspacesLink(target);resizeWindow(target);} else if (!Objects.equal(state.blobIdent.path, blobIdent.path)) {state.blobIdent.path = blobIdent.path;diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditor.java b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditor.javaindex 793177fe6b..0a27c46aab 100644--- a/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditor.java+++ b/server-core/src/main/java/io/onedev/server/web/page/project/blob/render/renderers/markdown/MarkdownBlobEditor.java@@ -22,6 +22,7 @@ import io.onedev.server.service.PullRequestService;import io.onedev.server.service.UserService;import io.onedev.server.markdown.MarkdownService;import io.onedev.server.model.Build;+import io.onedev.server.model.Workspace;import io.onedev.server.model.Issue;import io.onedev.server.model.Project;import io.onedev.server.model.PullRequest;@@ -38,6 +39,7 @@ import io.onedev.server.web.component.markdown.MarkdownEditor;import io.onedev.server.web.component.markdown.UserMentionSupport;import io.onedev.server.web.page.project.blob.render.BlobRenderContext;import io.onedev.server.web.page.project.blob.render.BlobRenderContext.Mode;+import io.onedev.server.workspace.WorkspaceService;class MarkdownBlobEditor extends FormComponentPanel<byte[]> {@@ -137,13 +139,18 @@ class MarkdownBlobEditor extends FormComponentPanel<byte[]> {}}- @Override- public List<Build> queryBuilds(Project project, String query, int count) {- var subject = SecurityUtils.getSubject();- return OneDev.getInstance(BuildService.class).query(subject, project, query, count);- }-- };+ @Override+ public List<Build> queryBuilds(Project project, String query, int count) {+ var subject = SecurityUtils.getSubject();+ return OneDev.getInstance(BuildService.class).query(subject, project, query, count);+ }++ @Override+ public List<Workspace> queryWorkspaces(Project project, String query, int count) {+ return OneDev.getInstance(WorkspaceService.class).query(SecurityUtils.getSubject(), project, query, count);+ }++ };}});diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/branches/ProjectBranchesPage.html b/server-core/src/main/java/io/onedev/server/web/page/project/branches/ProjectBranchesPage.htmlindex 30e3141bc6..7e088e4818 100644--- a/server-core/src/main/java/io/onedev/server/web/page/project/branches/ProjectBranchesPage.html+++ b/server-core/src/main/java/io/onedev/server/web/page/project/branches/ProjectBranchesPage.html@@ -21,6 +21,7 @@<div class="title my-2"><a wicket:id="branchLink" class="name mr-2"><span wicket:id="name"></span></a><a wicket:id="buildStatus" class="build-status mr-2"></a>+ <a wicket:id="workspaces" t:data-tippy-content="Workspaces on this branch" class="mr-2"><wicket:svg href="workspace" class="icon"/> <wicket:svg href="arrow" class="icon rotate-90"/></a><span class="badge badge-info badge-sm mr-2" wicket:id="default"><wicket:t>default</wicket:t></span></div><div class="commit-message mb-2">diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/branches/ProjectBranchesPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/branches/ProjectBranchesPage.javaindex 0c93b2563b..ce6867aa74 100644--- a/server-core/src/main/java/io/onedev/server/web/page/project/branches/ProjectBranchesPage.java+++ b/server-core/src/main/java/io/onedev/server/web/page/project/branches/ProjectBranchesPage.java@@ -16,7 +16,7 @@ import java.util.Locale;import java.util.Map;import java.util.stream.Collectors;-import org.jspecify.annotations.Nullable;+import javax.inject.Inject;import org.apache.commons.validator.routines.PercentValidator;import org.apache.wicket.Component;@@ -54,13 +54,10 @@ import org.eclipse.jgit.lib.Constants;import org.eclipse.jgit.lib.FileMode;import org.eclipse.jgit.lib.ObjectId;import org.eclipse.jgit.revwalk.RevCommit;+import org.jspecify.annotations.Nullable;import com.google.common.base.Preconditions;-import io.onedev.server.OneDev;-import io.onedev.server.service.BuildService;-import io.onedev.server.service.ProjectService;-import io.onedev.server.service.PullRequestService;import io.onedev.server.entityreference.LinkTransformer;import io.onedev.server.git.BlobIdent;import io.onedev.server.git.GitUtils;@@ -74,6 +71,8 @@ import io.onedev.server.search.entity.pullrequest.OpenCriteria;import io.onedev.server.search.entity.pullrequest.PullRequestQuery;import io.onedev.server.search.entity.pullrequest.PullRequestQueryLexer;import io.onedev.server.security.SecurityUtils;+import io.onedev.server.service.BuildService;+import io.onedev.server.service.PullRequestService;import io.onedev.server.util.Path;import io.onedev.server.util.PathNode;import io.onedev.server.util.ProjectAndBranch;@@ -83,10 +82,13 @@ import io.onedev.server.web.component.branch.choice.BranchSingleChoice;import io.onedev.server.web.component.commit.status.CommitStatusLink;import io.onedev.server.web.component.contributorpanel.ContributorPanel;import io.onedev.server.web.component.datatable.DefaultDataTable;+import io.onedev.server.web.component.floating.FloatingPanel;import io.onedev.server.web.component.link.ArchiveMenuLink;+import io.onedev.server.web.component.link.DropdownLink;import io.onedev.server.web.component.link.ViewStateAwarePageLink;import io.onedev.server.web.component.modal.ModalLink;import io.onedev.server.web.component.modal.ModalPanel;+import io.onedev.server.web.component.workspace.speclist.WorkspaceSpecListPanel;import io.onedev.server.web.editable.BeanContext;import io.onedev.server.web.editable.BeanEditor;import io.onedev.server.web.page.project.ProjectPage;@@ -99,6 +101,7 @@ import io.onedev.server.web.page.project.pullrequests.detail.activities.PullRequimport io.onedev.server.web.util.LoadableDetachableDataProvider;import io.onedev.server.web.util.paginghistory.PagingHistorySupport;import io.onedev.server.web.util.paginghistory.ParamPagingHistorySupport;+import io.onedev.server.workspace.WorkspaceService;public class ProjectBranchesPage extends ProjectPage {@@ -110,7 +113,19 @@ public class ProjectBranchesPage extends ProjectPage {// use a small page size to load page quicklyprivate static final int PAGE_SIZE = 10;++ @Inject+ private PullRequestService pullRequestService;+ @Inject+ private GitService gitService;++ @Inject+ private BuildService buildService;++ @Inject+ private WorkspaceService workspaceService;+private String baseBranch;private IModel<Map<String, RefFacade>> branchesModel = new LoadableDetachableModel<Map<String, RefFacade>>() {@@ -147,7 +162,7 @@ public class ProjectBranchesPage extends ProjectPage {sources.add(new ProjectAndBranch(getProject(), branchName));}- return OneDev.getInstance(PullRequestService.class).findEffectives(target, sources);+ return pullRequestService.findEffectives(target, sources);}};@@ -168,8 +183,6 @@ public class ProjectBranchesPage extends ProjectPage {@Overrideprotected Map<ObjectId, AheadBehind> load() {List<ObjectId> compareIds = getCommitIdsToDisplay();-- GitService gitService = OneDev.getInstance(GitService.class);RefFacade baseRef = Preconditions.checkNotNull(getProject().getBranchRef(baseBranch));return gitService.getAheadBehinds(getProject(), baseRef.getObjectId(), compareIds);@@ -391,7 +404,7 @@ public class ProjectBranchesPage extends ProjectPage {_T("Valid signature required for head commit of this branch per branch protection rule"));target.add(form);} else {- OneDev.getInstance(GitService.class).createBranch(getProject(), branchName, helperBean.getRevision());+ gitService.createBranch(getProject(), branchName, helperBean.getRevision());modal.close();target.add(branchesTable);@@ -465,6 +478,29 @@ public class ProjectBranchesPage extends ProjectPage {});+ fragment.add(new DropdownLink("workspaces") {++ @Override+ protected Component newContent(String id, FloatingPanel dropdown) {+ return new WorkspaceSpecListPanel(id, branch) {++ @Override+ protected Project getProject() {+ return ProjectBranchesPage.this.getProject();+ }++ };+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(SecurityUtils.canWriteCode(getProject())+ && !getProject().getHierarchyWorkspaceSpecs().isEmpty());+ }++ });+fragment.add(new WebMarkupContainer("default") {@Override@@ -545,7 +581,6 @@ public class ProjectBranchesPage extends ProjectPage {@Overrideprotected Component newContent(String id, ModalPanel modal) {Fragment fragment = new Fragment(id, "confirmDeleteBranchFrag", ProjectBranchesPage.this);- PullRequestService pullRequestService = OneDev.getInstance(PullRequestService.class);if (!pullRequestService.queryOpen(new ProjectAndBranch(getProject(), branch)).isEmpty()) {Fragment bodyFrag = new Fragment("body", "openRequestsFrag", ProjectBranchesPage.this);String query = String.format("\"%s\" %s \"%s\" %s %s",@@ -563,13 +598,18 @@ public class ProjectBranchesPage extends ProjectPage {@Overridepublic void onClick(AjaxRequestTarget target) {- OneDev.getInstance(ProjectService.class).deleteBranch(getProject(), branch);- getSession().success(MessageFormat.format(_T("Branch \"{0}\" deleted"), branch));- if (branch.equals(baseBranch)) {- baseBranch = getProject().getDefaultBranch();- target.add(baseChoice);+ if (workspaceService.count(getProject(), branch) > 0) {+ getSession().error(MessageFormat.format(+ _T("Can not delete branch \"{0}\" as there are workspaces on it"), branch));+ } else {+ projectService.deleteBranch(getProject(), branch);+ getSession().success(MessageFormat.format(_T("Branch \"{0}\" deleted"), branch));+ if (branch.equals(baseBranch)) {+ baseBranch = getProject().getDefaultBranch();+ target.add(baseChoice);+ }+ target.add(branchesTable);}- target.add(branchesTable);modal.close();}@@ -708,7 +748,7 @@ public class ProjectBranchesPage extends ProjectPage {@Overrideprotected void onBeforeRender() {- BuildService buildService = OneDev.getInstance(BuildService.class);+ buildService.queryStatus(getProject(), getCommitIdsToDisplay());getProject().cacheCommitStatuses(buildService.queryStatus(getProject(), getCommitIdsToDisplay()));super.onBeforeRender();}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/BuildDetailPage.html b/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/BuildDetailPage.htmlindex 4227bd871d..ceb8e65bd9 100644--- a/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/BuildDetailPage.html+++ b/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/BuildDetailPage.html@@ -2,8 +2,8 @@<div class="build-detail d-flex flex-column card m-2 m-sm-5 flex-grow-1"><div class="card-header flex-shrink-0 flex-nowrap"><div class="card-title flex-wrap">- <span wicket:id="summary" class="mr-4 text-break"></span>- <div wicket:id="status" class="status text-nowrap mr-4">+ <span wicket:id="caption" class="mr-4 text-break"></span>+ <div class="status text-nowrap mr-4"><svg wicket:id="statusIcon" class="mr-2"></svg><span wicket:id="statusLabel"></span></div>diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/BuildDetailPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/BuildDetailPage.javaindex b73fef72d9..c35054d98b 100644--- a/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/BuildDetailPage.java+++ b/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/BuildDetailPage.java@@ -69,7 +69,8 @@ import io.onedev.server.job.JobAuthorizationContext;import io.onedev.server.job.JobAuthorizationContextAware;import io.onedev.server.job.JobContext;import io.onedev.server.job.JobService;-import io.onedev.server.job.log.LogService;+import io.onedev.server.job.JobTerminalService;+import io.onedev.server.logging.LogService;import io.onedev.server.model.Build;import io.onedev.server.model.Build.Status;import io.onedev.server.model.Project;@@ -79,7 +80,6 @@ import io.onedev.server.search.entity.EntityQuery;import io.onedev.server.search.entity.build.BuildQuery;import io.onedev.server.security.SecurityUtils;import io.onedev.server.service.BuildService;-import io.onedev.server.terminal.TerminalService;import io.onedev.server.util.ProjectScope;import io.onedev.server.web.WebSession;import io.onedev.server.web.ajaxlistener.ConfirmClickListener;@@ -131,7 +131,7 @@ public abstract class BuildDetailPage extends ProjectPageprivate JobService jobService;@Inject- private TerminalService terminalService;+ private JobTerminalService terminalService;@Injectprivate LogService logService;@@ -238,11 +238,11 @@ public abstract class BuildDetailPage extends ProjectPageprotected void onInitialize() {super.onInitialize();- add(new Label("summary", new AbstractReadOnlyModel<String>() {+ add(new Label("caption", new AbstractReadOnlyModel<String>() {@Overridepublic String getObject() {- return getBuild().getSummary(getProject());+ return getBuild().getCaption(getProject());}}) {@@ -256,11 +256,7 @@ public abstract class BuildDetailPage extends ProjectPage});- WebMarkupContainer statusContainer = new WebMarkupContainer("status");- add(statusContainer);- statusContainer.add(newBuildObserver(getBuild().getId()));- statusContainer.setOutputMarkupId(true);- statusContainer.add(new BuildStatusIcon("statusIcon", new AbstractReadOnlyModel<Status>() {+ add(new BuildStatusIcon("statusIcon", new AbstractReadOnlyModel<Status>() {@Overridepublic Status getObject() {@@ -275,14 +271,14 @@ public abstract class BuildDetailPage extends ProjectPage}});- statusContainer.add(new Label("statusLabel", new AbstractReadOnlyModel<String>() {+ add(new Label("statusLabel", new AbstractReadOnlyModel<String>() {@Overridepublic String getObject() {return _T(buildModel.getObject().getStatus().toString());}- }));+ }).add(newBuildObserver(getBuild().getId())));add(new WebMarkupContainer("actions") {@Override@@ -854,8 +850,7 @@ public abstract class BuildDetailPage extends ProjectPagepublic CompletableFuture<ToolExecutionResult> execute(IPartialPageRequestHandler handler, Subject subject, JsonNode arguments) {if (!SecurityUtils.canAccessLog(subject, getBuild()))throw new UnauthorizedException();- var snippet = logService.readLogSnippetReversely(- getBuild().getProject().getId(), getBuild().getNumber(), MAX_LOG_ENTRIES);+ var snippet = logService.readLogSnippetReversely(getBuild().getLoggingSupport(), MAX_LOG_ENTRIES);var builder = new StringBuilder();for (var entry : snippet.entries) {builder.append(entry.render()).append("\n");diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/build-detail.css b/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/build-detail.cssindex 227dc8f77b..d63eddab57 100644--- a/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/build-detail.css+++ b/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/build-detail.css@@ -20,4 +20,4 @@}.build-pipeline .pipeline-row>.btn-group>.run {flex-grow: 0;-}\ No newline at end of file+}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/dashboard/BuildDashboardPage.html b/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/dashboard/BuildDashboardPage.htmlindex 89e2ed850a..b47194918b 100644--- a/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/dashboard/BuildDashboardPage.html+++ b/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/dashboard/BuildDashboardPage.html@@ -1,3 +1,2 @@<wicket:extend>-TBD</wicket:extend>\ No newline at end of filediff --git a/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/log/BuildLogPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/log/BuildLogPage.javaindex 3c49d38916..64d89f9849 100644--- a/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/log/BuildLogPage.java+++ b/server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/log/BuildLogPage.java@@ -1,18 +1,28 @@package io.onedev.server.web.page.project.builds.detail.log;+import javax.inject.Inject;+import org.apache.wicket.Component;import org.apache.wicket.markup.html.link.ResourceLink;import org.apache.wicket.markup.html.panel.Fragment;import org.apache.wicket.request.mapper.parameter.PageParameters;+import org.jspecify.annotations.Nullable;+import io.onedev.server.job.JobService;+import io.onedev.server.logging.LoggingSupport;+import io.onedev.server.model.Build;import io.onedev.server.security.SecurityUtils;-import io.onedev.server.web.component.build.log.BuildLogPanel;+import io.onedev.server.web.component.logging.LogPanel;+import io.onedev.server.web.component.logging.PauseSupport;import io.onedev.server.web.page.project.builds.detail.BuildDetailPage;import io.onedev.server.web.resource.BuildLogResource;import io.onedev.server.web.resource.BuildLogResourceReference;public class BuildLogPage extends BuildDetailPage {+ @Inject+ private JobService jobService;+public BuildLogPage(PageParameters params) {super(params);}@@ -21,7 +31,42 @@ public class BuildLogPage extends BuildDetailPage {protected void onInitialize() {super.onInitialize();- add(new BuildLogPanel("log", buildModel));+ add(new LogPanel("log") {++ @Override+ protected LoggingSupport getLoggingSupport() {+ return getBuild().getLoggingSupport();+ }++ @Nullable+ @Override+ protected PauseSupport getPauseSupport() {+ return new PauseSupport() {++ @Override+ public boolean isPaused() {+ return getBuild().isPaused();+ }++ @Override+ public boolean canResume() {+ return SecurityUtils.canRunJob(getBuild().getProject(), getBuild().getJobName());+ }++ @Override+ public void resume() {+ jobService.resume(getBuild());+ }++ @Override+ public String getStatusChangeObservable() {+ return Build.getDetailChangeObservable(getBuild().getId());+ }++ };+ }++ });}@Overridediff --git a/server-core/src/main/java/io/onedev/server/web/page/project/setting/build/CacheManagementPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/setting/build/CacheManagementPage.javaindex 029536b81c..6d6ccd0113 100644--- a/server-core/src/main/java/io/onedev/server/web/page/project/setting/build/CacheManagementPage.java+++ b/server-core/src/main/java/io/onedev/server/web/page/project/setting/build/CacheManagementPage.java@@ -1,6 +1,6 @@package io.onedev.server.web.page.project.setting.build;-import static io.onedev.server.model.JobCache.PROP_PROJECT;+import static io.onedev.server.model.RunCache.PROP_PROJECT;import static io.onedev.server.web.translation.Translation._T;import java.text.MessageFormat;@@ -31,10 +31,10 @@ import org.hibernate.criterion.Restrictions;import io.onedev.server.OneDev;import io.onedev.server.data.migration.VersionedXmlDoc;-import io.onedev.server.service.JobCacheService;-import io.onedev.server.service.ProjectService;-import io.onedev.server.model.JobCache;+import io.onedev.server.model.RunCache;import io.onedev.server.persistence.dao.EntityCriteria;+import io.onedev.server.service.ProjectService;+import io.onedev.server.service.RunCacheService;import io.onedev.server.util.DateUtils;import io.onedev.server.web.WebConstants;import io.onedev.server.web.component.datatable.DefaultDataTable;@@ -46,7 +46,7 @@ public class CacheManagementPage extends ProjectBuildSettingPage {private static final String PARAM_PAGE = "page";- private DataTable<JobCache, Void> cachesTable;+ private DataTable<RunCache, Void> cachesTable;public CacheManagementPage(PageParameters params) {super(params);@@ -73,21 +73,33 @@ public class CacheManagementPage extends ProjectBuildSettingPage {form.add(BeanContext.edit("editor", bean));add(form);- List<IColumn<JobCache, Void>> columns = new ArrayList<>();+ List<IColumn<RunCache, Void>> columns = new ArrayList<>();columns.add(new AbstractColumn<>(Model.of(_T("Key"))) {@Override- public void populateItem(Item<ICellPopulator<JobCache>> cellItem, String componentId, IModel<JobCache> rowModel) {+ public void populateItem(Item<ICellPopulator<RunCache>> cellItem, String componentId, IModel<RunCache> rowModel) {cellItem.add(new Label(componentId, rowModel.getObject().getKey()));}});++ columns.add(new AbstractColumn<>(Model.of(_T("Checksum"))) {++ @Override+ public void populateItem(Item<ICellPopulator<RunCache>> cellItem, String componentId, IModel<RunCache> rowModel) {+ var checksum = rowModel.getObject().getChecksum();+ if (checksum != null)+ cellItem.add(new Label(componentId, checksum));+ else+ cellItem.add(new Label(componentId, "<i>N/A</i>").setEscapeModelStrings(false));+ }+ });columns.add(new AbstractColumn<>(Model.of(_T("Size"))) {@Override- public void populateItem(Item<ICellPopulator<JobCache>> cellItem, String componentId,- IModel<JobCache> rowModel) {+ public void populateItem(Item<ICellPopulator<RunCache>> cellItem, String componentId,+ IModel<RunCache> rowModel) {var cache = rowModel.getObject();var cacheSize = getCacheService().getCacheSize(cache.getProject().getId(), cache.getId());if (cacheSize != null)@@ -101,8 +113,8 @@ public class CacheManagementPage extends ProjectBuildSettingPage {columns.add(new AbstractColumn<>(Model.of(_T("Last Accessed"))) {@Override- public void populateItem(Item<ICellPopulator<JobCache>> cellItem, String componentId,- IModel<JobCache> rowModel) {+ public void populateItem(Item<ICellPopulator<RunCache>> cellItem, String componentId,+ IModel<RunCache> rowModel) {var cache = rowModel.getObject();cellItem.add(new Label(componentId, DateUtils.formatDate(cache.getAccessDate())));}@@ -112,7 +124,7 @@ public class CacheManagementPage extends ProjectBuildSettingPage {columns.add(new AbstractColumn<>(Model.of("")) {@Override- public void populateItem(Item<ICellPopulator<JobCache>> cellItem, String componentId, IModel<JobCache> rowModel) {+ public void populateItem(Item<ICellPopulator<RunCache>> cellItem, String componentId, IModel<RunCache> rowModel) {Fragment fragment = new Fragment(componentId, "actionFrag", CacheManagementPage.this);fragment.add(new AjaxLink<Void>("delete") {@@ -137,18 +149,18 @@ public class CacheManagementPage extends ProjectBuildSettingPage {});- SortableDataProvider<JobCache, Void> dataProvider = new SortableDataProvider<>() {+ SortableDataProvider<RunCache, Void> dataProvider = new SortableDataProvider<>() {- private EntityCriteria<JobCache> newCriteria() {- var criteria = EntityCriteria.of(JobCache.class);+ private EntityCriteria<RunCache> newCriteria() {+ var criteria = EntityCriteria.of(RunCache.class);criteria.add(Restrictions.eq(PROP_PROJECT, getProject()));return criteria;}@Override- public Iterator<? extends JobCache> iterator(long first, long count) {+ public Iterator<? extends RunCache> iterator(long first, long count) {var criteria = newCriteria();- criteria.addOrder(Order.desc(JobCache.PROP_ACCESS_DATE));+ criteria.addOrder(Order.desc(RunCache.PROP_ACCESS_DATE));return getCacheService().query(criteria, (int) first, (int) count).iterator();}@@ -158,12 +170,12 @@ public class CacheManagementPage extends ProjectBuildSettingPage {}@Override- public IModel<JobCache> model(JobCache object) {+ public IModel<RunCache> model(RunCache object) {Long id = object.getId();return new LoadableDetachableModel<>() {@Override- protected JobCache load() {+ protected RunCache load() {return getCacheService().load(id);}@@ -197,8 +209,8 @@ public class CacheManagementPage extends ProjectBuildSettingPage {return new Label(componentId, _T("Job Cache Management"));}- private JobCacheService getCacheService() {- return OneDev.getInstance(JobCacheService.class);+ private RunCacheService getCacheService() {+ return OneDev.getInstance(RunCacheService.class);}}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/setting/project-setting.css b/server-core/src/main/java/io/onedev/server/web/page/project/setting/project-setting.cssindex 64f8542690..a77912109e 100644--- a/server-core/src/main/java/io/onedev/server/web/page/project/setting/project-setting.css+++ b/server-core/src/main/java/io/onedev/server/web/page/project/setting/project-setting.css@@ -15,26 +15,31 @@width: 30%;}.project-setting .branch-protection>.card-header .badge,-.project-setting .tag-protection>.card-header .badge {+.project-setting .tag-protection>.card-header .badge,+.project-setting .workspace-spec>.card-header .badge {font-size: 0.9rem;}.project-setting .branch-protection>.card-header .toggle>.icon,-.project-setting .tag-protection>.card-header .toggle>.icon {+.project-setting .tag-protection>.card-header .toggle>.icon,+.project-setting .workspace-spec>.card-header .toggle>.icon {width: 30px;height: 30px;margin-top: 2px;margin-left: -8px;}.project-setting .branch-protection.expanded>.card-header .toggle>.icon,-.project-setting .tag-protection.expanded>.card-header .toggle>.icon {+.project-setting .tag-protection.expanded>.card-header .toggle>.icon,+.project-setting .workspace-spec.expanded>.card-header .toggle>.icon {transform: rotate(0deg);}.project-setting .branch-protection>.card-body,-.project-setting .tag-protection>.card-body {+.project-setting .tag-protection>.card-body,+.project-setting .workspace-spec>.card-body {display: none;}.project-setting .branch-protection.expanded>.card-body,-.project-setting .tag-protection.expanded>.card-body {+.project-setting .tag-protection.expanded>.card-body,+.project-setting .workspace-spec.expanded>.card-body {display: block;}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecEditPanel.html b/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecEditPanel.htmlnew file mode 100644index 0000000000..336c50cf35--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecEditPanel.html@@ -0,0 +1,10 @@+<wicket:panel>+ <form wicket:id="form" class="leave-confirm">+ <div wicket:id="feedback"></div>+ <div wicket:id="editor"></div>+ <div class="actions">+ <button wicket:id="save" class="dirty-aware btn btn-primary mr-1"><wicket:t>Save</wicket:t></button>+ <button wicket:id="cancel" class="btn btn-secondary"><wicket:t>Cancel</wicket:t></button>+ </div>+ </form>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecEditPanel.java b/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecEditPanel.javanew file mode 100644index 0000000000..1d89c0c86e--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecEditPanel.java@@ -0,0 +1,62 @@+package io.onedev.server.web.page.project.setting.workspacespec;++import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.ajax.markup.html.form.AjaxButton;+import org.apache.wicket.feedback.FencedFeedbackPanel;+import org.apache.wicket.markup.html.form.Form;+import org.apache.wicket.markup.html.panel.Panel;++import io.onedev.server.model.support.workspace.spec.WorkspaceSpec;+import io.onedev.server.web.editable.BeanContext;++abstract class WorkspaceSpecEditPanel extends Panel {++ private final WorkspaceSpec spec;++ public WorkspaceSpecEditPanel(String id, WorkspaceSpec spec) {+ super(id);+ this.spec = spec;+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ setOutputMarkupId(true);++ Form<?> form = new Form<Void>("form");+ form.add(new FencedFeedbackPanel("feedback", form));++ form.add(BeanContext.edit("editor", spec));++ form.add(new AjaxButton("save") {++ @Override+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {+ super.onSubmit(target, form);+ onSave(target, spec);+ }++ @Override+ protected void onError(AjaxRequestTarget target, Form<?> form) {+ super.onError(target, form);+ target.add(form);+ }++ });+ form.add(new AjaxLink<Void>("cancel") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ onCancel(target);+ }++ });+ add(form);+ }++ protected abstract void onSave(AjaxRequestTarget target, WorkspaceSpec spec);++ protected abstract void onCancel(AjaxRequestTarget target);+}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecPanel.html b/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecPanel.htmlnew file mode 100644index 0000000000..19b011d3eb--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecPanel.html@@ -0,0 +1,16 @@+<wicket:panel>+ <div class="workspace-spec card">+ <div class="card-header">+ <div class="card-title">+ <a class="toggle" onclick="$(this).closest('.workspace-spec').toggleClass('expanded');"><wicket:svg href="arrow4" class="icon rotate-270"/></a>+ <span class="drag-indicator"><wicket:svg href="grip" class="icon icon-lg mr-2"/></span>+ <span wicket:id="name" class="mr-3"></span>+ <a wicket:id="edit" onclick="$(this).closest('.workspace-spec').addClass('expanded');" class="btn btn-xs btn-icon btn-light btn-hover-primary mr-2" t:data-tippy-content="Edit this spec"><wicket:svg href="edit" class="icon"></wicket:svg></a>+ <a wicket:id="delete" class="btn btn-xs btn-icon btn-light btn-hover-danger mr-4" t:data-tippy-content="Delete this spec"><wicket:svg href="trash" class="icon"></wicket:svg></a>+ </div>+ </div>+ <div class="card-body">+ <div wicket:id="spec"></div>+ </div>+ </div>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecPanel.java b/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecPanel.javanew file mode 100644index 0000000000..5814221485--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecPanel.java@@ -0,0 +1,79 @@+package io.onedev.server.web.page.project.setting.workspacespec;++import static io.onedev.server.web.translation.Translation._T;++import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.panel.Panel;++import io.onedev.server.model.support.workspace.spec.WorkspaceSpec;+import io.onedev.server.web.ajaxlistener.ConfirmClickListener;+import io.onedev.server.web.editable.BeanContext;++abstract class WorkspaceSpecPanel extends Panel {++ private final WorkspaceSpec spec;++ public WorkspaceSpecPanel(String id, WorkspaceSpec spec) {+ super(id);+ this.spec = spec;+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ add(new Label("name", spec.getName()));++ add(new AjaxLink<Void>("edit") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ WorkspaceSpecEditPanel editor = new WorkspaceSpecEditPanel("spec", spec) {++ @Override+ protected void onSave(AjaxRequestTarget target, WorkspaceSpec spec) {+ WorkspaceSpecPanel.this.onSave(target, spec);+ }++ @Override+ protected void onCancel(AjaxRequestTarget target) {+ WorkspaceSpecPanel.this.onCancel(target);+ }++ };+ WorkspaceSpecPanel.this.replace(editor);+ target.add(editor);+ }++ });++ add(new AjaxLink<Void>("delete") {++ @Override+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {+ super.updateAjaxAttributes(attributes);+ attributes.getAjaxCallListeners().add(new ConfirmClickListener(_T("Do you really want to delete this workspace spec?")));+ }++ @Override+ public void onClick(AjaxRequestTarget target) {+ onDelete(target);+ }++ });++ add(BeanContext.view("spec", spec).setOutputMarkupId(true));++ setOutputMarkupId(true);+ }++ protected abstract void onDelete(AjaxRequestTarget target);++ protected abstract void onSave(AjaxRequestTarget target, WorkspaceSpec spec);++ protected abstract void onCancel(AjaxRequestTarget target);++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecsPage.html b/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecsPage.htmlnew file mode 100644index 0000000000..a36e9555e5--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecsPage.html@@ -0,0 +1,37 @@+<wicket:extend>+ <div class="workspace-specs">+ <div class="alert alert-notice bg-white shadow mb-5 text-gray">+ <wicket:svg href="bulb" class="icon mr-2"></wicket:svg>+ <wicket:t>Define workspace specs for the project. Child projects inherit specs from parent projects.+ Specs defined in child project override those with the same name from parent project</wicket:t>+ </div>++ <div class="body">+ <div wicket:id="workspaceSpecSetting">+ <ul class="list-unstyled">+ <li wicket:id="specs" class="spec mb-5"><div wicket:id="spec"></div></li>+ </ul>+ <div wicket:id="newSpec"></div>+ </div>+ </div>+ </div>+ <wicket:fragment wicket:id="editNewFrag">+ <div class="spec card">+ <div class="card-header">+ <div class="card-title"><wicket:t>New Workspace Spec</wicket:t></div>+ </div>+ <div class="card-body">+ <div wicket:id="editor"></div>+ </div>+ </div>+ </wicket:fragment>+ <wicket:fragment wicket:id="addNewLinkFrag">+ <div class="card">+ <div class="card-header">+ <div class="card-title">+ <a wicket:id="link" class="d-flex align-items-center add-new"><wicket:svg href="plus-circle-o" class="icon align-middle mr-2"></wicket:svg> <span><wicket:t>Add Spec</wicket:t></span></a>+ </div>+ </div>+ </div>+ </wicket:fragment>+</wicket:extend>diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecsPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecsPage.javanew file mode 100644index 0000000000..6c51eda193--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/setting/workspacespec/WorkspaceSpecsPage.java@@ -0,0 +1,155 @@+package io.onedev.server.web.page.project.setting.workspacespec;++import static io.onedev.server.web.translation.Translation._T;++import java.util.List;++import org.apache.wicket.Component;+import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.markup.html.WebMarkupContainer;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.link.BookmarkablePageLink;+import org.apache.wicket.markup.html.list.ListItem;+import org.apache.wicket.markup.html.list.ListView;+import org.apache.wicket.markup.html.panel.Fragment;+import org.apache.wicket.model.AbstractReadOnlyModel;+import org.apache.wicket.request.mapper.parameter.PageParameters;++import io.onedev.server.data.migration.VersionedXmlDoc;+import io.onedev.server.model.Project;+import io.onedev.server.model.support.workspace.spec.WorkspaceSpec;+import io.onedev.server.security.SecurityUtils;+import io.onedev.server.util.CollectionUtils;+import io.onedev.server.web.behavior.sortable.SortBehavior;+import io.onedev.server.web.behavior.sortable.SortPosition;+import io.onedev.server.web.component.link.ViewStateAwarePageLink;+import io.onedev.server.web.page.project.ProjectPage;+import io.onedev.server.web.page.project.dashboard.ProjectDashboardPage;+import io.onedev.server.web.page.project.setting.ProjectSettingPage;++public class WorkspaceSpecsPage extends ProjectSettingPage {++ private WebMarkupContainer container;++ public WorkspaceSpecsPage(PageParameters params) {+ super(params);+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ container = new WebMarkupContainer("workspaceSpecSetting");+ container.setOutputMarkupId(true);+ add(container);+ container.add(new ListView<WorkspaceSpec>("specs", new AbstractReadOnlyModel<List<WorkspaceSpec>>() {++ @Override+ public List<WorkspaceSpec> getObject() {+ return getProject().getWorkspaceSpecs();+ }+ }) {++ @Override+ protected void populateItem(final ListItem<WorkspaceSpec> item) {+ item.add(new WorkspaceSpecPanel("spec", item.getModelObject()) {++ @Override+ protected void onDelete(AjaxRequestTarget target) {+ var spec = getProject().getWorkspaceSpecs().remove(item.getIndex());+ var oldAuditContent = VersionedXmlDoc.fromBean(spec).toXML();+ getProjectService().update(getProject());+ auditService.audit(getProject(), "deleted workspace spec \"" + spec.getName() + "\"", oldAuditContent, null);+ target.add(container);+ }++ @Override+ protected void onSave(AjaxRequestTarget target, WorkspaceSpec spec) {+ var oldSpec = getProject().getWorkspaceSpecs().set(item.getIndex(), spec);+ var oldAuditContent = VersionedXmlDoc.fromBean(oldSpec).toXML();+ var newAuditContent = VersionedXmlDoc.fromBean(spec).toXML();+ getProjectService().update(getProject());+ auditService.audit(getProject(), "changed workspace spec \"" + spec.getName() + "\"", oldAuditContent, newAuditContent);+ target.add(container);+ }++ @Override+ protected void onCancel(AjaxRequestTarget target) {+ target.add(container);+ }++ });+ }++ });++ container.add(new SortBehavior() {++ @Override+ protected void onSort(AjaxRequestTarget target, SortPosition from, SortPosition to) {+ List<WorkspaceSpec> specs = getProject().getWorkspaceSpecs();+ var oldAuditContent = VersionedXmlDoc.fromBean(specs).toXML();+ CollectionUtils.move(specs, from.getItemIndex(), to.getItemIndex());+ var newAuditContent = VersionedXmlDoc.fromBean(specs).toXML();+ getProjectService().update(getProject());+ auditService.audit(getProject(), "reordered workspace specs", oldAuditContent, newAuditContent);+ target.add(container);+ }++ }.items("li.spec").handle(".card-header"));++ container.add(newAddNewFrag());+ }++ private Component newAddNewFrag() {+ Fragment fragment = new Fragment("newSpec", "addNewLinkFrag", this);+ fragment.add(new AjaxLink<Void>("link") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ Fragment fragment = new Fragment("newSpec", "editNewFrag", getPage());+ fragment.setOutputMarkupId(true);+ fragment.add(new WorkspaceSpecEditPanel("editor", new WorkspaceSpec()) {++ @Override+ protected void onSave(AjaxRequestTarget target, WorkspaceSpec spec) {+ getProject().getWorkspaceSpecs().add(spec);+ var newAuditContent = VersionedXmlDoc.fromBean(spec).toXML();+ getProjectService().update(getProject());+ auditService.audit(getProject(), "added workspace spec \"" + spec.getName() + "\"", null, newAuditContent);+ container.replace(newAddNewFrag());+ target.add(container);+ }++ @Override+ protected void onCancel(AjaxRequestTarget target) {+ Component newAddNewFrag = newAddNewFrag();+ container.replace(newAddNewFrag);+ target.add(newAddNewFrag);+ }++ });+ container.replace(fragment);+ target.add(fragment);+ }++ });+ fragment.setOutputMarkupId(true);+ return fragment;+ }++ @Override+ protected Component newProjectTitle(String componentId) {+ return new Label(componentId, "<span class='text-truncate'>" + _T("Workspace Specs") + "</span>").setEscapeModelStrings(false);+ }++ @Override+ protected BookmarkablePageLink<Void> navToProject(String componentId, Project project) {+ if (SecurityUtils.canManageProject(project))+ return new ViewStateAwarePageLink<Void>(componentId, WorkspaceSpecsPage.class, paramsOf(project.getId()));+ else+ return new ViewStateAwarePageLink<Void>(componentId, ProjectDashboardPage.class, ProjectPage.paramsOf(project.getId()));+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/ProjectWorkspacesPage.html b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/ProjectWorkspacesPage.htmlnew file mode 100644index 0000000000..4fceb8da82--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/ProjectWorkspacesPage.html@@ -0,0 +1,6 @@+<wicket:extend>+ <div class="side-main side-main-wrap p-2 p-sm-5">+ <div wicket:id="savedQueries" class="side"></div>+ <div wicket:id="workspaces" class="main"></div>+ </div>+</wicket:extend>diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/ProjectWorkspacesPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/ProjectWorkspacesPage.javanew file mode 100644index 0000000000..5a576339e0--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/ProjectWorkspacesPage.java@@ -0,0 +1,295 @@+package io.onedev.server.web.page.project.workspaces;++import static io.onedev.server.web.translation.Translation._T;++import java.io.Serializable;+import java.util.ArrayList;++import org.apache.wicket.Component;+import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.link.BookmarkablePageLink;+import org.apache.wicket.markup.html.link.Link;+import org.apache.wicket.model.IModel;+import org.apache.wicket.request.cycle.RequestCycle;+import org.apache.wicket.request.mapper.parameter.PageParameters;+import org.jspecify.annotations.Nullable;++import io.onedev.server.OneDev;+import io.onedev.server.data.migration.VersionedXmlDoc;+import io.onedev.server.model.WorkspaceQueryPersonalization;+import io.onedev.server.model.Project;+import io.onedev.server.model.support.NamedQuery;+import io.onedev.server.model.support.QueryPersonalization;+import io.onedev.server.model.support.administration.GlobalWorkspaceSetting;+import io.onedev.server.model.support.workspace.NamedWorkspaceQuery;+import io.onedev.server.model.support.workspace.ProjectWorkspaceSetting;+import io.onedev.server.security.SecurityUtils;+import io.onedev.server.service.SettingService;+import io.onedev.server.web.component.workspace.list.WorkspaceListPanel;+import io.onedev.server.web.component.link.ViewStateAwarePageLink;+import io.onedev.server.web.component.modal.ModalPanel;+import io.onedev.server.web.component.savedquery.NamedQueriesBean;+import io.onedev.server.web.component.savedquery.PersonalQuerySupport;+import io.onedev.server.web.component.savedquery.SaveQueryPanel;+import io.onedev.server.web.component.savedquery.SavedQueriesPanel;+import io.onedev.server.web.page.project.ProjectPage;+import io.onedev.server.web.page.project.dashboard.ProjectDashboardPage;+import io.onedev.server.web.util.NamedWorkspaceQueriesBean;+import io.onedev.server.web.util.QuerySaveSupport;+import io.onedev.server.web.util.paginghistory.PagingHistorySupport;+import io.onedev.server.web.util.paginghistory.ParamPagingHistorySupport;+import io.onedev.server.workspace.WorkspaceQueryPersonalizationService;++public class ProjectWorkspacesPage extends ProjectPage {++ private static final String PARAM_PAGE = "page";++ private static final String PARAM_QUERY = "query";++ private String query;++ private SavedQueriesPanel<NamedWorkspaceQuery> savedQueries;++ private WorkspaceListPanel workspaces;++ public ProjectWorkspacesPage(PageParameters params) {+ super(params);+ query = getPageParameters().get(PARAM_QUERY).toOptionalString();+ }++ private WorkspaceQueryPersonalizationService getWorkspaceQueryPersonalizationService() {+ return OneDev.getInstance(WorkspaceQueryPersonalizationService.class);+ }++ protected GlobalWorkspaceSetting getWorkspaceSetting() {+ return OneDev.getInstance(SettingService.class).getWorkspaceSetting();+ }++ @Override+ protected boolean isPermitted() {+ return SecurityUtils.canWriteCode(getProject());+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ add(savedQueries = new SavedQueriesPanel<>("savedQueries") {++ @Override+ protected NamedQueriesBean<NamedWorkspaceQuery> newNamedQueriesBean() {+ return new NamedWorkspaceQueriesBean();+ }++ @Override+ protected Link<Void> newQueryLink(String componentId, NamedWorkspaceQuery namedQuery) {+ return new BookmarkablePageLink<>(componentId, ProjectWorkspacesPage.class,+ ProjectWorkspacesPage.paramsOf(getProject(), namedQuery.getQuery(), 0));+ }++ @Override+ protected QueryPersonalization<NamedWorkspaceQuery> getQueryPersonalization() {+ return getProject().getWorkspaceQueryPersonalizationOfCurrentUser();+ }++ @Override+ protected ArrayList<NamedWorkspaceQuery> getCommonQueries() {+ return (ArrayList<NamedWorkspaceQuery>) getProject().getWorkspaceSetting().getNamedQueries();+ }++ private String getAuditContent() {+ var auditData = getProject().getWorkspaceSetting().getNamedQueries();+ if (auditData == null)+ auditData = getWorkspaceSetting().getNamedQueries();+ return VersionedXmlDoc.fromBean(auditData).toXML();+ }++ @Override+ protected void onSaveCommonQueries(ArrayList<NamedWorkspaceQuery> namedQueries) {+ var oldAuditContent = getAuditContent();+ getProject().getWorkspaceSetting().setNamedQueries(namedQueries);+ var newAuditContent = getAuditContent();+ getProjectService().update(getProject());+ auditService.audit(getProject(), "changed workspace queries", oldAuditContent, newAuditContent);+ }++ @Override+ protected ArrayList<NamedWorkspaceQuery> getInheritedCommonQueries() {+ if (getProject().getParent() != null)+ return (ArrayList<NamedWorkspaceQuery>) getProject().getParent().getNamedWorkspaceQueries();+ else+ return (ArrayList<NamedWorkspaceQuery>) getWorkspaceSetting().getNamedQueries();+ }++ });++ add(workspaces = new WorkspaceListPanel("workspaces", new IModel<>() {++ @Override+ public void detach() {+ }++ @Override+ public String getObject() {+ return query;+ }++ @Override+ public void setObject(String object) {+ query = object;+ PageParameters params = getPageParameters();+ params.set(PARAM_QUERY, query);+ params.remove(PARAM_PAGE);+ CharSequence url = RequestCycle.get().urlFor(ProjectWorkspacesPage.class, params);+ pushState(RequestCycle.get().find(AjaxRequestTarget.class), url.toString(), query);+ }++ }) {++ @Override+ protected PagingHistorySupport getPagingHistorySupport() {+ return new ParamPagingHistorySupport() {++ @Override+ public PageParameters newPageParameters(int currentPage) {+ return paramsOf(getProject(), query, currentPage + 1);+ }++ @Override+ public int getCurrentPage() {+ return getPageParameters().get(PARAM_PAGE).toInt(1) - 1;+ }++ };+ }++ @Override+ protected QuerySaveSupport getQuerySaveSupport() {+ return new QuerySaveSupport() {++ @Override+ public void onSaveQuery(AjaxRequestTarget target, String query) {+ new ModalPanel(target) {++ @Override+ protected Component newContent(String id) {+ return new SaveQueryPanel(id, new PersonalQuerySupport() {++ @Override+ public void onSave(AjaxRequestTarget target, String name) {+ WorkspaceQueryPersonalization setting =+ getProject().getWorkspaceQueryPersonalizationOfCurrentUser();+ NamedWorkspaceQuery namedQuery = NamedQuery.find(setting.getQueries(), name);+ if (namedQuery == null) {+ namedQuery = new NamedWorkspaceQuery(name, query);+ setting.getQueries().add(namedQuery);+ } else {+ namedQuery.setQuery(query);+ }+ getWorkspaceQueryPersonalizationService().createOrUpdate(setting);+ target.add(savedQueries);+ close();+ }++ }) {++ @Override+ protected void onSave(AjaxRequestTarget target, String name) {+ ProjectWorkspaceSetting setting = getProject().getWorkspaceSetting();+ if (setting.getNamedQueries() == null)+ setting.setNamedQueries(new ArrayList<>(getWorkspaceSetting().getNamedQueries()));+ NamedWorkspaceQuery namedQuery = getProject().getNamedWorkspaceQuery(name);+ String oldAuditContent = null;+ String verb;+ if (namedQuery == null) {+ namedQuery = new NamedWorkspaceQuery(name, query);+ setting.getNamedQueries().add(namedQuery);+ verb = "created";+ } else {+ oldAuditContent = VersionedXmlDoc.fromBean(namedQuery).toXML();+ namedQuery.setQuery(query);+ verb = "changed";+ }+ var newAuditContent = VersionedXmlDoc.fromBean(namedQuery).toXML();+ getProjectService().update(getProject());+ auditService.audit(getProject(),+ verb + " workspace query \"" + name + "\"",+ oldAuditContent, newAuditContent);+ target.add(savedQueries);+ close();+ }++ @Override+ protected void onCancel(AjaxRequestTarget target) {+ close();+ }++ };+ }++ };+ }++ @Override+ public boolean isSavedQueriesVisible() {+ savedQueries.configure();+ return savedQueries.isVisible();+ }++ };+ }++ @Override+ protected Project getProject() {+ return ProjectWorkspacesPage.this.getProject();+ }++ });+ }++ @Override+ protected void onPopState(AjaxRequestTarget target, Serializable data) {+ query = (String) data;+ getPageParameters().set(PARAM_QUERY, query);+ target.add(workspaces);+ }++ public static PageParameters paramsOf(Project project, @Nullable String query, int page) {+ PageParameters params = paramsOf(project);+ if (query != null)+ params.add(PARAM_QUERY, query);+ if (page != 0)+ params.add(PARAM_PAGE, page);+ return params;+ }++ public static PageParameters paramsOf(Project project, int page) {+ String query = null;+ if (project.getWorkspaceQueryPersonalizationOfCurrentUser() != null+ && !project.getWorkspaceQueryPersonalizationOfCurrentUser().getQueries().isEmpty()) {+ query = project.getWorkspaceQueryPersonalizationOfCurrentUser().getQueries()+ .iterator().next().getQuery();+ } else if (!project.getNamedWorkspaceQueries().isEmpty()) {+ query = project.getNamedWorkspaceQueries().iterator().next().getQuery();+ }+ return paramsOf(project, query, page);+ }++ @Override+ protected BookmarkablePageLink<Void> navToProject(String componentId, Project project) {+ return new ViewStateAwarePageLink<>(componentId, ProjectDashboardPage.class,+ ProjectDashboardPage.paramsOf(project.getId()));+ }++ @Override+ protected Component newProjectTitle(String componentId) {+ return new Label(componentId, _T("Workspaces"));+ }++ @Override+ protected String getPageTitle() {+ return _T("Workspaces") + " - " + getProject().getPath();+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceDetailCssResourceReference.java b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceDetailCssResourceReference.javanew file mode 100644index 0000000000..26d5d3d728--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceDetailCssResourceReference.java@@ -0,0 +1,13 @@+package io.onedev.server.web.page.project.workspaces.detail;++import io.onedev.server.web.page.base.BaseDependentCssResourceReference;++public class WorkspaceDetailCssResourceReference extends BaseDependentCssResourceReference {++ private static final long serialVersionUID = 1L;++ public WorkspaceDetailCssResourceReference() {+ super(WorkspaceDetailCssResourceReference.class, "workspace-detail.css");+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceDetailPage.html b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceDetailPage.htmlnew file mode 100644index 0000000000..313fb7b593--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceDetailPage.html@@ -0,0 +1,36 @@+<wicket:extend>+ <div class="workspace-detail d-flex flex-column flex-grow-1">+ <div class="head d-flex align-items-center px-3 py-2">+ <div class="left d-flex align-items-center">+ <div class="summary mr-4">+ <a wicket:id="user"></a> on <a wicket:id="branch"></a> for <span wicket:id="spec"></span>+ <span wicket:id="invalidSpec" class="text-warning ml-1"></span>+ </div>+ <div class="status text-nowrap mr-4">+ <svg wicket:id="statusIcon" class="mr-2"></svg>+ <span wicket:id="statusLabel"></span>+ </div>+ <a wicket:id="openTerminal" class="btn btn-xs btn-icon btn-light btn-hover-primary mr-4" t:data-tippy-content="Open terminal">+ <wicket:svg href="terminal" class="icon"></wicket:svg>+ </a>+ </div>+ <div class="right d-flex align-items-center ml-auto">+ <a wicket:id="delete" class="btn btn-xs btn-icon btn-light btn-hover-danger" t:data-tippy-content="Delete this workspace">+ <wicket:svg href="trash" class="icon"></wicket:svg>+ </a>+ <div wicket:id="entityNav" class="d-xl-block d-none ml-4"></div>+ </div>+ </div>+ <div class="body d-flex flex-column flex-grow-1">+ <ul wicket:id="workspaceTabs" class="tabs nav nav-tabs nav-tabs-line nav-bold"></ul>+ <wicket:child></wicket:child>+ </div>+ </div>+ <wicket:fragment wicket:id="projectTitleFrag">+ <span class="d-flex align-items-center">+ <a wicket:id="workspaces" class="text-nowrap"><wicket:t>Workspaces</wicket:t></a>+ <span class="dot"></span>+ <span wicket:id="workspaceNumber"></span>+ </span>+ </wicket:fragment>+</wicket:extend>diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceDetailPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceDetailPage.javanew file mode 100644index 0000000000..38d5490f81--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceDetailPage.java@@ -0,0 +1,312 @@+package io.onedev.server.web.page.project.workspaces.detail;++import static io.onedev.server.web.translation.Translation._T;++import java.text.MessageFormat;+import java.util.ArrayList;+import java.util.Collection;+import java.util.List;+import java.util.Set;++import javax.inject.Inject;+import javax.persistence.EntityNotFoundException;++import org.apache.commons.lang3.StringUtils;+import org.apache.wicket.Component;+import org.apache.wicket.RestartResponseException;+import org.apache.wicket.Session;+import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;+import org.apache.wicket.markup.head.CssHeaderItem;+import org.apache.wicket.markup.head.IHeaderResponse;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.link.BookmarkablePageLink;+import org.apache.wicket.markup.html.link.Link;+import org.apache.wicket.markup.html.panel.Fragment;+import org.apache.wicket.model.AbstractReadOnlyModel;+import org.apache.wicket.model.IModel;+import org.apache.wicket.model.LoadableDetachableModel;+import org.apache.wicket.model.Model;+import org.apache.wicket.request.flow.RedirectToUrlException;+import org.apache.wicket.request.mapper.parameter.PageParameters;+import org.jspecify.annotations.Nullable;++import io.onedev.server.data.migration.VersionedXmlDoc;+import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.Workspace.Status;+import io.onedev.server.search.entity.EntityQuery;+import io.onedev.server.search.entity.workspace.WorkspaceQuery;+import io.onedev.server.security.SecurityUtils;+import io.onedev.server.util.ProjectAndBranch;+import io.onedev.server.util.ProjectScope;+import io.onedev.server.web.WebSession;+import io.onedev.server.web.behavior.ChangeObserver;+import io.onedev.server.web.component.branch.BranchLink;+import io.onedev.server.web.component.entity.nav.EntityNavPanel;+import io.onedev.server.web.component.link.ViewStateAwarePageLink;+import io.onedev.server.web.component.tabbable.Tab;+import io.onedev.server.web.component.tabbable.Tabbable;+import io.onedev.server.web.component.user.ident.Mode;+import io.onedev.server.web.component.user.ident.UserIdentPanel;+import io.onedev.server.web.component.workspace.invalidspec.InvalidWorkspaceSpecIcon;+import io.onedev.server.web.component.workspace.status.WorkspaceStatusIcon;+import io.onedev.server.web.page.project.ProjectPage;+import io.onedev.server.web.page.project.dashboard.ProjectDashboardPage;+import io.onedev.server.web.page.project.workspaces.ProjectWorkspacesPage;+import io.onedev.server.web.page.project.workspaces.detail.changes.WorkspaceChangesPage;+import io.onedev.server.web.page.project.workspaces.detail.dashboard.WorkspaceDashboardPage;+import io.onedev.server.web.page.project.workspaces.detail.log.WorkspaceLogPage;+import io.onedev.server.web.page.project.workspaces.detail.terminal.TerminalTab;+import io.onedev.server.web.page.project.workspaces.detail.terminal.WorkspaceTerminalPage;+import io.onedev.server.web.util.ConfirmClickModifier;+import io.onedev.server.web.util.Cursor;+import io.onedev.server.web.util.CursorSupport;+import io.onedev.server.workspace.WorkspaceService;++public abstract class WorkspaceDetailPage extends ProjectPage {++ private static final long serialVersionUID = 1L;++ public static final String PARAM_WOPKSPACE = "workspace";++ protected final IModel<Workspace> workspaceModel;++ @Inject+ protected WorkspaceService workspaceService;++ private Workspace.Status workspaceStatus;++ public WorkspaceDetailPage(PageParameters params) {+ super(params);++ String workspaceNumberString = params.get(PARAM_WOPKSPACE).toString();+ if (StringUtils.isBlank(workspaceNumberString))+ throw new RestartResponseException(ProjectDashboardPage.class, ProjectDashboardPage.paramsOf(getProject().getId()));++ workspaceModel = new LoadableDetachableModel<Workspace>() {++ @Override+ protected Workspace load() {+ Long workspaceNumber = Long.parseLong(workspaceNumberString);+ Workspace workspace = workspaceService.find(getProject(), workspaceNumber);+ if (workspace == null)+ throw new EntityNotFoundException(_T("Workspace not found"));+ if (!workspace.getProject().equals(getProject()))+ throw new RestartResponseException(WorkspaceDashboardPage.class, paramsOf(workspace));+ return workspace;+ }++ };+ }++ public Workspace getWorkspace() {+ return workspaceModel.getObject();+ }++ @Override+ protected boolean isPermitted() {+ return SecurityUtils.canWriteCode(getProject());+ }++ @Override+ protected void onDetach() {+ workspaceModel.detach();+ super.onDetach();+ }++ @Override+ protected BookmarkablePageLink<Void> navToProject(String componentId, Project project) {+ return new ViewStateAwarePageLink<>(componentId, ProjectDashboardPage.class,+ ProjectDashboardPage.paramsOf(project.getId()));+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ Workspace workspace = getWorkspace();++ add(new UserIdentPanel("user", workspace.getUser(), Mode.AVATAR_AND_NAME));+ add(new BranchLink("branch", new ProjectAndBranch(workspace.getProject(), workspace.getBranch()), true));+ add(new Label("spec", workspace.getSpecName()));+ add(new InvalidWorkspaceSpecIcon("invalidSpec", workspaceModel));++ add(new WorkspaceStatusIcon("statusIcon", new AbstractReadOnlyModel<Status>() {++ @Override+ public Status getObject() {+ return getWorkspace().getStatus();+ }++ }) {++ @Override+ protected Collection<String> getChangeObservables() {+ return Set.of(getWorkspace().getStatusChangeObservable());+ }++ });+ add(new Label("statusLabel", new AbstractReadOnlyModel<String>() {++ @Override+ public String getObject() {+ return _T(workspaceModel.getObject().getStatus().toString());+ }++ }).add(new ChangeObserver() {++ @Override+ public Collection<String> findObservables() {+ return Set.of(getWorkspace().getStatusChangeObservable());+ }++ }));++ add(new Link<Void>("openTerminal") {++ @Override+ public void onClick() {+ var terminalIndex = workspaceService.openShell(getWorkspace());+ setResponsePage(WorkspaceTerminalPage.class, WorkspaceTerminalPage.paramsOf(getWorkspace(), terminalIndex));+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(getWorkspace().getStatus() == Status.ACTIVE+ && SecurityUtils.canModifyOrDelete(getWorkspace()));+ }++ });++ add(new Link<Void>("delete") {++ @Override+ public void onClick() {+ workspaceService.delete(getWorkspace());+ var oldAuditContent = VersionedXmlDoc.fromBean(getWorkspace()).toXML();+ auditService.audit(getWorkspace().getProject(), "deleted workspace \"" + getWorkspace().getReference().toString(getWorkspace().getProject()) + "\"", oldAuditContent, null);++ Session.get().success(MessageFormat.format(_T("Workspace {0} deleted"), getWorkspace().getReference().toString(getWorkspace().getProject())));++ String redirectUrlAfterDelete = WebSession.get().getRedirectUrlAfterDelete(Workspace.class);+ if (redirectUrlAfterDelete != null)+ throw new RedirectToUrlException(redirectUrlAfterDelete);+ else+ setResponsePage(ProjectWorkspacesPage.class, ProjectWorkspacesPage.paramsOf(getProject()));+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(SecurityUtils.canModifyOrDelete(getWorkspace()));+ }++ }.add(new ConfirmClickModifier(_T("Do you really want to delete this workspace?"))));++ add(new Tabbable("workspaceTabs", new LoadableDetachableModel<>() {++ @Override+ protected List<Tab> load() {+ List<Tab> tabs = new ArrayList<>();++ for (var shellId : workspaceService.getShellIds(getWorkspace()))+ tabs.add(new TerminalTab(getWorkspace(), shellId));+ if (getWorkspace().getStatus() != Workspace.Status.PENDING)+ tabs.add(new WorkspaceTab(Model.of(_T("Changes")), Model.of("diff"), WorkspaceChangesPage.class, WorkspaceChangesPage.paramsOf(getWorkspace())));+ tabs.add(new WorkspaceTab(Model.of(_T("Log")), Model.of("log"), WorkspaceLogPage.class, WorkspaceLogPage.paramsOf(getWorkspace())));+ return tabs;+ }++ }).add(new ChangeObserver() {++ @Override+ public Collection<String> findObservables() {+ return Set.of(getWorkspace().getStatusChangeObservable());+ }++ }));++ add(new EntityNavPanel<Workspace>("entityNav") {++ @Override+ protected EntityQuery<Workspace> parse(String queryString, @Nullable Project project) {+ return WorkspaceQuery.parse(project, queryString, true);+ }++ @Override+ protected Workspace getEntity() {+ return getWorkspace();+ }++ @Override+ protected CursorSupport<Workspace> getCursorSupport() {+ return new CursorSupport<Workspace>() {+ @Override+ public Cursor getCursor() {+ return WebSession.get().getWorkspaceCursor();+ }+ @Override+ public void navTo(AjaxRequestTarget target, Workspace entity, Cursor cursor) {+ WebSession.get().setWorkspaceCursor(cursor);+ setResponsePage(WorkspaceDashboardPage.class, WorkspaceDetailPage.paramsOf(entity));+ }+ };+ }++ @Override+ protected List<Workspace> query(EntityQuery<Workspace> query, int offset, int count, @Nullable ProjectScope projectScope) {+ Project project = projectScope != null ? projectScope.getProject() : null;+ return workspaceService.query(SecurityUtils.getSubject(), project, (WorkspaceQuery) query, offset, count);+ }+ });++ workspaceStatus = getWorkspace().getStatus();+ add(new ChangeObserver() {++ @Override+ public void onObservableChanged(IPartialPageRequestHandler handler, Collection<String> changedObservables) {+ if (workspaceStatus == Workspace.Status.PENDING && getWorkspace().getStatus() == Workspace.Status.ACTIVE) {+ var terminalId = workspaceService.openShell(getWorkspace());+ setResponsePage(WorkspaceTerminalPage.class, WorkspaceTerminalPage.paramsOf(getWorkspace(), terminalId));+ } else if (workspaceStatus == Workspace.Status.ACTIVE && getWorkspace().getStatus() == Workspace.Status.ERROR) {+ setResponsePage(WorkspaceDashboardPage.class, WorkspaceDashboardPage.paramsOf(getWorkspace()));+ }+ }++ @Override+ public Collection<String> findObservables() {+ return Set.of(getWorkspace().getStatusChangeObservable());+ }++ });++ }++ @Override+ public void renderHead(IHeaderResponse response) {+ super.renderHead(response);+ response.render(CssHeaderItem.forReference(new WorkspaceDetailCssResourceReference()));+ }++ @Override+ protected Component newProjectTitle(String componentId) {+ Fragment fragment = new Fragment(componentId, "projectTitleFrag", this);+ fragment.add(new ViewStateAwarePageLink<Void>("workspaces", ProjectWorkspacesPage.class,+ ProjectWorkspacesPage.paramsOf(getProject(), 0)));+ fragment.add(new Label("workspaceNumber", getWorkspace().getReference().toString(getProject())));+ return fragment;+ }++ public static PageParameters paramsOf(Workspace workspace) {+ return paramsOf(workspace.getProject(), workspace.getNumber());+ }++ public static PageParameters paramsOf(Project project, Long workspaceNumber) {+ PageParameters params = ProjectPage.paramsOf(project);+ params.add(PARAM_WOPKSPACE, workspaceNumber);+ return params;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceTab.java b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceTab.javanew file mode 100644index 0000000000..ec1d96064b--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceTab.java@@ -0,0 +1,14 @@+package io.onedev.server.web.page.project.workspaces.detail;++import io.onedev.server.web.component.tabbable.PageTab;+import org.apache.wicket.Page;+import org.apache.wicket.model.IModel;+import org.apache.wicket.request.mapper.parameter.PageParameters;++public class WorkspaceTab extends PageTab {++ public WorkspaceTab(IModel<String> titleModel, IModel<String> iconModel, Class<? extends Page> mainPageClass, PageParameters mainPageParams) {+ super(titleModel, iconModel, mainPageClass, mainPageParams);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/WorkspaceChangesCssResourceReference.java b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/WorkspaceChangesCssResourceReference.javanew file mode 100644index 0000000000..fa12c02ea6--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/WorkspaceChangesCssResourceReference.java@@ -0,0 +1,13 @@+package io.onedev.server.web.page.project.workspaces.detail.changes;++import io.onedev.server.web.page.base.BaseDependentCssResourceReference;++public class WorkspaceChangesCssResourceReference extends BaseDependentCssResourceReference {++ private static final long serialVersionUID = 1L;++ public WorkspaceChangesCssResourceReference() {+ super(WorkspaceChangesCssResourceReference.class, "workspace-changes.css");+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/WorkspaceChangesPage.html b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/WorkspaceChangesPage.htmlnew file mode 100644index 0000000000..07936213ec--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/WorkspaceChangesPage.html@@ -0,0 +1,111 @@+<wicket:extend>+ <div class="workspace-changes d-flex flex-grow-1 position-relative">+ <div wicket:id="changesSidebar" class="changes-sidebar autofit d-flex flex-column flex-grow-1 border-right">+ <div wicket:id="statusError" class="alert alert-light-danger m-3"></div>+ <div class="sync-info d-flex align-items-center p-3">+ <div class="pull-info flex-grow-1 d-flex align-items-center">+ <span wicket:id="behindCount" class="mr-1"></span>+ <a wicket:id="pull" t:data-tippy-content="Pull"><wicket:svg href="arrow3" class="icon rotate-90"/></a>+ </div>+ <a wicket:id="sync" t:data-tippy-content="Sync" class="mx-2">+ <wicket:svg href="refresh" class="icon"/>+ </a>+ <div class="push-info flex-grow-1 d-flex align-items-center justify-content-end">+ <span wicket:id="aheadCount" class="mr-1"></span>+ <a wicket:id="push" t:data-tippy-content="Push"><wicket:svg href="arrow3" class="icon rotate-270"/></a>+ </div>+ </div>+ <form wicket:id="commitForm" class="commit-form px-3 pt-2 pb-4">+ <div class="d-flex">+ <textarea wicket:id="commitMessage" class="form-control form-control-sm" rows="3" t:placeholder="Commit message"></textarea>+ </div>+ <div class="d-flex btn-group flex-grow-1 mt-4">+ <button wicket:id="commitButton" class="dirty-aware btn btn-sm btn-primary flex-grow-1"><wicket:t>Commit</wicket:t></button>+ <button wicket:id="dropdownToggle" type="button" class="dirty-aware btn btn-sm btn-icon btn-primary dropdown-toggle flex-grow-0" data-toggle="dropdown" aria-expanded="false"></button>+ <div class="dropdown-menu dropdown-menu-right">+ <a wicket:id="amendButton" class="dropdown-item"><wicket:t>Amend</wicket:t></a>+ </div>+ </div>+ <div wicket:id="mergeHint" class="text-info font-size-sm mt-2"><wicket:t>Commit to conclude the merge, or</wicket:t> <a wicket:id="abortMerge" class="text-danger" href="#"><wicket:t>abort merge</wicket:t></a></div>+ </form>+ <div wicket:id="noChangedFiles" class="alert alert-light mx-3">No changed files to commit</div>+ <div class="file-sections flex-grow-1 overflow-auto">+ <div wicket:id="conflictSection" class="file-section conflict-section">+ <div class="section-header d-flex align-items-center">+ <span class="font-weight-bold font-size-sm"><wicket:t>CONFLICTS</wicket:t></span>+ <span wicket:id="conflictCount" class="badge badge-sm badge-danger ml-1 mr-2"></span>+ <a wicket:id="abortMerge" class="btn btn-xs btn-icon btn-hover-danger ml-auto" t:data-tippy-content="Abort Merge">+ <wicket:svg href="undo" class="icon"/>+ </a>+ </div>+ <ul class="file-list list-unstyled mb-0">+ <li wicket:id="conflictFiles" class="d-flex align-items-center">+ <a wicket:id="fileLink" class="flex-grow-1 d-flex align-items-center min-width-0">+ <span wicket:id="conflictType" class="conflict-type mr-1 flex-shrink-0"></span>+ <span class="file-names"><span wicket:id="fileName" class="file-name"></span><span wicket:id="fileDir" class="file-dir"></span></span>+ </a>+ <a wicket:id="markResolved" class="btn btn-xs btn-icon btn-hover-primary flex-shrink-0 ml-1" t:data-tippy-content="Mark Resolved">+ <wicket:svg href="plus" class="icon"/>+ </a>+ </li>+ </ul>+ </div>+ <div wicket:id="stagedSection" class="file-section">+ <div class="section-header d-flex align-items-center">+ <span class="font-weight-bold font-size-sm"><wicket:t>STAGED</wicket:t></span>+ <span wicket:id="stagedCount" class="badge badge-sm badge-secondary ml-1 mr-2"></span>+ <a wicket:id="unstageAll" class="btn btn-xs btn-icon btn-hover-primary ml-auto" t:data-tippy-content="Unstage All">+ <wicket:svg href="minus" class="icon"/>+ </a>+ </div>+ <ul class="file-list list-unstyled mb-0">+ <li wicket:id="stagedFiles" class="d-flex align-items-center">+ <a wicket:id="fileLink" class="flex-grow-1 d-flex align-items-center min-width-0">+ <span wicket:id="status" class="file-status mr-1 flex-shrink-0"></span>+ <span class="file-names"><span wicket:id="fileName" class="file-name"></span><span wicket:id="fileDir" class="file-dir"></span></span>+ </a>+ <a wicket:id="unstage" class="btn btn-xs btn-icon btn-hover-primary flex-shrink-0 ml-1" t:data-tippy-content="Unstage">+ <wicket:svg href="minus" class="icon"/>+ </a>+ </li>+ </ul>+ </div>+ <div wicket:id="unstagedSection" class="file-section">+ <div class="section-header d-flex align-items-center">+ <span class="font-weight-bold font-size-sm"><wicket:t>UNSTAGED</wicket:t></span>+ <span wicket:id="unstagedCount" class="badge badge-sm badge-secondary ml-1 mr-2"></span>+ <a wicket:id="discardAll" class="btn btn-xs btn-icon btn-hover-danger ml-auto" t:data-tippy-content="Discard All">+ <wicket:svg href="undo2" class="icon"/>+ </a>+ <a wicket:id="stageAll" class="btn btn-xs btn-icon btn-hover-primary ml-1" t:data-tippy-content="Stage All">+ <wicket:svg href="plus" class="icon"/>+ </a>+ </div>+ <ul class="file-list list-unstyled mb-0">+ <li wicket:id="unstagedFiles" class="d-flex align-items-center">+ <a wicket:id="fileLink" class="flex-grow-1 d-flex align-items-center min-width-0">+ <span wicket:id="status" class="file-status mr-1 flex-shrink-0"></span>+ <span class="file-names"><span wicket:id="fileName" class="file-name"></span><span wicket:id="fileDir" class="file-dir"></span></span>+ </a>+ <a wicket:id="discard" class="btn btn-xs btn-icon btn-hover-danger flex-shrink-0 ml-1" t:data-tippy-content="Discard Changes">+ <wicket:svg href="undo2" class="icon"/>+ </a>+ <a wicket:id="stage" class="btn btn-xs btn-icon btn-hover-primary flex-shrink-0 ml-1" t:data-tippy-content="Stage">+ <wicket:svg href="plus" class="icon"/>+ </a>+ </li>+ </ul>+ </div>+ </div>+ </div>+ <div wicket:id="diffContent" class="diff-content autofit d-flex flex-column flex-grow-1">+ <div class="diff-header d-flex align-items-center px-3 py-2 border-bottom">+ <span wicket:id="diffFileName" class="font-weight-bold text-truncate"></span>+ </div>+ <div wicket:id="diffPanel" class="diff-panel flex-grow-1 overflow-auto"></div>+ </div>+ <div wicket:id="noSelection" class="no-selection autofit d-flex flex-grow-1 align-items-center justify-content-center text-muted text-center">+ <wicket:t>Select a file to view changes</wicket:t>+ </div>+ </div>+</wicket:extend>diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/WorkspaceChangesPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/WorkspaceChangesPage.javanew file mode 100644index 0000000000..48b588d77f--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/WorkspaceChangesPage.java@@ -0,0 +1,1081 @@+package io.onedev.server.web.page.project.workspaces.detail.changes;++import static io.onedev.server.web.translation.Translation._T;++import java.io.Serializable;+import java.nio.charset.StandardCharsets;+import java.util.ArrayList;+import java.util.List;++import org.apache.wicket.AttributeModifier;+import org.apache.wicket.Session;+import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.ajax.markup.html.form.AjaxButton;+import org.apache.wicket.behavior.AttributeAppender;+import org.apache.wicket.extensions.ajax.markup.html.AjaxIndicatorAppender;+import org.apache.wicket.markup.head.CssHeaderItem;+import org.apache.wicket.markup.head.IHeaderResponse;+import org.apache.wicket.markup.head.OnLoadHeaderItem;+import org.apache.wicket.markup.html.WebMarkupContainer;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.form.Form;+import org.apache.wicket.markup.html.form.TextArea;+import org.apache.wicket.markup.html.list.ListItem;+import org.apache.wicket.markup.html.list.ListView;+import org.apache.wicket.model.Model;+import org.apache.wicket.model.PropertyModel;+import org.apache.wicket.request.cycle.RequestCycle;+import org.apache.wicket.request.mapper.parameter.PageParameters;++import io.onedev.commons.utils.ExplicitException;+import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;+import io.onedev.server.security.SecurityUtils;+import io.onedev.server.util.FileData;+import io.onedev.server.web.ajaxlistener.AttachAjaxIndicatorListener;+import io.onedev.server.web.ajaxlistener.ConfirmClickListener;+import io.onedev.server.web.ajaxlistener.DisableGlobalAjaxIndicatorListener;+import io.onedev.server.web.component.diff.text.PlainTextDiffPanel;+import io.onedev.server.web.component.fileview.FileViewPanel;+import io.onedev.server.web.page.project.workspaces.detail.WorkspaceDetailPage;+import io.onedev.server.workspace.GitExecutionResult;++public class WorkspaceChangesPage extends WorkspaceDetailPage {++ private static final long serialVersionUID = 1L;++ private static final String PARAM_FILE = "file";++ private String commitMessage;++ private String selectedFile;++ private boolean selectedStaged;++ private boolean selectedConflicted;++ private WebMarkupContainer sidebar;++ private WebMarkupContainer diffContent;++ private WebMarkupContainer noSelection;++ public WorkspaceChangesPage(PageParameters params) {+ super(params);+ selectedFile = params.get(PARAM_FILE).toString();+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ executeGit("fetch");++ sidebar = new WebMarkupContainer("changesSidebar");+ sidebar.setOutputMarkupId(true);+ add(sidebar);++ addSyncInfo(sidebar);+ addCommitForm(sidebar);+ addFileSections(sidebar);++ diffContent = new WebMarkupContainer("diffContent");+ diffContent.setOutputMarkupPlaceholderTag(true);+ diffContent.setVisible(false);+ add(diffContent);++ diffContent.add(new Label("diffFileName", ""));+ diffContent.add(new WebMarkupContainer("diffPanel"));++ noSelection = new WebMarkupContainer("noSelection");+ noSelection.setOutputMarkupPlaceholderTag(true);+ add(noSelection);++ if (selectedFile != null) {+ FileEntry found = findSelectedFileEntry();+ if (found == null)+ throw new ExplicitException("Not a changed file: " + selectedFile);+ selectedStaged = found.staged;+ selectedConflicted = found.conflicted;+ showDiffContent(found);+ }+ }++ private void addSyncInfo(WebMarkupContainer container) {+ int[] counts = getAheadBehind();++ container.add(new Label("behindCount", String.valueOf(counts[0])));+ container.add(new Label("aheadCount", String.valueOf(counts[1])));++ AjaxLink<Void> pullLink = new AjaxLink<Void>("pull") {++ @Override+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {+ super.updateAjaxAttributes(attributes);+ attributes.getAjaxCallListeners().add(new AttachAjaxIndicatorListener(false));+ attributes.getAjaxCallListeners().add(new DisableGlobalAjaxIndicatorListener());+ }++ @Override+ public void onClick(AjaxRequestTarget target) {+ GitExecutionResult result = executeGit("pull");+ if (result.getReturnCode() == 0) {+ Session.get().success(_T("Pull successful"));+ } else {+ Session.get().error(getErrorMessage(result));+ }+ refreshAll(target);+ }++ };++ if (counts[0] == 0 || !SecurityUtils.canModifyOrDelete(getWorkspace())) {+ pullLink.add(AttributeAppender.append("class", "disabled"));+ pullLink.setEnabled(false);+ }+ container.add(pullLink);++ AjaxLink<Void> syncLink = new AjaxLink<Void>("sync") {++ @Override+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {+ super.updateAjaxAttributes(attributes);+ attributes.getAjaxCallListeners().add(new AttachAjaxIndicatorListener(false));+ attributes.getAjaxCallListeners().add(new DisableGlobalAjaxIndicatorListener());+ }++ @Override+ public void onClick(AjaxRequestTarget target) {+ if (getWorkspace().getProject().getDefaultBranch() != null) {+ var result = executeGit("pull");+ if (result.getReturnCode() != 0) {+ Session.get().error(getErrorMessage(result));+ refreshAll(target);+ return;+ }+ }+ int[] aheadBehind = getAheadBehind();+ if (aheadBehind[1] > 0) {+ var result = executeGit("push");+ if (result.getReturnCode() != 0) {+ Session.get().error(getErrorMessage(result));+ refreshAll(target);+ return;+ }+ }++ Session.get().success(_T("Sync successful"));+ refreshAll(target);+ }++ };+ syncLink.setVisible(SecurityUtils.canModifyOrDelete(getWorkspace()));+ container.add(syncLink);++ AjaxLink<Void> pushLink = new AjaxLink<Void>("push") {++ @Override+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {+ super.updateAjaxAttributes(attributes);+ attributes.getAjaxCallListeners().add(new AttachAjaxIndicatorListener(false));+ attributes.getAjaxCallListeners().add(new DisableGlobalAjaxIndicatorListener());+ }++ @Override+ public void onClick(AjaxRequestTarget target) {+ GitExecutionResult result = executeGit("push");+ if (result.getReturnCode() == 0) {+ Session.get().success(_T("Push successful"));+ } else {+ Session.get().error(getErrorMessage(result));+ executeGit("fetch");+ }+ refreshAll(target);+ }++ };+ pushLink.add(new AjaxIndicatorAppender());+ if (counts[0] != 0 || counts[1] == 0 || !SecurityUtils.canModifyOrDelete(getWorkspace())) {+ pushLink.add(AttributeAppender.append("class", "disabled"));+ pushLink.setEnabled(false);+ }+ container.add(pushLink);+ }++ private void addCommitForm(WebMarkupContainer container) {+ Form<?> form = new Form<>("commitForm");+ container.add(form);++ form.add(new TextArea<>("commitMessage", new PropertyModel<>(this, "commitMessage")));++ AjaxButton commitButton = new AjaxButton("commitButton", form) {+ @Override+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {+ doCommit(target, false);+ }++ @Override+ protected void onError(AjaxRequestTarget target, Form<?> form) {+ refreshAll(target);+ }+ };+ form.add(commitButton);++ form.add(new WebMarkupContainer("dropdownToggle"));++ AjaxButton amendButton = new AjaxButton("amendButton", form) {+ @Override+ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {+ doCommit(target, true);+ }++ @Override+ protected void onError(AjaxRequestTarget target, Form<?> form) {+ refreshAll(target);+ }+ };+ form.add(amendButton);++ boolean conflicts = hasConflicts();+ boolean mergeInProgress = isMergeInProgress();++ WebMarkupContainer mergeHint = new WebMarkupContainer("mergeHint");+ mergeHint.setVisible(mergeInProgress && !conflicts);+ mergeHint.add(new AjaxLink<Void>("abortMerge") {++ @Override+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {+ super.updateAjaxAttributes(attributes);+ attributes.getAjaxCallListeners().add(new ConfirmClickListener(_T("Do you really want to abort the merge?")));+ }++ @Override+ public void onClick(AjaxRequestTarget target) {+ executeGit("merge", "--abort");+ Session.get().success(_T("Merge aborted"));+ refreshAll(target);+ }++ });+ form.add(mergeHint);++ form.setVisible((hasStagedFiles() || mergeInProgress)+ && !conflicts+ && SecurityUtils.canModifyOrDelete(getWorkspace()));+ }++ private void doCommit(AjaxRequestTarget target, boolean amend) {+ if (commitMessage == null || commitMessage.trim().isEmpty()) {+ Session.get().error(_T("Please enter a commit message"));+ refreshAll(target);+ return;+ }+ List<String> args = new ArrayList<>();+ args.add("commit");+ if (amend)+ args.add("--amend");+ args.add("-m");+ args.add(commitMessage.trim());+ GitExecutionResult result = executeGit(args.toArray(new String[0]));+ if (result.getReturnCode() == 0) {+ Session.get().success(_T("Changes committed successfully"));+ commitMessage = null;+ } else {+ Session.get().error(getErrorMessage(result));+ }+ refreshAll(target);+ }++ private void addFileSections(WebMarkupContainer container) {+ GitExecutionResult statusResult = executeGit("status", "--porcelain");++ Label statusError = new Label("statusError", getErrorMessage(statusResult));+ statusError.setVisible(statusResult.getReturnCode() != 0);+ container.add(statusError);++ List<FileEntry> allEntries = statusResult.getReturnCode() == 0+ ? parseGitStatusOutput(stdoutString(statusResult))+ : new ArrayList<>();++ container.add(new WebMarkupContainer("noChangedFiles")+ .setVisible(statusResult.getReturnCode() == 0 && allEntries.isEmpty()));++ List<FileEntry> conflictEntries = new ArrayList<>();+ List<FileEntry> stagedEntries = new ArrayList<>();+ List<FileEntry> unstagedEntries = new ArrayList<>();+ for (FileEntry entry : allEntries) {+ if (isConflicted(entry)) {+ conflictEntries.add(new FileEntry(entry.path, entry.indexStatus, entry.workTreeStatus));+ } else {+ if (entry.indexStatus != ' ' && entry.indexStatus != '?')+ stagedEntries.add(new FileEntry(entry.indexStatus, entry.path, true));+ if (entry.workTreeStatus != ' ' || entry.indexStatus == '?')+ unstagedEntries.add(new FileEntry(+ entry.indexStatus == '?' ? 'U' : entry.workTreeStatus,+ entry.path, false));+ }+ }++ addConflictSection(container, conflictEntries);++ WebMarkupContainer stagedSection = new WebMarkupContainer("stagedSection");+ stagedSection.setVisible(!stagedEntries.isEmpty());+ container.add(stagedSection);++ stagedSection.add(new Label("stagedCount", String.valueOf(stagedEntries.size())));+ stagedSection.add(new AjaxLink<Void>("unstageAll") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ executeGit("reset", "HEAD");+ refreshAll(target);+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(SecurityUtils.canModifyOrDelete(getWorkspace()));+ }++ });++ stagedSection.add(new ListView<>("stagedFiles", stagedEntries) {+ @Override+ protected void populateItem(ListItem<FileEntry> item) {+ FileEntry entry = item.getModelObject();+ populateFileItem(item, entry);+ }+ });++ WebMarkupContainer unstagedSection = new WebMarkupContainer("unstagedSection");+ unstagedSection.setVisible(!unstagedEntries.isEmpty());+ container.add(unstagedSection);++ unstagedSection.add(new Label("unstagedCount", String.valueOf(unstagedEntries.size())));+ unstagedSection.add(new AjaxLink<Void>("discardAll") {++ @Override+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {+ super.updateAjaxAttributes(attributes);+ attributes.getAjaxCallListeners().add(new ConfirmClickListener(_T("Do you really want to discard all unstaged changes? This cannot be undone.")));+ }++ @Override+ public void onClick(AjaxRequestTarget target) {+ executeGit("checkout", "--", ".");+ executeGit("clean", "-fd");+ refreshAll(target);+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(SecurityUtils.canModifyOrDelete(getWorkspace()));+ }++ });+ unstagedSection.add(new AjaxLink<Void>("stageAll") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ executeGit("add", "-A");+ refreshAll(target);+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(SecurityUtils.canModifyOrDelete(getWorkspace()));+ }++ });++ unstagedSection.add(new ListView<>("unstagedFiles", unstagedEntries) {+ @Override+ protected void populateItem(ListItem<FileEntry> item) {+ FileEntry entry = item.getModelObject();+ populateFileItem(item, entry);+ }+ });+ }++ private void addConflictSection(WebMarkupContainer container, List<FileEntry> conflictEntries) {+ WebMarkupContainer conflictSection = new WebMarkupContainer("conflictSection");+ conflictSection.setVisible(!conflictEntries.isEmpty());+ container.add(conflictSection);++ conflictSection.add(new Label("conflictCount", String.valueOf(conflictEntries.size())));+ conflictSection.add(new AjaxLink<Void>("abortMerge") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ executeGit("merge", "--abort");+ Session.get().success(_T("Merge aborted"));+ refreshAll(target);+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(SecurityUtils.canModifyOrDelete(getWorkspace()));+ }++ });++ conflictSection.add(new ListView<>("conflictFiles", conflictEntries) {+ @Override+ protected void populateItem(ListItem<FileEntry> item) {+ populateConflictFileItem(item, item.getModelObject());+ }+ });+ }++ private void populateConflictFileItem(ListItem<FileEntry> item, FileEntry entry) {+ item.setOutputMarkupId(true);+ if (selectedFile != null && selectedFile.equals(entry.path) && selectedConflicted) {+ item.add(new AttributeAppender("class", " active"));+ }++ AjaxLink<Void> fileLink = new AjaxLink<>("fileLink") {+ @Override+ public void onClick(AjaxRequestTarget target) {+ selectedFile = entry.path;+ selectedConflicted = true;+ showDiff(target, entry);+ pushState(target);+ target.appendJavaScript(+ "$('.file-list > li').removeClass('active');"+ + "$('#" + item.getMarkupId() + "').addClass('active');");+ }+ };+ item.add(fileLink);++ String fileName = entry.path;+ String dirName = null;+ int lastSlash = fileName.lastIndexOf('/');+ if (lastSlash >= 0) {+ dirName = fileName.substring(0, lastSlash);+ fileName = fileName.substring(lastSlash + 1);+ }+ fileLink.add(new Label("fileName", fileName)+ .add(new AttributeModifier("title", entry.path)));+ Label fileDirLabel = new Label("fileDir", dirName != null ? dirName : "");+ fileDirLabel.setVisible(dirName != null);+ fileLink.add(fileDirLabel);++ Label conflictTypeLabel = new Label("conflictType",+ "" + entry.indexStatus + entry.workTreeStatus);+ conflictTypeLabel.add(new AttributeModifier("title",+ getConflictDescription(entry.indexStatus, entry.workTreeStatus)));+ fileLink.add(conflictTypeLabel);++ item.add(new AjaxLink<Void>("markResolved") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ GitExecutionResult result = executeGit("add", "-A", "--", entry.path);+ if (result.getReturnCode() != 0)+ executeGit("rm", "--cached", "--", entry.path);+ refreshSidebar(target);+ if (entry.path.equals(selectedFile))+ refreshDiff(target);+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(SecurityUtils.canModifyOrDelete(getWorkspace()));+ }++ });+ }++ private void populateFileItem(ListItem<FileEntry> item, FileEntry entry) {+ item.setOutputMarkupId(true);+ if (selectedFile != null && selectedFile.equals(entry.path)+ && selectedStaged == entry.staged && !selectedConflicted) {+ item.add(new AttributeAppender("class", " active"));+ }++ AjaxLink<Void> fileLink = new AjaxLink<>("fileLink") {+ @Override+ public void onClick(AjaxRequestTarget target) {+ selectedFile = entry.path;+ selectedStaged = entry.staged;+ selectedConflicted = false;+ showDiff(target, entry);+ pushState(target);+ target.appendJavaScript(+ "$('.file-list > li').removeClass('active');"+ + "$('#" + item.getMarkupId() + "').addClass('active');");+ }+ };+ item.add(fileLink);++ Label statusLabel = new Label("status", String.valueOf(entry.displayStatus));+ statusLabel.add(new org.apache.wicket.behavior.AttributeAppender(+ "class", " status-" + entry.displayStatus));+ fileLink.add(statusLabel);++ String fileName = entry.path;+ String dirName = null;+ int lastSlash = fileName.lastIndexOf('/');+ if (lastSlash >= 0) {+ dirName = fileName.substring(0, lastSlash);+ fileName = fileName.substring(lastSlash + 1);+ }+ fileLink.add(new Label("fileName", fileName)+ .add(new org.apache.wicket.AttributeModifier("title", entry.path)));+ Label fileDirLabel = new Label("fileDir", dirName != null ? dirName : "");+ fileDirLabel.setVisible(dirName != null);+ fileLink.add(fileDirLabel);++ if (entry.staged) {+ item.add(new AjaxLink<Void>("unstage") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ executeGit("reset", "HEAD", "--", entry.path);+ refreshSidebar(target);+ if (entry.path.equals(selectedFile))+ refreshDiff(target);+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(SecurityUtils.canModifyOrDelete(getWorkspace()));+ }++ });+ } else {+ item.add(new AjaxLink<Void>("discard") {++ @Override+ protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {+ super.updateAjaxAttributes(attributes);+ attributes.getAjaxCallListeners().add(new ConfirmClickListener(_T("Do you really want to discard changes to this file? This cannot be undone.")));+ }++ @Override+ public void onClick(AjaxRequestTarget target) {+ if (entry.displayStatus == 'U') {+ executeGit("clean", "-f", "--", entry.path);+ } else {+ executeGit("checkout", "--", entry.path);+ }+ refreshSidebar(target);+ if (entry.path.equals(selectedFile))+ refreshDiff(target);+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(SecurityUtils.canModifyOrDelete(getWorkspace()));+ }++ });+ item.add(new AjaxLink<Void>("stage") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ executeGit("add", "--", entry.path);+ refreshSidebar(target);+ if (entry.path.equals(selectedFile))+ refreshDiff(target);+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ setVisible(SecurityUtils.canModifyOrDelete(getWorkspace()));+ }++ });+ }+ }++ private void showDiff(AjaxRequestTarget target, FileEntry entry) {+ diffContent.setVisible(true);+ noSelection.setVisible(false);++ if (entry.conflicted) {+ diffContent.replace(new Label("diffFileName", entry.path+ + " \u2014 " + getConflictDescription(entry.indexStatus, entry.workTreeStatus)));+ showConflictDiff(entry);+ } else {+ diffContent.replace(new Label("diffFileName", entry.path));+ showRegularDiff(entry);+ }++ target.add(diffContent);+ target.add(noSelection);+ }++ private void refreshAll(AjaxRequestTarget target) {+ refreshSidebar(target);+ refreshDiff(target);+ }++ private void refreshSidebar(AjaxRequestTarget target) {+ WebMarkupContainer newSidebar = new WebMarkupContainer("changesSidebar");+ newSidebar.setOutputMarkupId(true);+ addSyncInfo(newSidebar);+ addCommitForm(newSidebar);+ addFileSections(newSidebar);+ sidebar.replaceWith(newSidebar);+ sidebar = newSidebar;+ target.add(sidebar);+ }++ private void refreshDiff(AjaxRequestTarget target) {+ if (selectedFile != null) {+ FileEntry found = findSelectedFileEntry();+ if (found != null) {+ selectedStaged = found.staged;+ selectedConflicted = found.conflicted;+ showDiffContent(found);+ } else {+ selectedFile = null;+ diffContent.setVisible(false);+ noSelection.setVisible(true);+ replaceState(target);+ }+ } else {+ diffContent.setVisible(false);+ noSelection.setVisible(true);+ }+ target.add(diffContent);+ target.add(noSelection);+ }++ private void showDiffContent(FileEntry entry) {+ diffContent.setVisible(true);+ noSelection.setVisible(false);++ if (entry.conflicted) {+ diffContent.replace(new Label("diffFileName", entry.path+ + " \u2014 " + getConflictDescription(entry.indexStatus, entry.workTreeStatus)));+ showConflictDiff(entry);+ } else {+ diffContent.replace(new Label("diffFileName", entry.path));+ showRegularDiff(entry);+ }+ }++ private void showRegularDiff(FileEntry entry) {+ if (entry.displayStatus == 'U') {+ FileData fileData = workspaceService.readFileData(getWorkspace(), entry.path);+ diffContent.replace(new FileViewPanel("diffPanel", Model.of(fileData)));+ return;+ }++ String diffOutput = getDiffOutput(entry);+ if (isBinaryDiff(diffOutput)) {+ diffContent.replace(new Label("diffPanel", _T("Binary file"))+ .add(AttributeModifier.replace("class", "d-flex flex-grow-1 align-items-center justify-content-center text-muted text-center")));+ } else {+ List<List<String>> parsed = parseDiffToOldNewLines(diffOutput);+ diffContent.replace(new PlainTextDiffPanel("diffPanel",+ parsed.get(0), parsed.get(1), true, entry.path));+ }+ }++ private void showConflictDiff(FileEntry entry) {+ if (entry.indexStatus == 'D' && entry.workTreeStatus == 'D') {+ diffContent.replace(new Label("diffPanel",+ _T("Both sides deleted this file") + ". "+ + _T("Mark as resolved to confirm the deletion, or restore the file in terminal."))+ .add(AttributeModifier.replace("class", "d-flex flex-grow-1 align-items-center justify-content-center text-muted text-center")));+ return;+ }++ FileData fileData;+ try {+ fileData = workspaceService.readFileData(getWorkspace(), entry.path);+ } catch (Exception e) {+ diffContent.replace(new Label("diffPanel",+ getConflictDescription(entry.indexStatus, entry.workTreeStatus) + ". "+ + _T("Unable to read file from the working directory. Please resolve this conflict in the terminal and then mark as resolved."))+ .add(AttributeModifier.replace("class", "d-flex flex-grow-1 align-items-center justify-content-center text-muted text-center")));+ return;+ }++ diffContent.replace(new FileViewPanel("diffPanel", Model.of(fileData)));+ }++ private static String getConflictDescription(char indexStatus, char workTreeStatus) {+ if (indexStatus == 'D' && workTreeStatus == 'D')+ return _T("Both deleted");+ if (indexStatus == 'A' && workTreeStatus == 'A')+ return _T("Both added");+ if (indexStatus == 'U' && workTreeStatus == 'U')+ return _T("Both modified");+ if (indexStatus == 'D' && workTreeStatus == 'U')+ return _T("Deleted by us, modified by them");+ if (indexStatus == 'U' && workTreeStatus == 'D')+ return _T("Modified by us, deleted by them");+ if (indexStatus == 'A' && workTreeStatus == 'U')+ return _T("Added by us");+ if (indexStatus == 'U' && workTreeStatus == 'A')+ return _T("Added by them");+ return _T("Conflict");+ }++ private String getDiffOutput(FileEntry entry) {+ GitExecutionResult result;+ if (entry.staged) {+ result = executeGit("diff", "--cached", "-U999999", "--", entry.path);+ } else {+ result = executeGit("diff", "-U999999", "--", entry.path);+ }+ return stdoutString(result);+ }++ private boolean isBinaryDiff(String diffOutput) {+ for (String line : diffOutput.split("\n")) {+ if (line.startsWith("Binary files "))+ return true;+ }+ return false;+ }++ // --- Git helper methods ---++ private GitExecutionResult executeGit(String... args) {+ return workspaceService.executeGitCommand(getWorkspace(), args);+ }++ private String stdoutString(GitExecutionResult result) {+ return new String(result.getStdout(), StandardCharsets.UTF_8);+ }++ private boolean indicatesLocalChangesOverwritten(String text) {+ return text.contains("Your local changes to the following files would be overwritten by merge")+ || text.contains("The following untracked working tree files would be overwritten by merge");+ }++ private int collectErrorLines(String output, List<String> keyLines) {+ int conflictCount = 0;+ for (String line : output.split("\n")) {+ line = line.trim();+ if (line.isEmpty())+ continue;+ if (line.startsWith("CONFLICT ")) {+ conflictCount++;+ } else if (line.startsWith("fatal:") || line.startsWith("error:")+ || line.startsWith("nothing to commit")+ || line.startsWith("nothing added to commit")+ || line.contains("! [rejected]")) {+ if (line.startsWith("fatal:"))+ line = line.substring("fatal:".length()).trim();+ else if (line.startsWith("error:"))+ line = line.substring("error:".length()).trim();+ if (!line.isEmpty() && !keyLines.contains(line))+ keyLines.add(line);+ }+ }+ return conflictCount;+ }++ private String buildErrorMessage(List<String> errorLines, int conflictCount) {+ if (conflictCount > 0)+ errorLines.add(0, _T("Conflicts found when trying to merge") + " (" + conflictCount + " " + (conflictCount == 1 ? _T("file") : _T("files")) + ")");+ return String.join("\n", errorLines);+ }++ private String getErrorMessage(GitExecutionResult result) {+ String stderr = new String(result.getStderr(), StandardCharsets.UTF_8).trim();+ String stdout = new String(result.getStdout(), StandardCharsets.UTF_8).trim();++ if (indicatesLocalChangesOverwritten(stderr))+ return _T("Some local changes would be overwritten by merge");++ List<String> errorLines = new ArrayList<>();+ int conflictCount = collectErrorLines(stderr, errorLines);+ if (!errorLines.isEmpty() || conflictCount > 0)+ return buildErrorMessage(errorLines, conflictCount);++ if (indicatesLocalChangesOverwritten(stdout))+ return _T("Some local changes would be overwritten by merge");++ conflictCount = collectErrorLines(stdout, errorLines);+ if (!errorLines.isEmpty() || conflictCount > 0)+ return buildErrorMessage(errorLines, conflictCount);++ if (!stderr.isEmpty())+ return stderr;+ return _T("Git command failed with exit code") + " " + result.getReturnCode();+ }+++ private static boolean isConflicted(FileEntry entry) {+ char x = entry.indexStatus, y = entry.workTreeStatus;+ return x == 'U' || y == 'U'+ || (x == 'A' && y == 'A')+ || (x == 'D' && y == 'D');+ }++ private boolean hasConflicts() {+ for (FileEntry entry : parseGitStatus()) {+ if (isConflicted(entry))+ return true;+ }+ return false;+ }++ private boolean isMergeInProgress() {+ GitExecutionResult result = executeGit("rev-parse", "--verify", "MERGE_HEAD");+ return result.getReturnCode() == 0;+ }++ private boolean hasStagedFiles() {+ for (FileEntry entry : parseGitStatus()) {+ if (entry.indexStatus != ' ' && entry.indexStatus != '?' && !isConflicted(entry))+ return true;+ }+ return false;+ }++ private int[] getAheadBehind() {+ GitExecutionResult result = executeGit("rev-list", "--left-right", "--count",+ "@{upstream}...HEAD");+ if (result.getReturnCode() != 0) {+ result = executeGit("rev-list", "--count", "HEAD");+ if (result.getReturnCode() == 0) {+ try {+ int count = Integer.parseInt(stdoutString(result).trim());+ return new int[]{0, count};+ } catch (NumberFormatException e) {+ // fall through+ }+ }+ return new int[]{0, 0};+ }+ String output = stdoutString(result).trim();+ String[] parts = output.split("\\s+");+ if (parts.length == 2) {+ try {+ return new int[]{Integer.parseInt(parts[0]), Integer.parseInt(parts[1])};+ } catch (NumberFormatException e) {+ return new int[]{0, 0};+ }+ }+ return new int[]{0, 0};+ }++ private List<FileEntry> parseGitStatus() {+ GitExecutionResult result = executeGit("status", "--porcelain");+ if (result.getReturnCode() != 0)+ return new ArrayList<>();+ return parseGitStatusOutput(stdoutString(result));+ }++ private List<FileEntry> parseGitStatusOutput(String output) {+ List<FileEntry> entries = new ArrayList<>();+ for (String line : output.split("\n")) {+ if (line.length() < 4)+ continue;+ char indexStatus = line.charAt(0);+ char workTreeStatus = line.charAt(1);+ String path = line.substring(3);+ if (path.startsWith("\"") && path.endsWith("\""))+ path = unquoteGitPath(path);+ if (path.endsWith("/")) {+ GitExecutionResult lsResult = executeGit(+ "ls-files", "--others", "--exclude-standard", "--", path);+ if (lsResult.getReturnCode() == 0) {+ for (String filePath : stdoutString(lsResult).split("\n")) {+ filePath = filePath.trim();+ if (!filePath.isEmpty())+ entries.add(new FileEntry(indexStatus, workTreeStatus, filePath));+ }+ }+ } else {+ entries.add(new FileEntry(indexStatus, workTreeStatus, path));+ }+ }+ return entries;+ }++ private String unquoteGitPath(String quoted) {+ String inner = quoted.substring(1, quoted.length() - 1);+ StringBuilder sb = new StringBuilder();+ for (int i = 0; i < inner.length(); i++) {+ char c = inner.charAt(i);+ if (c == '\\' && i + 1 < inner.length()) {+ char next = inner.charAt(i + 1);+ switch (next) {+ case 'n': sb.append('\n'); i++; break;+ case 't': sb.append('\t'); i++; break;+ case '\\': sb.append('\\'); i++; break;+ case '"': sb.append('"'); i++; break;+ default:+ if (next >= '0' && next <= '7') {+ StringBuilder octal = new StringBuilder();+ for (int j = i + 1; j < Math.min(i + 4, inner.length()); j++) {+ char oc = inner.charAt(j);+ if (oc >= '0' && oc <= '7')+ octal.append(oc);+ else+ break;+ }+ sb.append((char) Integer.parseInt(octal.toString(), 8));+ i += octal.length();+ } else {+ sb.append(c);+ }+ break;+ }+ } else {+ sb.append(c);+ }+ }+ return sb.toString();+ }++ /**+ * Parse unified diff output into [oldLines, newLines] by extracting context+ * and change lines from hunks.+ */+ private List<List<String>> parseDiffToOldNewLines(String diffOutput) {+ List<String> oldLines = new ArrayList<>();+ List<String> newLines = new ArrayList<>();+ boolean inHunk = false;++ for (String line : diffOutput.split("\n", -1)) {+ if (line.startsWith("@@")) {+ inHunk = true;+ continue;+ }+ if (!inHunk)+ continue;+ if (line.startsWith("diff --git") || line.startsWith("index ")) {+ inHunk = false;+ continue;+ }+ if (line.startsWith("-")) {+ oldLines.add(line.length() > 1 ? line.substring(1) : "");+ } else if (line.startsWith("+")) {+ newLines.add(line.length() > 1 ? line.substring(1) : "");+ } else if (line.startsWith(" ") || line.isEmpty()) {+ String content = line.isEmpty() ? "" : line.substring(1);+ oldLines.add(content);+ newLines.add(content);+ } else if (line.startsWith("\\ No newline at end of file")) {+ // skip+ }+ }++ List<List<String>> result = new ArrayList<>();+ result.add(oldLines);+ result.add(newLines);+ return result;+ }++ @Override+ public void renderHead(IHeaderResponse response) {+ super.renderHead(response);+ response.render(CssHeaderItem.forReference(new WorkspaceChangesCssResourceReference()));+ if (selectedFile != null) {+ response.render(OnLoadHeaderItem.forScript("""+ var active = document.querySelector('.file-sections .file-list > li.active');+ if (active) active.scrollIntoView({block: 'nearest'});+ """));+ }+ }++ private FileEntry findSelectedFileEntry() {+ List<FileEntry> allEntries = parseGitStatus();+ for (FileEntry e : allEntries) {+ if (e.path.equals(selectedFile)) {+ if (isConflicted(e))+ return new FileEntry(e.path, e.indexStatus, e.workTreeStatus);+ if (e.indexStatus != ' ' && e.indexStatus != '?')+ return new FileEntry(e.indexStatus, e.path, true);+ if (e.workTreeStatus != ' ' || e.indexStatus == '?')+ return new FileEntry(+ e.indexStatus == '?' ? 'U' : e.workTreeStatus,+ e.path, false);+ break;+ }+ }+ return null;+ }++ @Override+ protected void onPopState(AjaxRequestTarget target, Serializable data) {+ super.onPopState(target, data);+ selectedFile = (String) data;+ refreshAll(target);+ }++ private void pushState(AjaxRequestTarget target) {+ PageParameters params = paramsOf(getWorkspace(), selectedFile);+ CharSequence url = RequestCycle.get().urlFor(WorkspaceChangesPage.class, params);+ pushState(target, url.toString(), selectedFile);+ }++ private void replaceState(AjaxRequestTarget target) {+ PageParameters params = paramsOf(getWorkspace(), selectedFile);+ CharSequence url = RequestCycle.get().urlFor(WorkspaceChangesPage.class, params);+ replaceState(target, url.toString(), selectedFile);+ }++ public static PageParameters paramsOf(Workspace workspace) {+ return WorkspaceDetailPage.paramsOf(workspace);+ }++ public static PageParameters paramsOf(Project project, Long workspaceNumber) {+ return WorkspaceDetailPage.paramsOf(project, workspaceNumber);+ }++ public static PageParameters paramsOf(Workspace workspace, String file) {+ PageParameters params = WorkspaceDetailPage.paramsOf(workspace);+ if (file != null)+ params.add(PARAM_FILE, file);+ return params;+ }++ private static class FileEntry implements Serializable {+ private static final long serialVersionUID = 1L;++ final char indexStatus;+ final char workTreeStatus;+ final String path;+ final char displayStatus;+ final boolean staged;+ final boolean conflicted;++ FileEntry(char indexStatus, char workTreeStatus, String path) {+ this.indexStatus = indexStatus;+ this.workTreeStatus = workTreeStatus;+ this.path = path;+ this.displayStatus = ' ';+ this.staged = false;+ this.conflicted = false;+ }++ FileEntry(char displayStatus, String path, boolean staged) {+ this.indexStatus = ' ';+ this.workTreeStatus = ' ';+ this.path = path;+ this.displayStatus = displayStatus;+ this.staged = staged;+ this.conflicted = false;+ }++ FileEntry(String path, char indexStatus, char workTreeStatus) {+ this.indexStatus = indexStatus;+ this.workTreeStatus = workTreeStatus;+ this.path = path;+ this.displayStatus = 'C';+ this.staged = false;+ this.conflicted = true;+ }+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/workspace-changes.css b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/workspace-changes.cssnew file mode 100644index 0000000000..370f4f6adc--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/changes/workspace-changes.css@@ -0,0 +1,170 @@+.workspace-changes>.changes-sidebar {+ max-width: 360px !important;+ min-width: 360px !important;+ background: white;+}+@media (max-width: 1199.98px) {+ .workspace-changes>.changes-sidebar {+ max-width: 320px !important;+ min-width: 320px !important;+ }+}+@media (max-width: 767.98px) {+ .workspace-changes>.changes-sidebar {+ max-width: 240px !important;+ min-width: 240px !important;+ }+}+.dark-mode .workspace-changes>.changes-sidebar {+ background: var(--dark-mode-dark);+ border-right-color: var(--dark-mode-lighter-dark) !important;+}+.workspace-changes>.changes-sidebar a.with-working-indicator {+ display: none;+}+.workspace-changes>.changes-sidebar>.sync-info {+ font-size: 1.1rem;+ font-weight: bold;+}+/* .icon is fixed 16px in base.css; scale all sync bar SVGs to match larger text */+.workspace-changes>.changes-sidebar>.sync-info .icon {+ width: 20px;+ height: 20px;+}+.dark-mode .workspace-changes>.changes-sidebar>.sync-info {+ border-bottom-color: var(--dark-mode-lighter-dark) !important;+}+.workspace-changes>.changes-sidebar>.commit-form textarea {+ resize: vertical;+}+.dark-mode .workspace-changes>.changes-sidebar>.commit-form {+ border-bottom-color: var(--dark-mode-lighter-dark) !important;+}+.workspace-changes>.changes-sidebar>.commit-form .btn-group {+ position: relative;+}+.workspace-changes>.changes-sidebar .file-section>.section-header {+ background: var(--light);+ border-top: 1px solid var(--light-gray);+ border-bottom: 1px solid var(--light-gray);+ line-height: 2;+ padding: 0.3rem 0.25rem 0.3rem 1rem;+}+.workspace-changes>.changes-sidebar .file-list>li {+ padding-right: 0.25rem;+}+.workspace-changes>.changes-sidebar .file-list>li>a:first-child {+ padding: 0.3rem 0 0.3rem 1rem;+}+.dark-mode .workspace-changes>.changes-sidebar .file-section>.section-header {+ background: var(--dark-mode-light-dark);+ border-top-color: var(--dark-mode-lighter-dark);+ border-bottom-color: var(--dark-mode-lighter-dark);+}+.workspace-changes>.changes-sidebar .conflict-section>.section-header {+ background: var(--light-danger);+ color: var(--danger);+ border-color: #f1c0c0;+}+.dark-mode .workspace-changes>.changes-sidebar .conflict-section>.section-header {+ background: rgba(241, 65, 108, 0.15);+ color: var(--danger);+ border-color: rgb(97, 48, 63);+}+.workspace-changes>.changes-sidebar .file-section>.section-header>.btn {+ display: none;+}+.workspace-changes>.changes-sidebar .file-section:hover>.section-header>.btn {+ display: inline;+}+.workspace-changes>.changes-sidebar .file-list>li>.btn {+ display: none;+}+.workspace-changes>.changes-sidebar .file-list>li:hover>.btn {+ display: inline;+}+.workspace-changes>.changes-sidebar .conflict-action {+ font-size: 0.7rem;+ padding: 0 0.25rem;+ line-height: 1.4;+}+.workspace-changes>.changes-sidebar .conflict-type {+ font-weight: 600;+ font-size: 0.8rem;+ color: var(--danger);+ white-space: nowrap;+ text-align: center;+ flex-shrink: 0;+}+.workspace-changes>.changes-sidebar .file-list>li:hover {+ background-color: var(--light-warning);+ border-color: var(--light-warning);+}+.workspace-changes>.changes-sidebar .file-list>li.active {+ background-color: var(--light-primary);+ border-color: #BBDFF9;+}+.workspace-changes>.changes-sidebar .file-list>li>a {+ color: var(--gray-dark);+ min-width: 0;+}+.dark-mode .workspace-changes>.changes-sidebar .file-list>li:hover {+ background-color: var(--dark-mode-light-warning);+ border-color: var(--dark-mode-light-warning);+}+.dark-mode .workspace-changes>.changes-sidebar .file-list>li.active {+ background-color: var(--dark-mode-light-primary);+ border-color: rgb(48, 68, 107);+}+.dark-mode .workspace-changes>.changes-sidebar .file-list>li>a {+ color: var(--dark-mode-light-gray);+}+.workspace-changes>.changes-sidebar .file-names {+ flex: 1;+ min-width: 0;+ overflow: hidden;+ white-space: nowrap;+ text-overflow: ellipsis;+}+.workspace-changes>.changes-sidebar .file-dir {+ font-size: 0.8rem;+ color: var(--text-muted);+ margin-left: 0.4em;+}+.dark-mode .workspace-changes>.changes-sidebar .file-dir {+ color: var(--dark-mode-muted);+}+.workspace-changes>.changes-sidebar .file-status {+ font-weight: 600;+ font-size: 0.8rem;+ width: 1rem;+ text-align: center;+ flex-shrink: 0;+}+.workspace-changes>.changes-sidebar .file-status.status-M,+.workspace-changes>.changes-sidebar .file-status.status-T {+ color: var(--warning);+}+.workspace-changes>.changes-sidebar .file-status.status-A {+ color: var(--success);+}+.workspace-changes>.changes-sidebar .file-status.status-D {+ color: var(--danger);+}+.workspace-changes>.changes-sidebar .file-status.status-U {+ color: var(--muted);+}+.workspace-changes>.diff-content {+ background: white;+}+.dark-mode .workspace-changes>.diff-content {+ background: var(--dark-mode-dark);+}+.workspace-changes>.diff-content>.diff-header {+ background: var(--light);+ border-bottom-color: var(--light-gray) !important;+}+.dark-mode .workspace-changes>.diff-content>.diff-header {+ background: var(--dark-mode-light-dark);+ border-bottom-color: var(--dark-mode-lighter-dark) !important;+}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/dashboard/WorkspaceDashboardPage.html b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/dashboard/WorkspaceDashboardPage.htmlnew file mode 100644index 0000000000..52347806c0--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/dashboard/WorkspaceDashboardPage.html@@ -0,0 +1,2 @@+<wicket:extend>+</wicket:extend>diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/dashboard/WorkspaceDashboardPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/dashboard/WorkspaceDashboardPage.javanew file mode 100644index 0000000000..01038fbc84--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/dashboard/WorkspaceDashboardPage.java@@ -0,0 +1,38 @@+package io.onedev.server.web.page.project.workspaces.detail.dashboard;++import org.apache.wicket.RestartResponseException;+import org.apache.wicket.core.request.handler.PageProvider;+import org.apache.wicket.core.request.handler.RenderPageRequestHandler.RedirectPolicy;+import org.apache.wicket.request.mapper.parameter.PageParameters;++import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;+import io.onedev.server.web.page.project.workspaces.detail.WorkspaceDetailPage;+import io.onedev.server.web.page.project.workspaces.detail.log.WorkspaceLogPage;+import io.onedev.server.web.page.project.workspaces.detail.terminal.WorkspaceTerminalPage;++public class WorkspaceDashboardPage extends WorkspaceDetailPage {++ public WorkspaceDashboardPage(PageParameters params) {+ super(params);++ PageProvider pageProvider;++ var terminalIds = workspaceService.getShellIds(getWorkspace());+ if (!terminalIds.isEmpty())+ pageProvider = new PageProvider(WorkspaceTerminalPage.class, WorkspaceTerminalPage.paramsOf(getWorkspace(), terminalIds.get(0)));+ else+ pageProvider = new PageProvider(WorkspaceLogPage.class, WorkspaceLogPage.paramsOf(getWorkspace()));++ throw new RestartResponseException(pageProvider, RedirectPolicy.NEVER_REDIRECT);+ }++ public static PageParameters paramsOf(Workspace workspace) {+ return WorkspaceDetailPage.paramsOf(workspace);+ }++ public static PageParameters paramsOf(Project project, Long workspaceNumber) {+ return WorkspaceDetailPage.paramsOf(project, workspaceNumber);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/log/WorkspaceLogPage.html b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/log/WorkspaceLogPage.htmlnew file mode 100644index 0000000000..a87076b2d5--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/log/WorkspaceLogPage.html@@ -0,0 +1,3 @@+<wicket:extend>+ <div wicket:id="log" class="log d-flex flex-grow-1 position-relative"></div>+</wicket:extend>diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/log/WorkspaceLogPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/log/WorkspaceLogPage.javanew file mode 100644index 0000000000..aa1cf0b7d5--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/log/WorkspaceLogPage.java@@ -0,0 +1,47 @@+package io.onedev.server.web.page.project.workspaces.detail.log;++import org.apache.wicket.request.mapper.parameter.PageParameters;+import org.jspecify.annotations.Nullable;++import io.onedev.server.logging.LoggingSupport;+import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;+import io.onedev.server.web.component.logging.LogPanel;+import io.onedev.server.web.component.logging.PauseSupport;+import io.onedev.server.web.page.project.workspaces.detail.WorkspaceDetailPage;++public class WorkspaceLogPage extends WorkspaceDetailPage {++ public WorkspaceLogPage(PageParameters params) {+ super(params);+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ add(new LogPanel("log") {++ @Override+ protected LoggingSupport getLoggingSupport() {+ return getWorkspace().getLoggingSupport();+ }++ @Nullable+ @Override+ protected PauseSupport getPauseSupport() {+ return null;+ }++ });+ }++ public static PageParameters paramsOf(Workspace workspace) {+ return WorkspaceDetailPage.paramsOf(workspace);+ }++ public static PageParameters paramsOf(Project project, Long workspaceNumber) {+ return WorkspaceDetailPage.paramsOf(project, workspaceNumber);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/TerminalTab.java b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/TerminalTab.javanew file mode 100644index 0000000000..87480b30c6--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/TerminalTab.java@@ -0,0 +1,39 @@+package io.onedev.server.web.page.project.workspaces.detail.terminal;++import org.apache.wicket.Page;+import org.apache.wicket.Component;+import org.apache.wicket.model.Model;++import io.onedev.server.OneDev;+import io.onedev.server.model.Workspace;+import io.onedev.server.web.page.project.workspaces.detail.WorkspaceTab;+import io.onedev.server.workspace.WorkspaceService;++public class TerminalTab extends WorkspaceTab {++ private final String shellId;++ public TerminalTab(Workspace workspace, String shellId) {+ super(Model.of("Terminal " + (getTerminalIndex(workspace, shellId) + 1)), Model.of("terminal2"), WorkspaceTerminalPage.class, WorkspaceTerminalPage.paramsOf(workspace, shellId));+ this.shellId = shellId;+ }++ private static int getTerminalIndex(Workspace workspace, String shellId) {+ return OneDev.getInstance(WorkspaceService.class).getShellIds(workspace).indexOf(shellId);+ }++ @Override+ public Component render(String componentId) {+ return new TerminalTabHead(componentId, this, shellId);+ }++ @Override+ public boolean isActive(Page currentPage) {+ if (super.isActive(currentPage)) {+ WorkspaceTerminalPage terminalPage = (WorkspaceTerminalPage) currentPage;+ return shellId.equals(terminalPage.getShellId());+ } else {+ return false;+ }+ }+}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/TerminalTabHead.html b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/TerminalTabHead.htmlnew file mode 100644index 0000000000..21fe0f3ace--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/TerminalTabHead.html@@ -0,0 +1,10 @@+<wicket:panel>+ <a wicket:id="link" class="nav-link nav-link-terminal d-inline-block flex-grow-1">+ <svg wicket:id="icon" class="icon mr-1"/>+ <wicket:container wicket:id="label"></wicket:container>+ </a>+ <a wicket:id="close" class="nav-link nav-link-close d-inline-block flex-grow-1" t:data-tippy-content="Close terminal">+ <wicket:svg href="times" class="icon"></wicket:svg>+ </a>+ <span wicket:id="readOnlyNotice" class="nav-link nav-link-read-only-notice d-inline-block flex-grow-1" t:data-tippy-content="This terminal is read only"><wicket:svg href="warning-o" class="icon"></wicket:svg></span>+</wicket:panel>diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/TerminalTabHead.java b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/TerminalTabHead.javanew file mode 100644index 0000000000..333fc3de99--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/TerminalTabHead.java@@ -0,0 +1,74 @@+package io.onedev.server.web.page.project.workspaces.detail.terminal;++import javax.inject.Inject;++import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.ajax.markup.html.AjaxLink;+import org.apache.wicket.markup.html.WebMarkupContainer;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.link.Link;+import org.apache.wicket.markup.html.panel.Panel;++import io.onedev.server.security.SecurityUtils;+import io.onedev.server.web.component.link.ViewStateAwarePageLink;+import io.onedev.server.web.component.svg.SpriteImage;+import io.onedev.server.web.page.project.workspaces.detail.WorkspaceDetailPage;+import io.onedev.server.web.page.project.workspaces.detail.dashboard.WorkspaceDashboardPage;+import io.onedev.server.workspace.WorkspaceService;++public class TerminalTabHead extends Panel {++ private static final long serialVersionUID = 1L;++ private final TerminalTab tab;++ private final String shellId;++ @Inject+ private WorkspaceService workspaceService;++ public TerminalTabHead(String id, TerminalTab tab, String shellId) {+ super(id);+ this.tab = tab;+ this.shellId = shellId;+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ var page = (WorkspaceDetailPage) getPage();+ Link<Void> link = new ViewStateAwarePageLink<>("link", WorkspaceTerminalPage.class,+ WorkspaceTerminalPage.paramsOf(page.getWorkspace(), shellId));+ add(link);+ link.add(new SpriteImage("icon", tab.getIconModel()));+ link.add(new Label("label", tab.getTitleModel()));++ add(new AjaxLink<Void>("close") {++ @Override+ public void onClick(AjaxRequestTarget target) {+ var page = (WorkspaceDetailPage) getPage();+ var workspace = page.getWorkspace();+ workspaceService.terminateShell(workspace, shellId);++ if (page instanceof WorkspaceTerminalPage terminalPage && shellId.equals(terminalPage.getShellId())) {+ setResponsePage(WorkspaceDashboardPage.class, WorkspaceDashboardPage.paramsOf(workspace));+ } else {+ setResponsePage(getPage().getClass(), getPage().getPageParameters());+ }+ }++ @Override+ protected void onConfigure() {+ super.onConfigure();+ var workspace = ((WorkspaceDetailPage) getPage()).getWorkspace();+ setVisible(SecurityUtils.canModifyOrDelete(workspace));+ }++ });++ add(new WebMarkupContainer("readOnlyNotice").setVisible(!SecurityUtils.canModifyOrDelete(page.getWorkspace())));+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/WorkspaceTerminalPage.html b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/WorkspaceTerminalPage.htmlnew file mode 100644index 0000000000..a8fb32dcfd--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/WorkspaceTerminalPage.html@@ -0,0 +1,3 @@+<wicket:extend>+ <div wicket:id="terminal" class="d-flex flex-column flex-grow-1 p-2 bg-black"></div>+</wicket:extend>diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/WorkspaceTerminalPage.java b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/WorkspaceTerminalPage.javanew file mode 100644index 0000000000..2925e5d044--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/terminal/WorkspaceTerminalPage.java@@ -0,0 +1,82 @@+package io.onedev.server.web.page.project.workspaces.detail.terminal;++import javax.inject.Inject;++import org.apache.wicket.RestartResponseException;+import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;+import org.apache.wicket.protocol.ws.api.IWebSocketConnection;+import org.apache.wicket.request.mapper.parameter.PageParameters;++import io.onedev.server.model.Workspace;+import io.onedev.server.security.SecurityUtils;+import io.onedev.server.web.component.terminal.TerminalPanel;+import io.onedev.server.web.page.project.workspaces.detail.WorkspaceDetailPage;+import io.onedev.server.web.page.project.workspaces.detail.dashboard.WorkspaceDashboardPage;+import io.onedev.server.workspace.WorkspaceService;++public class WorkspaceTerminalPage extends WorkspaceDetailPage {++ private static final long serialVersionUID = 1L;++ private static final String PARAM_SHELL = "shell";++ private final String shellId;++ @Inject+ private WorkspaceService workspaceService;++ public WorkspaceTerminalPage(PageParameters params) {+ super(params);+ shellId = params.get(PARAM_SHELL).toString();++ if (!workspaceService.getShellIds(getWorkspace()).contains(shellId))+ throw new RestartResponseException(WorkspaceDashboardPage.class, WorkspaceDashboardPage.paramsOf(getWorkspace()));+ }++ public String getShellId() {+ return shellId;+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ add(new TerminalPanel("terminal") {++ @Override+ protected void onConnectionOpen(IWebSocketConnection connection) {+ workspaceService.onOpen(connection, getWorkspace(), shellId);+ }++ @Override+ protected void onConnectionClose(IWebSocketConnection connection) {+ workspaceService.onClose(connection);+ }++ @Override+ protected void writeToStdin(IWebSocketConnection connection, String data) {+ if (SecurityUtils.canModifyOrDelete(getWorkspace()))+ workspaceService.onMessage(connection, getWorkspace(), shellId, "SHELL_INPUT:" + data);+ }++ @Override+ protected void onResized(IWebSocketConnection connection, int rows, int cols) {+ workspaceService.onMessage(connection, getWorkspace(), shellId,+ "TERMINAL_RESIZE:" + rows + "," + cols);+ }++ @Override+ protected void onShellExit(IPartialPageRequestHandler handler) {+ setResponsePage(WorkspaceDashboardPage.class, WorkspaceDashboardPage.paramsOf(getWorkspace()));+ }++ });+ }++ public static PageParameters paramsOf(Workspace workspace, String shellId) {+ var params = WorkspaceDetailPage.paramsOf(workspace);+ params.add(PARAM_SHELL, shellId);+ return params;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/workspace-detail.css b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/workspace-detail.cssnew file mode 100644index 0000000000..2b119a8eb9--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/workspace-detail.css@@ -0,0 +1,52 @@+.WorkspaceDetailPage .topbar {+ box-shadow: none;+ border-bottom: 1px solid var(--light-gray);+}+.dark-mode.WorkspaceDetailPage .topbar {+ border-bottom-color: var(--dark-mode-lighter-dark);+}+.workspace-detail {+ background: white;+}+.dark-mode .workspace-detail {+ background: var(--dark-mode-dark);+}+.workspace-detail>.head {+ border-bottom: 1px solid var(--light-gray);+ min-height: 40px;+}+.dark-mode .workspace-detail>.head {+ border-bottom-color: var(--dark-mode-lighter-dark);+}+.workspace-detail>.body>.tabs .nav-item {+ display: inline-flex;+ align-items: center;+ padding: 0 0.75rem !important;+}+.workspace-detail>.body>.tabs .nav-item:first-child {+ padding-left: 1.5rem !important;+}++.workspace-detail>.body>.tabs .nav-link {+ border: 0;+ border-bottom: 3px solid transparent !important;+ margin-right: 0 !important;+}+.workspace-detail>.body>.tabs .nav-item.active .nav-link {+ border-bottom: 3px solid var(--primary) !important;+}+.workspace-detail>.body>.tabs .nav-item .nav-link.nav-link-close,+.workspace-detail>.body>.tabs .nav-item .nav-link.nav-link-read-only-notice {+ padding-left: 0.5rem !important;+}+.workspace-detail>.body>.tabs .nav-item.active .nav-link.nav-link-close:hover,+.workspace-detail>.body>.tabs .nav-item.active .nav-link.nav-link-close:hover .icon {+ color: #0065ca !important;+}+.dark-mode .workspace-detail>.body>.tabs .nav-item.active .nav-link.nav-link-close:hover,+.dark-mode .workspace-detail>.body>.tabs .nav-item.active .nav-link.nav-link-close:hover .icon {+ color: rgb(127, 196, 255) !important;+}+.workspace-detail>.body>.log>.log {+ padding: 1.6rem;+}diff --git a/server-core/src/main/java/io/onedev/server/web/page/workspaces/WorkspaceListPage.html b/server-core/src/main/java/io/onedev/server/web/page/workspaces/WorkspaceListPage.htmlnew file mode 100644index 0000000000..00da1181ab--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/workspaces/WorkspaceListPage.html@@ -0,0 +1,6 @@+<wicket:extend>+ <div class="side-main side-main-wrap p-2 p-sm-5">+ <div wicket:id="savedQueries" class="side"></div>+ <div wicket:id="sessions" class="main"></div>+ </div>+</wicket:extend>diff --git a/server-core/src/main/java/io/onedev/server/web/page/workspaces/WorkspaceListPage.java b/server-core/src/main/java/io/onedev/server/web/page/workspaces/WorkspaceListPage.javanew file mode 100644index 0000000000..6d35f73fa7--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/page/workspaces/WorkspaceListPage.java@@ -0,0 +1,259 @@+package io.onedev.server.web.page.workspaces;++import static io.onedev.server.web.translation.Translation._T;++import java.io.Serializable;+import java.util.ArrayList;++import org.jspecify.annotations.Nullable;++import org.apache.wicket.Component;+import org.apache.wicket.ajax.AjaxRequestTarget;+import org.apache.wicket.markup.html.basic.Label;+import org.apache.wicket.markup.html.link.BookmarkablePageLink;+import org.apache.wicket.markup.html.link.Link;+import org.apache.wicket.model.IModel;+import org.apache.wicket.request.cycle.RequestCycle;+import org.apache.wicket.request.mapper.parameter.PageParameters;++import io.onedev.server.OneDev;+import io.onedev.server.data.migration.VersionedXmlDoc;+import io.onedev.server.model.Project;+import io.onedev.server.model.User;+import io.onedev.server.model.support.NamedQuery;+import io.onedev.server.model.support.QueryPersonalization;+import io.onedev.server.model.support.administration.GlobalWorkspaceSetting;+import io.onedev.server.model.support.workspace.NamedWorkspaceQuery;+import io.onedev.server.security.SecurityUtils;+import io.onedev.server.service.SettingService;+import io.onedev.server.service.UserService;+import io.onedev.server.web.component.workspace.list.WorkspaceListPanel;+import io.onedev.server.web.component.savedquery.PersonalQuerySupport;+import io.onedev.server.web.component.modal.ModalPanel;+import io.onedev.server.web.component.savedquery.NamedQueriesBean;+import io.onedev.server.web.component.savedquery.SaveQueryPanel;+import io.onedev.server.web.component.savedquery.SavedQueriesPanel;+import io.onedev.server.web.page.layout.LayoutPage;+import io.onedev.server.web.util.NamedWorkspaceQueriesBean;+import io.onedev.server.web.util.QuerySaveSupport;+import io.onedev.server.web.util.paginghistory.PagingHistorySupport;+import io.onedev.server.web.util.paginghistory.ParamPagingHistorySupport;++public class WorkspaceListPage extends LayoutPage {++ private static final String PARAM_PAGE = "page";++ private static final String PARAM_QUERY = "query";++ private String query;++ private SavedQueriesPanel<NamedWorkspaceQuery> savedQueries;++ private WorkspaceListPanel sessionList;++ public WorkspaceListPage(PageParameters params) {+ super(params);+ query = params.get(PARAM_QUERY).toOptionalString();+ }++ private static GlobalWorkspaceSetting getWorkspaceSetting() {+ return OneDev.getInstance(SettingService.class).getWorkspaceSetting();+ }++ @Override+ protected void onInitialize() {+ super.onInitialize();++ add(savedQueries = new SavedQueriesPanel<>("savedQueries") {++ @Override+ protected NamedQueriesBean<NamedWorkspaceQuery> newNamedQueriesBean() {+ return new NamedWorkspaceQueriesBean();+ }++ @Override+ protected Link<Void> newQueryLink(String componentId, NamedWorkspaceQuery namedQuery) {+ return new BookmarkablePageLink<>(componentId, WorkspaceListPage.class,+ WorkspaceListPage.paramsOf(namedQuery.getQuery(), 0));+ }++ @Override+ protected QueryPersonalization<NamedWorkspaceQuery> getQueryPersonalization() {+ return getLoginUser() != null ? getLoginUser().getWorkspaceQueryPersonalization() : null;+ }++ @Override+ protected ArrayList<NamedWorkspaceQuery> getCommonQueries() {+ return (ArrayList<NamedWorkspaceQuery>) getWorkspaceSetting().getNamedQueries();+ }++ @Override+ protected void onSaveCommonQueries(ArrayList<NamedWorkspaceQuery> namedQueries) {+ var oldAuditContent = VersionedXmlDoc.fromBean(getWorkspaceSetting().getNamedQueries()).toXML();+ getWorkspaceSetting().setNamedQueries(namedQueries);+ var newAuditContent = VersionedXmlDoc.fromBean(getWorkspaceSetting().getNamedQueries()).toXML();+ OneDev.getInstance(SettingService.class).saveWorkspaceSetting(getWorkspaceSetting());+ auditService.audit(null, "changed workspace queries", oldAuditContent, newAuditContent);+ }++ });++ add(sessionList = new WorkspaceListPanel("sessions", new IModel<>() {++ @Override+ public void detach() {+ }++ @Override+ public String getObject() {+ return query;+ }++ @Override+ public void setObject(String object) {+ query = object;+ PageParameters params = getPageParameters();+ params.set(PARAM_QUERY, query);+ params.remove(PARAM_PAGE);+ CharSequence url = RequestCycle.get().urlFor(WorkspaceListPage.class, params);+ pushState(RequestCycle.get().find(AjaxRequestTarget.class), url.toString(), query);+ }++ }) {++ @Override+ protected PagingHistorySupport getPagingHistorySupport() {+ return new ParamPagingHistorySupport() {++ @Override+ public PageParameters newPageParameters(int currentPage) {+ return paramsOf(query, currentPage + 1);+ }++ @Override+ public int getCurrentPage() {+ return getPageParameters().get(PARAM_PAGE).toInt(1) - 1;+ }++ };+ }++ @Override+ protected QuerySaveSupport getQuerySaveSupport() {+ return new QuerySaveSupport() {++ @Override+ public void onSaveQuery(AjaxRequestTarget target, String query) {+ new ModalPanel(target) {++ @Override+ protected Component newContent(String id) {+ return new SaveQueryPanel(id, new PersonalQuerySupport() {++ @Override+ public void onSave(AjaxRequestTarget target, String name) {+ QueryPersonalization<NamedWorkspaceQuery> personalization =+ getLoginUser().getWorkspaceQueryPersonalization();+ NamedWorkspaceQuery namedQuery = NamedQuery.find(personalization.getQueries(), name);+ if (namedQuery == null) {+ namedQuery = new NamedWorkspaceQuery(name, query);+ personalization.getQueries().add(namedQuery);+ } else {+ namedQuery.setQuery(query);+ }+ OneDev.getInstance(UserService.class).update(getLoginUser(), null);+ target.add(savedQueries);+ close();+ }++ }) {++ @Override+ protected void onSave(AjaxRequestTarget target, String name) {+ GlobalWorkspaceSetting setting = getWorkspaceSetting();+ NamedWorkspaceQuery namedQuery = setting.getNamedQuery(name);+ String oldAuditContent = null;+ String verb;+ if (namedQuery == null) {+ namedQuery = new NamedWorkspaceQuery(name, query);+ setting.getNamedQueries().add(namedQuery);+ verb = "created";+ } else {+ oldAuditContent = VersionedXmlDoc.fromBean(namedQuery).toXML();+ namedQuery.setQuery(query);+ verb = "changed";+ }+ var newAuditContent = VersionedXmlDoc.fromBean(namedQuery).toXML();+ OneDev.getInstance(SettingService.class).saveWorkspaceSetting(setting);+ auditService.audit(null,+ verb + " workspace query \"" + name + "\"",+ oldAuditContent, newAuditContent);+ target.add(savedQueries);+ close();+ }++ @Override+ protected void onCancel(AjaxRequestTarget target) {+ close();+ }++ };+ }++ };+ }++ @Override+ public boolean isSavedQueriesVisible() {+ savedQueries.configure();+ return savedQueries.isVisible();+ }++ };+ }++ @Override+ protected Project getProject() {+ return null;+ }++ });+ }++ @Override+ protected void onPopState(AjaxRequestTarget target, Serializable data) {+ query = (String) data;+ getPageParameters().set(PARAM_QUERY, query);+ target.add(sessionList);+ }++ public static PageParameters paramsOf(@Nullable String query, int page) {+ PageParameters params = new PageParameters();+ if (query != null)+ params.add(PARAM_QUERY, query);+ if (page != 0)+ params.add(PARAM_PAGE, page);+ return params;+ }++ public static PageParameters paramsOf(int page) {+ String query = null;+ User user = SecurityUtils.getAuthUser();+ if (user != null && !user.getWorkspaceQueryPersonalization().getQueries().isEmpty())+ query = user.getWorkspaceQueryPersonalization().getQueries().iterator().next().getQuery();+ else if (!getWorkspaceSetting().getNamedQueries().isEmpty())+ query = getWorkspaceSetting().getNamedQueries().iterator().next().getQuery();+ return paramsOf(query, page);+ }++ @Override+ protected Component newTopbarTitle(String componentId) {+ return new Label(componentId, _T("Workspaces"));+ }++ @Override+ protected String getPageTitle() {+ return _T("Workspaces") + " - " + OneDev.getInstance(SettingService.class).getBrandingSetting().getName();+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/resource/BuildLogResource.java b/server-core/src/main/java/io/onedev/server/web/resource/BuildLogResource.javaindex b64119f23f..e1607c5bc9 100644--- a/server-core/src/main/java/io/onedev/server/web/resource/BuildLogResource.java+++ b/server-core/src/main/java/io/onedev/server/web/resource/BuildLogResource.java@@ -1,20 +1,13 @@package io.onedev.server.web.resource;-import io.onedev.k8shelper.KubernetesHelper;-import io.onedev.server.OneDev;-import io.onedev.server.cluster.ClusterService;-import io.onedev.server.service.BuildService;-import io.onedev.server.service.ProjectService;-import io.onedev.server.job.log.LogService;-import io.onedev.server.model.Build;-import io.onedev.server.model.Project;-import io.onedev.server.security.SecurityUtils;-import io.onedev.server.util.IOUtils;-import org.apache.shiro.authz.UnauthorizedException;-import org.apache.tika.mime.MimeTypes;-import org.apache.wicket.request.cycle.RequestCycle;-import org.apache.wicket.request.mapper.parameter.PageParameters;-import org.apache.wicket.request.resource.AbstractResource;+import static io.onedev.server.util.IOUtils.BUFFER_SIZE;++import java.io.IOException;+import java.io.InputStream;+import java.io.OutputStream;+import java.io.UnsupportedEncodingException;+import java.net.URLEncoder;+import java.nio.charset.StandardCharsets;import javax.persistence.EntityNotFoundException;import javax.ws.rs.client.Client;@@ -23,14 +16,24 @@ import javax.ws.rs.client.Invocation;import javax.ws.rs.client.WebTarget;import javax.ws.rs.core.HttpHeaders;import javax.ws.rs.core.Response;-import java.io.IOException;-import java.io.InputStream;-import java.io.OutputStream;-import java.io.UnsupportedEncodingException;-import java.net.URLEncoder;-import java.nio.charset.StandardCharsets;-import static io.onedev.server.util.IOUtils.BUFFER_SIZE;+import org.apache.shiro.authz.UnauthorizedException;+import org.apache.tika.mime.MimeTypes;+import org.apache.wicket.request.cycle.RequestCycle;+import org.apache.wicket.request.mapper.parameter.PageParameters;+import org.apache.wicket.request.resource.AbstractResource;++import io.onedev.k8shelper.KubernetesHelper;+import io.onedev.server.OneDev;+import io.onedev.server.cluster.ClusterService;+import io.onedev.server.logging.BuildLoggingIdentity;+import io.onedev.server.logging.LogService;+import io.onedev.server.model.Build;+import io.onedev.server.model.Project;+import io.onedev.server.security.SecurityUtils;+import io.onedev.server.service.BuildService;+import io.onedev.server.service.ProjectService;+import io.onedev.server.util.IOUtils;public class BuildLogResource extends AbstractResource {@@ -50,9 +53,8 @@ public class BuildLogResource extends AbstractResource {throw new IllegalArgumentException("build number has to be specified");if (!SecurityUtils.isSystem()) {- Project project = OneDev.getInstance(ProjectService.class).load(projectId);-- Build build = OneDev.getInstance(BuildService.class).find(project, buildNumber);+ Project project = getProjectService().load(projectId);+ Build build = getBuildService().find(project, buildNumber);if (build == null) {String message = String.format("Unable to find build (project: %s, build number: %d)",@@ -78,13 +80,12 @@ public class BuildLogResource extends AbstractResource {@Overridepublic void writeData(Attributes attributes) throws IOException {- ProjectService projectService = OneDev.getInstance(ProjectService.class);- String activeServer = projectService.getActiveServer(projectId, true);- ClusterService clusterService = OneDev.getInstance(ClusterService.class);- LogService logService = OneDev.getInstance(LogService.class);+ String activeServer = getProjectService().getActiveServer(projectId, true);+ var clusterService = getClusterService();if (activeServer.equals(clusterService.getLocalServerAddress())) {+ var loggingIdentity = new BuildLoggingIdentity(projectId, buildNumber);try (- InputStream is = logService.openLogStream(projectId, buildNumber);+ InputStream is = getLogService().openLogStream(loggingIdentity);OutputStream os = attributes.getResponse().getOutputStream()) {IOUtils.copy(is, os, BUFFER_SIZE);}@@ -120,6 +121,22 @@ public class BuildLogResource extends AbstractResource {return response;}+ private ProjectService getProjectService() {+ return OneDev.getInstance(ProjectService.class);+ }++ private ClusterService getClusterService() {+ return OneDev.getInstance(ClusterService.class);+ }++ private LogService getLogService() {+ return OneDev.getInstance(LogService.class);+ }++ private BuildService getBuildService() {+ return OneDev.getInstance(BuildService.class);+ }+public static PageParameters paramsOf(Long projectId, Long buildNumber) {PageParameters params = new PageParameters();params.set(PARAM_PROJECT, projectId);diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_de.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_de.javaindex 862272edb8..e6a9b98d80 100644--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_de.java+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_de.java@@ -1397,8 +1397,8 @@ public class Translation_de extends TranslationResourceBundle {"Für Build-Commit, der vom Standardzweig nicht erreichbar ist, sollte ein <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>Job-Geheimnis</a> als Zugriffstoken mit Berechtigung zum Erstellen von Tags angegeben werden");m.put("For build commit not reachable from default branch, a <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> should be specified as access token with manage issue permission","Für Build-Commit, der vom Standardzweig nicht erreichbar ist, sollte ein <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>Job-Geheimnis</a> als Zugriffstoken mit Berechtigung zum Verwalten von Problemen angegeben werden");- m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>). For shell related executors which runs on host machine directly, only relative path is accepted",- "Für Docker-fähige Executor befindet sich dieser Pfad im Container und akzeptiert sowohl absolute als auch relative Pfade (relativ zu <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a>). Für Shell-bezogene Executor, die direkt auf der Host-Maschine laufen, werden nur relative Pfade akzeptiert");+ m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>). For shell related executors which runs on host machine directly, only relative path is accepted",+ "Für Docker-fähige Executor befindet sich dieser Pfad im Container und akzeptiert sowohl absolute als auch relative Pfade (relativ zu <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a>). Für Shell-bezogene Executor, die direkt auf der Host-Maschine laufen, werden nur relative Pfade akzeptiert");m.put("For each build, OneDev calculates a list of fixed issues since previous build automatically. This setting provides a default query to further filter/order this list. For a given job, the first matching entry will be used.","Für jeden Build berechnet OneDev automatisch eine Liste von behobenen Problemen seit dem vorherigen Build. Diese Einstellung bietet eine Standardabfrage, um diese Liste weiter zu filtern/zu ordnen. Für einen bestimmten Job wird der erste passende Eintrag verwendet.");m.put("For each selected branch/tag, a separate build will be generated with branch/tag set to corresponding value",@@ -2346,7 +2346,7 @@ public class Translation_de extends TranslationResourceBundle {m.put("Optionally filter issues", "Optional Issues filtern");m.put("Optionally filter pull requests", "Optional Pull-Requests filtern");m.put("Optionally leave a note", "Optional eine Notiz hinterlassen");- m.put("Optionally mount directories or files under job workspace into container", "Optional Verzeichnisse oder Dateien unter dem Job-Arbeitsbereich in den Container einbinden");+ m.put("Optionally mount directories or files under job workdir into container", "Optional Verzeichnisse oder Dateien unter dem Job-Arbeitsbereich in den Container einbinden");m.put("Optionally select fields to prompt when this button is pressed", "Optional Felder auswählen, die angezeigt werden sollen, wenn diese Schaltfläche gedrückt wird");m.put("Optionally select fields to remove when this transition happens", "Optional Felder auswählen, die entfernt werden sollen, wenn dieser Übergang stattfindet");m.put("Optionally specifies name of the attribute inside the user LDAP entry whose value will be taken as user email. This field is normally set to <i>mail</i> according to RFC 2798",@@ -2366,8 +2366,8 @@ public class Translation_de extends TranslationResourceBundle {m.put("Optionally specify <span class='text-info'>comma separated</span> platforms to scan, for instance <tt>linux/amd64,linux/arm64</tt>. Leave empty to scan all platforms in OCI layout","Optional geben Sie <span class='text-info'>kommagetrennte</span> Plattformen zum Scannen an, beispielsweise <tt>linux/amd64,linux/arm64</tt>. Lassen Sie das Feld leer, um alle Plattformen im OCI-Layout zu scannen");m.put("Optionally specify API key for authentication", "Optional API-Schlüssel für Authentifizierung angeben");- m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",- "Optional geben Sie die Dockerfile relativ zu <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a> an. Lassen Sie das Feld leer, um die Datei <tt>Dockerfile</tt> unter dem oben angegebenen Build-Pfad zu verwenden");+ m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",+ "Optional geben Sie die Dockerfile relativ zu <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a> an. Lassen Sie das Feld leer, um die Datei <tt>Dockerfile</tt> unter dem oben angegebenen Build-Pfad zu verwenden");m.put("Optionally specify JavaScript config to be used by Renovate CLI", "Optional geben Sie die JavaScript-Konfiguration an, die von der Renovate-CLI verwendet werden soll");m.put("Optionally specify SSH root URL, which will be used to construct project clone url via SSH protocol. Leave empty to derive from server url","Optional geben Sie die SSH-Root-URL an, die verwendet wird, um die Projekt-Klon-URL über das SSH-Protokoll zu erstellen. Lassen Sie das Feld leer, um es von der Server-URL abzuleiten");@@ -2385,8 +2385,8 @@ public class Translation_de extends TranslationResourceBundle {"Optional geben Sie einen Cron-Ausdruck an, um die automatische Datenbanksicherung zu planen. Das Cron-Ausdrucksformat ist <em><Sekunden> <Minuten> <Stunden> <Tag-des-Monats> <Monat> <Tag-der-Woche></em>. Zum Beispiel bedeutet <em>0 0 1 * * ?</em> 1:00 Uhr morgens jeden Tag. Einzelheiten zum Format finden Sie im <a href='http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html#format' target='_blank'>Quartz-Tutorial</a>. Die Sicherungsdateien werden im Ordner <em>db-backup</em> unter dem OneDev-Installationsverzeichnis abgelegt. Wenn mehrere Server verbunden sind, um einen Cluster zu bilden, erfolgt die automatische Sicherung auf dem <a href='https://docs.onedev.io/concepts#lead-server' target='_blank'>Leitserver</a>. Lassen Sie diese Eigenschaft leer, wenn Sie die automatische Datenbanksicherung nicht aktivieren möchten.");m.put("Optionally specify a date field to hold due date information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Optional geben Sie ein Datumsfeld an, um Informationen zum Fälligkeitsdatum zu speichern.<br><b>HINWEIS: </b> Sie können die OneDev-Probleme-Felder anpassen, falls hier keine geeignete Option vorhanden ist");- m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to put retrieved artifacts. Leave empty to use job workspace itself",- "Optional geben Sie einen Pfad relativ zu <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, um abgerufene Artefakte abzulegen. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden");+ m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to put retrieved artifacts. Leave empty to use job workdir itself",+ "Optional geben Sie einen Pfad relativ zu <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, um abgerufene Artefakte abzulegen. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden");m.put("Optionally specify a storage class to allocate build volume dynamically. Leave empty to use default storage class. <b class='text-warning'>NOTE:</b> Reclaim policy of the storage class should be set to <code>Delete</code>, as the volume is only used to hold temporary build files","Optional geben Sie eine Speicherklasse an, um das Build-Volume dynamisch zuzuweisen. Lassen Sie das Feld leer, um die Standard-Speicherklasse zu verwenden. <b class='text-warning'>HINWEIS:</b> Die Rückgewinnungsrichtlinie der Speicherklasse sollte auf <code>Delete</code> gesetzt werden, da das Volume nur zum Speichern temporärer Build-Dateien verwendet wird");m.put("Optionally specify a working period field to hold estimated time infomration.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",@@ -2405,17 +2405,17 @@ public class Translation_de extends TranslationResourceBundle {m.put("Optionally specify applicable jobs of this executor", "Optional anwendbare Jobs für diesen Executor angeben");m.put("Optionally specify applicable users who pushed the change", "Geben Sie optional an, welche Benutzer die Änderung gepusht haben");m.put("Optionally specify arguments to run above image", "Optional geben Sie Argumente an, um das obige Image auszuführen");- m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",- "Optional geben Sie Artefakte an, die aus der Abhängigkeit in den <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> abgerufen werden sollen. Nur veröffentlichte Artefakte (über den Artefakt-Veröffentlichungsschritt) können abgerufen werden. Lassen Sie das Feld leer, um keine Artefakte abzurufen");+ m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",+ "Optional geben Sie Artefakte an, die aus der Abhängigkeit in den <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> abgerufen werden sollen. Nur veröffentlichte Artefakte (über den Artefakt-Veröffentlichungsschritt) können abgerufen werden. Lassen Sie das Feld leer, um keine Artefakte abzurufen");m.put("Optionally specify authorized roles to press this button. If not specified, all users are allowed","Optional geben Sie autorisierte Rollen an, um diese Schaltfläche zu drücken. Wenn nicht angegeben, sind alle Benutzer berechtigt");m.put("Optionally specify base query of the list", "Optional geben Sie die Basisabfrage der Liste an");m.put("Optionally specify branches/users/groups allowed to access this secret. If left empty, any job can access this secret, including those triggered via external pull requests","Optional geben Sie Zweige/Benutzer/Gruppen an, die Zugriff auf dieses Geheimnis haben. Wenn leer gelassen, kann jeder Job auf dieses Geheimnis zugreifen, einschließlich derjenigen, die über externe Pull-Anfragen ausgelöst werden");- m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",- "Optional geben Sie den Build-Kontextpfad relativ zu <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a> an. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden. Die Datei <code>Dockerfile</code> wird im Build-Kontextverzeichnis erwartet, es sei denn, Sie geben einen anderen Speicherort mit der Option <code>--dockerfile</code> an");- m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself",- "Optional geben Sie den Build-Pfad relativ zu <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a> an. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden");+ m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",+ "Optional geben Sie den Build-Kontextpfad relativ zu <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a> an. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden. Die Datei <code>Dockerfile</code> wird im Build-Kontextverzeichnis erwartet, es sei denn, Sie geben einen anderen Speicherort mit der Option <code>--dockerfile</code> an");+ m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself",+ "Optional geben Sie den Build-Pfad relativ zu <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a> an. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden");m.put("Optionally specify cluster role the job pods service account binding to. This is necessary if you want to do things such as running other Kubernetes pods in job command","Optional geben Sie die Cluster-Rolle an, an die das Service-Konto der Job-Pods gebunden ist. Dies ist erforderlich, wenn Sie Dinge wie das Ausführen anderer Kubernetes-Pods im Job-Befehl ausführen möchten");m.put("Optionally specify container arguments separated by space. Single argument containing space should be quoted. <b class='text-warning'>Note: </b> do not confuse this with container options which should be specified in executor setting",@@ -2478,13 +2478,13 @@ public class Translation_de extends TranslationResourceBundle {"Optional geben Sie Optionen für den SSH-Befehl an. Mehrere Optionen müssen durch Leerzeichen getrennt werden");m.put("Optionally specify options passed to renovate cli. Multiple options should be separated by space, and single option containing spaces should be quoted","Optional geben Sie Optionen an, die an die Renovate-CLI übergeben werden. Mehrere Optionen sollten durch Leerzeichen getrennt werden, und einzelne Optionen, die Leerzeichen enthalten, sollten in Anführungszeichen gesetzt werden");- m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. You may ignore particular vulnerabilities via this file",- "Optional geben Sie die OSV-Scanner-<a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>Konfigurationsdatei</a> unter <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a> an. Sie können bestimmte Schwachstellen über diese Datei ignorieren");+ m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. You may ignore particular vulnerabilities via this file",+ "Optional geben Sie die OSV-Scanner-<a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>Konfigurationsdatei</a> unter <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a> an. Sie können bestimmte Schwachstellen über diese Datei ignorieren");m.put("Optionally specify path protection rules", "Optional geben Sie Pfadschutzregeln an");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",- "Optional geben Sie einen Pfad relativ zu <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, der als Trivy-<a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>Ignore-Datei</a> verwendet werden soll");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to publish artifacts from. Leave empty to use job workspace itself",- "Optional geben Sie einen Pfad relativ zu <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, um Artefakte zu veröffentlichen. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",+ "Optional geben Sie einen Pfad relativ zu <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, der als Trivy-<a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>Ignore-Datei</a> verwendet werden soll");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to publish artifacts from. Leave empty to use job workdir itself",+ "Optional geben Sie einen Pfad relativ zu <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, um Artefakte zu veröffentlichen. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden");m.put("Optionally specify platform to pull, for instance <tt>linux/amd64</tt>. Leave empty to pull all platforms in image","Optional geben Sie die Plattform zum Abrufen an, beispielsweise <tt>linux/amd64</tt>. Lassen Sie das Feld leer, um alle Plattformen im Image abzurufen");m.put("Optionally specify project to show builds of. Leave empty to show builds of all projects with permissions",@@ -2498,12 +2498,12 @@ public class Translation_de extends TranslationResourceBundle {m.put("Optionally specify registry logins to override those defined in job executor. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token secret for password secret","Optional geben Sie Registrierungsanmeldungen an, um die im Job-Executor definierten zu überschreiben. Für die integrierte Registrierung verwenden Sie <code>@server_url@</code> für die Registrierungs-URL, <code>@job_token@</code> für den Benutzernamen und das Zugriffstoken-Geheimnis für das Passwort-Geheimnis");m.put("Optionally specify relative directory to put uploaded files", "Optional geben Sie ein relatives Verzeichnis an, um hochgeladene Dateien abzulegen");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to clone code into. Leave empty to use job workspace itself",- "Optional geben Sie einen relativen Pfad unter <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, um Code zu klonen. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan. Leave empty to use job workspace itself",- "Optional geben Sie einen relativen Pfad unter <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, um zu scannen. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden");- m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workspace itself",- "Optional geben Sie relative Pfade unter <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, um Schwachstellen in Abhängigkeiten zu scannen. Mehrere Pfade können angegeben und sollten durch Leerzeichen getrennt werden. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to clone code into. Leave empty to use job workdir itself",+ "Optional geben Sie einen relativen Pfad unter <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, um Code zu klonen. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan. Leave empty to use job workdir itself",+ "Optional geben Sie einen relativen Pfad unter <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, um zu scannen. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden");+ m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workdir itself",+ "Optional geben Sie relative Pfade unter <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, um Schwachstellen in Abhängigkeiten zu scannen. Mehrere Pfade können angegeben und sollten durch Leerzeichen getrennt werden. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu verwenden");m.put("Optionally specify required reviewers for changes of specified branch", "Optional geben Sie erforderliche Prüfer für Änderungen des angegebenen Zweigs an");m.put("Optionally specify revision to create branch from. Leave empty to create from build commit","Optional geben Sie die Revision an, um den Zweig zu erstellen. Lassen Sie das Feld leer, um vom Build-Commit zu erstellen");@@ -3117,8 +3117,8 @@ public class Translation_de extends TranslationResourceBundle {m.put("Run job", "Job ausführen");m.put("Run job in another project", "Job in einem anderen Projekt ausführen");m.put("Run on Bare Metal/Virtual Machine", "Auf Bare Metal/virtueller Maschine ausführen");- m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKSPACE</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",- "Führen Sie den angegebenen Docker-Container aus. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a> wird in den Container eingebunden und sein Pfad wird in der Umgebungsvariable <code>ONEDEV_WORKSPACE</code> platziert. <b class='text-warning'>Hinweis: </b> Dieser Schritt kann nur vom Server-Docker-Executor oder Remote-Docker-Executor ausgeführt werden");+ m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKDIR</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",+ "Führen Sie den angegebenen Docker-Container aus. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a> wird in den Container eingebunden und sein Pfad wird in der Umgebungsvariable <code>ONEDEV_WORKDIR</code> platziert. <b class='text-warning'>Hinweis: </b> Dieser Schritt kann nur vom Server-Docker-Executor oder Remote-Docker-Executor ausgeführt werden");m.put("Run specified step template", "Ausgewählte Schrittvorlage ausführen");m.put("Run this job", "Diesen Job ausführen");m.put("Run trivy container image scanner to find issues in specified image. For vulnerabilities, it checks various <a href='https://aquasecurity.github.io/trivy/v0.50/docs/coverage/language/#supported-languages' target='_blank'>distribution files</a>. It can only be executed by docker aware executor.",@@ -3391,47 +3391,47 @@ public class Translation_de extends TranslationResourceBundle {m.put("Specifies who can access this AI service", "Gibt an, wer auf diesen AI-Dienst zugreifen kann");m.put("Specifies who can access this AI service. AI service can be accessed in below approaches:","Gibt an, wer auf diesen KI-Dienst zugreifen kann. Der KI-Dienst kann auf folgende Weise zugegriffen werden:");- m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",- "Gibt die relative .net TRX-Testergebnisdatei zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, z. B. <tt>TestResults/*.trx</tt>. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",+ "Gibt die relative .net TRX-Testergebnisdatei zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, z. B. <tt>TestResults/*.trx</tt>. Verwenden Sie * oder ? für Musterabgleich");m.put("Specify <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> whose value is access token with code write permission over above projects. Commits, issues, and pull requests will also be created under name of the access token owner","Gibt ein <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>Job-Geheimnis</a> an, dessen Wert ein Zugriffstoken mit Schreibberechtigung für Code über die oben genannten Projekte ist. Commits, Issues und Pull-Requests werden auch unter dem Namen des Zugriffstoken-Besitzers erstellt");- m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",- "Gibt die relative <a href='https://github.com/rust-lang/rust-clippy'>Rust Clippy</a>-JSON-Ausgabedatei zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an. Diese Datei kann mit der Clippy-JSON-Ausgabeoption generiert werden, z. B. <code>cargo clippy --message-format json>check-result.json</code>. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",+ "Gibt die relative <a href='https://github.com/rust-lang/rust-clippy'>Rust Clippy</a>-JSON-Ausgabedatei zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an. Diese Datei kann mit der Clippy-JSON-Ausgabeoption generiert werden, z. B. <code>cargo clippy --message-format json>check-result.json</code>. Verwenden Sie * oder ? für Musterabgleich");m.put("Specify Build Options", "Gibt Build-Optionen an");- m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",- "Gibt die relative CPD-Ergebnis-XML-Datei zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, z. B. <tt>target/cpd.xml</tt>. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",+ "Gibt die relative CPD-Ergebnis-XML-Datei zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, z. B. <tt>target/cpd.xml</tt>. Verwenden Sie * oder ? für Musterabgleich");m.put("Specify Commit Message", "Gibt die Commit-Nachricht an");- m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",- "Gibt die ESLint-Berichtsdatei im Checkstyle-Format unter <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an. Diese Datei kann mit der ESLint-Option <tt>'-f checkstyle'</tt> und <tt>'-o'</tt> generiert werden. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",+ "Gibt die ESLint-Berichtsdatei im Checkstyle-Format unter <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an. Diese Datei kann mit der ESLint-Option <tt>'-f checkstyle'</tt> und <tt>'-o'</tt> generiert werden. Verwenden Sie * oder ? für Musterabgleich");m.put("Specify GitHub API url, for instance <tt>https://api.github.com</tt>", "Gibt die GitHub-API-URL an, z. B. <tt>https://api.github.com</tt>");m.put("Specify GitLab API url, for instance <tt>https://gitlab.example.com/api/v4</tt>", "Gibt die GitLab-API-URL an, z. B. <tt>https://gitlab.example.com/api/v4</tt>");m.put("Specify Gitea API url, for instance <tt>https://gitea.example.com/api/v1</tt>", "Gibt die Gitea-API-URL an, z. B. <tt>https://gitea.example.com/api/v1</tt>");- m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",- "Gibt die relative GoogleTest-XML-Ergebnisdatei zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an. Dieser Bericht kann mit der Umgebungsvariable <tt>GTEST_OUTPUT</tt> beim Testen generiert werden, z. B. <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",+ "Gibt die relative GoogleTest-XML-Ergebnisdatei zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an. Dieser Bericht kann mit der Umgebungsvariable <tt>GTEST_OUTPUT</tt> beim Testen generiert werden, z. B. <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Verwenden Sie * oder ? für Musterabgleich");m.put("Specify IMAP user name.<br><b class='text-danger'>NOTE: </b> This account should be able to receive emails sent to system email address specified above","Gibt den IMAP-Benutzernamen an.<br><b class='text-danger'>HINWEIS: </b> Dieses Konto sollte in der Lage sein, E-Mails zu empfangen, die an die oben angegebene System-E-Mail-Adresse gesendet werden");- m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",- "Gibt die JUnit-Testergebnisdatei im XML-Format relativ zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, z. B. <tt>target/surefire-reports/TEST-*.xml</tt>. Verwenden Sie * oder ? für Musterabgleich");- m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",- "Gibt die relative JaCoCo-Abdeckungs-XML-Berichtsdatei zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, z. B. <tt>target/site/jacoco/jacoco.xml</tt>. Verwenden Sie * oder ? für Musterabgleich");- m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",- "Gibt die relative Jest-Abdeckungs-Berichtsdatei im Clover-Format zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, z. B. <tt>coverage/clover.xml</tt>. Diese Datei kann mit der Jest-Option <tt>'--coverage'</tt> generiert werden. Verwenden Sie * oder ? für Musterabgleich");- m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",- "Gibt die relative Jest-Testergebnisdatei im JSON-Format zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an. Diese Datei kann über die Jest-Option <tt>'--json'</tt> und <tt>'--outputFile'</tt> generiert werden. Verwenden Sie * oder ? für Musterabgleich");- m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Gibt das OCI-Layout-Verzeichnis des zu scannenden Images an. Dieses Verzeichnis kann über den Build-Image-Schritt oder den Pull-Image-Schritt generiert werden. Es sollte relativ zum <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a> sein");- m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to push from",- "Gibt das relative OCI-Layout-Verzeichnis zum <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a> an, von dem aus gepusht werden soll");+ m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",+ "Gibt die JUnit-Testergebnisdatei im XML-Format relativ zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, z. B. <tt>target/surefire-reports/TEST-*.xml</tt>. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",+ "Gibt die relative JaCoCo-Abdeckungs-XML-Berichtsdatei zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, z. B. <tt>target/site/jacoco/jacoco.xml</tt>. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",+ "Gibt die relative Jest-Abdeckungs-Berichtsdatei im Clover-Format zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, z. B. <tt>coverage/clover.xml</tt>. Diese Datei kann mit der Jest-Option <tt>'--coverage'</tt> generiert werden. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",+ "Gibt die relative Jest-Testergebnisdatei im JSON-Format zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an. Diese Datei kann über die Jest-Option <tt>'--json'</tt> und <tt>'--outputFile'</tt> generiert werden. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Gibt das OCI-Layout-Verzeichnis des zu scannenden Images an. Dieses Verzeichnis kann über den Build-Image-Schritt oder den Pull-Image-Schritt generiert werden. Es sollte relativ zum <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a> sein");+ m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to push from",+ "Gibt das relative OCI-Layout-Verzeichnis zum <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a> an, von dem aus gepusht werden soll");m.put("Specify OpenID scopes to request", "Gibt die OpenID-Bereiche an, die angefordert werden sollen");- m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",- "Gibt die relative PMD-Ergebnis-XML-Datei zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, z. B. <tt>target/pmd.xml</tt>. Verwenden Sie * oder ? für Musterabgleich");- m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",- "Gibt die PowerShell-Befehle an, die unter dem <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a> ausgeführt werden sollen.<br><b class='text-warning'>HINWEIS: </b> OneDev überprüft den Exit-Code des Skripts, um festzustellen, ob der Schritt erfolgreich ist. Da PowerShell immer mit 0 beendet wird, auch wenn Skriptfehler vorliegen, sollten Sie Fehler im Skript behandeln und mit einem Nicht-Null-Code beenden oder die Zeile <code>$ErrorActionPreference = "Stop"</code> am Anfang Ihres Skripts hinzufügen<br>");- m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",- "Gibt die relative Roslynator-Diagnose-Ausgabedatei im XML-Format zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an. Diese Datei kann mit der Option <i>-o</i> generiert werden. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",+ "Gibt die relative PMD-Ergebnis-XML-Datei zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, z. B. <tt>target/pmd.xml</tt>. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",+ "Gibt die PowerShell-Befehle an, die unter dem <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a> ausgeführt werden sollen.<br><b class='text-warning'>HINWEIS: </b> OneDev überprüft den Exit-Code des Skripts, um festzustellen, ob der Schritt erfolgreich ist. Da PowerShell immer mit 0 beendet wird, auch wenn Skriptfehler vorliegen, sollten Sie Fehler im Skript behandeln und mit einem Nicht-Null-Code beenden oder die Zeile <code>$ErrorActionPreference = "Stop"</code> am Anfang Ihres Skripts hinzufügen<br>");+ m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",+ "Gibt die relative Roslynator-Diagnose-Ausgabedatei im XML-Format zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an. Diese Datei kann mit der Option <i>-o</i> generiert werden. Verwenden Sie * oder ? für Musterabgleich");m.put("Specify Shell/Batch Commands to Run", "Gibt Shell-/Batch-Befehle zum Ausführen an");- m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",- "Gibt die relative SpotBugs-Ergebnis-XML-Datei zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, z. B. <tt>target/spotbugsXml.xml</tt>. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",+ "Gibt die relative SpotBugs-Ergebnis-XML-Datei zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, z. B. <tt>target/spotbugsXml.xml</tt>. Verwenden Sie * oder ? für Musterabgleich");m.put("Specify System Settings", "Gibt Systemeinstellungen an");m.put("Specify URL of remote git repository. Only http/https protocol is supported", "Gibt die URL des Remote-Git-Repositorys an. Es wird nur das http/https-Protokoll unterstützt");m.put("Specify YouTrack login name. This account should have permission to:<ul><li>Read full information and issues of the projects you want to import<li>Read issue tags<li>Read user basic information</ul>",@@ -3466,14 +3466,14 @@ public class Translation_de extends TranslationResourceBundle {m.put("Specify a Docker Image to Test Against", "Gibt ein Docker-Image an, gegen das getestet werden soll");m.put("Specify a custom field of Enum type", "Gibt ein benutzerdefiniertes Feld vom Typ Enum an");m.put("Specify a default query to filter/order fixed issues of specified jobs", "Gibt eine Standardabfrage an, um behobene Issues der angegebenen Jobs zu filtern/zu sortieren");- m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to write checksum into",- "Gibt eine Datei relativ zum <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a> an, in die die Prüfsumme geschrieben werden soll");+ m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to write checksum into",+ "Gibt eine Datei relativ zum <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a> an, in die die Prüfsumme geschrieben werden soll");m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Gibt ein mehrwertiges Benutzerfeld an, um Informationen zu den Zuweisungen zu speichern.<b>HINWEIS: </b> Sie können die OneDev-Issue-Felder anpassen, falls hier keine geeignete Option vorhanden ist");m.put("Specify a multi-value user field to hold assignees information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Gibt ein mehrwertiges Benutzerfeld an, um Informationen zu den Zuweisungen zu speichern.<br><b>HINWEIS: </b> Sie können die OneDev-Issue-Felder anpassen, falls hier keine geeignete Option vorhanden ist");m.put("Specify a path inside container to be used as mount target", "Gibt einen Pfad innerhalb des Containers an, der als Mount-Ziel verwendet werden soll");- m.put("Specify a path relative to job workspace to be used as mount source. Leave empty to mount job workspace itself",+ m.put("Specify a path relative to job workdir to be used as mount source. Leave empty to mount job workdir itself","Gibt einen Pfad relativ zum Job-Arbeitsbereich an, der als Mount-Quelle verwendet werden soll. Lassen Sie das Feld leer, um den Job-Arbeitsbereich selbst zu mounten");m.put("Specify a secret to be used as access token to create issue in above project if it is not publicly accessible","Gibt ein Geheimnis an, das als Zugriffstoken verwendet werden soll, um ein Issue im oben genannten Projekt zu erstellen, falls es nicht öffentlich zugänglich ist");@@ -3499,8 +3499,8 @@ public class Translation_de extends TranslationResourceBundle {m.put("Specify application (client) ID of the app registered in Entra ID", "Gibt die Anwendungs-(Client)-ID der in Entra ID registrierten App an");m.put("Specify arguments for imagetools. For instance <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>","Gibt Argumente für Imagetools an. Zum Beispiel <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>");- m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved.",- "Gibt Artefakte an, die in den <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> abgerufen werden sollen. Nur veröffentlichte Artefakte (über den Artefakt-Veröffentlichungsschritt) können abgerufen werden");+ m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved.",+ "Gibt Artefakte an, die in den <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> abgerufen werden sollen. Nur veröffentlichte Artefakte (über den Artefakt-Veröffentlichungsschritt) können abgerufen werden");m.put("Specify at least 10 alphanumeric chars to be used as secret, and then add an inbound parse entry at SendGrid side:<ul><li><code>Destination URL</code> should be set to <i><OneDev root url>/~sendgrid/<secret></i>, for instance, <i>https://onedev.example.com/~sendgrid/1234567890</i>. Note that in production environment, <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>https should be enabled</a> to protect the secret</li><li><code>Receiving domain</code> should be the same as domain part of system email address specified above</li><li>Option <code>POST the raw, full MIME message</code> is enabled</li></ul>","Gibt mindestens 10 alphanumerische Zeichen an, die als Geheimnis verwendet werden sollen, und fügt dann einen eingehenden Parse-Eintrag auf der SendGrid-Seite hinzu:<ul><li><code>Destination URL</code> sollte auf <i><OneDev root url>/~sendgrid/<secret></i> gesetzt werden, z. B. <i>https://onedev.example.com/~sendgrid/1234567890</i>. Beachten Sie, dass in einer Produktionsumgebung <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>HTTPS aktiviert sein sollte</a>, um das Geheimnis zu schützen</li><li><code>Receiving domain</code> sollte mit dem Domain-Teil der oben angegebenen System-E-Mail-Adresse übereinstimmen</li><li>Option <code>POST the raw, full MIME message</code> ist aktiviert</li></ul>");m.put("Specify base nodes for user search. For example: <i>cn=Users, dc=example, dc=com</i>",@@ -3516,13 +3516,13 @@ public class Translation_de extends TranslationResourceBundle {"Gibt das Zertifikat an, dem vertraut werden soll, falls Sie ein selbstsigniertes Zertifikat für das Remote-Repository verwenden");m.put("Specify certificates to trust if you are using self-signed certificates for your docker registries","Gibt Zertifikate an, denen vertraut werden soll, falls Sie selbstsignierte Zertifikate für Ihre Docker-Registrierungen verwenden");- m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",- "Gibt die relative Checkstyle-Ergebnis-XML-Datei zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, z. B. <tt>target/checkstyle-result.xml</tt>. Siehe <a href='https://checkstyle.org/'>Checkstyle-Dokumentation</a>, wie die Ergebnis-XML-Datei generiert wird. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",+ "Gibt die relative Checkstyle-Ergebnis-XML-Datei zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, z. B. <tt>target/checkstyle-result.xml</tt>. Siehe <a href='https://checkstyle.org/'>Checkstyle-Dokumentation</a>, wie die Ergebnis-XML-Datei generiert wird. Verwenden Sie * oder ? für Musterabgleich");m.put("Specify client secret of the app registered in Entra ID", "Gibt das Client-Geheimnis der in Entra ID registrierten App an");- m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",- "Gibt die relative Clover-Abdeckungs-XML-Berichtsdatei zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, z. B. <tt>target/site/clover/clover.xml</tt>. Siehe <a href='https://openclover.org/documentation'>OpenClover-Dokumentation</a>, wie die Clover-XML-Datei generiert wird. Verwenden Sie * oder ? für Musterabgleich");- m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",- "Gibt die relative Cobertura-Abdeckungs-XML-Berichtsdatei zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, z. B. <tt>target/site/cobertura/coverage.xml</tt>. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",+ "Gibt die relative Clover-Abdeckungs-XML-Berichtsdatei zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, z. B. <tt>target/site/clover/clover.xml</tt>. Siehe <a href='https://openclover.org/documentation'>OpenClover-Dokumentation</a>, wie die Clover-XML-Datei generiert wird. Verwenden Sie * oder ? für Musterabgleich");+ m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",+ "Gibt die relative Cobertura-Abdeckungs-XML-Berichtsdatei zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, z. B. <tt>target/site/cobertura/coverage.xml</tt>. Verwenden Sie * oder ? für Musterabgleich");m.put("Specify color of the state for displaying purpose", "Gibt die Farbe des Status für Anzeigezwecke an");m.put("Specify columns of the board. Each column corresponds to a value of the issue field specified above","Gibt die Spalten des Boards an. Jede Spalte entspricht einem Wert des oben angegebenen Issue-Felds");@@ -3535,8 +3535,8 @@ public class Translation_de extends TranslationResourceBundle {"Geben Sie die Konfigurations-Discovery-URL Ihres OpenID-Anbieters an, beispielsweise: <code>https://openid.example.com/.well-known/openid-configuration</code>. Stellen Sie sicher, dass Sie das HTTPS-Protokoll verwenden, da OneDev auf TLS-Verschlüsselung angewiesen ist, um die Token-Gültigkeit zu gewährleisten.");m.put("Specify container image to execute commands inside", "Geben Sie ein Container-Image an, um Befehle darin auszuführen.");m.put("Specify container image to run", "Geben Sie ein Container-Image zum Ausführen an.");- m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",- "Geben Sie die cppcheck-XML-Ergebnisdatei relativ zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an. Diese Datei kann mit der cppcheck-XML-Ausgabeoption generiert werden, beispielsweise <code>cppcheck src --xml 2>check-result.xml</code>. Verwenden Sie * oder ? für Musterabgleich.");+ m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",+ "Geben Sie die cppcheck-XML-Ergebnisdatei relativ zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an. Diese Datei kann mit der cppcheck-XML-Ausgabeoption generiert werden, beispielsweise <code>cppcheck src --xml 2>check-result.xml</code>. Verwenden Sie * oder ? für Musterabgleich.");m.put("Specify cpu request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","Geben Sie die CPU-Anforderung für jeden Job/Dienst an, der diesen Executor verwendet. Weitere Informationen finden Sie unter <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes-Ressourcenmanagement</a>.");m.put("Specify default assignees of pull requests submitted to this project. Only users with the write code permission to the project can be selected",@@ -3545,8 +3545,8 @@ public class Translation_de extends TranslationResourceBundle {m.put("Specify destinations, for instance <tt>registry-server:5000/myorg/myrepo:latest</tt>. Make sure to use <b>same host</b> as specified in server url of system settings if you want to push to built-in registry, or simply use the form <tt>@server@/<project path>/<repo name>:<tag name></tt>. Multiple destinations should be separated with space","Geben Sie Ziele an, beispielsweise <tt>registry-server:5000/myorg/myrepo:latest</tt>. Stellen Sie sicher, dass Sie <b>denselben Host</b> verwenden, wie in der Server-URL der Systemeinstellungen angegeben, wenn Sie in das integrierte Registry pushen möchten, oder verwenden Sie einfach die Form <tt>@server@/<project path>/<repo name>:<tag name></tt>. Mehrere Ziele sollten durch Leerzeichen getrennt werden.");m.put("Specify directory (tenant) ID of the app registered in Entra ID", "Geben Sie die Verzeichnis-(Mandanten-)ID der in Entra ID registrierten App an.");- m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "Geben Sie ein Verzeichnis relativ zum <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a> an, um das OCI-Layout zu speichern.");+ m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "Geben Sie ein Verzeichnis relativ zum <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a> an, um das OCI-Layout zu speichern.");m.put("Specify docker image of the service", "Geben Sie das Docker-Image des Dienstes an.");m.put("Specify dockerx builder used to build docker image. OneDev will create the builder automatically if it does not exist. Check <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>this tutorial</a> on how to customize the builder for instance to allow publishing to insecure registries","Geben Sie den dockerx-Builder an, der zum Erstellen des Docker-Images verwendet wird. OneDev erstellt den Builder automatisch, wenn er nicht existiert. Weitere Informationen zur Anpassung des Builders, beispielsweise um das Veröffentlichen in unsicheren Registries zu ermöglichen, finden Sie in <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>diesem Tutorial</a>.");@@ -3557,10 +3557,10 @@ public class Translation_de extends TranslationResourceBundle {"Geben Sie Felder für verschiedene Probleme an, die von Renovate erstellt wurden, um die Abhängigkeitsaktualisierung zu orchestrieren.");m.put("Specify fields to be displayed in the issue list", "Geben Sie die Felder an, die in der Problemliste angezeigt werden sollen.");m.put("Specify fields to display in board card", "Geben Sie die Felder an, die auf der Board-Karte angezeigt werden sollen.");- m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published. Use * or ? for pattern match",- "Geben Sie Dateien relativ zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, die veröffentlicht werden sollen. Verwenden Sie * oder ? für Musterabgleich.");- m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Geben Sie Dateien an, aus denen eine MD5-Prüfsumme erstellt werden soll. Mehrere Dateien sollten durch Leerzeichen getrennt werden. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a>-Muster werden akzeptiert. Nicht absolute Dateien gelten als relativ zum <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a>.");+ m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published. Use * or ? for pattern match",+ "Geben Sie Dateien relativ zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, die veröffentlicht werden sollen. Verwenden Sie * oder ? für Musterabgleich.");+ m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Geben Sie Dateien an, aus denen eine MD5-Prüfsumme erstellt werden soll. Mehrere Dateien sollten durch Leerzeichen getrennt werden. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a>-Muster werden akzeptiert. Nicht absolute Dateien gelten als relativ zum <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a>.");m.put("Specify files under above directory to be published", "Geben Sie Dateien im obigen Verzeichnis an, die veröffentlicht werden sollen");m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> <code>index.html</code> should be included in these files to be served as site start page","Geben Sie Dateien unter dem oben genannten Verzeichnis an, die veröffentlicht werden sollen. Verwenden Sie * oder ? für Musterabgleich. <b>HINWEIS:</b> <code>index.html</code> sollte in diesen Dateien enthalten sein, um als Startseite der Website zu dienen.");@@ -3604,8 +3604,8 @@ public class Translation_de extends TranslationResourceBundle {m.put("Specify manager DN to authenticate OneDev itself to Active Directory. The manager DN should be specified in form of <i><account name>@<domain></i>, for instance: <i>[email protected]</i>","Geben Sie den Manager-DN an, um OneDev selbst gegenüber Active Directory zu authentifizieren. Der Manager-DN sollte in der Form <i><account name>@<domain></i> angegeben werden, beispielsweise: <i>[email protected]</i>.");m.put("Specify manager DN to authenticate OneDev itself to LDAP server", "Geben Sie den Manager-DN an, um OneDev selbst gegenüber dem LDAP-Server zu authentifizieren.");- m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published",- "Geben Sie die Markdown-Datei relativ zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, die veröffentlicht werden soll.");+ m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published",+ "Geben Sie die Markdown-Datei relativ zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, die veröffentlicht werden soll.");m.put("Specify max git LFS file size in mega bytes", "Geben Sie die maximale Git-LFS-Dateigröße in Megabyte an.");m.put("Specify max number of CPU intensive tasks the server can run concurrently, such as Git repository pull/push, repository index, etc.","Geben Sie die maximale Anzahl von CPU-intensiven Aufgaben an, die der Server gleichzeitig ausführen kann, wie das Abrufen/Pushen von Git-Repositories, Repository-Indexierung usw.");@@ -3621,8 +3621,8 @@ public class Translation_de extends TranslationResourceBundle {"Geben Sie die maximale Größe der hochgeladenen Datei in Megabyte über die Weboberfläche an. Dies gilt für Dateien, die in das Repository hochgeladen werden, Markdown-Inhalte (Issue-Kommentare usw.) und Build-Artefakte.");m.put("Specify memory request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","Geben Sie die Speicheranforderung für jeden Job/Dienst an, der diesen Executor verwendet. Weitere Informationen finden Sie unter <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes-Ressourcenmanagement</a>.");- m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",- "Geben Sie die mypy-Ausgabedatei relativ zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an. Diese Datei kann durch Umleitung der mypy-Ausgabe <b>ohne die Option '--pretty'</b> generiert werden, beispielsweise <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Verwenden Sie * oder ? für Musterabgleich.");+ m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",+ "Geben Sie die mypy-Ausgabedatei relativ zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an. Diese Datei kann durch Umleitung der mypy-Ausgabe <b>ohne die Option '--pretty'</b> generiert werden, beispielsweise <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Verwenden Sie * oder ? für Musterabgleich.");m.put("Specify name of the branch", "Geben Sie den Namen des Branches an.");m.put("Specify name of the environment variable", "Geben Sie den Namen der Umgebungsvariable an.");m.put("Specify name of the iteration", "Geben Sie den Namen der Iteration an.");@@ -3645,23 +3645,23 @@ public class Translation_de extends TranslationResourceBundle {m.put("Specify project to run job in", "Geben Sie das Projekt an, in dem der Job ausgeführt werden soll");m.put("Specify projects", "Geben Sie Projekte an.");m.put("Specify projects to update dependencies. Leave empty for current project", "Geben Sie Projekte an, deren Abhängigkeiten aktualisiert werden sollen. Lassen Sie das Feld leer für das aktuelle Projekt.");- m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "Geben Sie die pylint-JSON-Ergebnisdatei relativ zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an. Diese Datei kann mit der pylint-JSON-Ausgabeformatoption generiert werden, beispielsweise <code>--exit-zero --output-format=json:pylint-result.json</code>. Beachten Sie, dass wir den pylint-Befehl bei Verstößen nicht fehlschlagen lassen, da dieser Schritt den Build basierend auf der konfigurierten Schwelle fehlschlagen lässt. Verwenden Sie * oder ? für Musterabgleich.");+ m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "Geben Sie die pylint-JSON-Ergebnisdatei relativ zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an. Diese Datei kann mit der pylint-JSON-Ausgabeformatoption generiert werden, beispielsweise <code>--exit-zero --output-format=json:pylint-result.json</code>. Beachten Sie, dass wir den pylint-Befehl bei Verstößen nicht fehlschlagen lassen, da dieser Schritt den Build basierend auf der konfigurierten Schwelle fehlschlagen lässt. Verwenden Sie * oder ? für Musterabgleich.");m.put("Specify registry logins if necessary. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token for password","Geben Sie Registry-Logins an, falls erforderlich. Für das integrierte Registry verwenden Sie <code>@server_url@</code> für die Registry-URL, <code>@job_token@</code> für den Benutzernamen und den Zugriffstoken für das Passwort.");m.put("Specify registry url. Leave empty for official registry", "Geben Sie die Registry-URL an. Lassen Sie das Feld leer für das offizielle Registry.");- m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "Geben Sie den relativen Pfad unter <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a> an, um das OCI-Layout zu speichern.");+ m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "Geben Sie den relativen Pfad unter <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a> an, um das OCI-Layout zu speichern.");m.put("Specify repositories", "Geben Sie Repositories an.");m.put("Specify required reviewers if specified path is changed. Note that the user submitting the change is considered to reviewed the change automatically","Geben Sie die erforderlichen Reviewer an, falls der angegebene Pfad geändert wird. Beachten Sie, dass der Benutzer, der die Änderung übermittelt, automatisch als Reviewer der Änderung gilt.");m.put("Specify root URL to access this server", "Geben Sie die Root-URL an, um auf diesen Server zuzugreifen.");- m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "Geben Sie die ruff-JSON-Ergebnisdatei relativ zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an. Diese Datei kann mit der ruff-JSON-Ausgabeformatoption generiert werden, beispielsweise <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Beachten Sie, dass wir den ruff-Befehl bei Verstößen nicht fehlschlagen lassen, da dieser Schritt den Build basierend auf der konfigurierten Schwelle fehlschlagen lässt. Verwenden Sie * oder ? für Musterabgleich.");- m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Geben Sie Shell-Befehle (auf Linux/Unix) oder Batch-Befehle (auf Windows) an, die unter dem <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a> ausgeführt werden sollen.");- m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Geben Sie Shell-Befehle an, die unter dem <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a> ausgeführt werden sollen.");+ m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "Geben Sie die ruff-JSON-Ergebnisdatei relativ zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an. Diese Datei kann mit der ruff-JSON-Ausgabeformatoption generiert werden, beispielsweise <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Beachten Sie, dass wir den ruff-Befehl bei Verstößen nicht fehlschlagen lassen, da dieser Schritt den Build basierend auf der konfigurierten Schwelle fehlschlagen lässt. Verwenden Sie * oder ? für Musterabgleich.");+ m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Geben Sie Shell-Befehle (auf Linux/Unix) oder Batch-Befehle (auf Windows) an, die unter dem <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a> ausgeführt werden sollen.");+ m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Geben Sie Shell-Befehle an, die unter dem <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a> ausgeführt werden sollen.");m.put("Specify shell to be used", "Geben Sie die zu verwendende Shell an.");m.put("Specify source param for SCP command, for instance <code>app.tar.gz</code>", "Geben Sie die Quellparameter für den SCP-Befehl an, beispielsweise <code>app.tar.gz</code>.");m.put("Specify space separated refs to pull from remote. '*' can be used in ref name for wildcard match<br><b class='text-danger'>NOTE:</b> branch/tag protection rule will be ignored when update branches/tags via this step",@@ -3680,10 +3680,10 @@ public class Translation_de extends TranslationResourceBundle {"Geben Sie durch Leerzeichen getrennte Absender-E-Mail-Adressen an, die für diesen Eintrag gelten. Verwenden Sie '*' oder '?' für Wildcard-Abgleich. Präfix mit '-', um auszuschließen. Lassen Sie das Feld leer, um alle Absender zuzuordnen.");m.put("Specify space-separated tags to be protected. Use '**', '*' or '?' for <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>path wildcard match</a>. Prefix with '-' to exclude","Geben Sie durch Leerzeichen getrennte Tags an, die geschützt werden sollen. Verwenden Sie '**', '*' oder '?' für <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>Pfad-Wildcard-Abgleich</a>. Präfix mit '-', um auszuschließen.");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: <tt>manual/index.md</tt>",- "Geben Sie die Startseite des Berichts relativ zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, beispielsweise: <tt>manual/index.md</tt>.");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: api/index.html",- "Geben Sie die Startseite des Berichts relativ zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> an, beispielsweise: api/index.html.");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: <tt>manual/index.md</tt>",+ "Geben Sie die Startseite des Berichts relativ zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, beispielsweise: <tt>manual/index.md</tt>.");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: api/index.html",+ "Geben Sie die Startseite des Berichts relativ zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> an, beispielsweise: api/index.html.");m.put("Specify storage size to request for the build volume. The size should conform to <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>Kubernetes resource capacity format</a>, for instance <i>10Gi</i>","Geben Sie die Speichergröße an, die für das Build-Volume angefordert werden soll. Die Größe sollte dem <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>Kubernetes-Ressourcenkapazitätsformat</a> entsprechen, beispielsweise <i>10Gi</i>.");m.put("Specify tab width used to calculate column value of found problems in provided report",@@ -3769,8 +3769,8 @@ public class Translation_de extends TranslationResourceBundle {m.put("Step Templates", "Schrittvorlagen");m.put("Step {0} of {1}: ", "Schritt {0} von {1}:");m.put("Steps", "Schritte");- m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>",- "Schritte werden seriell auf demselben Knoten ausgeführt und teilen sich denselben <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a>");+ m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>",+ "Schritte werden seriell auf demselben Knoten ausgeführt und teilen sich denselben <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a>");m.put("Stop", "Stopp");m.put("Stop work", "Arbeit beenden");m.put("Stopwatch Overdue", "Stoppuhr überfällig");@@ -4008,9 +4008,9 @@ public class Translation_de extends TranslationResourceBundle {m.put("This shows number of issues in various states over time", "Dies zeigt die Anzahl der Issues in verschiedenen Zuständen im Zeitverlauf");m.put("This shows number of open and merged pull requests over time", "Dies zeigt die Anzahl der offenen und zusammengeführten Pull-Requests im Zeitverlauf");m.put("This step can only be executed by a docker aware executor", "Dieser Schritt kann nur von einem Docker-fähigen Executor ausgeführt werden");- m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Dieser Schritt kann nur von einem Docker-fähigen Executor ausgeführt werden. Er läuft unter <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job-Arbeitsbereich</a>");- m.put("This step copies files from job workspace to build artifacts directory, so that they can be accessed after job is completed",+ m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Dieser Schritt kann nur von einem Docker-fähigen Executor ausgeführt werden. Er läuft unter <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job-Arbeitsbereich</a>");+ m.put("This step copies files from job workdir to build artifacts directory, so that they can be accessed after job is completed","Dieser Schritt kopiert Dateien vom Job-Arbeitsbereich in das Verzeichnis der Build-Artefakte, damit sie nach Abschluss des Jobs zugänglich sind");m.put("This step publishes specified files to be served as project web site. Project web site can be accessed publicly via <code>http://<onedev base url>/path/to/project/~site</code>","Dieser Schritt veröffentlicht die angegebenen Dateien, um als Projekt-Webseite bereitgestellt zu werden. Die Projekt-Webseite kann öffentlich über <code>http://<onedev base url>/path/to/project/~site</code> aufgerufen werden");@@ -4728,8 +4728,8 @@ public class Translation_de extends TranslationResourceBundle {"Optional Commit-Typen angeben, die für die Überprüfung der Commit-Nachrichtenfußzeile gelten (drücken Sie ENTER, um den Wert hinzuzufügen). Leer lassen für alle Typen");m.put("Optionally specify extra options for osv source scanner. Multiple options need to be separated with space","Optional zusätzliche Optionen für den OSV-Quellscanner angeben. Mehrere Optionen müssen durch Leerzeichen getrennt werden");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",- "Optional Pfad relativ zum <a href='https://docs.onedev.io/concepts#job-workspace'>Job-Arbeitsbereich</a> angeben, der als Trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>Geheimniskonfiguration</a> verwendet werden soll");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",+ "Optional Pfad relativ zum <a href='https://docs.onedev.io/concepts#job-workdir'>Job-Arbeitsbereich</a> angeben, der als Trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>Geheimniskonfiguration</a> verwendet werden soll");m.put("Osv Source Scanner", "OSV-Quellscanner");m.put("Run osv scanner to scan project source for vulnerabilities in <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>various lock files</a>. It can only be executed by docker aware executor.","OSV-Scanner ausführen, um den Projektquellcode auf Schwachstellen in <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>verschiedenen Sperrdateien</a> zu scannen. Es kann nur von einem Docker-fähigen Executor ausgeführt werden.");diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_es.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_es.javaindex 751cc92d81..d1cf92be2b 100644--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_es.java+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_es.java@@ -1397,8 +1397,8 @@ public class Translation_es extends TranslationResourceBundle {"Para confirmaciones de construcción no alcanzables desde la rama predeterminada, se debe especificar un <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>secreto de trabajo</a> como token de acceso con permiso para crear etiquetas");m.put("For build commit not reachable from default branch, a <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> should be specified as access token with manage issue permission","Para confirmaciones de construcción no alcanzables desde la rama predeterminada, se debe especificar un <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>secreto de trabajo</a> como token de acceso con permiso para gestionar problemas");- m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>). For shell related executors which runs on host machine directly, only relative path is accepted",- "Para ejecutores conscientes de Docker, esta ruta está dentro del contenedor y acepta tanto rutas absolutas como relativas (relativas a <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>el espacio de trabajo del trabajo</a>). Para ejecutores relacionados con shell que se ejecutan directamente en la máquina host, solo se acepta la ruta relativa");+ m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>). For shell related executors which runs on host machine directly, only relative path is accepted",+ "Para ejecutores conscientes de Docker, esta ruta está dentro del contenedor y acepta tanto rutas absolutas como relativas (relativas a <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>el espacio de trabajo del trabajo</a>). Para ejecutores relacionados con shell que se ejecutan directamente en la máquina host, solo se acepta la ruta relativa");m.put("For each build, OneDev calculates a list of fixed issues since previous build automatically. This setting provides a default query to further filter/order this list. For a given job, the first matching entry will be used.","Para cada construcción, OneDev calcula automáticamente una lista de problemas corregidos desde la construcción anterior. Esta configuración proporciona una consulta predeterminada para filtrar/ordenar aún más esta lista. Para un trabajo dado, se usará la primera entrada coincidente.");m.put("For each selected branch/tag, a separate build will be generated with branch/tag set to corresponding value",@@ -2346,7 +2346,7 @@ public class Translation_es extends TranslationResourceBundle {m.put("Optionally filter issues", "Opcionalmente filtre problemas");m.put("Optionally filter pull requests", "Opcionalmente filtre solicitudes de extracción");m.put("Optionally leave a note", "Opcionalmente deje una nota");- m.put("Optionally mount directories or files under job workspace into container", "Opcionalmente monte directorios o archivos bajo el espacio de trabajo del trabajo dentro del contenedor");+ m.put("Optionally mount directories or files under job workdir into container", "Opcionalmente monte directorios o archivos bajo el espacio de trabajo del trabajo dentro del contenedor");m.put("Optionally select fields to prompt when this button is pressed", "Opcionalmente seleccione campos para mostrar cuando se presione este botón");m.put("Optionally select fields to remove when this transition happens", "Opcionalmente seleccione campos para eliminar cuando ocurra esta transición");m.put("Optionally specifies name of the attribute inside the user LDAP entry whose value will be taken as user email. This field is normally set to <i>mail</i> according to RFC 2798",@@ -2366,8 +2366,8 @@ public class Translation_es extends TranslationResourceBundle {m.put("Optionally specify <span class='text-info'>comma separated</span> platforms to scan, for instance <tt>linux/amd64,linux/arm64</tt>. Leave empty to scan all platforms in OCI layout","Opcionalmente especifique <span class='text-info'>plataformas separadas por comas</span> para escanear, por ejemplo <tt>linux/amd64,linux/arm64</tt>. Déjelo vacío para escanear todas las plataformas en el diseño OCI.");m.put("Optionally specify API key for authentication", "Opcionalmente, especifique la clave API para autenticación");- m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",- "Opcionalmente especifique el Dockerfile relativo al <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espacio de trabajo del trabajo</a>. Déjelo vacío para usar el archivo <tt>Dockerfile</tt> bajo la ruta de construcción especificada anteriormente.");+ m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",+ "Opcionalmente especifique el Dockerfile relativo al <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espacio de trabajo del trabajo</a>. Déjelo vacío para usar el archivo <tt>Dockerfile</tt> bajo la ruta de construcción especificada anteriormente.");m.put("Optionally specify JavaScript config to be used by Renovate CLI", "Opcionalmente especifique la configuración de JavaScript para usar con Renovate CLI.");m.put("Optionally specify SSH root URL, which will be used to construct project clone url via SSH protocol. Leave empty to derive from server url","Opcionalmente especifique la URL raíz de SSH, que se utilizará para construir la URL de clonación del proyecto mediante el protocolo SSH. Déjelo vacío para derivarlo de la URL del servidor.");@@ -2385,8 +2385,8 @@ public class Translation_es extends TranslationResourceBundle {"Opcionalmente especifique una expresión cron para programar la copia de seguridad automática de la base de datos. El formato de la expresión cron es <em><segundos> <minutos> <horas> <día-del-mes> <mes> <día-de-la-semana></em>. Por ejemplo, <em>0 0 1 * * ?</em> significa 1:00am todos los días. Para detalles del formato, consulte el <a href='http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html#format' target='_blank'>tutorial de Quartz</a>. Los archivos de copia de seguridad se colocarán en la carpeta <em>db-backup</em> bajo el directorio de instalación de OneDev. En caso de que varios servidores se conecten para formar un clúster, la copia de seguridad automática se realiza en el <a href='https://docs.onedev.io/concepts#lead-server' target='_blank'>servidor principal</a>. Deje esta propiedad vacía si no desea habilitar la copia de seguridad automática de la base de datos.");m.put("Optionally specify a date field to hold due date information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Opcionalmente especifique un campo de fecha para contener información de fecha de vencimiento.<br><b>NOTA: </b> Puede personalizar los campos de problemas de OneDev en caso de que no haya una opción adecuada aquí.");- m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to put retrieved artifacts. Leave empty to use job workspace itself",- "Opcionalmente especifique una ruta relativa al <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a> para colocar artefactos recuperados. Déjelo vacío para usar el espacio de trabajo del trabajo en sí.");+ m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to put retrieved artifacts. Leave empty to use job workdir itself",+ "Opcionalmente especifique una ruta relativa al <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a> para colocar artefactos recuperados. Déjelo vacío para usar el espacio de trabajo del trabajo en sí.");m.put("Optionally specify a storage class to allocate build volume dynamically. Leave empty to use default storage class. <b class='text-warning'>NOTE:</b> Reclaim policy of the storage class should be set to <code>Delete</code>, as the volume is only used to hold temporary build files","Opcionalmente especifique una clase de almacenamiento para asignar dinámicamente el volumen de construcción. Déjelo vacío para usar la clase de almacenamiento predeterminada. <b class='text-warning'>NOTA:</b> La política de recuperación de la clase de almacenamiento debe configurarse en <code>Delete</code>, ya que el volumen solo se utiliza para contener archivos temporales de construcción.");m.put("Optionally specify a working period field to hold estimated time infomration.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",@@ -2405,17 +2405,17 @@ public class Translation_es extends TranslationResourceBundle {m.put("Optionally specify applicable jobs of this executor", "Especifique opcionalmente los trabajos aplicables de este ejecutor");m.put("Optionally specify applicable users who pushed the change", "Opcionalmente especifica los usuarios aplicables que realizaron el cambio");m.put("Optionally specify arguments to run above image", "Opcionalmente especifique argumentos para ejecutar la imagen anterior.");- m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",- "Opcionalmente especifique artefactos para recuperar de la dependencia en el <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a>. Solo se pueden recuperar artefactos publicados (a través del paso de publicación de artefactos). Déjelo vacío para no recuperar ningún artefacto.");+ m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",+ "Opcionalmente especifique artefactos para recuperar de la dependencia en el <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a>. Solo se pueden recuperar artefactos publicados (a través del paso de publicación de artefactos). Déjelo vacío para no recuperar ningún artefacto.");m.put("Optionally specify authorized roles to press this button. If not specified, all users are allowed","Opcionalmente especifique roles autorizados para presionar este botón. Si no se especifica, todos los usuarios están permitidos.");m.put("Optionally specify base query of the list", "Opcionalmente especifique la consulta base de la lista.");m.put("Optionally specify branches/users/groups allowed to access this secret. If left empty, any job can access this secret, including those triggered via external pull requests","Opcionalmente especifique ramas/usuarios/grupos permitidos para acceder a este secreto. Si se deja vacío, cualquier trabajo puede acceder a este secreto, incluidos aquellos activados a través de solicitudes de extracción externas.");- m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",- "Opcionalmente especifique la ruta de contexto de construcción relativa al <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espacio de trabajo del trabajo</a>. Déjelo vacío para usar el espacio de trabajo del trabajo en sí. Se espera que el archivo <code>Dockerfile</code> exista en el directorio de contexto de construcción, a menos que especifique una ubicación diferente con la opción <code>--dockerfile</code>.");- m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself",- "Opcionalmente especifique la ruta de construcción relativa al <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espacio de trabajo del trabajo</a>. Déjelo vacío para usar el espacio de trabajo del trabajo en sí.");+ m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",+ "Opcionalmente especifique la ruta de contexto de construcción relativa al <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espacio de trabajo del trabajo</a>. Déjelo vacío para usar el espacio de trabajo del trabajo en sí. Se espera que el archivo <code>Dockerfile</code> exista en el directorio de contexto de construcción, a menos que especifique una ubicación diferente con la opción <code>--dockerfile</code>.");+ m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself",+ "Opcionalmente especifique la ruta de construcción relativa al <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espacio de trabajo del trabajo</a>. Déjelo vacío para usar el espacio de trabajo del trabajo en sí.");m.put("Optionally specify cluster role the job pods service account binding to. This is necessary if you want to do things such as running other Kubernetes pods in job command","Opcionalmente especifique el rol de clúster al que se vincula la cuenta de servicio de los pods del trabajo. Esto es necesario si desea realizar acciones como ejecutar otros pods de Kubernetes en el comando del trabajo.");m.put("Optionally specify container arguments separated by space. Single argument containing space should be quoted. <b class='text-warning'>Note: </b> do not confuse this with container options which should be specified in executor setting",@@ -2478,13 +2478,13 @@ public class Translation_es extends TranslationResourceBundle {"Opcionalmente especifique opciones para el comando ssh. Las múltiples opciones deben estar separadas por espacio.");m.put("Optionally specify options passed to renovate cli. Multiple options should be separated by space, and single option containing spaces should be quoted","Opcionalmente especifique opciones pasadas a renovate cli. Las múltiples opciones deben estar separadas por espacio, y una única opción que contenga espacios debe estar entre comillas.");- m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. You may ignore particular vulnerabilities via this file",- "Opcionalmente especifique el archivo de configuración del escáner osv <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> bajo el <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espacio de trabajo del trabajo</a>. Puede ignorar vulnerabilidades particulares a través de este archivo.");+ m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. You may ignore particular vulnerabilities via this file",+ "Opcionalmente especifique el archivo de configuración del escáner osv <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> bajo el <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espacio de trabajo del trabajo</a>. Puede ignorar vulnerabilidades particulares a través de este archivo.");m.put("Optionally specify path protection rules", "Opcionalmente especifique reglas de protección de ruta.");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",- "Opcionalmente especifique la ruta relativa al <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a> para usar como archivo de ignorar de trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>.");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to publish artifacts from. Leave empty to use job workspace itself",- "Opcionalmente especifique la ruta relativa al <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a> para publicar artefactos. Déjelo vacío para usar el espacio de trabajo del trabajo en sí.");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",+ "Opcionalmente especifique la ruta relativa al <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a> para usar como archivo de ignorar de trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>.");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to publish artifacts from. Leave empty to use job workdir itself",+ "Opcionalmente especifique la ruta relativa al <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a> para publicar artefactos. Déjelo vacío para usar el espacio de trabajo del trabajo en sí.");m.put("Optionally specify platform to pull, for instance <tt>linux/amd64</tt>. Leave empty to pull all platforms in image","Opcionalmente especifique la plataforma para extraer, por ejemplo <tt>linux/amd64</tt>. Déjelo vacío para extraer todas las plataformas en la imagen.");m.put("Optionally specify project to show builds of. Leave empty to show builds of all projects with permissions",@@ -2498,12 +2498,12 @@ public class Translation_es extends TranslationResourceBundle {m.put("Optionally specify registry logins to override those defined in job executor. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token secret for password secret","Opcionalmente especifique inicios de sesión de registro para anular los definidos en el ejecutor del trabajo. Para el registro integrado, use <code>@server_url@</code> para la URL del registro, <code>@job_token@</code> para el nombre de usuario y el secreto del token de acceso para el secreto de contraseña.");m.put("Optionally specify relative directory to put uploaded files", "Opcionalmente especifique el directorio relativo para colocar los archivos subidos.");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to clone code into. Leave empty to use job workspace itself",- "Opcionalmente especifique la ruta relativa bajo el <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a> para clonar el código. Déjelo vacío para usar el espacio de trabajo del trabajo en sí.");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan. Leave empty to use job workspace itself",- "Opcionalmente especifique la ruta relativa bajo el <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a> para escanear. Déjelo vacío para usar el espacio de trabajo del trabajo en sí.");- m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workspace itself",- "Opcionalmente especifique rutas relativas bajo el <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a> para escanear vulnerabilidades de dependencias. Se pueden especificar múltiples rutas y deben estar separadas por espacio. Déjelo vacío para usar el espacio de trabajo del trabajo en sí.");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to clone code into. Leave empty to use job workdir itself",+ "Opcionalmente especifique la ruta relativa bajo el <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a> para clonar el código. Déjelo vacío para usar el espacio de trabajo del trabajo en sí.");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan. Leave empty to use job workdir itself",+ "Opcionalmente especifique la ruta relativa bajo el <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a> para escanear. Déjelo vacío para usar el espacio de trabajo del trabajo en sí.");+ m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workdir itself",+ "Opcionalmente especifique rutas relativas bajo el <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a> para escanear vulnerabilidades de dependencias. Se pueden especificar múltiples rutas y deben estar separadas por espacio. Déjelo vacío para usar el espacio de trabajo del trabajo en sí.");m.put("Optionally specify required reviewers for changes of specified branch", "Opcionalmente especifique revisores requeridos para cambios en la rama especificada.");m.put("Optionally specify revision to create branch from. Leave empty to create from build commit","Opcionalmente especifique la revisión para crear la rama. Déjelo vacío para crear desde el commit de construcción.");@@ -3117,8 +3117,8 @@ public class Translation_es extends TranslationResourceBundle {m.put("Run job", "Ejecutar trabajo");m.put("Run job in another project", "Ejecutar trabajo en otro proyecto");m.put("Run on Bare Metal/Virtual Machine", "Ejecutar en Metal Desnudo/Máquina Virtual");- m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKSPACE</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",- "Ejecute el contenedor Docker especificado. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>El espacio de trabajo del trabajo</a> se monta en el contenedor y su ruta se coloca en la variable de entorno <code>ONEDEV_WORKSPACE</code>. <b class='text-warning'>Nota: </b> este paso solo puede ser ejecutado por el ejecutor docker del servidor o el ejecutor docker remoto");+ m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKDIR</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",+ "Ejecute el contenedor Docker especificado. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>El espacio de trabajo del trabajo</a> se monta en el contenedor y su ruta se coloca en la variable de entorno <code>ONEDEV_WORKDIR</code>. <b class='text-warning'>Nota: </b> este paso solo puede ser ejecutado por el ejecutor docker del servidor o el ejecutor docker remoto");m.put("Run specified step template", "Ejecutar plantilla de paso especificada");m.put("Run this job", "Ejecutar este trabajo");m.put("Run trivy container image scanner to find issues in specified image. For vulnerabilities, it checks various <a href='https://aquasecurity.github.io/trivy/v0.50/docs/coverage/language/#supported-languages' target='_blank'>distribution files</a>. It can only be executed by docker aware executor.",@@ -3391,47 +3391,47 @@ public class Translation_es extends TranslationResourceBundle {m.put("Specifies who can access this AI service", "Especifica quién puede acceder a este servicio de IA");m.put("Specifies who can access this AI service. AI service can be accessed in below approaches:","Especifica quién puede acceder a este servicio de IA. El servicio de IA se puede acceder de las siguientes maneras:");- m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",- "Especifica el archivo de resultados de prueba .net TRX relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, por ejemplo <tt>TestResults/*.trx</tt>. Usa * o ? para coincidencia de patrones");+ m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",+ "Especifica el archivo de resultados de prueba .net TRX relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, por ejemplo <tt>TestResults/*.trx</tt>. Usa * o ? para coincidencia de patrones");m.put("Specify <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> whose value is access token with code write permission over above projects. Commits, issues, and pull requests will also be created under name of the access token owner","Especifica <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> cuyo valor es un token de acceso con permiso de escritura de código sobre los proyectos mencionados anteriormente. Los commits, problemas y solicitudes de extracción también se crearán bajo el nombre del propietario del token de acceso");- m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",- "Especifica el archivo de salida json de <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Este archivo puede generarse con la opción de salida json de clippy, por ejemplo <code>cargo clippy --message-format json>check-result.json</code>. Usa * o ? para coincidencia de patrones");+ m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",+ "Especifica el archivo de salida json de <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Este archivo puede generarse con la opción de salida json de clippy, por ejemplo <code>cargo clippy --message-format json>check-result.json</code>. Usa * o ? para coincidencia de patrones");m.put("Specify Build Options", "Especifica las opciones de compilación");- m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",- "Especifica el archivo xml de resultados de CPD relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, por ejemplo, <tt>target/cpd.xml</tt>. Usa * o ? para coincidencia de patrones");+ m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",+ "Especifica el archivo xml de resultados de CPD relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, por ejemplo, <tt>target/cpd.xml</tt>. Usa * o ? para coincidencia de patrones");m.put("Specify Commit Message", "Especifica el mensaje de commit");- m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",- "Especifica el archivo de informe ESLint en formato checkstyle bajo <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Este archivo puede generarse con la opción de ESLint <tt>'-f checkstyle'</tt> y <tt>'-o'</tt>. Usa * o ? para coincidencia de patrones");+ m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",+ "Especifica el archivo de informe ESLint en formato checkstyle bajo <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Este archivo puede generarse con la opción de ESLint <tt>'-f checkstyle'</tt> y <tt>'-o'</tt>. Usa * o ? para coincidencia de patrones");m.put("Specify GitHub API url, for instance <tt>https://api.github.com</tt>", "Especifica la URL de la API de GitHub, por ejemplo <tt>https://api.github.com</tt>");m.put("Specify GitLab API url, for instance <tt>https://gitlab.example.com/api/v4</tt>", "Especifica la URL de la API de GitLab, por ejemplo <tt>https://gitlab.example.com/api/v4</tt>");m.put("Specify Gitea API url, for instance <tt>https://gitea.example.com/api/v1</tt>", "Especifica la URL de la API de Gitea, por ejemplo <tt>https://gitea.example.com/api/v1</tt>");- m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",- "Especifica el archivo XML de resultados de GoogleTest relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Este informe puede generarse con la variable de entorno <tt>GTEST_OUTPUT</tt> al ejecutar pruebas, por ejemplo, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Usa * o ? para coincidencia de patrones");+ m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",+ "Especifica el archivo XML de resultados de GoogleTest relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Este informe puede generarse con la variable de entorno <tt>GTEST_OUTPUT</tt> al ejecutar pruebas, por ejemplo, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Usa * o ? para coincidencia de patrones");m.put("Specify IMAP user name.<br><b class='text-danger'>NOTE: </b> This account should be able to receive emails sent to system email address specified above","Especifica el nombre de usuario IMAP.<br><b class='text-danger'>NOTA: </b> Esta cuenta debería poder recibir correos enviados a la dirección de correo del sistema especificada anteriormente");- m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",- "Especifica el archivo de resultados de prueba JUnit en formato XML relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, por ejemplo <tt>target/surefire-reports/TEST-*.xml</tt>. Usa * o ? para coincidencia de patrones");- m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",- "Especifica el archivo de informe de cobertura xml de JaCoCo relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, por ejemplo, <tt>target/site/jacoco/jacoco.xml</tt>. Usa * o ? para coincidencia de patrones");- m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",- "Especifica el archivo de informe de cobertura de Jest en formato clover relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, por ejemplo <tt>coverage/clover.xml</tt>. Este archivo puede generarse con la opción de Jest <tt>'--coverage'</tt>. Usa * o ? para coincidencia de patrones");- m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",- "Especifica el archivo de resultados de prueba de Jest en formato json relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Este archivo puede generarse mediante la opción de Jest <tt>'--json'</tt> y <tt>'--outputFile'</tt>. Usa * o ? para coincidencia de patrones");- m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Especifica el directorio de diseño OCI de la imagen para escanear. Este directorio puede generarse mediante el paso de construcción de imagen o el paso de extracción de imagen. Debe ser relativo a <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>");- m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to push from",- "Especifica el directorio de diseño OCI relativo a <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> para realizar el push");+ m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",+ "Especifica el archivo de resultados de prueba JUnit en formato XML relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, por ejemplo <tt>target/surefire-reports/TEST-*.xml</tt>. Usa * o ? para coincidencia de patrones");+ m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",+ "Especifica el archivo de informe de cobertura xml de JaCoCo relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, por ejemplo, <tt>target/site/jacoco/jacoco.xml</tt>. Usa * o ? para coincidencia de patrones");+ m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",+ "Especifica el archivo de informe de cobertura de Jest en formato clover relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, por ejemplo <tt>coverage/clover.xml</tt>. Este archivo puede generarse con la opción de Jest <tt>'--coverage'</tt>. Usa * o ? para coincidencia de patrones");+ m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",+ "Especifica el archivo de resultados de prueba de Jest en formato json relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Este archivo puede generarse mediante la opción de Jest <tt>'--json'</tt> y <tt>'--outputFile'</tt>. Usa * o ? para coincidencia de patrones");+ m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Especifica el directorio de diseño OCI de la imagen para escanear. Este directorio puede generarse mediante el paso de construcción de imagen o el paso de extracción de imagen. Debe ser relativo a <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>");+ m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to push from",+ "Especifica el directorio de diseño OCI relativo a <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> para realizar el push");m.put("Specify OpenID scopes to request", "Especifica los alcances de OpenID a solicitar");- m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",- "Especifica el archivo xml de resultados de PMD relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, por ejemplo, <tt>target/pmd.xml</tt>. Usa * o ? para coincidencia de patrones");- m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",- "Especifica los comandos de PowerShell para ejecutar bajo <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>.<br><b class='text-warning'>NOTA: </b> OneDev verifica el código de salida del script para determinar si el paso es exitoso. Dado que PowerShell siempre sale con 0 incluso si hay errores en el script, deberías manejar los errores en el script y salir con un código distinto de cero, o agregar la línea <code>$ErrorActionPreference = "Stop"</code> al inicio de tu script<br>");- m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",- "Especifica el archivo de salida de diagnósticos de Roslynator en formato XML relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Este archivo puede generarse con la opción <i>-o</i>. Usa * o ? para coincidencia de patrones");+ m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",+ "Especifica el archivo xml de resultados de PMD relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, por ejemplo, <tt>target/pmd.xml</tt>. Usa * o ? para coincidencia de patrones");+ m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",+ "Especifica los comandos de PowerShell para ejecutar bajo <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>.<br><b class='text-warning'>NOTA: </b> OneDev verifica el código de salida del script para determinar si el paso es exitoso. Dado que PowerShell siempre sale con 0 incluso si hay errores en el script, deberías manejar los errores en el script y salir con un código distinto de cero, o agregar la línea <code>$ErrorActionPreference = "Stop"</code> al inicio de tu script<br>");+ m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",+ "Especifica el archivo de salida de diagnósticos de Roslynator en formato XML relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Este archivo puede generarse con la opción <i>-o</i>. Usa * o ? para coincidencia de patrones");m.put("Specify Shell/Batch Commands to Run", "Especifica los comandos Shell/Batch para ejecutar");- m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",- "Especifica el archivo xml de resultados de SpotBugs relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, por ejemplo, <tt>target/spotbugsXml.xml</tt>. Usa * o ? para coincidencia de patrones");+ m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",+ "Especifica el archivo xml de resultados de SpotBugs relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, por ejemplo, <tt>target/spotbugsXml.xml</tt>. Usa * o ? para coincidencia de patrones");m.put("Specify System Settings", "Especifica la configuración del sistema");m.put("Specify URL of remote git repository. Only http/https protocol is supported", "Especifica la URL del repositorio git remoto. Solo se admite el protocolo http/https");m.put("Specify YouTrack login name. This account should have permission to:<ul><li>Read full information and issues of the projects you want to import<li>Read issue tags<li>Read user basic information</ul>",@@ -3466,14 +3466,14 @@ public class Translation_es extends TranslationResourceBundle {m.put("Specify a Docker Image to Test Against", "Especifica una imagen Docker para probar");m.put("Specify a custom field of Enum type", "Especifica un campo personalizado de tipo Enum");m.put("Specify a default query to filter/order fixed issues of specified jobs", "Especifica una consulta predeterminada para filtrar/ordenar problemas solucionados de los trabajos especificados");- m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to write checksum into",- "Especifica un archivo relativo a <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> para escribir el checksum");+ m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to write checksum into",+ "Especifica un archivo relativo a <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> para escribir el checksum");m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Especifica un campo de usuario de múltiples valores para mantener la información de los asignados.<b>NOTA: </b> Puedes personalizar los campos de problemas de OneDev en caso de que no haya una opción adecuada aquí");m.put("Specify a multi-value user field to hold assignees information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Especifica un campo de usuario de múltiples valores para mantener la información de los asignados.<br><b>NOTA: </b> Puedes personalizar los campos de problemas de OneDev en caso de que no haya una opción adecuada aquí");m.put("Specify a path inside container to be used as mount target", "Especifica una ruta dentro del contenedor para usar como destino de montaje");- m.put("Specify a path relative to job workspace to be used as mount source. Leave empty to mount job workspace itself",+ m.put("Specify a path relative to job workdir to be used as mount source. Leave empty to mount job workdir itself","Especifica una ruta relativa al espacio de trabajo del trabajo para usar como fuente de montaje. Déjalo vacío para montar el espacio de trabajo del trabajo en sí");m.put("Specify a secret to be used as access token to create issue in above project if it is not publicly accessible","Especifica un secreto para usar como token de acceso para crear problemas en el proyecto mencionado anteriormente si no es accesible públicamente");@@ -3499,8 +3499,8 @@ public class Translation_es extends TranslationResourceBundle {m.put("Specify application (client) ID of the app registered in Entra ID", "Especifica el ID de aplicación (cliente) de la aplicación registrada en Entra ID");m.put("Specify arguments for imagetools. For instance <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>","Especifica argumentos para imagetools. Por ejemplo <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>");- m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved.",- "Especifica artefactos para recuperar en <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Solo se pueden recuperar artefactos publicados (mediante el paso de publicación de artefactos).");+ m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved.",+ "Especifica artefactos para recuperar en <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Solo se pueden recuperar artefactos publicados (mediante el paso de publicación de artefactos).");m.put("Specify at least 10 alphanumeric chars to be used as secret, and then add an inbound parse entry at SendGrid side:<ul><li><code>Destination URL</code> should be set to <i><OneDev root url>/~sendgrid/<secret></i>, for instance, <i>https://onedev.example.com/~sendgrid/1234567890</i>. Note that in production environment, <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>https should be enabled</a> to protect the secret</li><li><code>Receiving domain</code> should be the same as domain part of system email address specified above</li><li>Option <code>POST the raw, full MIME message</code> is enabled</li></ul>","Especifica al menos 10 caracteres alfanuméricos para usar como secreto, y luego agrega una entrada de análisis de entrada en el lado de SendGrid:<ul><li><code>Destination URL</code> debe configurarse como <i><OneDev root url>/~sendgrid/<secret></i>, por ejemplo, <i>https://onedev.example.com/~sendgrid/1234567890</i>. Ten en cuenta que en un entorno de producción, <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>debería habilitarse https</a> para proteger el secreto</li><li><code>Receiving domain</code> debe ser el mismo que la parte del dominio de la dirección de correo del sistema especificada anteriormente</li><li>La opción <code>POST the raw, full MIME message</code> está habilitada</li></ul>");m.put("Specify base nodes for user search. For example: <i>cn=Users, dc=example, dc=com</i>",@@ -3516,13 +3516,13 @@ public class Translation_es extends TranslationResourceBundle {"Especifica el certificado para confiar si estás utilizando un certificado autofirmado para el repositorio remoto");m.put("Specify certificates to trust if you are using self-signed certificates for your docker registries","Especifica los certificados para confiar si estás utilizando certificados autofirmados para tus registros de Docker");- m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",- "Especifica el archivo xml de resultados de checkstyle relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, por ejemplo, <tt>target/checkstyle-result.xml</tt>. Consulta la <a href='https://checkstyle.org/'>documentación de checkstyle</a> sobre cómo generar el archivo xml de resultados. Usa * o ? para coincidencia de patrones");+ m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",+ "Especifica el archivo xml de resultados de checkstyle relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, por ejemplo, <tt>target/checkstyle-result.xml</tt>. Consulta la <a href='https://checkstyle.org/'>documentación de checkstyle</a> sobre cómo generar el archivo xml de resultados. Usa * o ? para coincidencia de patrones");m.put("Specify client secret of the app registered in Entra ID", "Especifica el secreto del cliente de la aplicación registrada en Entra ID");- m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",- "Especifica el archivo de informe de cobertura xml de clover relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, por ejemplo, <tt>target/site/clover/clover.xml</tt>. Consulta la <a href='https://openclover.org/documentation'>documentación de OpenClover</a> sobre cómo generar el archivo xml de clover. Usa * o ? para coincidencia de patrones");- m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",- "Especifica el archivo de informe de cobertura xml de cobertura relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, por ejemplo, <tt>target/site/cobertura/coverage.xml</tt>. Usa * o ? para coincidencia de patrones");+ m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",+ "Especifica el archivo de informe de cobertura xml de clover relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, por ejemplo, <tt>target/site/clover/clover.xml</tt>. Consulta la <a href='https://openclover.org/documentation'>documentación de OpenClover</a> sobre cómo generar el archivo xml de clover. Usa * o ? para coincidencia de patrones");+ m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",+ "Especifica el archivo de informe de cobertura xml de cobertura relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, por ejemplo, <tt>target/site/cobertura/coverage.xml</tt>. Usa * o ? para coincidencia de patrones");m.put("Specify color of the state for displaying purpose", "Especifica el color del estado para fines de visualización");m.put("Specify columns of the board. Each column corresponds to a value of the issue field specified above","Especifica las columnas del tablero. Cada columna corresponde a un valor del campo de problema especificado anteriormente");@@ -3535,8 +3535,8 @@ public class Translation_es extends TranslationResourceBundle {"Especifique la URL de descubrimiento de configuración de su proveedor OpenID, por ejemplo: <code>https://openid.example.com/.well-known/openid-configuration</code>. Asegúrese de usar el protocolo HTTPS ya que OneDev depende del cifrado TLS para garantizar la validez del token");m.put("Specify container image to execute commands inside", "Especifique la imagen del contenedor para ejecutar los comandos dentro");m.put("Specify container image to run", "Especifique la imagen del contenedor para ejecutar");- m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",- "Especifique el archivo de resultados xml de cppcheck relativo al <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a>. Este archivo puede generarse con la opción de salida xml de cppcheck, por ejemplo <code>cppcheck src --xml 2>check-result.xml</code>. Use * o ? para coincidencia de patrones");+ m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",+ "Especifique el archivo de resultados xml de cppcheck relativo al <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a>. Este archivo puede generarse con la opción de salida xml de cppcheck, por ejemplo <code>cppcheck src --xml 2>check-result.xml</code>. Use * o ? para coincidencia de patrones");m.put("Specify cpu request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","Especifique la solicitud de CPU para cada trabajo/servicio que use este ejecutor. Consulte <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>gestión de recursos de Kubernetes</a> para más detalles");m.put("Specify default assignees of pull requests submitted to this project. Only users with the write code permission to the project can be selected",@@ -3545,8 +3545,8 @@ public class Translation_es extends TranslationResourceBundle {m.put("Specify destinations, for instance <tt>registry-server:5000/myorg/myrepo:latest</tt>. Make sure to use <b>same host</b> as specified in server url of system settings if you want to push to built-in registry, or simply use the form <tt>@server@/<project path>/<repo name>:<tag name></tt>. Multiple destinations should be separated with space","Especifique los destinos, por ejemplo <tt>registry-server:5000/myorg/myrepo:latest</tt>. Asegúrese de usar <b>el mismo host</b> especificado en la URL del servidor de la configuración del sistema si desea enviar al registro integrado, o simplemente use el formato <tt>@server@/<project path>/<repo name>:<tag name></tt>. Los destinos múltiples deben separarse con espacios");m.put("Specify directory (tenant) ID of the app registered in Entra ID", "Especifique el ID de directorio (tenant) de la aplicación registrada en Entra ID");- m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "Especifique el directorio relativo al <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espacio de trabajo del trabajo</a> para almacenar el diseño OCI");+ m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "Especifique el directorio relativo al <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espacio de trabajo del trabajo</a> para almacenar el diseño OCI");m.put("Specify docker image of the service", "Especifique la imagen de Docker del servicio");m.put("Specify dockerx builder used to build docker image. OneDev will create the builder automatically if it does not exist. Check <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>this tutorial</a> on how to customize the builder for instance to allow publishing to insecure registries","Especifique el constructor dockerx utilizado para construir la imagen de Docker. OneDev creará el constructor automáticamente si no existe. Consulte <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>este tutorial</a> sobre cómo personalizar el constructor, por ejemplo, para permitir la publicación en registros inseguros");@@ -3557,10 +3557,10 @@ public class Translation_es extends TranslationResourceBundle {"Especifique los campos de varios problemas creados por Renovate para orquestar la actualización de dependencias");m.put("Specify fields to be displayed in the issue list", "Especifique los campos que se mostrarán en la lista de problemas");m.put("Specify fields to display in board card", "Especifique los campos para mostrar en la tarjeta del tablero");- m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published. Use * or ? for pattern match",- "Especifique los archivos relativos al <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a> para publicar. Use * o ? para coincidencia de patrones");- m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Especifique los archivos para crear el checksum md5. Los archivos múltiples deben separarse por espacios. Se aceptan patrones <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a>. Los archivos no absolutos se consideran relativos al <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espacio de trabajo del trabajo</a>");+ m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published. Use * or ? for pattern match",+ "Especifique los archivos relativos al <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a> para publicar. Use * o ? para coincidencia de patrones");+ m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Especifique los archivos para crear el checksum md5. Los archivos múltiples deben separarse por espacios. Se aceptan patrones <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a>. Los archivos no absolutos se consideran relativos al <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espacio de trabajo del trabajo</a>");m.put("Specify files under above directory to be published", "Especifica los archivos bajo el directorio mencionado para ser publicados");m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> <code>index.html</code> should be included in these files to be served as site start page","Especifique los archivos bajo el directorio anterior para publicar. Use * o ? para coincidencia de patrones. <b>NOTA:</b> <code>index.html</code> debe incluirse en estos archivos para servir como página de inicio del sitio");@@ -3604,8 +3604,8 @@ public class Translation_es extends TranslationResourceBundle {m.put("Specify manager DN to authenticate OneDev itself to Active Directory. The manager DN should be specified in form of <i><account name>@<domain></i>, for instance: <i>[email protected]</i>","Especifique el DN del administrador para autenticar OneDev a Active Directory. El DN del administrador debe especificarse en forma de <i><account name>@<domain></i>, por ejemplo: <i>[email protected]</i>");m.put("Specify manager DN to authenticate OneDev itself to LDAP server", "Especifique el DN del administrador para autenticar OneDev al servidor LDAP");- m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published",- "Especifique el archivo markdown relativo al <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a> para publicar");+ m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published",+ "Especifique el archivo markdown relativo al <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a> para publicar");m.put("Specify max git LFS file size in mega bytes", "Especifique el tamaño máximo de archivo git LFS en megabytes");m.put("Specify max number of CPU intensive tasks the server can run concurrently, such as Git repository pull/push, repository index, etc.","Especifique el número máximo de tareas intensivas de CPU que el servidor puede ejecutar simultáneamente, como extracción/push de repositorio Git, indexación de repositorio, etc.");@@ -3621,8 +3621,8 @@ public class Translation_es extends TranslationResourceBundle {"Especifique el tamaño máximo de archivo subido en megabytes a través de la interfaz web. Esto se aplica a los archivos subidos al repositorio, contenido markdown (comentarios de problemas, etc.) y artefactos de compilación");m.put("Specify memory request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","Especifique la solicitud de memoria para cada trabajo/servicio que use este ejecutor. Consulte <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>gestión de recursos de Kubernetes</a> para más detalles");- m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",- "Especifique el archivo de salida de mypy relativo al <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a>. Este archivo puede generarse redirigiendo la salida de mypy <b>sin la opción '--pretty'</b>, por ejemplo <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * o ? para coincidencia de patrones");+ m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",+ "Especifique el archivo de salida de mypy relativo al <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a>. Este archivo puede generarse redirigiendo la salida de mypy <b>sin la opción '--pretty'</b>, por ejemplo <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * o ? para coincidencia de patrones");m.put("Specify name of the branch", "Especifique el nombre de la rama");m.put("Specify name of the environment variable", "Especifique el nombre de la variable de entorno");m.put("Specify name of the iteration", "Especifique el nombre de la iteración");@@ -3645,23 +3645,23 @@ public class Translation_es extends TranslationResourceBundle {m.put("Specify project to run job in", "Especifica el proyecto para ejecutar el trabajo");m.put("Specify projects", "Especifique los proyectos");m.put("Specify projects to update dependencies. Leave empty for current project", "Especifique los proyectos para actualizar dependencias. Déjelo vacío para el proyecto actual");- m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "Especifique el archivo de resultados json de pylint relativo al <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a>. Este archivo puede generarse con la opción de formato de salida json de pylint, por ejemplo <code>--exit-zero --output-format=json:pylint-result.json</code>. Tenga en cuenta que no fallamos el comando pylint ante violaciones, ya que este paso fallará la compilación según el umbral configurado. Use * o ? para coincidencia de patrones");+ m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "Especifique el archivo de resultados json de pylint relativo al <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a>. Este archivo puede generarse con la opción de formato de salida json de pylint, por ejemplo <code>--exit-zero --output-format=json:pylint-result.json</code>. Tenga en cuenta que no fallamos el comando pylint ante violaciones, ya que este paso fallará la compilación según el umbral configurado. Use * o ? para coincidencia de patrones");m.put("Specify registry logins if necessary. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token for password","Especifique los inicios de sesión del registro si es necesario. Para el registro integrado, use <code>@server_url@</code> para la URL del registro, <code>@job_token@</code> para el nombre de usuario y el token de acceso para la contraseña");m.put("Specify registry url. Leave empty for official registry", "Especifique la URL del registro. Déjelo vacío para el registro oficial");- m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "Especifique la ruta relativa bajo el <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espacio de trabajo del trabajo</a> para almacenar el diseño OCI");+ m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "Especifique la ruta relativa bajo el <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espacio de trabajo del trabajo</a> para almacenar el diseño OCI");m.put("Specify repositories", "Especifique los repositorios");m.put("Specify required reviewers if specified path is changed. Note that the user submitting the change is considered to reviewed the change automatically","Especifique los revisores requeridos si se cambia la ruta especificada. Tenga en cuenta que el usuario que envía el cambio se considera que ha revisado el cambio automáticamente");m.put("Specify root URL to access this server", "Especifique la URL raíz para acceder a este servidor");- m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "Especifique el archivo de resultados json de ruff relativo al <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a>. Este archivo puede generarse con la opción de formato de salida json de ruff, por ejemplo <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Tenga en cuenta que no fallamos el comando ruff ante violaciones, ya que este paso fallará la compilación según el umbral configurado. Use * o ? para coincidencia de patrones");- m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Especifique los comandos shell (en Linux/Unix) o comandos batch (en Windows) para ejecutar bajo el <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espacio de trabajo del trabajo</a>");- m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Especifique los comandos shell para ejecutar bajo el <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espacio de trabajo del trabajo</a>");+ m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "Especifique el archivo de resultados json de ruff relativo al <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a>. Este archivo puede generarse con la opción de formato de salida json de ruff, por ejemplo <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Tenga en cuenta que no fallamos el comando ruff ante violaciones, ya que este paso fallará la compilación según el umbral configurado. Use * o ? para coincidencia de patrones");+ m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Especifique los comandos shell (en Linux/Unix) o comandos batch (en Windows) para ejecutar bajo el <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espacio de trabajo del trabajo</a>");+ m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Especifique los comandos shell para ejecutar bajo el <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espacio de trabajo del trabajo</a>");m.put("Specify shell to be used", "Especifique el shell a utilizar");m.put("Specify source param for SCP command, for instance <code>app.tar.gz</code>", "Especifique el parámetro de origen para el comando SCP, por ejemplo <code>app.tar.gz</code>");m.put("Specify space separated refs to pull from remote. '*' can be used in ref name for wildcard match<br><b class='text-danger'>NOTE:</b> branch/tag protection rule will be ignored when update branches/tags via this step",@@ -3680,10 +3680,10 @@ public class Translation_es extends TranslationResourceBundle {"Especifique las direcciones de correo electrónico del remitente separadas por espacios aplicables para esta entrada. Use '*' o '?' para coincidencia de patrones. Prefijo con '-' para excluir. Déjelo vacío para coincidir con todos los remitentes");m.put("Specify space-separated tags to be protected. Use '**', '*' or '?' for <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>path wildcard match</a>. Prefix with '-' to exclude","Especifique las etiquetas separadas por espacios para proteger. Use '**', '*' o '?' para <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>coincidencia de patrones de ruta</a>. Prefijo con '-' para excluir");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: <tt>manual/index.md</tt>",- "Especifique la página de inicio del informe relativa al <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a>, por ejemplo: <tt>manual/index.md</tt>");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: api/index.html",- "Especifique la página de inicio del informe relativa al <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a>, por ejemplo: api/index.html");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: <tt>manual/index.md</tt>",+ "Especifique la página de inicio del informe relativa al <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a>, por ejemplo: <tt>manual/index.md</tt>");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: api/index.html",+ "Especifique la página de inicio del informe relativa al <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a>, por ejemplo: api/index.html");m.put("Specify storage size to request for the build volume. The size should conform to <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>Kubernetes resource capacity format</a>, for instance <i>10Gi</i>","Especifique el tamaño de almacenamiento para solicitar el volumen de compilación. El tamaño debe cumplir con el <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>formato de capacidad de recursos de Kubernetes</a>, por ejemplo <i>10Gi</i>");m.put("Specify tab width used to calculate column value of found problems in provided report",@@ -3769,8 +3769,8 @@ public class Translation_es extends TranslationResourceBundle {m.put("Step Templates", "Plantillas de Paso");m.put("Step {0} of {1}: ", "Paso {0} de {1}:");m.put("Steps", "Pasos");- m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>",- "Los pasos se ejecutarán en serie en el mismo nodo, compartiendo el mismo <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a>");+ m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>",+ "Los pasos se ejecutarán en serie en el mismo nodo, compartiendo el mismo <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a>");m.put("Stop", "Detener");m.put("Stop work", "Detener trabajo");m.put("Stopwatch Overdue", "Cronómetro Vencido");@@ -4008,9 +4008,9 @@ public class Translation_es extends TranslationResourceBundle {m.put("This shows number of issues in various states over time", "Esto muestra el número de problemas en varios estados a lo largo del tiempo");m.put("This shows number of open and merged pull requests over time", "Esto muestra el número de solicitudes de extracción abiertas y fusionadas a lo largo del tiempo");m.put("This step can only be executed by a docker aware executor", "Este paso solo puede ser ejecutado por un ejecutor compatible con Docker");- m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Este paso solo puede ser ejecutado por un ejecutor compatible con Docker. Se ejecuta bajo <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>el espacio de trabajo del trabajo</a>");- m.put("This step copies files from job workspace to build artifacts directory, so that they can be accessed after job is completed",+ m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Este paso solo puede ser ejecutado por un ejecutor compatible con Docker. Se ejecuta bajo <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>el espacio de trabajo del trabajo</a>");+ m.put("This step copies files from job workdir to build artifacts directory, so that they can be accessed after job is completed","Este paso copia archivos desde el espacio de trabajo del trabajo al directorio de artefactos de construcción, para que puedan ser accedidos después de que el trabajo se complete");m.put("This step publishes specified files to be served as project web site. Project web site can be accessed publicly via <code>http://<onedev base url>/path/to/project/~site</code>","Este paso publica los archivos especificados para ser servidos como sitio web del proyecto. El sitio web del proyecto puede ser accedido públicamente a través de <code>http://<onedev base url>/path/to/project/~site</code>");@@ -4728,8 +4728,8 @@ public class Translation_es extends TranslationResourceBundle {"Opcionalmente especifique tipos de commit aplicables para la verificación del pie de mensaje de commit (presione ENTER para agregar valor). Dejar vacío para todos los tipos");m.put("Optionally specify extra options for osv source scanner. Multiple options need to be separated with space","Opcionalmente especifique opciones extra para el escáner de fuente osv. Múltiples opciones deben ser separadas con espacio");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",- "Opcionalmente especifique la ruta relativa al <a href='https://docs.onedev.io/concepts#job-workspace'>espacio de trabajo del trabajo</a> para ser usada como <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>configuración de secretos</a> de trivy");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",+ "Opcionalmente especifique la ruta relativa al <a href='https://docs.onedev.io/concepts#job-workdir'>espacio de trabajo del trabajo</a> para ser usada como <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>configuración de secretos</a> de trivy");m.put("Osv Source Scanner", "Escáner de Fuente Osv");m.put("Run osv scanner to scan project source for vulnerabilities in <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>various lock files</a>. It can only be executed by docker aware executor.","Ejecutar el escáner osv para escanear la fuente del proyecto en busca de vulnerabilidades en <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>varios archivos de bloqueo</a>. Solo puede ser ejecutado por un ejecutor compatible con docker.");diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_fr.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_fr.javaindex e654e7d9f0..ffeefa41be 100644--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_fr.java+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_fr.java@@ -1397,8 +1397,8 @@ public class Translation_fr extends TranslationResourceBundle {"Pour un commit de build non accessible depuis la branche par défaut, un <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>secret de travail</a> doit être spécifié comme jeton d'accès avec la permission de créer une balise");m.put("For build commit not reachable from default branch, a <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> should be specified as access token with manage issue permission","Pour un commit de build non accessible depuis la branche par défaut, un <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>secret de travail</a> doit être spécifié comme jeton d'accès avec la permission de gérer les problèmes");- m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>). For shell related executors which runs on host machine directly, only relative path is accepted",- "Pour les exécuteurs compatibles avec Docker, ce chemin est à l'intérieur du conteneur et accepte à la fois les chemins absolus et relatifs (relatifs à <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail du travail</a>). Pour les exécuteurs liés au shell qui s'exécutent directement sur la machine hôte, seuls les chemins relatifs sont acceptés");+ m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>). For shell related executors which runs on host machine directly, only relative path is accepted",+ "Pour les exécuteurs compatibles avec Docker, ce chemin est à l'intérieur du conteneur et accepte à la fois les chemins absolus et relatifs (relatifs à <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail du travail</a>). Pour les exécuteurs liés au shell qui s'exécutent directement sur la machine hôte, seuls les chemins relatifs sont acceptés");m.put("For each build, OneDev calculates a list of fixed issues since previous build automatically. This setting provides a default query to further filter/order this list. For a given job, the first matching entry will be used.","Pour chaque build, OneDev calcule automatiquement une liste de problèmes corrigés depuis le build précédent. Ce paramètre fournit une requête par défaut pour filtrer/ordonner davantage cette liste. Pour un travail donné, la première entrée correspondante sera utilisée.");m.put("For each selected branch/tag, a separate build will be generated with branch/tag set to corresponding value",@@ -2346,7 +2346,7 @@ public class Translation_fr extends TranslationResourceBundle {m.put("Optionally filter issues", "Filtrez éventuellement les problèmes");m.put("Optionally filter pull requests", "Filtrez éventuellement les pull requests");m.put("Optionally leave a note", "Laissez éventuellement une note");- m.put("Optionally mount directories or files under job workspace into container", "Montez éventuellement des répertoires ou des fichiers sous l'espace de travail du job dans le conteneur");+ m.put("Optionally mount directories or files under job workdir into container", "Montez éventuellement des répertoires ou des fichiers sous l'espace de travail du job dans le conteneur");m.put("Optionally select fields to prompt when this button is pressed", "Sélectionnez éventuellement les champs à afficher lorsque ce bouton est pressé");m.put("Optionally select fields to remove when this transition happens", "Sélectionnez éventuellement les champs à supprimer lorsque cette transition se produit");m.put("Optionally specifies name of the attribute inside the user LDAP entry whose value will be taken as user email. This field is normally set to <i>mail</i> according to RFC 2798",@@ -2366,8 +2366,8 @@ public class Translation_fr extends TranslationResourceBundle {m.put("Optionally specify <span class='text-info'>comma separated</span> platforms to scan, for instance <tt>linux/amd64,linux/arm64</tt>. Leave empty to scan all platforms in OCI layout","Spécifiez éventuellement des <span class='text-info'>plateformes séparées par des virgules</span> à analyser, par exemple <tt>linux/amd64,linux/arm64</tt>. Laissez vide pour analyser toutes les plateformes dans la disposition OCI.");m.put("Optionally specify API key for authentication", "Spécifiez éventuellement la clé API pour l'authentification");- m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",- "Spécifiez éventuellement le Dockerfile relatif à <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail de la tâche</a>. Laissez vide pour utiliser le fichier <tt>Dockerfile</tt> sous le chemin de construction spécifié ci-dessus.");+ m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",+ "Spécifiez éventuellement le Dockerfile relatif à <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail de la tâche</a>. Laissez vide pour utiliser le fichier <tt>Dockerfile</tt> sous le chemin de construction spécifié ci-dessus.");m.put("Optionally specify JavaScript config to be used by Renovate CLI", "Spécifiez éventuellement une configuration JavaScript à utiliser par Renovate CLI.");m.put("Optionally specify SSH root URL, which will be used to construct project clone url via SSH protocol. Leave empty to derive from server url","Spécifiez éventuellement une URL racine SSH, qui sera utilisée pour construire l'URL de clonage du projet via le protocole SSH. Laissez vide pour dériver de l'URL du serveur.");@@ -2385,8 +2385,8 @@ public class Translation_fr extends TranslationResourceBundle {"Spécifiez éventuellement une expression cron pour planifier la sauvegarde automatique de la base de données. Le format de l'expression cron est <em><secondes> <minutes> <heures> <jour-du-mois> <mois> <jour-de-la-semaine></em>. Par exemple, <em>0 0 1 * * ?</em> signifie 1h00 tous les jours. Pour plus de détails sur le format, consultez le <a href='http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html#format' target='_blank'>tutoriel Quartz</a>. Les fichiers de sauvegarde seront placés dans le dossier <em>db-backup</em> sous le répertoire d'installation de OneDev. Dans le cas où plusieurs serveurs se connectent pour former un cluster, la sauvegarde automatique a lieu sur le <a href='https://docs.onedev.io/concepts#lead-server' target='_blank'>serveur principal</a>. Laissez cette propriété vide si vous ne souhaitez pas activer la sauvegarde automatique de la base de données.");m.put("Optionally specify a date field to hold due date information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Spécifiez éventuellement un champ de date pour contenir les informations de date d'échéance.<br><b>NOTE : </b> Vous pouvez personnaliser les champs de problème OneDev au cas où il n'y aurait pas d'option appropriée ici.");- m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to put retrieved artifacts. Leave empty to use job workspace itself",- "Spécifiez éventuellement un chemin relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail de la tâche</a> pour placer les artefacts récupérés. Laissez vide pour utiliser l'espace de travail de la tâche lui-même.");+ m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to put retrieved artifacts. Leave empty to use job workdir itself",+ "Spécifiez éventuellement un chemin relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail de la tâche</a> pour placer les artefacts récupérés. Laissez vide pour utiliser l'espace de travail de la tâche lui-même.");m.put("Optionally specify a storage class to allocate build volume dynamically. Leave empty to use default storage class. <b class='text-warning'>NOTE:</b> Reclaim policy of the storage class should be set to <code>Delete</code>, as the volume is only used to hold temporary build files","Spécifiez éventuellement une classe de stockage pour allouer dynamiquement le volume de construction. Laissez vide pour utiliser la classe de stockage par défaut. <b class='text-warning'>NOTE :</b> La politique de récupération de la classe de stockage doit être définie sur <code>Delete</code>, car le volume est uniquement utilisé pour contenir des fichiers de construction temporaires.");m.put("Optionally specify a working period field to hold estimated time infomration.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",@@ -2405,17 +2405,17 @@ public class Translation_fr extends TranslationResourceBundle {m.put("Optionally specify applicable jobs of this executor", "Spécifiez éventuellement les travaux applicables à cet exécuteur");m.put("Optionally specify applicable users who pushed the change", "Spécifiez éventuellement les utilisateurs applicables qui ont poussé le changement");m.put("Optionally specify arguments to run above image", "Spécifiez éventuellement des arguments pour exécuter l'image ci-dessus.");- m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",- "Spécifiez éventuellement des artefacts à récupérer de la dépendance dans <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail de la tâche</a>. Seuls les artefacts publiés (via l'étape de publication d'artefacts) peuvent être récupérés. Laissez vide pour ne récupérer aucun artefact.");+ m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",+ "Spécifiez éventuellement des artefacts à récupérer de la dépendance dans <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail de la tâche</a>. Seuls les artefacts publiés (via l'étape de publication d'artefacts) peuvent être récupérés. Laissez vide pour ne récupérer aucun artefact.");m.put("Optionally specify authorized roles to press this button. If not specified, all users are allowed","Spécifiez éventuellement les rôles autorisés à appuyer sur ce bouton. Si non spécifié, tous les utilisateurs sont autorisés.");m.put("Optionally specify base query of the list", "Spécifiez éventuellement la requête de base de la liste.");m.put("Optionally specify branches/users/groups allowed to access this secret. If left empty, any job can access this secret, including those triggered via external pull requests","Spécifiez éventuellement les branches/utilisateurs/groupes autorisés à accéder à ce secret. Si laissé vide, toute tâche peut accéder à ce secret, y compris celles déclenchées via des demandes de tirage externes.");- m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",- "Spécifiez éventuellement le chemin du contexte de construction relatif à <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail de la tâche</a>. Laissez vide pour utiliser l'espace de travail de la tâche lui-même. Le fichier <code>Dockerfile</code> est censé exister dans le répertoire du contexte de construction, sauf si vous spécifiez un emplacement différent avec l'option <code>--dockerfile</code>.");- m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself",- "Spécifiez éventuellement le chemin de construction relatif à <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail de la tâche</a>. Laissez vide pour utiliser l'espace de travail de la tâche lui-même.");+ m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",+ "Spécifiez éventuellement le chemin du contexte de construction relatif à <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail de la tâche</a>. Laissez vide pour utiliser l'espace de travail de la tâche lui-même. Le fichier <code>Dockerfile</code> est censé exister dans le répertoire du contexte de construction, sauf si vous spécifiez un emplacement différent avec l'option <code>--dockerfile</code>.");+ m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself",+ "Spécifiez éventuellement le chemin de construction relatif à <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail de la tâche</a>. Laissez vide pour utiliser l'espace de travail de la tâche lui-même.");m.put("Optionally specify cluster role the job pods service account binding to. This is necessary if you want to do things such as running other Kubernetes pods in job command","Spécifiez éventuellement le rôle de cluster auquel le compte de service des pods de tâche est lié. Cela est nécessaire si vous souhaitez effectuer des actions telles que l'exécution d'autres pods Kubernetes dans la commande de tâche.");m.put("Optionally specify container arguments separated by space. Single argument containing space should be quoted. <b class='text-warning'>Note: </b> do not confuse this with container options which should be specified in executor setting",@@ -2478,13 +2478,13 @@ public class Translation_fr extends TranslationResourceBundle {"Spécifiez éventuellement les options pour la commande ssh. Plusieurs options doivent être séparées par des espaces.");m.put("Optionally specify options passed to renovate cli. Multiple options should be separated by space, and single option containing spaces should be quoted","Spécifiez éventuellement les options passées à renovate cli. Plusieurs options doivent être séparées par des espaces, et une seule option contenant des espaces doit être entre guillemets.");- m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. You may ignore particular vulnerabilities via this file",- "Spécifiez éventuellement le fichier de configuration du scanner osv <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>sous</a> <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail de la tâche</a>. Vous pouvez ignorer certaines vulnérabilités via ce fichier.");+ m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. You may ignore particular vulnerabilities via this file",+ "Spécifiez éventuellement le fichier de configuration du scanner osv <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>sous</a> <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail de la tâche</a>. Vous pouvez ignorer certaines vulnérabilités via ce fichier.");m.put("Optionally specify path protection rules", "Spécifiez éventuellement les règles de protection de chemin.");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",- "Spécifiez éventuellement le chemin relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail de la tâche</a> à utiliser comme fichier d'ignorance trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>.");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to publish artifacts from. Leave empty to use job workspace itself",- "Spécifiez éventuellement le chemin relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail de la tâche</a> pour publier des artefacts. Laissez vide pour utiliser l'espace de travail de la tâche lui-même.");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",+ "Spécifiez éventuellement le chemin relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail de la tâche</a> à utiliser comme fichier d'ignorance trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>.");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to publish artifacts from. Leave empty to use job workdir itself",+ "Spécifiez éventuellement le chemin relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail de la tâche</a> pour publier des artefacts. Laissez vide pour utiliser l'espace de travail de la tâche lui-même.");m.put("Optionally specify platform to pull, for instance <tt>linux/amd64</tt>. Leave empty to pull all platforms in image","Spécifiez éventuellement la plateforme à récupérer, par exemple <tt>linux/amd64</tt>. Laissez vide pour récupérer toutes les plateformes dans l'image.");m.put("Optionally specify project to show builds of. Leave empty to show builds of all projects with permissions",@@ -2498,12 +2498,12 @@ public class Translation_fr extends TranslationResourceBundle {m.put("Optionally specify registry logins to override those defined in job executor. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token secret for password secret","Spécifiez éventuellement les connexions au registre pour remplacer celles définies dans l'exécuteur de tâche. Pour le registre intégré, utilisez <code>@server_url@</code> pour l'URL du registre, <code>@job_token@</code> pour le nom d'utilisateur, et le secret du jeton d'accès pour le mot de passe.");m.put("Optionally specify relative directory to put uploaded files", "Spécifiez éventuellement le répertoire relatif pour placer les fichiers téléchargés.");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to clone code into. Leave empty to use job workspace itself",- "Spécifiez éventuellement le chemin relatif sous <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail de la tâche</a> pour cloner le code. Laissez vide pour utiliser l'espace de travail de la tâche lui-même.");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan. Leave empty to use job workspace itself",- "Spécifiez éventuellement le chemin relatif sous <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail de la tâche</a> pour analyser. Laissez vide pour utiliser l'espace de travail de la tâche lui-même.");- m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workspace itself",- "Spécifiez éventuellement les chemins relatifs sous <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail de la tâche</a> pour analyser les vulnérabilités des dépendances. Plusieurs chemins peuvent être spécifiés et doivent être séparés par des espaces. Laissez vide pour utiliser l'espace de travail de la tâche lui-même.");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to clone code into. Leave empty to use job workdir itself",+ "Spécifiez éventuellement le chemin relatif sous <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail de la tâche</a> pour cloner le code. Laissez vide pour utiliser l'espace de travail de la tâche lui-même.");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan. Leave empty to use job workdir itself",+ "Spécifiez éventuellement le chemin relatif sous <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail de la tâche</a> pour analyser. Laissez vide pour utiliser l'espace de travail de la tâche lui-même.");+ m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workdir itself",+ "Spécifiez éventuellement les chemins relatifs sous <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail de la tâche</a> pour analyser les vulnérabilités des dépendances. Plusieurs chemins peuvent être spécifiés et doivent être séparés par des espaces. Laissez vide pour utiliser l'espace de travail de la tâche lui-même.");m.put("Optionally specify required reviewers for changes of specified branch", "Spécifiez éventuellement les réviseurs requis pour les modifications de la branche spécifiée.");m.put("Optionally specify revision to create branch from. Leave empty to create from build commit","Spécifiez éventuellement la révision à partir de laquelle créer la branche. Laissez vide pour créer à partir du commit de construction.");@@ -3117,8 +3117,8 @@ public class Translation_fr extends TranslationResourceBundle {m.put("Run job", "Exécuter le travail");m.put("Run job in another project", "Exécuter le travail dans un autre projet");m.put("Run on Bare Metal/Virtual Machine", "Exécuter sur Bare Metal/Machine Virtuelle");- m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKSPACE</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",- "Exécutez le conteneur docker spécifié. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>L'espace de travail du travail</a> est monté dans le conteneur et son chemin est placé dans la variable d'environnement <code>ONEDEV_WORKSPACE</code>. <b class='text-warning'>Remarque : </b> cette étape ne peut être exécutée que par un exécuteur docker serveur ou un exécuteur docker distant");+ m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKDIR</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",+ "Exécutez le conteneur docker spécifié. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>L'espace de travail du travail</a> est monté dans le conteneur et son chemin est placé dans la variable d'environnement <code>ONEDEV_WORKDIR</code>. <b class='text-warning'>Remarque : </b> cette étape ne peut être exécutée que par un exécuteur docker serveur ou un exécuteur docker distant");m.put("Run specified step template", "Exécuter le modèle d'étape spécifié");m.put("Run this job", "Exécuter ce travail");m.put("Run trivy container image scanner to find issues in specified image. For vulnerabilities, it checks various <a href='https://aquasecurity.github.io/trivy/v0.50/docs/coverage/language/#supported-languages' target='_blank'>distribution files</a>. It can only be executed by docker aware executor.",@@ -3391,47 +3391,47 @@ public class Translation_fr extends TranslationResourceBundle {m.put("Specifies who can access this AI service", "Spécifie qui peut accéder à ce service AI");m.put("Specifies who can access this AI service. AI service can be accessed in below approaches:","Spécifie qui peut accéder à ce service d'IA. Le service d'IA peut être accessible selon les approches suivantes :");- m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",- "Spécifie le fichier de résultats de test .net TRX relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>, par exemple <tt>TestResults/*.trx</tt>. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",+ "Spécifie le fichier de résultats de test .net TRX relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>, par exemple <tt>TestResults/*.trx</tt>. Utilisez * ou ? pour la correspondance de modèle");m.put("Specify <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> whose value is access token with code write permission over above projects. Commits, issues, and pull requests will also be created under name of the access token owner","Spécifie un <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>secret de job</a> dont la valeur est un jeton d'accès avec la permission d'écriture de code sur les projets ci-dessus. Les commits, les problèmes et les demandes de tirage seront également créés sous le nom du propriétaire du jeton d'accès");- m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",- "Spécifie le fichier de sortie json <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>. Ce fichier peut être généré avec l'option de sortie json de clippy, par exemple <code>cargo clippy --message-format json>check-result.json</code>. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",+ "Spécifie le fichier de sortie json <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>. Ce fichier peut être généré avec l'option de sortie json de clippy, par exemple <code>cargo clippy --message-format json>check-result.json</code>. Utilisez * ou ? pour la correspondance de modèle");m.put("Specify Build Options", "Spécifie les options de construction");- m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",- "Spécifie le fichier xml de résultats CPD relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>, par exemple, <tt>target/cpd.xml</tt>. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",+ "Spécifie le fichier xml de résultats CPD relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>, par exemple, <tt>target/cpd.xml</tt>. Utilisez * ou ? pour la correspondance de modèle");m.put("Specify Commit Message", "Spécifie le message de commit");- m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",- "Spécifie le fichier de rapport ESLint au format checkstyle sous <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>. Ce fichier peut être généré avec l'option ESLint <tt>'-f checkstyle'</tt> et <tt>'-o'</tt>. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",+ "Spécifie le fichier de rapport ESLint au format checkstyle sous <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>. Ce fichier peut être généré avec l'option ESLint <tt>'-f checkstyle'</tt> et <tt>'-o'</tt>. Utilisez * ou ? pour la correspondance de modèle");m.put("Specify GitHub API url, for instance <tt>https://api.github.com</tt>", "Spécifie l'URL de l'API GitHub, par exemple <tt>https://api.github.com</tt>");m.put("Specify GitLab API url, for instance <tt>https://gitlab.example.com/api/v4</tt>", "Spécifie l'URL de l'API GitLab, par exemple <tt>https://gitlab.example.com/api/v4</tt>");m.put("Specify Gitea API url, for instance <tt>https://gitea.example.com/api/v1</tt>", "Spécifie l'URL de l'API Gitea, par exemple <tt>https://gitea.example.com/api/v1</tt>");- m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",- "Spécifie le fichier XML de résultats GoogleTest relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>. Ce rapport peut être généré avec la variable d'environnement <tt>GTEST_OUTPUT</tt> lors de l'exécution des tests, par exemple, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",+ "Spécifie le fichier XML de résultats GoogleTest relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>. Ce rapport peut être généré avec la variable d'environnement <tt>GTEST_OUTPUT</tt> lors de l'exécution des tests, par exemple, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Utilisez * ou ? pour la correspondance de modèle");m.put("Specify IMAP user name.<br><b class='text-danger'>NOTE: </b> This account should be able to receive emails sent to system email address specified above","Spécifie le nom d'utilisateur IMAP.<br><b class='text-danger'>NOTE : </b> Ce compte doit être capable de recevoir les emails envoyés à l'adresse email système spécifiée ci-dessus");- m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",- "Spécifie le fichier de résultats de test JUnit au format XML relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>, par exemple <tt>target/surefire-reports/TEST-*.xml</tt>. Utilisez * ou ? pour la correspondance de modèle");- m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",- "Spécifie le fichier de rapport de couverture xml JaCoCo relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>, par exemple, <tt>target/site/jacoco/jacoco.xml</tt>. Utilisez * ou ? pour la correspondance de modèle");- m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",- "Spécifie le fichier de rapport de couverture Jest au format clover relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>, par exemple <tt>coverage/clover.xml</tt>. Ce fichier peut être généré avec l'option Jest <tt>'--coverage'</tt>. Utilisez * ou ? pour la correspondance de modèle");- m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",- "Spécifie le fichier de résultats de test Jest au format json relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>. Ce fichier peut être généré via l'option Jest <tt>'--json'</tt> et <tt>'--outputFile'</tt>. Utilisez * ou ? pour la correspondance de modèle");- m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Spécifie le répertoire de mise en page OCI de l'image à analyser. Ce répertoire peut être généré via l'étape de construction d'image ou l'étape de récupération d'image. Il doit être relatif à <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail du job</a>");- m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to push from",- "Spécifie le répertoire de mise en page OCI relatif à <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail du job</a> à partir duquel effectuer le push");+ m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",+ "Spécifie le fichier de résultats de test JUnit au format XML relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>, par exemple <tt>target/surefire-reports/TEST-*.xml</tt>. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",+ "Spécifie le fichier de rapport de couverture xml JaCoCo relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>, par exemple, <tt>target/site/jacoco/jacoco.xml</tt>. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",+ "Spécifie le fichier de rapport de couverture Jest au format clover relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>, par exemple <tt>coverage/clover.xml</tt>. Ce fichier peut être généré avec l'option Jest <tt>'--coverage'</tt>. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",+ "Spécifie le fichier de résultats de test Jest au format json relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>. Ce fichier peut être généré via l'option Jest <tt>'--json'</tt> et <tt>'--outputFile'</tt>. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Spécifie le répertoire de mise en page OCI de l'image à analyser. Ce répertoire peut être généré via l'étape de construction d'image ou l'étape de récupération d'image. Il doit être relatif à <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail du job</a>");+ m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to push from",+ "Spécifie le répertoire de mise en page OCI relatif à <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail du job</a> à partir duquel effectuer le push");m.put("Specify OpenID scopes to request", "Spécifie les scopes OpenID à demander");- m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",- "Spécifie le fichier xml de résultats PMD relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>, par exemple, <tt>target/pmd.xml</tt>. Utilisez * ou ? pour la correspondance de modèle");- m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",- "Spécifie les commandes PowerShell à exécuter sous <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail du job</a>.<br><b class='text-warning'>NOTE : </b> OneDev vérifie le code de sortie du script pour déterminer si l'étape est réussie. Étant donné que PowerShell retourne toujours 0 même en cas d'erreurs de script, vous devez gérer les erreurs dans le script et sortir avec un code non nul, ou ajouter la ligne <code>$ErrorActionPreference = "Stop"</code> au début de votre script<br>");- m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",- "Spécifie le fichier de sortie des diagnostics Roslynator au format XML relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>. Ce fichier peut être généré avec l'option <i>-o</i>. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",+ "Spécifie le fichier xml de résultats PMD relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>, par exemple, <tt>target/pmd.xml</tt>. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",+ "Spécifie les commandes PowerShell à exécuter sous <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail du job</a>.<br><b class='text-warning'>NOTE : </b> OneDev vérifie le code de sortie du script pour déterminer si l'étape est réussie. Étant donné que PowerShell retourne toujours 0 même en cas d'erreurs de script, vous devez gérer les erreurs dans le script et sortir avec un code non nul, ou ajouter la ligne <code>$ErrorActionPreference = "Stop"</code> au début de votre script<br>");+ m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",+ "Spécifie le fichier de sortie des diagnostics Roslynator au format XML relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>. Ce fichier peut être généré avec l'option <i>-o</i>. Utilisez * ou ? pour la correspondance de modèle");m.put("Specify Shell/Batch Commands to Run", "Spécifie les commandes Shell/Batch à exécuter");- m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",- "Spécifie le fichier xml de résultats SpotBugs relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>, par exemple, <tt>target/spotbugsXml.xml</tt>. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",+ "Spécifie le fichier xml de résultats SpotBugs relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>, par exemple, <tt>target/spotbugsXml.xml</tt>. Utilisez * ou ? pour la correspondance de modèle");m.put("Specify System Settings", "Spécifie les paramètres système");m.put("Specify URL of remote git repository. Only http/https protocol is supported", "Spécifie l'URL du dépôt git distant. Seuls les protocoles http/https sont pris en charge");m.put("Specify YouTrack login name. This account should have permission to:<ul><li>Read full information and issues of the projects you want to import<li>Read issue tags<li>Read user basic information</ul>",@@ -3466,14 +3466,14 @@ public class Translation_fr extends TranslationResourceBundle {m.put("Specify a Docker Image to Test Against", "Spécifie une image Docker à tester");m.put("Specify a custom field of Enum type", "Spécifie un champ personnalisé de type Enum");m.put("Specify a default query to filter/order fixed issues of specified jobs", "Spécifie une requête par défaut pour filtrer/ordonner les problèmes résolus des jobs spécifiés");- m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to write checksum into",- "Spécifie un fichier relatif à <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail du job</a> pour écrire le checksum");+ m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to write checksum into",+ "Spécifie un fichier relatif à <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail du job</a> pour écrire le checksum");m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Spécifie un champ utilisateur multi-valeurs pour contenir les informations des assignés.<b>NOTE : </b> Vous pouvez personnaliser les champs de problème OneDev si aucune option appropriée n'est disponible ici");m.put("Specify a multi-value user field to hold assignees information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Spécifie un champ utilisateur multi-valeurs pour contenir les informations des assignés.<br><b>NOTE : </b> Vous pouvez personnaliser les champs de problème OneDev si aucune option appropriée n'est disponible ici");m.put("Specify a path inside container to be used as mount target", "Spécifie un chemin à l'intérieur du conteneur à utiliser comme cible de montage");- m.put("Specify a path relative to job workspace to be used as mount source. Leave empty to mount job workspace itself",+ m.put("Specify a path relative to job workdir to be used as mount source. Leave empty to mount job workdir itself","Spécifie un chemin relatif à l'espace de travail du job à utiliser comme source de montage. Laissez vide pour monter l'espace de travail du job lui-même");m.put("Specify a secret to be used as access token to create issue in above project if it is not publicly accessible","Spécifie un secret à utiliser comme jeton d'accès pour créer un problème dans le projet ci-dessus s'il n'est pas accessible publiquement");@@ -3499,8 +3499,8 @@ public class Translation_fr extends TranslationResourceBundle {m.put("Specify application (client) ID of the app registered in Entra ID", "Spécifie l'ID de l'application (client) de l'application enregistrée dans Entra ID");m.put("Specify arguments for imagetools. For instance <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>","Spécifie les arguments pour imagetools. Par exemple <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>");- m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved.",- "Spécifie les artefacts à récupérer dans <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>. Seuls les artefacts publiés (via l'étape de publication d'artefacts) peuvent être récupérés.");+ m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved.",+ "Spécifie les artefacts à récupérer dans <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>. Seuls les artefacts publiés (via l'étape de publication d'artefacts) peuvent être récupérés.");m.put("Specify at least 10 alphanumeric chars to be used as secret, and then add an inbound parse entry at SendGrid side:<ul><li><code>Destination URL</code> should be set to <i><OneDev root url>/~sendgrid/<secret></i>, for instance, <i>https://onedev.example.com/~sendgrid/1234567890</i>. Note that in production environment, <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>https should be enabled</a> to protect the secret</li><li><code>Receiving domain</code> should be the same as domain part of system email address specified above</li><li>Option <code>POST the raw, full MIME message</code> is enabled</li></ul>","Spécifie au moins 10 caractères alphanumériques à utiliser comme secret, puis ajoutez une entrée de parse inbound côté SendGrid :<ul><li><code>URL de destination</code> doit être défini sur <i><URL racine OneDev>/~sendgrid/<secret></i>, par exemple, <i>https://onedev.example.com/~sendgrid/1234567890</i>. Notez qu'en environnement de production, <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>https doit être activé</a> pour protéger le secret</li><li><code>Domaine de réception</code> doit être le même que la partie domaine de l'adresse email système spécifiée ci-dessus</li><li>L'option <code>POST le message MIME brut et complet</code> est activée</li></ul>");m.put("Specify base nodes for user search. For example: <i>cn=Users, dc=example, dc=com</i>",@@ -3516,13 +3516,13 @@ public class Translation_fr extends TranslationResourceBundle {"Spécifie le certificat à faire confiance si vous utilisez un certificat auto-signé pour le dépôt distant");m.put("Specify certificates to trust if you are using self-signed certificates for your docker registries","Spécifie les certificats à faire confiance si vous utilisez des certificats auto-signés pour vos registres Docker");- m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",- "Spécifie le fichier xml de résultats checkstyle relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>, par exemple, <tt>target/checkstyle-result.xml</tt>. Consultez la <a href='https://checkstyle.org/'>documentation checkstyle</a> pour savoir comment générer le fichier xml de résultats. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",+ "Spécifie le fichier xml de résultats checkstyle relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>, par exemple, <tt>target/checkstyle-result.xml</tt>. Consultez la <a href='https://checkstyle.org/'>documentation checkstyle</a> pour savoir comment générer le fichier xml de résultats. Utilisez * ou ? pour la correspondance de modèle");m.put("Specify client secret of the app registered in Entra ID", "Spécifie le secret client de l'application enregistrée dans Entra ID");- m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",- "Spécifie le fichier de rapport de couverture xml clover relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>, par exemple, <tt>target/site/clover/clover.xml</tt>. Consultez la <a href='https://openclover.org/documentation'>documentation OpenClover</a> pour savoir comment générer le fichier xml clover. Utilisez * ou ? pour la correspondance de modèle");- m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",- "Spécifie le fichier de rapport de couverture xml cobertura relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>, par exemple, <tt>target/site/cobertura/coverage.xml</tt>. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",+ "Spécifie le fichier de rapport de couverture xml clover relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>, par exemple, <tt>target/site/clover/clover.xml</tt>. Consultez la <a href='https://openclover.org/documentation'>documentation OpenClover</a> pour savoir comment générer le fichier xml clover. Utilisez * ou ? pour la correspondance de modèle");+ m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",+ "Spécifie le fichier de rapport de couverture xml cobertura relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>, par exemple, <tt>target/site/cobertura/coverage.xml</tt>. Utilisez * ou ? pour la correspondance de modèle");m.put("Specify color of the state for displaying purpose", "Spécifie la couleur de l'état à des fins d'affichage");m.put("Specify columns of the board. Each column corresponds to a value of the issue field specified above","Spécifie les colonnes du tableau. Chaque colonne correspond à une valeur du champ de problème spécifié ci-dessus");@@ -3535,8 +3535,8 @@ public class Translation_fr extends TranslationResourceBundle {"Spécifiez l'URL de découverte de configuration de votre fournisseur OpenID, par exemple : <code>https://openid.example.com/.well-known/openid-configuration</code>. Assurez-vous d'utiliser le protocole HTTPS car OneDev s'appuie sur le chiffrement TLS pour garantir la validité des jetons");m.put("Specify container image to execute commands inside", "Spécifiez l'image du conteneur pour exécuter les commandes");m.put("Specify container image to run", "Spécifiez l'image du conteneur à exécuter");- m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",- "Spécifiez le fichier de résultats XML de cppcheck relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>. Ce fichier peut être généré avec l'option de sortie XML de cppcheck, par exemple <code>cppcheck src --xml 2>check-result.xml</code>. Utilisez * ou ? pour correspondre au modèle");+ m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",+ "Spécifiez le fichier de résultats XML de cppcheck relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>. Ce fichier peut être généré avec l'option de sortie XML de cppcheck, par exemple <code>cppcheck src --xml 2>check-result.xml</code>. Utilisez * ou ? pour correspondre au modèle");m.put("Specify cpu request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","Spécifiez la demande de CPU pour chaque job/service utilisant cet exécuteur. Consultez <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>la gestion des ressources Kubernetes</a> pour plus de détails");m.put("Specify default assignees of pull requests submitted to this project. Only users with the write code permission to the project can be selected",@@ -3545,8 +3545,8 @@ public class Translation_fr extends TranslationResourceBundle {m.put("Specify destinations, for instance <tt>registry-server:5000/myorg/myrepo:latest</tt>. Make sure to use <b>same host</b> as specified in server url of system settings if you want to push to built-in registry, or simply use the form <tt>@server@/<project path>/<repo name>:<tag name></tt>. Multiple destinations should be separated with space","Spécifiez les destinations, par exemple <tt>registry-server:5000/myorg/myrepo:latest</tt>. Assurez-vous d'utiliser <b>le même hôte</b> que celui spécifié dans l'URL du serveur des paramètres système si vous souhaitez pousser vers le registre intégré, ou utilisez simplement la forme <tt>@server@/<project path>/<repo name>:<tag name></tt>. Les destinations multiples doivent être séparées par un espace");m.put("Specify directory (tenant) ID of the app registered in Entra ID", "Spécifiez l'ID du répertoire (tenant) de l'application enregistrée dans Entra ID");- m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "Spécifiez le répertoire relatif à <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail du job</a> pour stocker la disposition OCI");+ m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "Spécifiez le répertoire relatif à <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail du job</a> pour stocker la disposition OCI");m.put("Specify docker image of the service", "Spécifiez l'image Docker du service");m.put("Specify dockerx builder used to build docker image. OneDev will create the builder automatically if it does not exist. Check <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>this tutorial</a> on how to customize the builder for instance to allow publishing to insecure registries","Spécifiez le builder dockerx utilisé pour construire l'image Docker. OneDev créera automatiquement le builder s'il n'existe pas. Consultez <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>ce tutoriel</a> pour savoir comment personnaliser le builder, par exemple pour permettre la publication dans des registres non sécurisés");@@ -3557,10 +3557,10 @@ public class Translation_fr extends TranslationResourceBundle {"Spécifiez les champs des différents problèmes créés par Renovate pour orchestrer la mise à jour des dépendances");m.put("Specify fields to be displayed in the issue list", "Spécifiez les champs à afficher dans la liste des problèmes");m.put("Specify fields to display in board card", "Spécifiez les champs à afficher sur la carte du tableau");- m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published. Use * or ? for pattern match",- "Spécifiez les fichiers relatifs à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a> à publier. Utilisez * ou ? pour correspondre au modèle");- m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Spécifiez les fichiers pour créer une somme de contrôle md5. Les fichiers multiples doivent être séparés par un espace. Les modèles <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> sont acceptés. Un fichier non absolu est considéré comme relatif à <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail du job</a>");+ m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published. Use * or ? for pattern match",+ "Spécifiez les fichiers relatifs à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a> à publier. Utilisez * ou ? pour correspondre au modèle");+ m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Spécifiez les fichiers pour créer une somme de contrôle md5. Les fichiers multiples doivent être séparés par un espace. Les modèles <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> sont acceptés. Un fichier non absolu est considéré comme relatif à <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail du job</a>");m.put("Specify files under above directory to be published", "Spécifiez les fichiers sous le répertoire ci-dessus à publier");m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> <code>index.html</code> should be included in these files to be served as site start page","Spécifiez les fichiers sous le répertoire ci-dessus à publier. Utilisez * ou ? pour correspondre au modèle. <b>REMARQUE :</b> <code>index.html</code> doit être inclus dans ces fichiers pour être servi comme page de démarrage du site");@@ -3604,8 +3604,8 @@ public class Translation_fr extends TranslationResourceBundle {m.put("Specify manager DN to authenticate OneDev itself to Active Directory. The manager DN should be specified in form of <i><account name>@<domain></i>, for instance: <i>[email protected]</i>","Spécifiez le DN du gestionnaire pour authentifier OneDev lui-même auprès d'Active Directory. Le DN du gestionnaire doit être spécifié sous la forme <i><nom du compte>@<domaine></i>, par exemple : <i>[email protected]</i>");m.put("Specify manager DN to authenticate OneDev itself to LDAP server", "Spécifiez le DN du gestionnaire pour authentifier OneDev lui-même auprès du serveur LDAP");- m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published",- "Spécifiez le fichier markdown relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a> à publier");+ m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published",+ "Spécifiez le fichier markdown relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a> à publier");m.put("Specify max git LFS file size in mega bytes", "Spécifiez la taille maximale des fichiers Git LFS en mégaoctets");m.put("Specify max number of CPU intensive tasks the server can run concurrently, such as Git repository pull/push, repository index, etc.","Spécifiez le nombre maximal de tâches intensives en CPU que le serveur peut exécuter simultanément, telles que le pull/push de dépôt Git, l'indexation de dépôt, etc.");@@ -3621,8 +3621,8 @@ public class Translation_fr extends TranslationResourceBundle {"Spécifiez la taille maximale des fichiers téléchargés via l'interface web en mégaoctets. Cela s'applique aux fichiers téléchargés dans le dépôt, au contenu markdown (commentaire de problème, etc.) et aux artefacts de construction");m.put("Specify memory request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","Spécifiez la demande de mémoire pour chaque job/service utilisant cet exécuteur. Consultez <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>la gestion des ressources Kubernetes</a> pour plus de détails");- m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",- "Spécifiez le fichier de sortie mypy relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>. Ce fichier peut être généré en redirigeant la sortie de mypy <b>sans l'option '--pretty'</b>, par exemple <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Utilisez * ou ? pour correspondre au modèle");+ m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",+ "Spécifiez le fichier de sortie mypy relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>. Ce fichier peut être généré en redirigeant la sortie de mypy <b>sans l'option '--pretty'</b>, par exemple <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Utilisez * ou ? pour correspondre au modèle");m.put("Specify name of the branch", "Spécifiez le nom de la branche");m.put("Specify name of the environment variable", "Spécifiez le nom de la variable d'environnement");m.put("Specify name of the iteration", "Spécifiez le nom de l'itération");@@ -3645,23 +3645,23 @@ public class Translation_fr extends TranslationResourceBundle {m.put("Specify project to run job in", "Spécifiez le projet pour exécuter le travail");m.put("Specify projects", "Spécifiez les projets");m.put("Specify projects to update dependencies. Leave empty for current project", "Spécifiez les projets pour mettre à jour les dépendances. Laissez vide pour le projet actuel");- m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "Spécifiez le fichier de résultats JSON pylint relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>. Ce fichier peut être généré avec l'option de format de sortie JSON pylint, par exemple <code>--exit-zero --output-format=json:pylint-result.json</code>. Notez que nous ne faisons pas échouer la commande pylint en cas de violations, car cette étape échouera la construction en fonction du seuil configuré. Utilisez * ou ? pour correspondre au modèle");+ m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "Spécifiez le fichier de résultats JSON pylint relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>. Ce fichier peut être généré avec l'option de format de sortie JSON pylint, par exemple <code>--exit-zero --output-format=json:pylint-result.json</code>. Notez que nous ne faisons pas échouer la commande pylint en cas de violations, car cette étape échouera la construction en fonction du seuil configuré. Utilisez * ou ? pour correspondre au modèle");m.put("Specify registry logins if necessary. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token for password","Spécifiez les connexions au registre si nécessaire. Pour le registre intégré, utilisez <code>@server_url@</code> pour l'URL du registre, <code>@job_token@</code> pour le nom d'utilisateur et le jeton d'accès pour le mot de passe");m.put("Specify registry url. Leave empty for official registry", "Spécifiez l'URL du registre. Laissez vide pour le registre officiel");- m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "Spécifiez le chemin relatif sous <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail du job</a> pour stocker la disposition OCI");+ m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "Spécifiez le chemin relatif sous <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail du job</a> pour stocker la disposition OCI");m.put("Specify repositories", "Spécifiez les dépôts");m.put("Specify required reviewers if specified path is changed. Note that the user submitting the change is considered to reviewed the change automatically","Spécifiez les réviseurs requis si le chemin spécifié est modifié. Notez que l'utilisateur soumettant la modification est automatiquement considéré comme ayant révisé la modification");m.put("Specify root URL to access this server", "Spécifiez l'URL racine pour accéder à ce serveur");- m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "Spécifiez le fichier de résultats JSON ruff relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>. Ce fichier peut être généré avec l'option de format de sortie JSON ruff, par exemple <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Notez que nous ne faisons pas échouer la commande ruff en cas de violations, car cette étape échouera la construction en fonction du seuil configuré. Utilisez * ou ? pour correspondre au modèle");- m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Spécifiez les commandes shell (sur Linux/Unix) ou les commandes batch (sur Windows) à exécuter sous <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail du job</a>");- m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Spécifiez les commandes shell à exécuter sous <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail du job</a>");+ m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "Spécifiez le fichier de résultats JSON ruff relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>. Ce fichier peut être généré avec l'option de format de sortie JSON ruff, par exemple <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Notez que nous ne faisons pas échouer la commande ruff en cas de violations, car cette étape échouera la construction en fonction du seuil configuré. Utilisez * ou ? pour correspondre au modèle");+ m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Spécifiez les commandes shell (sur Linux/Unix) ou les commandes batch (sur Windows) à exécuter sous <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail du job</a>");+ m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Spécifiez les commandes shell à exécuter sous <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail du job</a>");m.put("Specify shell to be used", "Spécifiez le shell à utiliser");m.put("Specify source param for SCP command, for instance <code>app.tar.gz</code>", "Spécifiez le paramètre source pour la commande SCP, par exemple <code>app.tar.gz</code>");m.put("Specify space separated refs to pull from remote. '*' can be used in ref name for wildcard match<br><b class='text-danger'>NOTE:</b> branch/tag protection rule will be ignored when update branches/tags via this step",@@ -3680,10 +3680,10 @@ public class Translation_fr extends TranslationResourceBundle {"Spécifiez les adresses email d'expéditeur séparées par des espaces applicables à cette entrée. Utilisez '*' ou '?' pour une correspondance par wildcard. Préfixez avec '-' pour exclure. Laissez vide pour correspondre à tous les expéditeurs");m.put("Specify space-separated tags to be protected. Use '**', '*' or '?' for <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>path wildcard match</a>. Prefix with '-' to exclude","Spécifiez les tags séparés par des espaces à protéger. Utilisez '**', '*' ou '?' pour une <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>correspondance par wildcard de chemin</a>. Préfixez avec '-' pour exclure");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: <tt>manual/index.md</tt>",- "Spécifiez la page de démarrage du rapport relative à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>, par exemple : <tt>manual/index.md</tt>");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: api/index.html",- "Spécifiez la page de démarrage du rapport relative à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du job</a>, par exemple : api/index.html");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: <tt>manual/index.md</tt>",+ "Spécifiez la page de démarrage du rapport relative à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>, par exemple : <tt>manual/index.md</tt>");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: api/index.html",+ "Spécifiez la page de démarrage du rapport relative à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du job</a>, par exemple : api/index.html");m.put("Specify storage size to request for the build volume. The size should conform to <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>Kubernetes resource capacity format</a>, for instance <i>10Gi</i>","Spécifiez la taille de stockage à demander pour le volume de construction. La taille doit être conforme au <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>format de capacité des ressources Kubernetes</a>, par exemple <i>10Gi</i>");m.put("Specify tab width used to calculate column value of found problems in provided report",@@ -3769,8 +3769,8 @@ public class Translation_fr extends TranslationResourceBundle {m.put("Step Templates", "Modèles d'étape");m.put("Step {0} of {1}: ", "Étape {0} de {1} :");m.put("Steps", "Étapes");- m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>",- "Les étapes seront exécutées séquentiellement sur le même nœud, partageant le même <a href='https://docs.onedev.io/concepts#job-workspace'>espace de travail du travail</a>");+ m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>",+ "Les étapes seront exécutées séquentiellement sur le même nœud, partageant le même <a href='https://docs.onedev.io/concepts#job-workdir'>espace de travail du travail</a>");m.put("Stop", "Arrêter");m.put("Stop work", "Arrêter le travail");m.put("Stopwatch Overdue", "Chronomètre en retard");@@ -4008,9 +4008,9 @@ public class Translation_fr extends TranslationResourceBundle {m.put("This shows number of issues in various states over time", "Ceci montre le nombre de problèmes dans divers états au fil du temps");m.put("This shows number of open and merged pull requests over time", "Ceci montre le nombre de demandes de tirage ouvertes et fusionnées au fil du temps");m.put("This step can only be executed by a docker aware executor", "Cette étape ne peut être exécutée que par un exécuteur compatible avec Docker");- m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Cette étape ne peut être exécutée que par un exécuteur compatible avec Docker. Elle s'exécute sous <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>l'espace de travail de la tâche</a>");- m.put("This step copies files from job workspace to build artifacts directory, so that they can be accessed after job is completed",+ m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Cette étape ne peut être exécutée que par un exécuteur compatible avec Docker. Elle s'exécute sous <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>l'espace de travail de la tâche</a>");+ m.put("This step copies files from job workdir to build artifacts directory, so that they can be accessed after job is completed","Cette étape copie les fichiers de l'espace de travail du job vers le répertoire des artefacts de construction, afin qu'ils puissent être accessibles après la fin du job");m.put("This step publishes specified files to be served as project web site. Project web site can be accessed publicly via <code>http://<onedev base url>/path/to/project/~site</code>","Cette étape publie les fichiers spécifiés pour être servis comme site web du projet. Le site web du projet peut être accessible publiquement via <code>http://<onedev base url>/path/to/project/~site</code>");@@ -4728,8 +4728,8 @@ public class Translation_fr extends TranslationResourceBundle {"Spécifiez éventuellement les types de commit applicables pour la vérification du pied de page du message de commit (appuyez sur ENTRÉE pour ajouter une valeur). Laissez vide pour tous les types");m.put("Optionally specify extra options for osv source scanner. Multiple options need to be separated with space","Spécifiez éventuellement des options supplémentaires pour le scanner de source osv. Plusieurs options doivent être séparées par un espace");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",- "Spécifiez éventuellement le chemin relatif à <a href='https://docs.onedev.io/concepts#job-workspace'>l'espace de travail du travail</a> à utiliser comme <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>configuration secrète</a> trivy");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",+ "Spécifiez éventuellement le chemin relatif à <a href='https://docs.onedev.io/concepts#job-workdir'>l'espace de travail du travail</a> à utiliser comme <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>configuration secrète</a> trivy");m.put("Osv Source Scanner", "Scanner de source Osv");m.put("Run osv scanner to scan project source for vulnerabilities in <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>various lock files</a>. It can only be executed by docker aware executor.","Exécutez le scanner osv pour analyser la source du projet à la recherche de vulnérabilités dans <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>divers fichiers de verrouillage</a>. Il ne peut être exécuté que par un exécuteur compatible avec Docker.");diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_it.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_it.javaindex 35ec2b764e..44a9a1fe80 100644--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_it.java+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_it.java@@ -1397,8 +1397,8 @@ public class Translation_it extends TranslationResourceBundle {"Per il commit di build non raggiungibile dal ramo predefinito, un <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>segreto di lavoro</a> dovrebbe essere specificato come token di accesso con permesso di creare tag");m.put("For build commit not reachable from default branch, a <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> should be specified as access token with manage issue permission","Per il commit di build non raggiungibile dal ramo predefinito, un <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>segreto di lavoro</a> dovrebbe essere specificato come token di accesso con permesso di gestire problemi");- m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>). For shell related executors which runs on host machine directly, only relative path is accepted",- "Per gli esecutori consapevoli di Docker, questo percorso è all'interno del container e accetta sia percorsi assoluti che relativi (relativi a <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>spazio di lavoro del lavoro</a>). Per gli esecutori correlati alla shell che funzionano direttamente sulla macchina host, è accettato solo il percorso relativo");+ m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>). For shell related executors which runs on host machine directly, only relative path is accepted",+ "Per gli esecutori consapevoli di Docker, questo percorso è all'interno del container e accetta sia percorsi assoluti che relativi (relativi a <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>spazio di lavoro del lavoro</a>). Per gli esecutori correlati alla shell che funzionano direttamente sulla macchina host, è accettato solo il percorso relativo");m.put("For each build, OneDev calculates a list of fixed issues since previous build automatically. This setting provides a default query to further filter/order this list. For a given job, the first matching entry will be used.","Per ogni build, OneDev calcola automaticamente un elenco di problemi risolti dalla build precedente. Questa impostazione fornisce una query predefinita per filtrare/ordinare ulteriormente questo elenco. Per un determinato lavoro, verrà utilizzata la prima voce corrispondente.");m.put("For each selected branch/tag, a separate build will be generated with branch/tag set to corresponding value",@@ -2346,7 +2346,7 @@ public class Translation_it extends TranslationResourceBundle {m.put("Optionally filter issues", "Filtra opzionalmente i problemi");m.put("Optionally filter pull requests", "Filtra opzionalmente le pull request");m.put("Optionally leave a note", "Lascia opzionalmente una nota");- m.put("Optionally mount directories or files under job workspace into container", "Monta opzionalmente directory o file sotto lo spazio di lavoro del job nel container");+ m.put("Optionally mount directories or files under job workdir into container", "Monta opzionalmente directory o file sotto lo spazio di lavoro del job nel container");m.put("Optionally select fields to prompt when this button is pressed", "Seleziona opzionalmente i campi da visualizzare quando questo pulsante viene premuto");m.put("Optionally select fields to remove when this transition happens", "Seleziona opzionalmente i campi da rimuovere quando avviene questa transizione");m.put("Optionally specifies name of the attribute inside the user LDAP entry whose value will be taken as user email. This field is normally set to <i>mail</i> according to RFC 2798",@@ -2366,8 +2366,8 @@ public class Translation_it extends TranslationResourceBundle {m.put("Optionally specify <span class='text-info'>comma separated</span> platforms to scan, for instance <tt>linux/amd64,linux/arm64</tt>. Leave empty to scan all platforms in OCI layout","Specifica facoltativamente <span class='text-info'>piattaforme separate da virgola</span> da scansionare, ad esempio <tt>linux/amd64,linux/arm64</tt>. Lascia vuoto per scansionare tutte le piattaforme nel layout OCI");m.put("Optionally specify API key for authentication", "Specifica facoltativamente la chiave API per l'autenticazione");- m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",- "Specifica facoltativamente il Dockerfile relativo a <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Lascia vuoto per utilizzare il file <tt>Dockerfile</tt> sotto il percorso di build specificato sopra");+ m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",+ "Specifica facoltativamente il Dockerfile relativo a <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Lascia vuoto per utilizzare il file <tt>Dockerfile</tt> sotto il percorso di build specificato sopra");m.put("Optionally specify JavaScript config to be used by Renovate CLI", "Specifica facoltativamente la configurazione JavaScript da utilizzare con la CLI di Renovate");m.put("Optionally specify SSH root URL, which will be used to construct project clone url via SSH protocol. Leave empty to derive from server url","Specifica facoltativamente l'URL root SSH, che verrà utilizzato per costruire l'URL di clonazione del progetto tramite protocollo SSH. Lascia vuoto per derivarlo dall'URL del server");@@ -2385,8 +2385,8 @@ public class Translation_it extends TranslationResourceBundle {"Specifica facoltativamente un'espressione cron per programmare il backup automatico del database. Il formato dell'espressione cron è <em><secondi> <minuti> <ore> <giorno-del-mese> <mese> <giorno-della-settimana></em>. Ad esempio, <em>0 0 1 * * ?</em> significa alle 1:00 di ogni giorno. Per i dettagli sul formato, consulta il <a href='http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html#format' target='_blank'>tutorial di Quartz</a>. I file di backup verranno posizionati nella cartella <em>db-backup</em> sotto la directory di installazione di OneDev. Nel caso in cui più server si connettano per formare un cluster, il backup automatico avviene sul <a href='https://docs.onedev.io/concepts#lead-server' target='_blank'>server principale</a>. Lascia questa proprietà vuota se non vuoi abilitare il backup automatico del database.");m.put("Optionally specify a date field to hold due date information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Specifica facoltativamente un campo data per contenere informazioni sulla data di scadenza.<br><b>NOTA: </b> Puoi personalizzare i campi dei problemi di OneDev nel caso non ci sia un'opzione appropriata qui");- m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to put retrieved artifacts. Leave empty to use job workspace itself",- "Specifica facoltativamente un percorso relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> per posizionare gli artefatti recuperati. Lascia vuoto per utilizzare il job workspace stesso");+ m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to put retrieved artifacts. Leave empty to use job workdir itself",+ "Specifica facoltativamente un percorso relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> per posizionare gli artefatti recuperati. Lascia vuoto per utilizzare il job workdir stesso");m.put("Optionally specify a storage class to allocate build volume dynamically. Leave empty to use default storage class. <b class='text-warning'>NOTE:</b> Reclaim policy of the storage class should be set to <code>Delete</code>, as the volume is only used to hold temporary build files","Specifica facoltativamente una classe di archiviazione per allocare dinamicamente il volume di build. Lascia vuoto per utilizzare la classe di archiviazione predefinita. <b class='text-warning'>NOTA:</b> La politica di recupero della classe di archiviazione dovrebbe essere impostata su <code>Delete</code>, poiché il volume viene utilizzato solo per contenere file di build temporanei");m.put("Optionally specify a working period field to hold estimated time infomration.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",@@ -2405,17 +2405,17 @@ public class Translation_it extends TranslationResourceBundle {m.put("Optionally specify applicable jobs of this executor", "Specifica facoltativamente i lavori applicabili di questo executor");m.put("Optionally specify applicable users who pushed the change", "Specifica facoltativamente gli utenti applicabili che hanno effettuato il push della modifica");m.put("Optionally specify arguments to run above image", "Specifica facoltativamente gli argomenti per eseguire l'immagine sopra");- m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",- "Specifica facoltativamente gli artefatti da recuperare dalla dipendenza in <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Possono essere recuperati solo artefatti pubblicati (tramite il passaggio di pubblicazione degli artefatti). Lascia vuoto per non recuperare alcun artefatto");+ m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",+ "Specifica facoltativamente gli artefatti da recuperare dalla dipendenza in <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Possono essere recuperati solo artefatti pubblicati (tramite il passaggio di pubblicazione degli artefatti). Lascia vuoto per non recuperare alcun artefatto");m.put("Optionally specify authorized roles to press this button. If not specified, all users are allowed","Specifica facoltativamente i ruoli autorizzati per premere questo pulsante. Se non specificato, tutti gli utenti sono autorizzati");m.put("Optionally specify base query of the list", "Specifica facoltativamente la query di base della lista");m.put("Optionally specify branches/users/groups allowed to access this secret. If left empty, any job can access this secret, including those triggered via external pull requests","Specifica facoltativamente i rami/utenti/gruppi autorizzati ad accedere a questo segreto. Se lasciato vuoto, qualsiasi job può accedere a questo segreto, inclusi quelli attivati tramite richieste pull esterne");- m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",- "Specifica facoltativamente il percorso del contesto di build relativo a <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Lascia vuoto per utilizzare il job workspace stesso. Il file <code>Dockerfile</code> dovrebbe esistere nella directory del contesto di build, a meno che tu non specifichi una posizione diversa con l'opzione <code>--dockerfile</code>");- m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself",- "Specifica facoltativamente il percorso di build relativo a <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Lascia vuoto per utilizzare il job workspace stesso");+ m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",+ "Specifica facoltativamente il percorso del contesto di build relativo a <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Lascia vuoto per utilizzare il job workdir stesso. Il file <code>Dockerfile</code> dovrebbe esistere nella directory del contesto di build, a meno che tu non specifichi una posizione diversa con l'opzione <code>--dockerfile</code>");+ m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself",+ "Specifica facoltativamente il percorso di build relativo a <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Lascia vuoto per utilizzare il job workdir stesso");m.put("Optionally specify cluster role the job pods service account binding to. This is necessary if you want to do things such as running other Kubernetes pods in job command","Specifica facoltativamente il ruolo del cluster a cui è associato l'account di servizio dei pod del job. Questo è necessario se vuoi fare cose come eseguire altri pod Kubernetes nel comando del job");m.put("Optionally specify container arguments separated by space. Single argument containing space should be quoted. <b class='text-warning'>Note: </b> do not confuse this with container options which should be specified in executor setting",@@ -2478,13 +2478,13 @@ public class Translation_it extends TranslationResourceBundle {"Specifica facoltativamente le opzioni per il comando ssh. Più opzioni devono essere separate da spazio");m.put("Optionally specify options passed to renovate cli. Multiple options should be separated by space, and single option containing spaces should be quoted","Specifica facoltativamente le opzioni passate alla CLI di Renovate. Più opzioni dovrebbero essere separate da spazio, e una singola opzione contenente spazi dovrebbe essere quotata");- m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. You may ignore particular vulnerabilities via this file",- "Specifica facoltativamente il file di configurazione dello scanner osv <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> sotto <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Puoi ignorare particolari vulnerabilità tramite questo file");+ m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. You may ignore particular vulnerabilities via this file",+ "Specifica facoltativamente il file di configurazione dello scanner osv <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> sotto <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Puoi ignorare particolari vulnerabilità tramite questo file");m.put("Optionally specify path protection rules", "Specifica facoltativamente le regole di protezione del percorso");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",- "Specifica facoltativamente il percorso relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> da utilizzare come file di ignoranza di trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to publish artifacts from. Leave empty to use job workspace itself",- "Specifica facoltativamente il percorso relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> per pubblicare gli artefatti. Lascia vuoto per utilizzare il job workspace stesso");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",+ "Specifica facoltativamente il percorso relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> da utilizzare come file di ignoranza di trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to publish artifacts from. Leave empty to use job workdir itself",+ "Specifica facoltativamente il percorso relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> per pubblicare gli artefatti. Lascia vuoto per utilizzare il job workdir stesso");m.put("Optionally specify platform to pull, for instance <tt>linux/amd64</tt>. Leave empty to pull all platforms in image","Specifica facoltativamente la piattaforma da pullare, ad esempio <tt>linux/amd64</tt>. Lascia vuoto per pullare tutte le piattaforme nell'immagine");m.put("Optionally specify project to show builds of. Leave empty to show builds of all projects with permissions",@@ -2498,12 +2498,12 @@ public class Translation_it extends TranslationResourceBundle {m.put("Optionally specify registry logins to override those defined in job executor. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token secret for password secret","Specifica facoltativamente i login al registro per sovrascrivere quelli definiti nell'esecutore del job. Per il registro integrato, usa <code>@server_url@</code> per l'URL del registro, <code>@job_token@</code> per il nome utente e il segreto del token di accesso per la password");m.put("Optionally specify relative directory to put uploaded files", "Specifica facoltativamente la directory relativa per posizionare i file caricati");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to clone code into. Leave empty to use job workspace itself",- "Specifica facoltativamente il percorso relativo sotto <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> per clonare il codice. Lascia vuoto per utilizzare il job workspace stesso");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan. Leave empty to use job workspace itself",- "Specifica facoltativamente il percorso relativo sotto <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> per scansionare. Lascia vuoto per utilizzare il job workspace stesso");- m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workspace itself",- "Specifica facoltativamente i percorsi relativi sotto <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> per scansionare le vulnerabilità delle dipendenze. Più percorsi possono essere specificati e dovrebbero essere separati da spazio. Lascia vuoto per utilizzare il job workspace stesso");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to clone code into. Leave empty to use job workdir itself",+ "Specifica facoltativamente il percorso relativo sotto <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> per clonare il codice. Lascia vuoto per utilizzare il job workdir stesso");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan. Leave empty to use job workdir itself",+ "Specifica facoltativamente il percorso relativo sotto <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> per scansionare. Lascia vuoto per utilizzare il job workdir stesso");+ m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workdir itself",+ "Specifica facoltativamente i percorsi relativi sotto <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> per scansionare le vulnerabilità delle dipendenze. Più percorsi possono essere specificati e dovrebbero essere separati da spazio. Lascia vuoto per utilizzare il job workdir stesso");m.put("Optionally specify required reviewers for changes of specified branch", "Specifica facoltativamente i revisori richiesti per le modifiche del ramo specificato");m.put("Optionally specify revision to create branch from. Leave empty to create from build commit","Specifica facoltativamente la revisione da cui creare il ramo. Lascia vuoto per creare dal commit del build");@@ -3117,8 +3117,8 @@ public class Translation_it extends TranslationResourceBundle {m.put("Run job", "Esegui lavoro");m.put("Run job in another project", "Esegui il job in un altro progetto");m.put("Run on Bare Metal/Virtual Machine", "Esegui su Bare Metal/Macchina Virtuale");- m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKSPACE</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",- "Esegui il contenitore Docker specificato. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Workspace del lavoro</a> è montato nel contenitore e il suo percorso è posizionato nella variabile di ambiente <code>ONEDEV_WORKSPACE</code>. <b class='text-warning'>Nota: </b> questo passaggio può essere eseguito solo dall'esecutore docker del server o dall'esecutore docker remoto");+ m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKDIR</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",+ "Esegui il contenitore Docker specificato. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Workspace del lavoro</a> è montato nel contenitore e il suo percorso è posizionato nella variabile di ambiente <code>ONEDEV_WORKDIR</code>. <b class='text-warning'>Nota: </b> questo passaggio può essere eseguito solo dall'esecutore docker del server o dall'esecutore docker remoto");m.put("Run specified step template", "Esegui il modello di passaggio specificato");m.put("Run this job", "Esegui questo lavoro");m.put("Run trivy container image scanner to find issues in specified image. For vulnerabilities, it checks various <a href='https://aquasecurity.github.io/trivy/v0.50/docs/coverage/language/#supported-languages' target='_blank'>distribution files</a>. It can only be executed by docker aware executor.",@@ -3391,47 +3391,47 @@ public class Translation_it extends TranslationResourceBundle {m.put("Specifies who can access this AI service", "Specifica chi può accedere a questo servizio AI");m.put("Specifies who can access this AI service. AI service can be accessed in below approaches:","Specifica chi può accedere a questo servizio AI. Il servizio AI può essere accessibile nei seguenti modi:");- m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",- "Specifica il file di risultati del test .net TRX relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, ad esempio <tt>TestResults/*.trx</tt>. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",+ "Specifica il file di risultati del test .net TRX relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, ad esempio <tt>TestResults/*.trx</tt>. Usa * o ? per la corrispondenza del pattern");m.put("Specify <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> whose value is access token with code write permission over above projects. Commits, issues, and pull requests will also be created under name of the access token owner","Specifica un <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>segreto di lavoro</a> il cui valore è un token di accesso con permesso di scrittura del codice sui progetti sopra indicati. I commit, i problemi e le richieste di pull saranno creati anche sotto il nome del proprietario del token di accesso");- m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",- "Specifica il file di output json di <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Questo file può essere generato con l'opzione di output json di clippy, ad esempio <code>cargo clippy --message-format json>check-result.json</code>. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",+ "Specifica il file di output json di <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Questo file può essere generato con l'opzione di output json di clippy, ad esempio <code>cargo clippy --message-format json>check-result.json</code>. Usa * o ? per la corrispondenza del pattern");m.put("Specify Build Options", "Specifica le opzioni di build");- m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",- "Specifica il file xml dei risultati CPD relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, ad esempio, <tt>target/cpd.xml</tt>. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",+ "Specifica il file xml dei risultati CPD relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, ad esempio, <tt>target/cpd.xml</tt>. Usa * o ? per la corrispondenza del pattern");m.put("Specify Commit Message", "Specifica il messaggio di commit");- m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",- "Specifica il file di report ESLint in formato checkstyle sotto <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Questo file può essere generato con l'opzione ESLint <tt>'-f checkstyle'</tt> e <tt>'-o'</tt>. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",+ "Specifica il file di report ESLint in formato checkstyle sotto <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Questo file può essere generato con l'opzione ESLint <tt>'-f checkstyle'</tt> e <tt>'-o'</tt>. Usa * o ? per la corrispondenza del pattern");m.put("Specify GitHub API url, for instance <tt>https://api.github.com</tt>", "Specifica l'URL API di GitHub, ad esempio <tt>https://api.github.com</tt>");m.put("Specify GitLab API url, for instance <tt>https://gitlab.example.com/api/v4</tt>", "Specifica l'URL API di GitLab, ad esempio <tt>https://gitlab.example.com/api/v4</tt>");m.put("Specify Gitea API url, for instance <tt>https://gitea.example.com/api/v1</tt>", "Specifica l'URL API di Gitea, ad esempio <tt>https://gitea.example.com/api/v1</tt>");- m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",- "Specifica il file XML dei risultati di GoogleTest relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Questo report può essere generato con la variabile di ambiente <tt>GTEST_OUTPUT</tt> durante l'esecuzione dei test, ad esempio, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",+ "Specifica il file XML dei risultati di GoogleTest relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Questo report può essere generato con la variabile di ambiente <tt>GTEST_OUTPUT</tt> durante l'esecuzione dei test, ad esempio, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Usa * o ? per la corrispondenza del pattern");m.put("Specify IMAP user name.<br><b class='text-danger'>NOTE: </b> This account should be able to receive emails sent to system email address specified above","Specifica il nome utente IMAP.<br><b class='text-danger'>NOTA: </b> Questo account dovrebbe essere in grado di ricevere email inviate all'indirizzo email di sistema specificato sopra");- m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",- "Specifica il file dei risultati del test JUnit in formato XML relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, ad esempio <tt>target/surefire-reports/TEST-*.xml</tt>. Usa * o ? per la corrispondenza del pattern");- m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",- "Specifica il file di report di copertura xml JaCoCo relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, ad esempio, <tt>target/site/jacoco/jacoco.xml</tt>. Usa * o ? per la corrispondenza del pattern");- m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",- "Specifica il file di report di copertura Jest in formato clover relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, ad esempio <tt>coverage/clover.xml</tt>. Questo file può essere generato con l'opzione Jest <tt>'--coverage'</tt>. Usa * o ? per la corrispondenza del pattern");- m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",- "Specifica il file dei risultati del test Jest in formato json relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Questo file può essere generato tramite l'opzione Jest <tt>'--json'</tt> e <tt>'--outputFile'</tt>. Usa * o ? per la corrispondenza del pattern");- m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Specifica la directory di layout OCI dell'immagine da scansionare. Questa directory può essere generata tramite il passaggio di build dell'immagine o il passaggio di pull dell'immagine. Dovrebbe essere relativa a <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>");- m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to push from",- "Specifica la directory di layout OCI relativa a <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> da cui eseguire il push");+ m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",+ "Specifica il file dei risultati del test JUnit in formato XML relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, ad esempio <tt>target/surefire-reports/TEST-*.xml</tt>. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",+ "Specifica il file di report di copertura xml JaCoCo relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, ad esempio, <tt>target/site/jacoco/jacoco.xml</tt>. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",+ "Specifica il file di report di copertura Jest in formato clover relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, ad esempio <tt>coverage/clover.xml</tt>. Questo file può essere generato con l'opzione Jest <tt>'--coverage'</tt>. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",+ "Specifica il file dei risultati del test Jest in formato json relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Questo file può essere generato tramite l'opzione Jest <tt>'--json'</tt> e <tt>'--outputFile'</tt>. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Specifica la directory di layout OCI dell'immagine da scansionare. Questa directory può essere generata tramite il passaggio di build dell'immagine o il passaggio di pull dell'immagine. Dovrebbe essere relativa a <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>");+ m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to push from",+ "Specifica la directory di layout OCI relativa a <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> da cui eseguire il push");m.put("Specify OpenID scopes to request", "Specifica gli scope OpenID da richiedere");- m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",- "Specifica il file xml dei risultati PMD relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, ad esempio, <tt>target/pmd.xml</tt>. Usa * o ? per la corrispondenza del pattern");- m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",- "Specifica i comandi PowerShell da eseguire sotto <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>.<br><b class='text-warning'>NOTA: </b> OneDev controlla il codice di uscita dello script per determinare se il passaggio è riuscito. Poiché PowerShell esce sempre con 0 anche se ci sono errori nello script, dovresti gestire gli errori nello script e uscire con un codice diverso da zero, o aggiungere la riga <code>$ErrorActionPreference = "Stop"</code> all'inizio del tuo script<br>");- m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",- "Specifica il file di output delle diagnosi Roslynator in formato XML relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Questo file può essere generato con l'opzione <i>-o</i>. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",+ "Specifica il file xml dei risultati PMD relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, ad esempio, <tt>target/pmd.xml</tt>. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",+ "Specifica i comandi PowerShell da eseguire sotto <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>.<br><b class='text-warning'>NOTA: </b> OneDev controlla il codice di uscita dello script per determinare se il passaggio è riuscito. Poiché PowerShell esce sempre con 0 anche se ci sono errori nello script, dovresti gestire gli errori nello script e uscire con un codice diverso da zero, o aggiungere la riga <code>$ErrorActionPreference = "Stop"</code> all'inizio del tuo script<br>");+ m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",+ "Specifica il file di output delle diagnosi Roslynator in formato XML relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Questo file può essere generato con l'opzione <i>-o</i>. Usa * o ? per la corrispondenza del pattern");m.put("Specify Shell/Batch Commands to Run", "Specifica i comandi Shell/Batch da eseguire");- m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",- "Specifica il file xml dei risultati SpotBugs relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, ad esempio, <tt>target/spotbugsXml.xml</tt>. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",+ "Specifica il file xml dei risultati SpotBugs relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, ad esempio, <tt>target/spotbugsXml.xml</tt>. Usa * o ? per la corrispondenza del pattern");m.put("Specify System Settings", "Specifica le impostazioni di sistema");m.put("Specify URL of remote git repository. Only http/https protocol is supported", "Specifica l'URL del repository git remoto. Sono supportati solo i protocolli http/https");m.put("Specify YouTrack login name. This account should have permission to:<ul><li>Read full information and issues of the projects you want to import<li>Read issue tags<li>Read user basic information</ul>",@@ -3466,15 +3466,15 @@ public class Translation_it extends TranslationResourceBundle {m.put("Specify a Docker Image to Test Against", "Specifica un'immagine Docker da testare");m.put("Specify a custom field of Enum type", "Specifica un campo personalizzato di tipo Enum");m.put("Specify a default query to filter/order fixed issues of specified jobs", "Specifica una query predefinita per filtrare/ordinare i problemi risolti dei lavori specificati");- m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to write checksum into",- "Specifica un file relativo a <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> in cui scrivere il checksum");+ m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to write checksum into",+ "Specifica un file relativo a <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> in cui scrivere il checksum");m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Specifica un campo utente multi-valore per contenere le informazioni sugli assegnatari.<b>NOTA: </b> Puoi personalizzare i campi dei problemi di OneDev nel caso in cui non ci sia un'opzione appropriata qui");m.put("Specify a multi-value user field to hold assignees information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Specifica un campo utente multi-valore per contenere le informazioni sugli assegnatari.<br><b>NOTA: </b> Puoi personalizzare i campi dei problemi di OneDev nel caso in cui non ci sia un'opzione appropriata qui");m.put("Specify a path inside container to be used as mount target", "Specifica un percorso all'interno del container da utilizzare come target di montaggio");- m.put("Specify a path relative to job workspace to be used as mount source. Leave empty to mount job workspace itself",- "Specifica un percorso relativo al job workspace da utilizzare come sorgente di montaggio. Lascia vuoto per montare il job workspace stesso");+ m.put("Specify a path relative to job workdir to be used as mount source. Leave empty to mount job workdir itself",+ "Specifica un percorso relativo al job workdir da utilizzare come sorgente di montaggio. Lascia vuoto per montare il job workdir stesso");m.put("Specify a secret to be used as access token to create issue in above project if it is not publicly accessible","Specifica un segreto da utilizzare come token di accesso per creare un problema nel progetto sopra indicato se non è accessibile pubblicamente");m.put("Specify a secret to be used as access token to retrieve artifacts from above project. If not specified, project artifacts will be accessed anonymously",@@ -3499,8 +3499,8 @@ public class Translation_it extends TranslationResourceBundle {m.put("Specify application (client) ID of the app registered in Entra ID", "Specifica l'ID applicazione (client) dell'app registrata in Entra ID");m.put("Specify arguments for imagetools. For instance <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>","Specifica gli argomenti per imagetools. Ad esempio <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>");- m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved.",- "Specifica gli artefatti da recuperare in <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Solo gli artefatti pubblicati (tramite il passaggio di pubblicazione degli artefatti) possono essere recuperati.");+ m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved.",+ "Specifica gli artefatti da recuperare in <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Solo gli artefatti pubblicati (tramite il passaggio di pubblicazione degli artefatti) possono essere recuperati.");m.put("Specify at least 10 alphanumeric chars to be used as secret, and then add an inbound parse entry at SendGrid side:<ul><li><code>Destination URL</code> should be set to <i><OneDev root url>/~sendgrid/<secret></i>, for instance, <i>https://onedev.example.com/~sendgrid/1234567890</i>. Note that in production environment, <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>https should be enabled</a> to protect the secret</li><li><code>Receiving domain</code> should be the same as domain part of system email address specified above</li><li>Option <code>POST the raw, full MIME message</code> is enabled</li></ul>","Specifica almeno 10 caratteri alfanumerici da utilizzare come segreto, e poi aggiungi una voce di analisi in entrata sul lato SendGrid:<ul><li><code>URL di destinazione</code> dovrebbe essere impostato su <i><URL root di OneDev>/~sendgrid/<segreto></i>, ad esempio, <i>https://onedev.example.com/~sendgrid/1234567890</i>. Nota che in ambiente di produzione, <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>https dovrebbe essere abilitato</a> per proteggere il segreto</li><li><code>Dominio di ricezione</code> dovrebbe essere lo stesso della parte di dominio dell'indirizzo email di sistema specificato sopra</li><li>L'opzione <code>POST il messaggio MIME completo e grezzo</code> è abilitata</li></ul>");m.put("Specify base nodes for user search. For example: <i>cn=Users, dc=example, dc=com</i>",@@ -3516,13 +3516,13 @@ public class Translation_it extends TranslationResourceBundle {"Specifica il certificato da fidarsi se stai utilizzando un certificato autofirmato per il repository remoto");m.put("Specify certificates to trust if you are using self-signed certificates for your docker registries","Specifica i certificati da fidarsi se stai utilizzando certificati autofirmati per i tuoi registri Docker");- m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",- "Specifica il file xml dei risultati checkstyle relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, ad esempio, <tt>target/checkstyle-result.xml</tt>. Consulta la <a href='https://checkstyle.org/'>documentazione di checkstyle</a> su come generare il file xml dei risultati. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",+ "Specifica il file xml dei risultati checkstyle relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, ad esempio, <tt>target/checkstyle-result.xml</tt>. Consulta la <a href='https://checkstyle.org/'>documentazione di checkstyle</a> su come generare il file xml dei risultati. Usa * o ? per la corrispondenza del pattern");m.put("Specify client secret of the app registered in Entra ID", "Specifica il segreto client dell'app registrata in Entra ID");- m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",- "Specifica il file di report di copertura xml clover relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, ad esempio, <tt>target/site/clover/clover.xml</tt>. Consulta la <a href='https://openclover.org/documentation'>documentazione di OpenClover</a> su come generare il file xml clover. Usa * o ? per la corrispondenza del pattern");- m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",- "Specifica il file di report di copertura xml cobertura relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, ad esempio, <tt>target/site/cobertura/coverage.xml</tt>. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",+ "Specifica il file di report di copertura xml clover relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, ad esempio, <tt>target/site/clover/clover.xml</tt>. Consulta la <a href='https://openclover.org/documentation'>documentazione di OpenClover</a> su come generare il file xml clover. Usa * o ? per la corrispondenza del pattern");+ m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",+ "Specifica il file di report di copertura xml cobertura relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, ad esempio, <tt>target/site/cobertura/coverage.xml</tt>. Usa * o ? per la corrispondenza del pattern");m.put("Specify color of the state for displaying purpose", "Specifica il colore dello stato per scopi di visualizzazione");m.put("Specify columns of the board. Each column corresponds to a value of the issue field specified above","Specifica le colonne della board. Ogni colonna corrisponde a un valore del campo problema specificato sopra");@@ -3535,8 +3535,8 @@ public class Translation_it extends TranslationResourceBundle {"Specifica l'URL di scoperta della configurazione del tuo provider OpenID, ad esempio: <code>https://openid.example.com/.well-known/openid-configuration</code>. Assicurati di utilizzare il protocollo HTTPS poiché OneDev si basa sulla crittografia TLS per garantire la validità del token");m.put("Specify container image to execute commands inside", "Specifica l'immagine del container per eseguire i comandi all'interno");m.put("Specify container image to run", "Specifica l'immagine del container da eseguire");- m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",- "Specifica il file di risultati xml di cppcheck relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Questo file può essere generato con l'opzione di output xml di cppcheck, ad esempio <code>cppcheck src --xml 2>check-result.xml</code>. Usa * o ? per la corrispondenza dei pattern");+ m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",+ "Specifica il file di risultati xml di cppcheck relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Questo file può essere generato con l'opzione di output xml di cppcheck, ad esempio <code>cppcheck src --xml 2>check-result.xml</code>. Usa * o ? per la corrispondenza dei pattern");m.put("Specify cpu request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","Specifica la richiesta di CPU per ogni job/servizio utilizzando questo executor. Controlla <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>la gestione delle risorse di Kubernetes</a> per i dettagli");m.put("Specify default assignees of pull requests submitted to this project. Only users with the write code permission to the project can be selected",@@ -3545,8 +3545,8 @@ public class Translation_it extends TranslationResourceBundle {m.put("Specify destinations, for instance <tt>registry-server:5000/myorg/myrepo:latest</tt>. Make sure to use <b>same host</b> as specified in server url of system settings if you want to push to built-in registry, or simply use the form <tt>@server@/<project path>/<repo name>:<tag name></tt>. Multiple destinations should be separated with space","Specifica le destinazioni, ad esempio <tt>registry-server:5000/myorg/myrepo:latest</tt>. Assicurati di utilizzare <b>lo stesso host</b> specificato nell'URL del server delle impostazioni di sistema se desideri inviare al registro integrato, oppure usa semplicemente la forma <tt>@server@/<project path>/<repo name>:<tag name></tt>. Le destinazioni multiple devono essere separate da uno spazio");m.put("Specify directory (tenant) ID of the app registered in Entra ID", "Specifica l'ID della directory (tenant) dell'app registrata in Entra ID");- m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "Specifica la directory relativa a <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> per archiviare il layout OCI");+ m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "Specifica la directory relativa a <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> per archiviare il layout OCI");m.put("Specify docker image of the service", "Specifica l'immagine Docker del servizio");m.put("Specify dockerx builder used to build docker image. OneDev will create the builder automatically if it does not exist. Check <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>this tutorial</a> on how to customize the builder for instance to allow publishing to insecure registries","Specifica il builder dockerx utilizzato per costruire l'immagine Docker. OneDev creerà automaticamente il builder se non esiste. Controlla <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>questo tutorial</a> su come personalizzare il builder, ad esempio per consentire la pubblicazione su registri non sicuri");@@ -3557,10 +3557,10 @@ public class Translation_it extends TranslationResourceBundle {"Specifica i campi di vari problemi creati da Renovate per orchestrare l'aggiornamento delle dipendenze");m.put("Specify fields to be displayed in the issue list", "Specifica i campi da visualizzare nella lista dei problemi");m.put("Specify fields to display in board card", "Specifica i campi da visualizzare nella scheda della board");- m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published. Use * or ? for pattern match",- "Specifica i file relativi a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> da pubblicare. Usa * o ? per la corrispondenza dei pattern");- m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Specifica i file da cui creare il checksum md5. I file multipli devono essere separati da uno spazio. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>I pattern Globstar</a> sono accettati. I file non assoluti sono considerati relativi a <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>");+ m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published. Use * or ? for pattern match",+ "Specifica i file relativi a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> da pubblicare. Usa * o ? per la corrispondenza dei pattern");+ m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Specifica i file da cui creare il checksum md5. I file multipli devono essere separati da uno spazio. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>I pattern Globstar</a> sono accettati. I file non assoluti sono considerati relativi a <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>");m.put("Specify files under above directory to be published", "Specifica i file sotto la directory sopra da pubblicare");m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> <code>index.html</code> should be included in these files to be served as site start page","Specifica i file sotto la directory sopra da pubblicare. Usa * o ? per la corrispondenza dei pattern. <b>NOTA:</b> <code>index.html</code> deve essere incluso in questi file per essere servito come pagina iniziale del sito");@@ -3604,8 +3604,8 @@ public class Translation_it extends TranslationResourceBundle {m.put("Specify manager DN to authenticate OneDev itself to Active Directory. The manager DN should be specified in form of <i><account name>@<domain></i>, for instance: <i>[email protected]</i>","Specifica il DN del manager per autenticare OneDev stesso con Active Directory. Il DN del manager deve essere specificato nella forma <i><account name>@<domain></i>, ad esempio: <i>[email protected]</i>");m.put("Specify manager DN to authenticate OneDev itself to LDAP server", "Specifica il DN del manager per autenticare OneDev stesso con il server LDAP");- m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published",- "Specifica il file markdown relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> da pubblicare");+ m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published",+ "Specifica il file markdown relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> da pubblicare");m.put("Specify max git LFS file size in mega bytes", "Specifica la dimensione massima del file git LFS in megabyte");m.put("Specify max number of CPU intensive tasks the server can run concurrently, such as Git repository pull/push, repository index, etc.","Specifica il numero massimo di attività intensive per la CPU che il server può eseguire contemporaneamente, come il pull/push del repository Git, l'indicizzazione del repository, ecc.");@@ -3621,8 +3621,8 @@ public class Translation_it extends TranslationResourceBundle {"Specifica la dimensione massima del file caricato in megabyte tramite l'interfaccia web. Questo si applica ai file caricati nel repository, al contenuto markdown (commenti sui problemi, ecc.) e agli artefatti di build");m.put("Specify memory request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","Specifica la richiesta di memoria per ogni job/servizio utilizzando questo executor. Controlla <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>la gestione delle risorse di Kubernetes</a> per i dettagli");- m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",- "Specifica il file di output mypy relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Questo file può essere generato reindirizzando l'output di mypy <b>senza l'opzione '--pretty'</b>, ad esempio <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Usa * o ? per la corrispondenza dei pattern");+ m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",+ "Specifica il file di output mypy relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Questo file può essere generato reindirizzando l'output di mypy <b>senza l'opzione '--pretty'</b>, ad esempio <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Usa * o ? per la corrispondenza dei pattern");m.put("Specify name of the branch", "Specifica il nome del branch");m.put("Specify name of the environment variable", "Specifica il nome della variabile di ambiente");m.put("Specify name of the iteration", "Specifica il nome dell'iterazione");@@ -3645,23 +3645,23 @@ public class Translation_it extends TranslationResourceBundle {m.put("Specify project to run job in", "Specifica il progetto in cui eseguire il lavoro");m.put("Specify projects", "Specifica i progetti");m.put("Specify projects to update dependencies. Leave empty for current project", "Specifica i progetti per aggiornare le dipendenze. Lascia vuoto per il progetto corrente");- m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "Specifica il file di risultati json di pylint relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Questo file può essere generato con l'opzione di formato di output json di pylint, ad esempio <code>--exit-zero --output-format=json:pylint-result.json</code>. Nota che non falliamo il comando pylint in caso di violazioni, poiché questo passaggio fallirà la build in base alla soglia configurata. Usa * o ? per la corrispondenza dei pattern");+ m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "Specifica il file di risultati json di pylint relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Questo file può essere generato con l'opzione di formato di output json di pylint, ad esempio <code>--exit-zero --output-format=json:pylint-result.json</code>. Nota che non falliamo il comando pylint in caso di violazioni, poiché questo passaggio fallirà la build in base alla soglia configurata. Usa * o ? per la corrispondenza dei pattern");m.put("Specify registry logins if necessary. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token for password","Specifica i login del registro se necessario. Per il registro integrato, usa <code>@server_url@</code> per l'URL del registro, <code>@job_token@</code> per il nome utente e il token di accesso per la password");m.put("Specify registry url. Leave empty for official registry", "Specifica l'URL del registro. Lascia vuoto per il registro ufficiale");- m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "Specifica il percorso relativo sotto <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> per archiviare il layout OCI");+ m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "Specifica il percorso relativo sotto <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> per archiviare il layout OCI");m.put("Specify repositories", "Specifica i repository");m.put("Specify required reviewers if specified path is changed. Note that the user submitting the change is considered to reviewed the change automatically","Specifica i revisori richiesti se il percorso specificato viene modificato. Nota che l'utente che invia la modifica è considerato automaticamente come revisore della modifica");m.put("Specify root URL to access this server", "Specifica l'URL radice per accedere a questo server");- m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "Specifica il file di risultati json di ruff relativo a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Questo file può essere generato con l'opzione di formato di output json di ruff, ad esempio <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Nota che non falliamo il comando ruff in caso di violazioni, poiché questo passaggio fallirà la build in base alla soglia configurata. Usa * o ? per la corrispondenza dei pattern");- m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Specifica i comandi shell (su Linux/Unix) o batch (su Windows) da eseguire sotto <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>");- m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Specifica i comandi shell da eseguire sotto <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>");+ m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "Specifica il file di risultati json di ruff relativo a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Questo file può essere generato con l'opzione di formato di output json di ruff, ad esempio <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Nota che non falliamo il comando ruff in caso di violazioni, poiché questo passaggio fallirà la build in base alla soglia configurata. Usa * o ? per la corrispondenza dei pattern");+ m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Specifica i comandi shell (su Linux/Unix) o batch (su Windows) da eseguire sotto <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>");+ m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Specifica i comandi shell da eseguire sotto <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>");m.put("Specify shell to be used", "Specifica la shell da utilizzare");m.put("Specify source param for SCP command, for instance <code>app.tar.gz</code>", "Specifica il parametro di origine per il comando SCP, ad esempio <code>app.tar.gz</code>");m.put("Specify space separated refs to pull from remote. '*' can be used in ref name for wildcard match<br><b class='text-danger'>NOTE:</b> branch/tag protection rule will be ignored when update branches/tags via this step",@@ -3680,10 +3680,10 @@ public class Translation_it extends TranslationResourceBundle {"Specifica gli indirizzi email del mittente separati da spazio applicabili per questa voce. Usa '*' o '?' per la corrispondenza con caratteri jolly. Prefissa con '-' per escludere. Lascia vuoto per corrispondere a tutti i mittenti");m.put("Specify space-separated tags to be protected. Use '**', '*' or '?' for <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>path wildcard match</a>. Prefix with '-' to exclude","Specifica i tag separati da spazio da proteggere. Usa '**', '*' o '?' per <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>la corrispondenza con caratteri jolly</a>. Prefissa con '-' per escludere");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: <tt>manual/index.md</tt>",- "Specifica la pagina iniziale del report relativa a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, ad esempio: <tt>manual/index.md</tt>");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: api/index.html",- "Specifica la pagina iniziale del report relativa a <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, ad esempio: api/index.html");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: <tt>manual/index.md</tt>",+ "Specifica la pagina iniziale del report relativa a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, ad esempio: <tt>manual/index.md</tt>");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: api/index.html",+ "Specifica la pagina iniziale del report relativa a <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, ad esempio: api/index.html");m.put("Specify storage size to request for the build volume. The size should conform to <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>Kubernetes resource capacity format</a>, for instance <i>10Gi</i>","Specifica la dimensione di archiviazione da richiedere per il volume di build. La dimensione deve conformarsi al <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>formato di capacità delle risorse di Kubernetes</a>, ad esempio <i>10Gi</i>");m.put("Specify tab width used to calculate column value of found problems in provided report",@@ -3769,8 +3769,8 @@ public class Translation_it extends TranslationResourceBundle {m.put("Step Templates", "Template dei Passaggi");m.put("Step {0} of {1}: ", "Passaggio {0} di {1}:");m.put("Steps", "Passaggi");- m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>",- "I passaggi verranno eseguiti in serie sullo stesso nodo, condividendo lo stesso <a href='https://docs.onedev.io/concepts#job-workspace'>workspace del job</a>");+ m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>",+ "I passaggi verranno eseguiti in serie sullo stesso nodo, condividendo lo stesso <a href='https://docs.onedev.io/concepts#job-workdir'>workspace del job</a>");m.put("Stop", "Ferma");m.put("Stop work", "Ferma il lavoro");m.put("Stopwatch Overdue", "Cronometro Scaduto");@@ -4008,9 +4008,9 @@ public class Translation_it extends TranslationResourceBundle {m.put("This shows number of issues in various states over time", "Questo mostra il numero di problemi in vari stati nel tempo");m.put("This shows number of open and merged pull requests over time", "Questo mostra il numero di pull request aperte e unite nel tempo");m.put("This step can only be executed by a docker aware executor", "Questo step può essere eseguito solo da un executor compatibile con docker");- m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Questo step può essere eseguito solo da un executor compatibile con docker. Viene eseguito sotto <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>workspace del lavoro</a>");- m.put("This step copies files from job workspace to build artifacts directory, so that they can be accessed after job is completed",+ m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Questo step può essere eseguito solo da un executor compatibile con docker. Viene eseguito sotto <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>workspace del lavoro</a>");+ m.put("This step copies files from job workdir to build artifacts directory, so that they can be accessed after job is completed","Questo passo copia i file dalla workspace del job alla directory degli artefatti di build, in modo che possano essere accessibili dopo il completamento del job");m.put("This step publishes specified files to be served as project web site. Project web site can be accessed publicly via <code>http://<onedev base url>/path/to/project/~site</code>","Questo step pubblica i file specificati per essere serviti come sito web del progetto. Il sito web del progetto può essere accessibile pubblicamente tramite <code>http://<onedev base url>/path/to/project/~site</code>");@@ -4728,8 +4728,8 @@ public class Translation_it extends TranslationResourceBundle {"Specifica facoltativamente i tipi di commit applicabili per il controllo del piè di pagina del messaggio di commit (premi INVIO per aggiungere valore). Lascia vuoto per tutti i tipi");m.put("Optionally specify extra options for osv source scanner. Multiple options need to be separated with space","Specifica facoltativamente opzioni extra per lo scanner di origine osv. Più opzioni devono essere separate con uno spazio");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",- "Specifica facoltativamente il percorso relativo allo <a href='https://docs.onedev.io/concepts#job-workspace'>spazio di lavoro del lavoro</a> da utilizzare come <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>configurazione segreta</a> di trivy");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",+ "Specifica facoltativamente il percorso relativo allo <a href='https://docs.onedev.io/concepts#job-workdir'>spazio di lavoro del lavoro</a> da utilizzare come <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>configurazione segreta</a> di trivy");m.put("Osv Source Scanner", "Scanner di Origine Osv");m.put("Run osv scanner to scan project source for vulnerabilities in <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>various lock files</a>. It can only be executed by docker aware executor.","Esegui lo scanner osv per scansionare il codice sorgente del progetto alla ricerca di vulnerabilità in <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>vari file di blocco</a>. Può essere eseguito solo da un esecutore compatibile con docker.");diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_ja.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_ja.javaindex 40aaa3b637..4b66189e34 100644--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_ja.java+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_ja.java@@ -1397,8 +1397,8 @@ public class Translation_ja extends TranslationResourceBundle {"デフォルトブランチから到達できないビルドコミットの場合、<a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>ジョブシークレット</a>を作成タグ権限付きのアクセストークンとして指定する必要があります");m.put("For build commit not reachable from default branch, a <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> should be specified as access token with manage issue permission","デフォルトブランチから到達できないビルドコミットの場合、<a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>ジョブシークレット</a>を問題管理権限付きのアクセストークンとして指定する必要があります");- m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>). For shell related executors which runs on host machine directly, only relative path is accepted",- "Docker対応エグゼキューターの場合、このパスはコンテナ内にあり、絶対パスと相対パス(<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>に対する相対パス)を受け入れます。ホストマシンで直接実行されるシェル関連エグゼキューターの場合、相対パスのみが受け入れられます");+ m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>). For shell related executors which runs on host machine directly, only relative path is accepted",+ "Docker対応エグゼキューターの場合、このパスはコンテナ内にあり、絶対パスと相対パス(<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>に対する相対パス)を受け入れます。ホストマシンで直接実行されるシェル関連エグゼキューターの場合、相対パスのみが受け入れられます");m.put("For each build, OneDev calculates a list of fixed issues since previous build automatically. This setting provides a default query to further filter/order this list. For a given job, the first matching entry will be used.","各ビルドに対して、OneDevは前回のビルド以降に修正された問題のリストを自動的に計算します。この設定は、このリストをさらにフィルター/順序付けするためのデフォルトクエリを提供します。特定のジョブの場合、最初に一致するエントリが使用されます。");m.put("For each selected branch/tag, a separate build will be generated with branch/tag set to corresponding value",@@ -2346,7 +2346,7 @@ public class Translation_ja extends TranslationResourceBundle {m.put("Optionally filter issues", "課題を任意でフィルタリング");m.put("Optionally filter pull requests", "プルリクエストを任意でフィルタリング");m.put("Optionally leave a note", "任意で注記を残す");- m.put("Optionally mount directories or files under job workspace into container", "ジョブワークスペース内のディレクトリやファイルをコンテナにマウントすることを任意で選択");+ m.put("Optionally mount directories or files under job workdir into container", "ジョブワークスペース内のディレクトリやファイルをコンテナにマウントすることを任意で選択");m.put("Optionally select fields to prompt when this button is pressed", "このボタンが押されたときにプロンプトするフィールドを任意で選択");m.put("Optionally select fields to remove when this transition happens", "この遷移が発生したときに削除するフィールドを任意で選択");m.put("Optionally specifies name of the attribute inside the user LDAP entry whose value will be taken as user email. This field is normally set to <i>mail</i> according to RFC 2798",@@ -2366,8 +2366,8 @@ public class Translation_ja extends TranslationResourceBundle {m.put("Optionally specify <span class='text-info'>comma separated</span> platforms to scan, for instance <tt>linux/amd64,linux/arm64</tt>. Leave empty to scan all platforms in OCI layout","オプションで、スキャンするプラットフォームを<span class='text-info'>カンマ区切り</span>で指定してください。例: <tt>linux/amd64,linux/arm64</tt>。OCIレイアウト内のすべてのプラットフォームをスキャンする場合は空のままにしてください。");m.put("Optionally specify API key for authentication", "認証のためにAPIキーを任意で指定");- m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",- "オプションで、<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>に対するDockerfileの相対パスを指定してください。上記で指定したビルドパスの下にある<tt>Dockerfile</tt>ファイルを使用する場合は空のままにしてください。");+ m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",+ "オプションで、<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>に対するDockerfileの相対パスを指定してください。上記で指定したビルドパスの下にある<tt>Dockerfile</tt>ファイルを使用する場合は空のままにしてください。");m.put("Optionally specify JavaScript config to be used by Renovate CLI", "オプションで、Renovate CLIで使用するJavaScript設定を指定してください。");m.put("Optionally specify SSH root URL, which will be used to construct project clone url via SSH protocol. Leave empty to derive from server url","オプションで、SSHルートURLを指定してください。これはSSHプロトコルを介してプロジェクトクローンURLを構築するために使用されます。サーバーURLから派生する場合は空のままにしてください。");@@ -2385,8 +2385,8 @@ public class Translation_ja extends TranslationResourceBundle {"オプションで、データベース自動バックアップをスケジュールするためのcron式を指定してください。cron式の形式は<em><秒> <分> <時> <日> <月> <曜日></em>です。例えば、<em>0 0 1 * * ?</em>は毎日午前1時を意味します。形式の詳細については、<a href='http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html#format' target='_blank'>Quartzチュートリアル</a>を参照してください。バックアップファイルはOneDevインストールディレクトリの<em>db-backup</em>フォルダに配置されます。複数のサーバーがクラスターを形成する場合、自動バックアップは<a href='https://docs.onedev.io/concepts#lead-server' target='_blank'>リードサーバー</a>で行われます。このプロパティを空のままにしておくと、データベース自動バックアップは有効になりません。");m.put("Optionally specify a date field to hold due date information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","オプションで、期限情報を保持する日付フィールドを指定してください。<br><b>注意: </b>適切なオプションがない場合は、OneDev課題フィールドをカスタマイズすることができます。");- m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to put retrieved artifacts. Leave empty to use job workspace itself",- "オプションで、取得したアーティファクトを配置する<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する相対パスを指定してください。ジョブワークスペース自体を使用する場合は空のままにしてください。");+ m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to put retrieved artifacts. Leave empty to use job workdir itself",+ "オプションで、取得したアーティファクトを配置する<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する相対パスを指定してください。ジョブワークスペース自体を使用する場合は空のままにしてください。");m.put("Optionally specify a storage class to allocate build volume dynamically. Leave empty to use default storage class. <b class='text-warning'>NOTE:</b> Reclaim policy of the storage class should be set to <code>Delete</code>, as the volume is only used to hold temporary build files","オプションで、ビルドボリュームを動的に割り当てるためのストレージクラスを指定してください。デフォルトのストレージクラスを使用する場合は空のままにしてください。<b class='text-warning'>注意:</b> ストレージクラスの再利用ポリシーは<code>Delete</code>に設定する必要があります。ボリュームは一時的なビルドファイルを保持するためだけに使用されます。");m.put("Optionally specify a working period field to hold estimated time infomration.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",@@ -2405,17 +2405,17 @@ public class Translation_ja extends TranslationResourceBundle {m.put("Optionally specify applicable jobs of this executor", "このエグゼキュータに適用可能なジョブを任意で指定してください");m.put("Optionally specify applicable users who pushed the change", "変更をプッシュした適用可能なユーザーを任意で指定");m.put("Optionally specify arguments to run above image", "オプションで、上記のイメージを実行するための引数を指定してください。");- m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",- "オプションで、依存関係から<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に取得するアーティファクトを指定してください。公開されたアーティファクト(アーティファクト公開ステップを介して)だけが取得可能です。アーティファクトを取得しない場合は空のままにしてください。");+ m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",+ "オプションで、依存関係から<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に取得するアーティファクトを指定してください。公開されたアーティファクト(アーティファクト公開ステップを介して)だけが取得可能です。アーティファクトを取得しない場合は空のままにしてください。");m.put("Optionally specify authorized roles to press this button. If not specified, all users are allowed","オプションで、このボタンを押すための認証済みロールを指定してください。指定されていない場合、すべてのユーザーが許可されます。");m.put("Optionally specify base query of the list", "オプションで、リストの基本クエリを指定してください。");m.put("Optionally specify branches/users/groups allowed to access this secret. If left empty, any job can access this secret, including those triggered via external pull requests","オプションで、このシークレットにアクセスできるブランチ/ユーザー/グループを指定してください。空のままにすると、外部プルリクエストを介してトリガーされたジョブを含む、任意のジョブがこのシークレットにアクセスできます。");- m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",- "オプションで、<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>に対するビルドコンテキストパスを指定してください。ジョブワークスペース自体を使用する場合は空のままにしてください。<code>Dockerfile</code>ファイルはビルドコンテキストディレクトリに存在することが期待されますが、オプション<code>--dockerfile</code>で異なる場所を指定することもできます。");- m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself",- "オプションで、<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>に対するビルドパスを指定してください。ジョブワークスペース自体を使用する場合は空のままにしてください。");+ m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",+ "オプションで、<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>に対するビルドコンテキストパスを指定してください。ジョブワークスペース自体を使用する場合は空のままにしてください。<code>Dockerfile</code>ファイルはビルドコンテキストディレクトリに存在することが期待されますが、オプション<code>--dockerfile</code>で異なる場所を指定することもできます。");+ m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself",+ "オプションで、<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>に対するビルドパスを指定してください。ジョブワークスペース自体を使用する場合は空のままにしてください。");m.put("Optionally specify cluster role the job pods service account binding to. This is necessary if you want to do things such as running other Kubernetes pods in job command","オプションで、ジョブポッドのサービスアカウントがバインドされるクラスター役割を指定してください。これは、ジョブコマンドで他のKubernetesポッドを実行するなどの操作を行いたい場合に必要です。");m.put("Optionally specify container arguments separated by space. Single argument containing space should be quoted. <b class='text-warning'>Note: </b> do not confuse this with container options which should be specified in executor setting",@@ -2478,13 +2478,13 @@ public class Translation_ja extends TranslationResourceBundle {"オプションで、sshコマンドのオプションを指定してください。複数のオプションはスペースで区切る必要があります。");m.put("Optionally specify options passed to renovate cli. Multiple options should be separated by space, and single option containing spaces should be quoted","オプションで、Renovate CLIに渡されるオプションを指定してください。複数のオプションはスペースで区切る必要があり、スペースを含む単一のオプションは引用符で囲む必要があります。");- m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. You may ignore particular vulnerabilities via this file",- "オプションで、<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>内のosvスキャナー<a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>設定ファイル</a>を指定してください。このファイルを使用して特定の脆弱性を無視することができます。");+ m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. You may ignore particular vulnerabilities via this file",+ "オプションで、<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>内のosvスキャナー<a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>設定ファイル</a>を指定してください。このファイルを使用して特定の脆弱性を無視することができます。");m.put("Optionally specify path protection rules", "オプションで、パス保護ルールを指定してください。");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",- "オプションで、trivy<a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>無視ファイル</a>として使用する<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する相対パスを指定してください。");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to publish artifacts from. Leave empty to use job workspace itself",- "オプションで、アーティファクトを公開するための<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する相対パスを指定してください。ジョブワークスペース自体を使用する場合は空のままにしてください。");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",+ "オプションで、trivy<a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>無視ファイル</a>として使用する<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する相対パスを指定してください。");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to publish artifacts from. Leave empty to use job workdir itself",+ "オプションで、アーティファクトを公開するための<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する相対パスを指定してください。ジョブワークスペース自体を使用する場合は空のままにしてください。");m.put("Optionally specify platform to pull, for instance <tt>linux/amd64</tt>. Leave empty to pull all platforms in image","オプションで、プルするプラットフォームを指定してください。例: <tt>linux/amd64</tt>。イメージ内のすべてのプラットフォームをプルする場合は空のままにしてください。");m.put("Optionally specify project to show builds of. Leave empty to show builds of all projects with permissions",@@ -2498,12 +2498,12 @@ public class Translation_ja extends TranslationResourceBundle {m.put("Optionally specify registry logins to override those defined in job executor. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token secret for password secret","オプションで、ジョブエグゼキューターで定義されたものを上書きするためのレジストリログインを指定してください。組み込みレジストリの場合、レジストリURLには<code>@server_url@</code>、ユーザー名には<code>@job_token@</code>、パスワードシークレットにはアクセストークンシークレットを使用してください。");m.put("Optionally specify relative directory to put uploaded files", "オプションで、アップロードされたファイルを配置する相対ディレクトリを指定してください。");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to clone code into. Leave empty to use job workspace itself",- "オプションで、コードをクローンするための<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する相対パスを指定してください。ジョブワークスペース自体を使用する場合は空のままにしてください。");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan. Leave empty to use job workspace itself",- "オプションで、スキャンするための<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する相対パスを指定してください。ジョブワークスペース自体を使用する場合は空のままにしてください。");- m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workspace itself",- "オプションで、依存関係の脆弱性をスキャンするための<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する相対パスを指定してください。複数のパスを指定することができ、スペースで区切る必要があります。ジョブワークスペース自体を使用する場合は空のままにしてください。");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to clone code into. Leave empty to use job workdir itself",+ "オプションで、コードをクローンするための<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する相対パスを指定してください。ジョブワークスペース自体を使用する場合は空のままにしてください。");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan. Leave empty to use job workdir itself",+ "オプションで、スキャンするための<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する相対パスを指定してください。ジョブワークスペース自体を使用する場合は空のままにしてください。");+ m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workdir itself",+ "オプションで、依存関係の脆弱性をスキャンするための<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する相対パスを指定してください。複数のパスを指定することができ、スペースで区切る必要があります。ジョブワークスペース自体を使用する場合は空のままにしてください。");m.put("Optionally specify required reviewers for changes of specified branch", "オプションで、指定されたブランチの変更に対する必要なレビュアーを指定してください。");m.put("Optionally specify revision to create branch from. Leave empty to create from build commit","オプションで、ブランチを作成するためのリビジョンを指定してください。ビルドコミットから作成する場合は空のままにしてください。");@@ -3117,8 +3117,8 @@ public class Translation_ja extends TranslationResourceBundle {m.put("Run job", "ジョブを実行");m.put("Run job in another project", "別のプロジェクトでジョブを実行する");m.put("Run on Bare Metal/Virtual Machine", "ベアメタル/仮想マシンで実行");- m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKSPACE</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",- "指定されたDockerコンテナを実行します。<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>がコンテナにマウントされ、そのパスが環境変数<code>ONEDEV_WORKSPACE</code>に配置されます。<b class='text-warning'>注意: </b>このステップはサーバーDockerエグゼキューターまたはリモートDockerエグゼキューターによってのみ実行可能です");+ m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKDIR</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",+ "指定されたDockerコンテナを実行します。<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>がコンテナにマウントされ、そのパスが環境変数<code>ONEDEV_WORKDIR</code>に配置されます。<b class='text-warning'>注意: </b>このステップはサーバーDockerエグゼキューターまたはリモートDockerエグゼキューターによってのみ実行可能です");m.put("Run specified step template", "指定されたステップテンプレートを実行");m.put("Run this job", "このジョブを実行");m.put("Run trivy container image scanner to find issues in specified image. For vulnerabilities, it checks various <a href='https://aquasecurity.github.io/trivy/v0.50/docs/coverage/language/#supported-languages' target='_blank'>distribution files</a>. It can only be executed by docker aware executor.",@@ -3391,47 +3391,47 @@ public class Translation_ja extends TranslationResourceBundle {m.put("Specifies who can access this AI service", "このAIサービスにアクセスできる人を指定します");m.put("Specifies who can access this AI service. AI service can be accessed in below approaches:","このAIサービスにアクセスできる人を指定します。AIサービスには以下の方法でアクセスできます:");- m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する .net TRX テスト結果ファイルを指定します。例: <tt>TestResults/*.trx</tt>。パターンマッチには * または ? を使用してください");+ m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する .net TRX テスト結果ファイルを指定します。例: <tt>TestResults/*.trx</tt>。パターンマッチには * または ? を使用してください");m.put("Specify <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> whose value is access token with code write permission over above projects. Commits, issues, and pull requests will also be created under name of the access token owner","<a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>ジョブシークレット</a>を指定します。この値はコード書き込み権限を持つアクセス トークンです。コミット、課題、プルリクエストはアクセス トークン所有者の名前で作成されます");- m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",- "<a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> の JSON 出力ファイルを <a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対して指定します。このファイルは clippy の JSON 出力オプションで生成できます。例: <code>cargo clippy --message-format json>check-result.json</code>。パターンマッチには * または ? を使用してください");+ m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",+ "<a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> の JSON 出力ファイルを <a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対して指定します。このファイルは clippy の JSON 出力オプションで生成できます。例: <code>cargo clippy --message-format json>check-result.json</code>。パターンマッチには * または ? を使用してください");m.put("Specify Build Options", "ビルドオプションを指定します");- m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する CPD 結果 XML ファイルを指定します。例: <tt>target/cpd.xml</tt>。パターンマッチには * または ? を使用してください");+ m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する CPD 結果 XML ファイルを指定します。例: <tt>target/cpd.xml</tt>。パターンマッチには * または ? を使用してください");m.put("Specify Commit Message", "コミットメッセージを指定します");- m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>内の checkstyle フォーマットで ESLint レポートファイルを指定します。このファイルは ESLint オプション <tt>'-f checkstyle'</tt> および <tt>'-o'</tt> を使用して生成できます。パターンマッチには * または ? を使用してください");+ m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>内の checkstyle フォーマットで ESLint レポートファイルを指定します。このファイルは ESLint オプション <tt>'-f checkstyle'</tt> および <tt>'-o'</tt> を使用して生成できます。パターンマッチには * または ? を使用してください");m.put("Specify GitHub API url, for instance <tt>https://api.github.com</tt>", "GitHub API URL を指定します。例: <tt>https://api.github.com</tt>");m.put("Specify GitLab API url, for instance <tt>https://gitlab.example.com/api/v4</tt>", "GitLab API URL を指定します。例: <tt>https://gitlab.example.com/api/v4</tt>");m.put("Specify Gitea API url, for instance <tt>https://gitea.example.com/api/v1</tt>", "Gitea API URL を指定します。例: <tt>https://gitea.example.com/api/v1</tt>");- m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する GoogleTest XML 結果ファイルを指定します。このレポートはテスト実行時に環境変数 <tt>GTEST_OUTPUT</tt> を使用して生成できます。例: <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>。パターンマッチには * または ? を使用してください");+ m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する GoogleTest XML 結果ファイルを指定します。このレポートはテスト実行時に環境変数 <tt>GTEST_OUTPUT</tt> を使用して生成できます。例: <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>。パターンマッチには * または ? を使用してください");m.put("Specify IMAP user name.<br><b class='text-danger'>NOTE: </b> This account should be able to receive emails sent to system email address specified above","IMAP ユーザー名を指定します。<br><b class='text-danger'>注意: </b>このアカウントは上記で指定されたシステムメールアドレスに送信されたメールを受信できる必要があります");- m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する JUnit テスト結果ファイル (XML フォーマット) を指定します。例: <tt>target/surefire-reports/TEST-*.xml</tt>。パターンマッチには * または ? を使用してください");- m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する JaCoCo カバレッジ XML レポートファイルを指定します。例: <tt>target/site/jacoco/jacoco.xml</tt>。パターンマッチには * または ? を使用してください");- m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する Jest カバレッジレポートファイル (clover フォーマット) を指定します。例: <tt>coverage/clover.xml</tt>。このファイルは Jest オプション <tt>'--coverage'</tt> を使用して生成できます。パターンマッチには * または ? を使用してください");- m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する Jest テスト結果ファイル (JSON フォーマット) を指定します。このファイルは Jest オプション <tt>'--json'</tt> および <tt>'--outputFile'</tt> を使用して生成できます。パターンマッチには * または ? を使用してください");- m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "スキャン対象のイメージの OCI レイアウトディレクトリを指定します。このディレクトリはイメージビルドステップまたはイメージプルステップで生成できます。<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>に対して相対的である必要があります");- m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to push from",- "プッシュ元として使用する OCI レイアウトディレクトリを <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>に対して指定します");+ m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する JUnit テスト結果ファイル (XML フォーマット) を指定します。例: <tt>target/surefire-reports/TEST-*.xml</tt>。パターンマッチには * または ? を使用してください");+ m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する JaCoCo カバレッジ XML レポートファイルを指定します。例: <tt>target/site/jacoco/jacoco.xml</tt>。パターンマッチには * または ? を使用してください");+ m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する Jest カバレッジレポートファイル (clover フォーマット) を指定します。例: <tt>coverage/clover.xml</tt>。このファイルは Jest オプション <tt>'--coverage'</tt> を使用して生成できます。パターンマッチには * または ? を使用してください");+ m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する Jest テスト結果ファイル (JSON フォーマット) を指定します。このファイルは Jest オプション <tt>'--json'</tt> および <tt>'--outputFile'</tt> を使用して生成できます。パターンマッチには * または ? を使用してください");+ m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "スキャン対象のイメージの OCI レイアウトディレクトリを指定します。このディレクトリはイメージビルドステップまたはイメージプルステップで生成できます。<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>に対して相対的である必要があります");+ m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to push from",+ "プッシュ元として使用する OCI レイアウトディレクトリを <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>に対して指定します");m.put("Specify OpenID scopes to request", "要求する OpenID スコープを指定します");- m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する PMD 結果 XML ファイルを指定します。例: <tt>target/pmd.xml</tt>。パターンマッチには * または ? を使用してください");- m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",- "<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>内で実行する PowerShell コマンドを指定します。<br><b class='text-warning'>注意: </b>OneDev はスクリプトの終了コードをチェックしてステップが成功したかどうかを判断します。PowerShell はスクリプトエラーがあっても常に 0 を返すため、スクリプト内でエラーを処理して非ゼロコードで終了するか、スクリプトの冒頭に <code>$ErrorActionPreference = "Stop"</code> を追加してください<br>");- m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する Roslynator 診断出力ファイル (XML フォーマット) を指定します。このファイルは <i>-o</i> オプションで生成できます。パターンマッチには * または ? を使用してください");+ m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する PMD 結果 XML ファイルを指定します。例: <tt>target/pmd.xml</tt>。パターンマッチには * または ? を使用してください");+ m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",+ "<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>内で実行する PowerShell コマンドを指定します。<br><b class='text-warning'>注意: </b>OneDev はスクリプトの終了コードをチェックしてステップが成功したかどうかを判断します。PowerShell はスクリプトエラーがあっても常に 0 を返すため、スクリプト内でエラーを処理して非ゼロコードで終了するか、スクリプトの冒頭に <code>$ErrorActionPreference = "Stop"</code> を追加してください<br>");+ m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する Roslynator 診断出力ファイル (XML フォーマット) を指定します。このファイルは <i>-o</i> オプションで生成できます。パターンマッチには * または ? を使用してください");m.put("Specify Shell/Batch Commands to Run", "実行するシェル/バッチコマンドを指定します");- m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する SpotBugs 結果 XML ファイルを指定します。例: <tt>target/spotbugsXml.xml</tt>。パターンマッチには * または ? を使用してください");+ m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する SpotBugs 結果 XML ファイルを指定します。例: <tt>target/spotbugsXml.xml</tt>。パターンマッチには * または ? を使用してください");m.put("Specify System Settings", "システム設定を指定します");m.put("Specify URL of remote git repository. Only http/https protocol is supported", "リモート Git リポジトリの URL を指定します。http/https プロトコルのみサポートされています");m.put("Specify YouTrack login name. This account should have permission to:<ul><li>Read full information and issues of the projects you want to import<li>Read issue tags<li>Read user basic information</ul>",@@ -3466,14 +3466,14 @@ public class Translation_ja extends TranslationResourceBundle {m.put("Specify a Docker Image to Test Against", "テスト対象の Docker イメージを指定します");m.put("Specify a custom field of Enum type", "Enum 型のカスタムフィールドを指定します");m.put("Specify a default query to filter/order fixed issues of specified jobs", "指定されたジョブの修正済み課題をフィルタリング/並べ替えるためのデフォルトクエリを指定します");- m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to write checksum into",- "チェックサムを書き込むためのファイルを <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>に対して指定します");+ m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to write checksum into",+ "チェックサムを書き込むためのファイルを <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>に対して指定します");m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","担当者情報を保持するための複数値ユーザーフィールドを指定します。<b>注意: </b>適切なオプションがない場合は OneDev の課題フィールドをカスタマイズすることができます");m.put("Specify a multi-value user field to hold assignees information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","担当者情報を保持するための複数値ユーザーフィールドを指定します。<br><b>注意: </b>適切なオプションがない場合は OneDev の課題フィールドをカスタマイズすることができます");m.put("Specify a path inside container to be used as mount target", "マウントターゲットとして使用するコンテナ内のパスを指定します");- m.put("Specify a path relative to job workspace to be used as mount source. Leave empty to mount job workspace itself",+ m.put("Specify a path relative to job workdir to be used as mount source. Leave empty to mount job workdir itself","マウントソースとして使用するジョブワークスペースに対するパスを指定します。空欄の場合、ジョブワークスペース自体をマウントします");m.put("Specify a secret to be used as access token to create issue in above project if it is not publicly accessible","上記プロジェクトで課題を作成するためのアクセス トークンとして使用するシークレットを指定します。このプロジェクトが公開されていない場合に使用します");@@ -3499,8 +3499,8 @@ public class Translation_ja extends TranslationResourceBundle {m.put("Specify application (client) ID of the app registered in Entra ID", "Entra ID に登録されたアプリのアプリケーション (クライアント) ID を指定します");m.put("Specify arguments for imagetools. For instance <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>","イメージツールの引数を指定します。例: <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>");- m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved.",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に取得するアーティファクトを指定します。公開されたアーティファクト (アーティファクト公開ステップを通じて) のみ取得可能です");+ m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved.",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に取得するアーティファクトを指定します。公開されたアーティファクト (アーティファクト公開ステップを通じて) のみ取得可能です");m.put("Specify at least 10 alphanumeric chars to be used as secret, and then add an inbound parse entry at SendGrid side:<ul><li><code>Destination URL</code> should be set to <i><OneDev root url>/~sendgrid/<secret></i>, for instance, <i>https://onedev.example.com/~sendgrid/1234567890</i>. Note that in production environment, <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>https should be enabled</a> to protect the secret</li><li><code>Receiving domain</code> should be the same as domain part of system email address specified above</li><li>Option <code>POST the raw, full MIME message</code> is enabled</li></ul>","少なくとも 10 文字の英数字をシークレットとして指定し、SendGrid 側でインバウンド解析エントリを追加します:<ul><li><code>送信先 URL</code> は <i><OneDev ルート URL>/~sendgrid/<シークレット></i> に設定する必要があります。例: <i>https://onedev.example.com/~sendgrid/1234567890</i>。本番環境では、<a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>https を有効にする必要があります</a> シークレットを保護するため</li><li><code>受信ドメイン</code> は上記で指定されたシステムメールアドレスのドメイン部分と同じである必要があります</li><li>オプション <code>生の完全な MIME メッセージを POST</code> が有効になっています</li></ul>");m.put("Specify base nodes for user search. For example: <i>cn=Users, dc=example, dc=com</i>",@@ -3516,13 +3516,13 @@ public class Translation_ja extends TranslationResourceBundle {"リモートリポジトリに自己署名証明書を使用している場合に信頼する証明書を指定します");m.put("Specify certificates to trust if you are using self-signed certificates for your docker registries","Docker レジストリに自己署名証明書を使用している場合に信頼する証明書を指定します");- m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する checkstyle 結果 XML ファイルを指定します。例: <tt>target/checkstyle-result.xml</tt>。結果 XML ファイルの生成方法については <a href='https://checkstyle.org/'>checkstyle ドキュメント</a> を参照してください。パターンマッチには * または ? を使用してください");+ m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する checkstyle 結果 XML ファイルを指定します。例: <tt>target/checkstyle-result.xml</tt>。結果 XML ファイルの生成方法については <a href='https://checkstyle.org/'>checkstyle ドキュメント</a> を参照してください。パターンマッチには * または ? を使用してください");m.put("Specify client secret of the app registered in Entra ID", "Entra ID に登録されたアプリのクライアントシークレットを指定します");- m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する clover カバレッジ XML レポートファイルを指定します。例: <tt>target/site/clover/clover.xml</tt>。clover XML ファイルの生成方法については <a href='https://openclover.org/documentation'>OpenClover ドキュメント</a> を参照してください。パターンマッチには * または ? を使用してください");- m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する cobertura カバレッジ XML レポートファイルを指定します。例: <tt>target/site/cobertura/coverage.xml</tt>。パターンマッチには * または ? を使用してください");+ m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する clover カバレッジ XML レポートファイルを指定します。例: <tt>target/site/clover/clover.xml</tt>。clover XML ファイルの生成方法については <a href='https://openclover.org/documentation'>OpenClover ドキュメント</a> を参照してください。パターンマッチには * または ? を使用してください");+ m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する cobertura カバレッジ XML レポートファイルを指定します。例: <tt>target/site/cobertura/coverage.xml</tt>。パターンマッチには * または ? を使用してください");m.put("Specify color of the state for displaying purpose", "表示目的の状態の色を指定します");m.put("Specify columns of the board. Each column corresponds to a value of the issue field specified above","ボードの列を指定します。各列は上記で指定された課題フィールドの値に対応します");@@ -3535,8 +3535,8 @@ public class Translation_ja extends TranslationResourceBundle {"OpenIDプロバイダーの構成検出URLを指定してください。例: <code>https://openid.example.com/.well-known/openid-configuration</code>。OneDevはトークンの有効性を確保するためにTLS暗号化に依存しているため、HTTPSプロトコルを使用してください。");m.put("Specify container image to execute commands inside", "コマンドを実行するためのコンテナイメージを指定してください。");m.put("Specify container image to run", "実行するコンテナイメージを指定してください。");- m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対するcppcheckのXML結果ファイルを指定してください。このファイルはcppcheckのXML出力オプションで生成できます。例: <code>cppcheck src --xml 2>check-result.xml</code>。パターンマッチには*や?を使用してください。");+ m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対するcppcheckのXML結果ファイルを指定してください。このファイルはcppcheckのXML出力オプションで生成できます。例: <code>cppcheck src --xml 2>check-result.xml</code>。パターンマッチには*や?を使用してください。");m.put("Specify cpu request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","このエグゼキューターを使用する各ジョブ/サービスのCPUリクエストを指定してください。詳細は<a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetesリソース管理</a>を確認してください。");m.put("Specify default assignees of pull requests submitted to this project. Only users with the write code permission to the project can be selected",@@ -3545,8 +3545,8 @@ public class Translation_ja extends TranslationResourceBundle {m.put("Specify destinations, for instance <tt>registry-server:5000/myorg/myrepo:latest</tt>. Make sure to use <b>same host</b> as specified in server url of system settings if you want to push to built-in registry, or simply use the form <tt>@server@/<project path>/<repo name>:<tag name></tt>. Multiple destinations should be separated with space","送信先を指定してください。例: <tt>registry-server:5000/myorg/myrepo:latest</tt>。組み込みレジストリにプッシュする場合、システム設定のサーバーURLで指定された<b>同じホスト</b>を使用するか、単に<tt>@server@/<project path>/<repo name>:<tag name></tt>の形式を使用してください。複数の送信先はスペースで区切ってください。");m.put("Specify directory (tenant) ID of the app registered in Entra ID", "Entra IDに登録されたアプリのディレクトリ(テナント)IDを指定してください。");- m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>に対するOCIレイアウトを保存するディレクトリを指定してください。");+ m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>に対するOCIレイアウトを保存するディレクトリを指定してください。");m.put("Specify docker image of the service", "サービスのDockerイメージを指定してください。");m.put("Specify dockerx builder used to build docker image. OneDev will create the builder automatically if it does not exist. Check <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>this tutorial</a> on how to customize the builder for instance to allow publishing to insecure registries","Dockerイメージをビルドするために使用するdockerxビルダーを指定してください。OneDevはビルダーが存在しない場合、自動的に作成します。例えば、非セキュアなレジストリへの公開を許可するためにビルダーをカスタマイズする方法については<a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>このチュートリアル</a>を確認してください。");@@ -3557,10 +3557,10 @@ public class Translation_ja extends TranslationResourceBundle {"依存関係の更新を調整するためにRenovateによって作成されたさまざまな課題のフィールドを指定してください。");m.put("Specify fields to be displayed in the issue list", "課題リストに表示するフィールドを指定してください。");m.put("Specify fields to display in board card", "ボードカードに表示するフィールドを指定してください。");- m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する公開するファイルを指定してください。パターンマッチには*や?を使用してください。");- m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "md5チェックサムを作成するファイルを指定してください。複数のファイルはスペースで区切ってください。<a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a>パターンが使用可能です。絶対パスでないファイルは<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>に対する相対パスとみなされます。");+ m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する公開するファイルを指定してください。パターンマッチには*や?を使用してください。");+ m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "md5チェックサムを作成するファイルを指定してください。複数のファイルはスペースで区切ってください。<a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a>パターンが使用可能です。絶対パスでないファイルは<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>に対する相対パスとみなされます。");m.put("Specify files under above directory to be published", "上記のディレクトリ内で公開するファイルを指定");m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> <code>index.html</code> should be included in these files to be served as site start page","上記のディレクトリ内で公開するファイルを指定してください。パターンマッチには*や?を使用してください。<b>注意:</b> サイトの開始ページとして提供される<code>index.html</code>をこれらのファイルに含める必要があります。");@@ -3604,8 +3604,8 @@ public class Translation_ja extends TranslationResourceBundle {m.put("Specify manager DN to authenticate OneDev itself to Active Directory. The manager DN should be specified in form of <i><account name>@<domain></i>, for instance: <i>[email protected]</i>","OneDev自身をActive Directoryに認証するためのマネージャーDNを指定してください。マネージャーDNは<i><アカウント名>@<ドメイン></i>の形式で指定する必要があります。例: <i>[email protected]</i>");m.put("Specify manager DN to authenticate OneDev itself to LDAP server", "OneDev自身をLDAPサーバーに認証するためのマネージャーDNを指定してください。");- m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する公開するMarkdownファイルを指定してください。");+ m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する公開するMarkdownファイルを指定してください。");m.put("Specify max git LFS file size in mega bytes", "Git LFSファイルの最大サイズをメガバイト単位で指定してください。");m.put("Specify max number of CPU intensive tasks the server can run concurrently, such as Git repository pull/push, repository index, etc.","サーバーが同時に実行できるCPU集約型タスクの最大数を指定してください。例: Gitリポジトリのプル/プッシュ、リポジトリのインデックス作成など。");@@ -3621,8 +3621,8 @@ public class Translation_ja extends TranslationResourceBundle {"Webインターフェースを介してアップロードされるファイルの最大サイズをメガバイト単位で指定してください。これにはリポジトリにアップロードされるファイル、Markdownコンテンツ(課題コメントなど)、およびビルド成果物が含まれます。");m.put("Specify memory request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","このエグゼキューターを使用する各ジョブ/サービスのメモリリクエストを指定してください。詳細は<a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetesリソース管理</a>を確認してください。");- m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対するmypy出力ファイルを指定してください。このファイルはmypy出力をリダイレクトすることで生成できます。<b>オプション'--pretty'を使用しない</b>例: <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>。パターンマッチには*や?を使用してください。");+ m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対するmypy出力ファイルを指定してください。このファイルはmypy出力をリダイレクトすることで生成できます。<b>オプション'--pretty'を使用しない</b>例: <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>。パターンマッチには*や?を使用してください。");m.put("Specify name of the branch", "ブランチ名を指定してください。");m.put("Specify name of the environment variable", "環境変数の名前を指定してください。");m.put("Specify name of the iteration", "イテレーションの名前を指定してください。");@@ -3645,23 +3645,23 @@ public class Translation_ja extends TranslationResourceBundle {m.put("Specify project to run job in", "ジョブを実行するプロジェクトを指定します。");m.put("Specify projects", "プロジェクトを指定してください。");m.put("Specify projects to update dependencies. Leave empty for current project", "依存関係を更新するプロジェクトを指定してください。現在のプロジェクトの場合は空欄にしてください。");- m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対するpylintのJSON結果ファイルを指定してください。このファイルはpylintのJSON出力形式オプションで生成できます。例: <code>--exit-zero --output-format=json:pylint-result.json</code>。違反があってもpylintコマンドは失敗しません。このステップは設定された閾値に基づいてビルドを失敗させます。パターンマッチには*や?を使用してください。");+ m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対するpylintのJSON結果ファイルを指定してください。このファイルはpylintのJSON出力形式オプションで生成できます。例: <code>--exit-zero --output-format=json:pylint-result.json</code>。違反があってもpylintコマンドは失敗しません。このステップは設定された閾値に基づいてビルドを失敗させます。パターンマッチには*や?を使用してください。");m.put("Specify registry logins if necessary. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token for password","必要に応じてレジストリログインを指定してください。組み込みレジストリの場合、レジストリURLには<code>@server_url@</code>、ユーザー名には<code>@job_token@</code>、パスワードにはアクセストークンを使用してください。");m.put("Specify registry url. Leave empty for official registry", "レジストリURLを指定してください。公式レジストリの場合は空欄にしてください。");- m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>に対するOCIレイアウトを保存する相対パスを指定してください。");+ m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>に対するOCIレイアウトを保存する相対パスを指定してください。");m.put("Specify repositories", "リポジトリを指定してください。");m.put("Specify required reviewers if specified path is changed. Note that the user submitting the change is considered to reviewed the change automatically","指定されたパスが変更された場合に必要なレビュアーを指定してください。変更を提出したユーザーは自動的に変更をレビューしたとみなされます。");m.put("Specify root URL to access this server", "このサーバーにアクセスするためのルートURLを指定してください。");- m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対するruffのJSON結果ファイルを指定してください。このファイルはruffのJSON出力形式オプションで生成できます。例: <code>--exit-zero --output-format json --output-file ruff-result.json</code>。違反があってもruffコマンドは失敗しません。このステップは設定された閾値に基づいてビルドを失敗させます。パターンマッチには*や?を使用してください。");- m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>で実行するシェルコマンド(Linux/Unix)またはバッチコマンド(Windows)を指定してください。");- m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>で実行するシェルコマンドを指定してください。");+ m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対するruffのJSON結果ファイルを指定してください。このファイルはruffのJSON出力形式オプションで生成できます。例: <code>--exit-zero --output-format json --output-file ruff-result.json</code>。違反があってもruffコマンドは失敗しません。このステップは設定された閾値に基づいてビルドを失敗させます。パターンマッチには*や?を使用してください。");+ m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>で実行するシェルコマンド(Linux/Unix)またはバッチコマンド(Windows)を指定してください。");+ m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>で実行するシェルコマンドを指定してください。");m.put("Specify shell to be used", "使用するシェルを指定してください。");m.put("Specify source param for SCP command, for instance <code>app.tar.gz</code>", "SCPコマンドのソースパラメータを指定してください。例: <code>app.tar.gz</code>");m.put("Specify space separated refs to pull from remote. '*' can be used in ref name for wildcard match<br><b class='text-danger'>NOTE:</b> branch/tag protection rule will be ignored when update branches/tags via this step",@@ -3680,10 +3680,10 @@ public class Translation_ja extends TranslationResourceBundle {"このエントリに適用されるスペース区切りの送信者メールアドレスを指定してください。ワイルドカードマッチには'*'または'?'を使用してください。'-'で始めると除外されます。すべての送信者に一致させる場合は空欄にしてください。");m.put("Specify space-separated tags to be protected. Use '**', '*' or '?' for <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>path wildcard match</a>. Prefix with '-' to exclude","保護するスペース区切りのタグを指定してください。<a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>パスワイルドカードマッチ</a>には'**'、'*'、または'?'を使用してください。'-'で始めると除外されます。");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: <tt>manual/index.md</tt>",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対するレポートの開始ページを指定してください。例: <tt>manual/index.md</tt>");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: api/index.html",- "<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対するレポートの開始ページを指定してください。例: api/index.html");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: <tt>manual/index.md</tt>",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対するレポートの開始ページを指定してください。例: <tt>manual/index.md</tt>");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: api/index.html",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対するレポートの開始ページを指定してください。例: api/index.html");m.put("Specify storage size to request for the build volume. The size should conform to <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>Kubernetes resource capacity format</a>, for instance <i>10Gi</i>","ビルドボリュームのストレージサイズをリクエストするために指定してください。サイズは<a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>Kubernetesリソース容量形式</a>に準拠する必要があります。例: <i>10Gi</i>");m.put("Specify tab width used to calculate column value of found problems in provided report",@@ -3769,8 +3769,8 @@ public class Translation_ja extends TranslationResourceBundle {m.put("Step Templates", "ステップテンプレート");m.put("Step {0} of {1}: ", "{0}のステップ{1}:");m.put("Steps", "ステップ");- m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>",- "ステップは同じノード上で直列に実行され、同じ<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>を共有します。");+ m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>",+ "ステップは同じノード上で直列に実行され、同じ<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>を共有します。");m.put("Stop", "停止");m.put("Stop work", "作業を停止");m.put("Stopwatch Overdue", "ストップウォッチ期限切れ");@@ -4008,9 +4008,9 @@ public class Translation_ja extends TranslationResourceBundle {m.put("This shows number of issues in various states over time", "これは、時間の経過に伴うさまざまな状態の課題の数を示します");m.put("This shows number of open and merged pull requests over time", "これは、時間の経過に伴うオープンおよびマージされたプルリクエストの数を示します");m.put("This step can only be executed by a docker aware executor", "このステップはDocker対応エグゼキュータによってのみ実行可能です");- m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "このステップはDocker対応エグゼキュータによってのみ実行可能です。<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>ジョブワークスペース</a>で実行されます");- m.put("This step copies files from job workspace to build artifacts directory, so that they can be accessed after job is completed",+ m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "このステップはDocker対応エグゼキュータによってのみ実行可能です。<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>ジョブワークスペース</a>で実行されます");+ m.put("This step copies files from job workdir to build artifacts directory, so that they can be accessed after job is completed","このステップは、ジョブのワークスペースからビルド成果物ディレクトリにファイルをコピーし、ジョブが完了した後にアクセスできるようにします");m.put("This step publishes specified files to be served as project web site. Project web site can be accessed publicly via <code>http://<onedev base url>/path/to/project/~site</code>","このステップは指定されたファイルをプロジェクトウェブサイトとして公開します。プロジェクトウェブサイトは<code>http://<onedev base url>/path/to/project/~site</code>で公開アクセス可能です");@@ -4728,8 +4728,8 @@ public class Translation_ja extends TranslationResourceBundle {"コミットメッセージフッターチェックに適用されるコミットタイプを任意で指定します(値を追加するにはENTERを押します)。すべてのタイプには空のままにします");m.put("Optionally specify extra options for osv source scanner. Multiple options need to be separated with space","osvソーススキャナーの追加オプションを任意で指定します。複数のオプションはスペースで区切る必要があります");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",- "trivy<a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>シークレット設定</a>として使用する<a href='https://docs.onedev.io/concepts#job-workspace'>ジョブワークスペース</a>に対する相対パスを任意で指定します");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",+ "trivy<a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>シークレット設定</a>として使用する<a href='https://docs.onedev.io/concepts#job-workdir'>ジョブワークスペース</a>に対する相対パスを任意で指定します");m.put("Osv Source Scanner", "Osvソーススキャナー");m.put("Run osv scanner to scan project source for vulnerabilities in <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>various lock files</a>. It can only be executed by docker aware executor.","プロジェクトソースの脆弱性を<a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>さまざまなロックファイル</a>でスキャンするためにosvスキャナーを実行します。これはdocker対応のエグゼキューターによってのみ実行可能です。");diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_ko.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_ko.javaindex 1a7f9fb652..2c0ed64183 100644--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_ko.java+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_ko.java@@ -1397,8 +1397,8 @@ public class Translation_ko extends TranslationResourceBundle {"기본 브랜치에서 접근할 수 없는 빌드 커밋의 경우, <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>작업 비밀</a>을 생성 태그 권한이 있는 액세스 토큰으로 지정해야 합니다");m.put("For build commit not reachable from default branch, a <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> should be specified as access token with manage issue permission","기본 브랜치에서 접근할 수 없는 빌드 커밋의 경우, <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>작업 비밀</a>을 문제 관리 권한이 있는 액세스 토큰으로 지정해야 합니다");- m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>). For shell related executors which runs on host machine directly, only relative path is accepted",- "도커 인식 실행기의 경우, 이 경로는 컨테이너 내부에 있으며 절대 경로와 상대 경로( <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 공간</a> 기준 상대 경로)를 모두 허용합니다. 호스트 머신에서 직접 실행되는 쉘 관련 실행기의 경우, 상대 경로만 허용됩니다");+ m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>). For shell related executors which runs on host machine directly, only relative path is accepted",+ "도커 인식 실행기의 경우, 이 경로는 컨테이너 내부에 있으며 절대 경로와 상대 경로( <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 공간</a> 기준 상대 경로)를 모두 허용합니다. 호스트 머신에서 직접 실행되는 쉘 관련 실행기의 경우, 상대 경로만 허용됩니다");m.put("For each build, OneDev calculates a list of fixed issues since previous build automatically. This setting provides a default query to further filter/order this list. For a given job, the first matching entry will be used.","각 빌드마다 OneDev는 이전 빌드 이후 수정된 문제 목록을 자동으로 계산합니다. 이 설정은 이 목록을 추가로 필터링/정렬하기 위한 기본 쿼리를 제공합니다. 특정 작업의 경우, 첫 번째 일치 항목이 사용됩니다.");m.put("For each selected branch/tag, a separate build will be generated with branch/tag set to corresponding value",@@ -2346,7 +2346,7 @@ public class Translation_ko extends TranslationResourceBundle {m.put("Optionally filter issues", "선택적으로 이슈를 필터링하십시오");m.put("Optionally filter pull requests", "선택적으로 풀 리퀘스트를 필터링하십시오");m.put("Optionally leave a note", "선택적으로 노트를 남기십시오");- m.put("Optionally mount directories or files under job workspace into container", "선택적으로 작업 공간의 디렉토리 또는 파일을 컨테이너에 마운트하십시오");+ m.put("Optionally mount directories or files under job workdir into container", "선택적으로 작업 공간의 디렉토리 또는 파일을 컨테이너에 마운트하십시오");m.put("Optionally select fields to prompt when this button is pressed", "선택적으로 이 버튼을 눌렀을 때 프롬프트할 필드를 선택하십시오");m.put("Optionally select fields to remove when this transition happens", "선택적으로 이 전환이 발생할 때 제거할 필드를 선택하십시오");m.put("Optionally specifies name of the attribute inside the user LDAP entry whose value will be taken as user email. This field is normally set to <i>mail</i> according to RFC 2798",@@ -2366,8 +2366,8 @@ public class Translation_ko extends TranslationResourceBundle {m.put("Optionally specify <span class='text-info'>comma separated</span> platforms to scan, for instance <tt>linux/amd64,linux/arm64</tt>. Leave empty to scan all platforms in OCI layout","선택적으로 <span class='text-info'>쉼표로 구분된</span> 스캔 플랫폼을 지정하세요. 예를 들어 <tt>linux/amd64,linux/arm64</tt>. OCI 레이아웃의 모든 플랫폼을 스캔하려면 비워 두세요.");m.put("Optionally specify API key for authentication", "인증을 위해 API 키를 선택적으로 지정");- m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",- "선택적으로 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 워크스페이스</a>에 상대적인 Dockerfile을 지정하세요. 위에서 지정한 빌드 경로 아래의 <tt>Dockerfile</tt> 파일을 사용하려면 비워 두세요.");+ m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",+ "선택적으로 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 워크스페이스</a>에 상대적인 Dockerfile을 지정하세요. 위에서 지정한 빌드 경로 아래의 <tt>Dockerfile</tt> 파일을 사용하려면 비워 두세요.");m.put("Optionally specify JavaScript config to be used by Renovate CLI", "선택적으로 Renovate CLI에서 사용할 JavaScript 구성을 지정하세요.");m.put("Optionally specify SSH root URL, which will be used to construct project clone url via SSH protocol. Leave empty to derive from server url","선택적으로 SSH 루트 URL을 지정하세요. 이는 SSH 프로토콜을 통해 프로젝트 클론 URL을 구성하는 데 사용됩니다. 서버 URL에서 파생하려면 비워 두세요.");@@ -2385,8 +2385,8 @@ public class Translation_ko extends TranslationResourceBundle {"선택적으로 데이터베이스 자동 백업을 예약하기 위한 크론 표현식을 지정하세요. 크론 표현식 형식은 <em><초> <분> <시간> <일> <월> <요일></em>입니다. 예를 들어, <em>0 0 1 * * ?</em>는 매일 오전 1시를 의미합니다. 형식에 대한 자세한 내용은 <a href='http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html#format' target='_blank'>Quartz 튜토리얼</a>을 참조하세요. 백업 파일은 OneDev 설치 디렉터리 아래의 <em>db-backup</em> 폴더에 저장됩니다. 여러 서버가 클러스터를 형성하기 위해 연결된 경우, 자동 백업은 <a href='https://docs.onedev.io/concepts#lead-server' target='_blank'>리드 서버</a>에서 수행됩니다. 데이터베이스 자동 백업을 활성화하지 않으려면 이 속성을 비워 두세요.");m.put("Optionally specify a date field to hold due date information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","선택적으로 마감일 정보를 보유할 날짜 필드를 지정하세요.<br><b>참고: </b> 적절한 옵션이 없는 경우 OneDev 문제 필드를 사용자 정의할 수 있습니다.");- m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to put retrieved artifacts. Leave empty to use job workspace itself",- "선택적으로 검색된 아티팩트를 저장할 <a href='https://docs.onedev.io/concepts#job-workspace'>작업 워크스페이스</a>에 상대적인 경로를 지정하세요. 작업 워크스페이스 자체를 사용하려면 비워 두세요.");+ m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to put retrieved artifacts. Leave empty to use job workdir itself",+ "선택적으로 검색된 아티팩트를 저장할 <a href='https://docs.onedev.io/concepts#job-workdir'>작업 워크스페이스</a>에 상대적인 경로를 지정하세요. 작업 워크스페이스 자체를 사용하려면 비워 두세요.");m.put("Optionally specify a storage class to allocate build volume dynamically. Leave empty to use default storage class. <b class='text-warning'>NOTE:</b> Reclaim policy of the storage class should be set to <code>Delete</code>, as the volume is only used to hold temporary build files","선택적으로 빌드 볼륨을 동적으로 할당할 스토리지 클래스를 지정하세요. 기본 스토리지 클래스를 사용하려면 비워 두세요. <b class='text-warning'>참고:</b> 스토리지 클래스의 복구 정책은 <code>Delete</code>로 설정되어야 합니다. 볼륨은 임시 빌드 파일을 저장하는 데만 사용됩니다.");m.put("Optionally specify a working period field to hold estimated time infomration.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",@@ -2405,17 +2405,17 @@ public class Translation_ko extends TranslationResourceBundle {m.put("Optionally specify applicable jobs of this executor", "선택적으로 이 실행자에 적용 가능한 작업을 지정합니다");m.put("Optionally specify applicable users who pushed the change", "변경 사항을 푸시한 적용 가능한 사용자를 선택적으로 지정");m.put("Optionally specify arguments to run above image", "선택적으로 위 이미지 실행을 위한 인수를 지정하세요.");- m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",- "선택적으로 <a href='https://docs.onedev.io/concepts#job-workspace'>작업 워크스페이스</a>로 종속 항목에서 검색할 아티팩트를 지정하세요. 게시된 아티팩트(아티팩트 게시 단계에서 게시된 것)만 검색할 수 있습니다. 아티팩트를 검색하지 않으려면 비워 두세요.");+ m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",+ "선택적으로 <a href='https://docs.onedev.io/concepts#job-workdir'>작업 워크스페이스</a>로 종속 항목에서 검색할 아티팩트를 지정하세요. 게시된 아티팩트(아티팩트 게시 단계에서 게시된 것)만 검색할 수 있습니다. 아티팩트를 검색하지 않으려면 비워 두세요.");m.put("Optionally specify authorized roles to press this button. If not specified, all users are allowed","선택적으로 이 버튼을 누를 수 있는 권한이 있는 역할을 지정하세요. 지정하지 않으면 모든 사용자가 허용됩니다.");m.put("Optionally specify base query of the list", "선택적으로 목록의 기본 쿼리를 지정하세요.");m.put("Optionally specify branches/users/groups allowed to access this secret. If left empty, any job can access this secret, including those triggered via external pull requests","선택적으로 이 비밀에 액세스할 수 있는 브랜치/사용자/그룹을 지정하세요. 비워 두면 외부 풀 요청을 통해 트리거된 작업을 포함하여 모든 작업이 이 비밀에 액세스할 수 있습니다.");- m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",- "선택적으로 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 워크스페이스</a>에 상대적인 빌드 컨텍스트 경로를 지정하세요. 작업 워크스페이스 자체를 사용하려면 비워 두세요. <code>Dockerfile</code> 파일은 빌드 컨텍스트 디렉터리에 존재해야 하며, 옵션 <code>--dockerfile</code>로 다른 위치를 지정하지 않는 한 그렇습니다.");- m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself",- "선택적으로 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 워크스페이스</a>에 상대적인 빌드 경로를 지정하세요. 작업 워크스페이스 자체를 사용하려면 비워 두세요.");+ m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",+ "선택적으로 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 워크스페이스</a>에 상대적인 빌드 컨텍스트 경로를 지정하세요. 작업 워크스페이스 자체를 사용하려면 비워 두세요. <code>Dockerfile</code> 파일은 빌드 컨텍스트 디렉터리에 존재해야 하며, 옵션 <code>--dockerfile</code>로 다른 위치를 지정하지 않는 한 그렇습니다.");+ m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself",+ "선택적으로 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 워크스페이스</a>에 상대적인 빌드 경로를 지정하세요. 작업 워크스페이스 자체를 사용하려면 비워 두세요.");m.put("Optionally specify cluster role the job pods service account binding to. This is necessary if you want to do things such as running other Kubernetes pods in job command","선택적으로 작업 포드 서비스 계정이 바인딩되는 클러스터 역할을 지정하세요. 이는 작업 명령에서 다른 Kubernetes 포드를 실행하는 등의 작업을 수행하려는 경우 필요합니다.");m.put("Optionally specify container arguments separated by space. Single argument containing space should be quoted. <b class='text-warning'>Note: </b> do not confuse this with container options which should be specified in executor setting",@@ -2478,13 +2478,13 @@ public class Translation_ko extends TranslationResourceBundle {"선택적으로 ssh 명령의 옵션을 지정하세요. 여러 옵션은 공백으로 구분해야 합니다.");m.put("Optionally specify options passed to renovate cli. Multiple options should be separated by space, and single option containing spaces should be quoted","선택적으로 Renovate CLI에 전달된 옵션을 지정하세요. 여러 옵션은 공백으로 구분해야 하며, 공백이 포함된 단일 옵션은 따옴표로 묶어야 합니다.");- m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. You may ignore particular vulnerabilities via this file",- "선택적으로 <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>OSV 스캐너 구성 파일</a>을 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 워크스페이스</a> 아래에 지정하세요. 이 파일을 통해 특정 취약점을 무시할 수 있습니다.");+ m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. You may ignore particular vulnerabilities via this file",+ "선택적으로 <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>OSV 스캐너 구성 파일</a>을 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 워크스페이스</a> 아래에 지정하세요. 이 파일을 통해 특정 취약점을 무시할 수 있습니다.");m.put("Optionally specify path protection rules", "선택적으로 경로 보호 규칙을 지정하세요.");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",- "선택적으로 <a href='https://docs.onedev.io/concepts#job-workspace'>작업 워크스페이스</a>에 상대적인 경로를 지정하여 trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>무시 파일</a>로 사용하세요.");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to publish artifacts from. Leave empty to use job workspace itself",- "선택적으로 <a href='https://docs.onedev.io/concepts#job-workspace'>작업 워크스페이스</a>에서 아티팩트를 게시할 경로를 지정하세요. 작업 워크스페이스 자체를 사용하려면 비워 두세요.");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",+ "선택적으로 <a href='https://docs.onedev.io/concepts#job-workdir'>작업 워크스페이스</a>에 상대적인 경로를 지정하여 trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>무시 파일</a>로 사용하세요.");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to publish artifacts from. Leave empty to use job workdir itself",+ "선택적으로 <a href='https://docs.onedev.io/concepts#job-workdir'>작업 워크스페이스</a>에서 아티팩트를 게시할 경로를 지정하세요. 작업 워크스페이스 자체를 사용하려면 비워 두세요.");m.put("Optionally specify platform to pull, for instance <tt>linux/amd64</tt>. Leave empty to pull all platforms in image","선택적으로 가져올 플랫폼을 지정하세요. 예를 들어 <tt>linux/amd64</tt>. 이미지의 모든 플랫폼을 가져오려면 비워 두세요.");m.put("Optionally specify project to show builds of. Leave empty to show builds of all projects with permissions",@@ -2498,12 +2498,12 @@ public class Translation_ko extends TranslationResourceBundle {m.put("Optionally specify registry logins to override those defined in job executor. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token secret for password secret","선택적으로 작업 실행자에 정의된 레지스트리 로그인을 재정의하세요. 내장 레지스트리의 경우, 레지스트리 URL로 <code>@server_url@</code>, 사용자 이름으로 <code>@job_token@</code>, 비밀번호 비밀로 액세스 토큰 비밀을 사용하세요.");m.put("Optionally specify relative directory to put uploaded files", "선택적으로 업로드된 파일을 저장할 상대 디렉터리를 지정하세요.");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to clone code into. Leave empty to use job workspace itself",- "선택적으로 <a href='https://docs.onedev.io/concepts#job-workspace'>작업 워크스페이스</a> 아래에 코드를 클론할 상대 경로를 지정하세요. 작업 워크스페이스 자체를 사용하려면 비워 두세요.");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan. Leave empty to use job workspace itself",- "선택적으로 <a href='https://docs.onedev.io/concepts#job-workspace'>작업 워크스페이스</a> 아래에 스캔할 상대 경로를 지정하세요. 작업 워크스페이스 자체를 사용하려면 비워 두세요.");- m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workspace itself",- "선택적으로 <a href='https://docs.onedev.io/concepts#job-workspace'>작업 워크스페이스</a> 아래에 종속성 취약점을 스캔할 상대 경로를 지정하세요. 여러 경로를 지정할 수 있으며 공백으로 구분해야 합니다. 작업 워크스페이스 자체를 사용하려면 비워 두세요.");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to clone code into. Leave empty to use job workdir itself",+ "선택적으로 <a href='https://docs.onedev.io/concepts#job-workdir'>작업 워크스페이스</a> 아래에 코드를 클론할 상대 경로를 지정하세요. 작업 워크스페이스 자체를 사용하려면 비워 두세요.");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan. Leave empty to use job workdir itself",+ "선택적으로 <a href='https://docs.onedev.io/concepts#job-workdir'>작업 워크스페이스</a> 아래에 스캔할 상대 경로를 지정하세요. 작업 워크스페이스 자체를 사용하려면 비워 두세요.");+ m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workdir itself",+ "선택적으로 <a href='https://docs.onedev.io/concepts#job-workdir'>작업 워크스페이스</a> 아래에 종속성 취약점을 스캔할 상대 경로를 지정하세요. 여러 경로를 지정할 수 있으며 공백으로 구분해야 합니다. 작업 워크스페이스 자체를 사용하려면 비워 두세요.");m.put("Optionally specify required reviewers for changes of specified branch", "선택적으로 지정된 브랜치 변경 사항에 대한 필요한 검토자를 지정하세요.");m.put("Optionally specify revision to create branch from. Leave empty to create from build commit","선택적으로 브랜치를 생성할 리비전을 지정하세요. 빌드 커밋에서 생성하려면 비워 두세요.");@@ -3117,8 +3117,8 @@ public class Translation_ko extends TranslationResourceBundle {m.put("Run job", "작업 실행");m.put("Run job in another project", "다른 프로젝트에서 작업 실행");m.put("Run on Bare Metal/Virtual Machine", "베어 메탈/가상 머신에서 실행");- m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKSPACE</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",- "지정된 Docker 컨테이너를 실행하십시오. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 워크스페이스</a>가 컨테이너에 마운트되고 해당 경로가 환경 변수 <code>ONEDEV_WORKSPACE</code>에 배치됩니다. <b class='text-warning'>참고: </b> 이 단계는 서버 Docker 실행기 또는 원격 Docker 실행기에서만 실행할 수 있습니다");+ m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKDIR</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",+ "지정된 Docker 컨테이너를 실행하십시오. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 워크스페이스</a>가 컨테이너에 마운트되고 해당 경로가 환경 변수 <code>ONEDEV_WORKDIR</code>에 배치됩니다. <b class='text-warning'>참고: </b> 이 단계는 서버 Docker 실행기 또는 원격 Docker 실행기에서만 실행할 수 있습니다");m.put("Run specified step template", "지정된 단계 템플릿 실행");m.put("Run this job", "이 작업 실행");m.put("Run trivy container image scanner to find issues in specified image. For vulnerabilities, it checks various <a href='https://aquasecurity.github.io/trivy/v0.50/docs/coverage/language/#supported-languages' target='_blank'>distribution files</a>. It can only be executed by docker aware executor.",@@ -3391,47 +3391,47 @@ public class Translation_ko extends TranslationResourceBundle {m.put("Specifies who can access this AI service", "이 AI 서비스에 접근할 수 있는 사람을 지정합니다");m.put("Specifies who can access this AI service. AI service can be accessed in below approaches:","이 AI 서비스에 접근할 수 있는 대상을 지정합니다. AI 서비스는 아래 방법으로 접근할 수 있습니다:");- m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 .net TRX 테스트 결과 파일을 지정합니다. 예: <tt>TestResults/*.trx</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 .net TRX 테스트 결과 파일을 지정합니다. 예: <tt>TestResults/*.trx</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");m.put("Specify <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> whose value is access token with code write permission over above projects. Commits, issues, and pull requests will also be created under name of the access token owner","<a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>작업 비밀</a>을 지정하여 위 프로젝트에 대한 코드 쓰기 권한이 있는 액세스 토큰 값을 사용합니다. 커밋, 이슈 및 풀 요청은 액세스 토큰 소유자의 이름으로 생성됩니다");- m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",- "<a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json 출력 파일을 <a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 지정합니다. 이 파일은 clippy json 출력 옵션으로 생성할 수 있습니다. 예: <code>cargo clippy --message-format json>check-result.json</code>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",+ "<a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json 출력 파일을 <a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 지정합니다. 이 파일은 clippy json 출력 옵션으로 생성할 수 있습니다. 예: <code>cargo clippy --message-format json>check-result.json</code>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");m.put("Specify Build Options", "빌드 옵션을 지정합니다");- m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 CPD 결과 xml 파일을 지정합니다. 예: <tt>target/cpd.xml</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 CPD 결과 xml 파일을 지정합니다. 예: <tt>target/cpd.xml</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");m.put("Specify Commit Message", "커밋 메시지를 지정합니다");- m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 아래에서 체크스타일 형식의 ESLint 보고서 파일을 지정합니다. 이 파일은 ESLint 옵션 <tt>'-f checkstyle'</tt> 및 <tt>'-o'</tt>로 생성할 수 있습니다. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 아래에서 체크스타일 형식의 ESLint 보고서 파일을 지정합니다. 이 파일은 ESLint 옵션 <tt>'-f checkstyle'</tt> 및 <tt>'-o'</tt>로 생성할 수 있습니다. 패턴 매칭을 위해 * 또는 ?를 사용하세요");m.put("Specify GitHub API url, for instance <tt>https://api.github.com</tt>", "GitHub API URL을 지정합니다. 예: <tt>https://api.github.com</tt>");m.put("Specify GitLab API url, for instance <tt>https://gitlab.example.com/api/v4</tt>", "GitLab API URL을 지정합니다. 예: <tt>https://gitlab.example.com/api/v4</tt>");m.put("Specify Gitea API url, for instance <tt>https://gitea.example.com/api/v1</tt>", "Gitea API URL을 지정합니다. 예: <tt>https://gitea.example.com/api/v1</tt>");- m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 GoogleTest XML 결과 파일을 지정합니다. 이 보고서는 테스트 실행 시 환경 변수 <tt>GTEST_OUTPUT</tt>로 생성할 수 있습니다. 예: <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 GoogleTest XML 결과 파일을 지정합니다. 이 보고서는 테스트 실행 시 환경 변수 <tt>GTEST_OUTPUT</tt>로 생성할 수 있습니다. 예: <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");m.put("Specify IMAP user name.<br><b class='text-danger'>NOTE: </b> This account should be able to receive emails sent to system email address specified above","IMAP 사용자 이름을 지정합니다.<br><b class='text-danger'>참고: </b> 이 계정은 위에 지정된 시스템 이메일 주소로 전송된 이메일을 받을 수 있어야 합니다");- m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 XML 형식의 JUnit 테스트 결과 파일을 지정합니다. 예: <tt>target/surefire-reports/TEST-*.xml</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");- m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 JaCoCo 커버리지 xml 보고서 파일을 지정합니다. 예: <tt>target/site/jacoco/jacoco.xml</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");- m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 클로버 형식의 Jest 커버리지 보고서 파일을 지정합니다. 예: <tt>coverage/clover.xml</tt>. 이 파일은 Jest 옵션 <tt>'--coverage'</tt>로 생성할 수 있습니다. 패턴 매칭을 위해 * 또는 ?를 사용하세요");- m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 json 형식의 Jest 테스트 결과 파일을 지정합니다. 이 파일은 Jest 옵션 <tt>'--json'</tt> 및 <tt>'--outputFile'</tt>로 생성할 수 있습니다. 패턴 매칭을 위해 * 또는 ?를 사용하세요");- m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "스캔할 이미지의 OCI 레이아웃 디렉토리를 지정합니다. 이 디렉토리는 이미지 빌드 단계 또는 이미지 가져오기 단계에서 생성할 수 있습니다. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 공간</a> 상대 경로여야 합니다");- m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to push from",- "푸시할 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 공간</a> 상대 경로의 OCI 레이아웃 디렉토리를 지정합니다");+ m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 XML 형식의 JUnit 테스트 결과 파일을 지정합니다. 예: <tt>target/surefire-reports/TEST-*.xml</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 JaCoCo 커버리지 xml 보고서 파일을 지정합니다. 예: <tt>target/site/jacoco/jacoco.xml</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 클로버 형식의 Jest 커버리지 보고서 파일을 지정합니다. 예: <tt>coverage/clover.xml</tt>. 이 파일은 Jest 옵션 <tt>'--coverage'</tt>로 생성할 수 있습니다. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 json 형식의 Jest 테스트 결과 파일을 지정합니다. 이 파일은 Jest 옵션 <tt>'--json'</tt> 및 <tt>'--outputFile'</tt>로 생성할 수 있습니다. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "스캔할 이미지의 OCI 레이아웃 디렉토리를 지정합니다. 이 디렉토리는 이미지 빌드 단계 또는 이미지 가져오기 단계에서 생성할 수 있습니다. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 공간</a> 상대 경로여야 합니다");+ m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to push from",+ "푸시할 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 공간</a> 상대 경로의 OCI 레이아웃 디렉토리를 지정합니다");m.put("Specify OpenID scopes to request", "요청할 OpenID 범위를 지정합니다");- m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 PMD 결과 xml 파일을 지정합니다. 예: <tt>target/pmd.xml</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");- m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",- "<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 공간</a> 아래에서 실행할 PowerShell 명령을 지정합니다.<br><b class='text-warning'>참고: </b> OneDev는 스크립트의 종료 코드를 확인하여 단계가 성공했는지 판단합니다. PowerShell은 스크립트 오류가 있어도 항상 0으로 종료되므로, 스크립트에서 오류를 처리하고 0이 아닌 코드로 종료하거나 스크립트 시작 부분에 <code>$ErrorActionPreference = "Stop"</code>를 추가해야 합니다<br>");- m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 XML 형식의 Roslynator 진단 출력 파일을 지정합니다. 이 파일은 <i>-o</i> 옵션으로 생성할 수 있습니다. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 PMD 결과 xml 파일을 지정합니다. 예: <tt>target/pmd.xml</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",+ "<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 공간</a> 아래에서 실행할 PowerShell 명령을 지정합니다.<br><b class='text-warning'>참고: </b> OneDev는 스크립트의 종료 코드를 확인하여 단계가 성공했는지 판단합니다. PowerShell은 스크립트 오류가 있어도 항상 0으로 종료되므로, 스크립트에서 오류를 처리하고 0이 아닌 코드로 종료하거나 스크립트 시작 부분에 <code>$ErrorActionPreference = "Stop"</code>를 추가해야 합니다<br>");+ m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 XML 형식의 Roslynator 진단 출력 파일을 지정합니다. 이 파일은 <i>-o</i> 옵션으로 생성할 수 있습니다. 패턴 매칭을 위해 * 또는 ?를 사용하세요");m.put("Specify Shell/Batch Commands to Run", "실행할 Shell/Batch 명령을 지정합니다");- m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 SpotBugs 결과 xml 파일을 지정합니다. 예: <tt>target/spotbugsXml.xml</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 SpotBugs 결과 xml 파일을 지정합니다. 예: <tt>target/spotbugsXml.xml</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");m.put("Specify System Settings", "시스템 설정을 지정합니다");m.put("Specify URL of remote git repository. Only http/https protocol is supported", "원격 git 저장소의 URL을 지정합니다. http/https 프로토콜만 지원됩니다");m.put("Specify YouTrack login name. This account should have permission to:<ul><li>Read full information and issues of the projects you want to import<li>Read issue tags<li>Read user basic information</ul>",@@ -3466,14 +3466,14 @@ public class Translation_ko extends TranslationResourceBundle {m.put("Specify a Docker Image to Test Against", "테스트할 Docker 이미지를 지정합니다");m.put("Specify a custom field of Enum type", "Enum 유형의 사용자 정의 필드를 지정합니다");m.put("Specify a default query to filter/order fixed issues of specified jobs", "지정된 작업의 고정된 이슈를 필터링/정렬하기 위한 기본 쿼리를 지정합니다");- m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to write checksum into",- "체크섬을 기록할 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 공간</a> 상대 경로의 파일을 지정합니다");+ m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to write checksum into",+ "체크섬을 기록할 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 공간</a> 상대 경로의 파일을 지정합니다");m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","담당자 정보를 저장할 다중 값 사용자 필드를 지정합니다.<b>참고: </b> 적절한 옵션이 없는 경우 OneDev 이슈 필드를 사용자 정의할 수 있습니다");m.put("Specify a multi-value user field to hold assignees information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","담당자 정보를 저장할 다중 값 사용자 필드를 지정합니다.<br><b>참고: </b> 적절한 옵션이 없는 경우 OneDev 이슈 필드를 사용자 정의할 수 있습니다");m.put("Specify a path inside container to be used as mount target", "마운트 대상으로 사용할 컨테이너 내부 경로를 지정합니다");- m.put("Specify a path relative to job workspace to be used as mount source. Leave empty to mount job workspace itself",+ m.put("Specify a path relative to job workdir to be used as mount source. Leave empty to mount job workdir itself","마운트 소스로 사용할 작업 공간 상대 경로를 지정합니다. 비워두면 작업 공간 자체를 마운트합니다");m.put("Specify a secret to be used as access token to create issue in above project if it is not publicly accessible","위 프로젝트에서 이슈를 생성하기 위한 액세스 토큰으로 사용할 비밀을 지정합니다. 프로젝트가 공개적으로 접근 가능하지 않은 경우에만 필요합니다");@@ -3499,8 +3499,8 @@ public class Translation_ko extends TranslationResourceBundle {m.put("Specify application (client) ID of the app registered in Entra ID", "Entra ID에 등록된 앱의 애플리케이션(클라이언트) ID를 지정합니다");m.put("Specify arguments for imagetools. For instance <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>","imagetools에 대한 인수를 지정합니다. 예: <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>");- m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved.",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a>으로 가져올 아티팩트를 지정합니다. 아티팩트는 아티팩트 게시 단계에서 게시된 것만 가져올 수 있습니다");+ m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved.",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a>으로 가져올 아티팩트를 지정합니다. 아티팩트는 아티팩트 게시 단계에서 게시된 것만 가져올 수 있습니다");m.put("Specify at least 10 alphanumeric chars to be used as secret, and then add an inbound parse entry at SendGrid side:<ul><li><code>Destination URL</code> should be set to <i><OneDev root url>/~sendgrid/<secret></i>, for instance, <i>https://onedev.example.com/~sendgrid/1234567890</i>. Note that in production environment, <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>https should be enabled</a> to protect the secret</li><li><code>Receiving domain</code> should be the same as domain part of system email address specified above</li><li>Option <code>POST the raw, full MIME message</code> is enabled</li></ul>","비밀로 사용할 최소 10자리의 영숫자를 지정한 후 SendGrid 측에서 인바운드 파싱 항목을 추가합니다:<ul><li><code>Destination URL</code>은 <i><OneDev 루트 URL>/~sendgrid/<비밀></i>로 설정해야 합니다. 예: <i>https://onedev.example.com/~sendgrid/1234567890</i>. 프로덕션 환경에서는 <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>https를 활성화</a>하여 비밀을 보호해야 합니다</li><li><code>Receiving domain</code>은 위에 지정된 시스템 이메일 주소의 도메인 부분과 동일해야 합니다</li><li>옵션 <code>POST the raw, full MIME message</code>가 활성화되어야 합니다</li></ul>");m.put("Specify base nodes for user search. For example: <i>cn=Users, dc=example, dc=com</i>",@@ -3516,13 +3516,13 @@ public class Translation_ko extends TranslationResourceBundle {"원격 저장소에 대해 자체 서명 인증서를 사용하는 경우 신뢰할 인증서를 지정합니다");m.put("Specify certificates to trust if you are using self-signed certificates for your docker registries","도커 레지스트리에 대해 자체 서명 인증서를 사용하는 경우 신뢰할 인증서를 지정합니다");- m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 체크스타일 결과 xml 파일을 지정합니다. 예: <tt>target/checkstyle-result.xml</tt>. 체크스타일 결과 xml 파일을 생성하는 방법은 <a href='https://checkstyle.org/'>체크스타일 문서</a>를 참조하세요. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 체크스타일 결과 xml 파일을 지정합니다. 예: <tt>target/checkstyle-result.xml</tt>. 체크스타일 결과 xml 파일을 생성하는 방법은 <a href='https://checkstyle.org/'>체크스타일 문서</a>를 참조하세요. 패턴 매칭을 위해 * 또는 ?를 사용하세요");m.put("Specify client secret of the app registered in Entra ID", "Entra ID에 등록된 앱의 클라이언트 비밀을 지정합니다");- m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 클로버 커버리지 xml 보고서 파일을 지정합니다. 예: <tt>target/site/clover/clover.xml</tt>. 클로버 xml 파일을 생성하는 방법은 <a href='https://openclover.org/documentation'>OpenClover 문서</a>를 참조하세요. 패턴 매칭을 위해 * 또는 ?를 사용하세요");- m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 상대 경로로 cobertura 커버리지 xml 보고서 파일을 지정합니다. 예: <tt>target/site/cobertura/coverage.xml</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 클로버 커버리지 xml 보고서 파일을 지정합니다. 예: <tt>target/site/clover/clover.xml</tt>. 클로버 xml 파일을 생성하는 방법은 <a href='https://openclover.org/documentation'>OpenClover 문서</a>를 참조하세요. 패턴 매칭을 위해 * 또는 ?를 사용하세요");+ m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 상대 경로로 cobertura 커버리지 xml 보고서 파일을 지정합니다. 예: <tt>target/site/cobertura/coverage.xml</tt>. 패턴 매칭을 위해 * 또는 ?를 사용하세요");m.put("Specify color of the state for displaying purpose", "표시 목적으로 상태의 색상을 지정합니다");m.put("Specify columns of the board. Each column corresponds to a value of the issue field specified above","보드의 열을 지정합니다. 각 열은 위에 지정된 이슈 필드의 값에 해당합니다");@@ -3535,8 +3535,8 @@ public class Translation_ko extends TranslationResourceBundle {"OpenID 제공자의 구성 검색 URL을 지정하세요. 예: <code>https://openid.example.com/.well-known/openid-configuration</code>. OneDev는 토큰 유효성을 보장하기 위해 TLS 암호화에 의존하므로 HTTPS 프로토콜을 사용해야 합니다.");m.put("Specify container image to execute commands inside", "명령을 실행할 컨테이너 이미지를 지정하세요.");m.put("Specify container image to run", "실행할 컨테이너 이미지를 지정하세요.");- m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 기준으로 cppcheck XML 결과 파일을 지정하세요. 이 파일은 cppcheck XML 출력 옵션으로 생성할 수 있습니다. 예: <code>cppcheck src --xml 2>check-result.xml</code>. 패턴 매칭을 위해 * 또는 ?를 사용하세요.");+ m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 기준으로 cppcheck XML 결과 파일을 지정하세요. 이 파일은 cppcheck XML 출력 옵션으로 생성할 수 있습니다. 예: <code>cppcheck src --xml 2>check-result.xml</code>. 패턴 매칭을 위해 * 또는 ?를 사용하세요.");m.put("Specify cpu request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","이 실행자를 사용하는 각 작업/서비스에 대한 CPU 요청을 지정하세요. 자세한 내용은 <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes 리소스 관리</a>를 확인하세요.");m.put("Specify default assignees of pull requests submitted to this project. Only users with the write code permission to the project can be selected",@@ -3545,8 +3545,8 @@ public class Translation_ko extends TranslationResourceBundle {m.put("Specify destinations, for instance <tt>registry-server:5000/myorg/myrepo:latest</tt>. Make sure to use <b>same host</b> as specified in server url of system settings if you want to push to built-in registry, or simply use the form <tt>@server@/<project path>/<repo name>:<tag name></tt>. Multiple destinations should be separated with space","대상지를 지정하세요. 예: <tt>registry-server:5000/myorg/myrepo:latest</tt>. 내장 레지스트리에 푸시하려면 시스템 설정의 서버 URL에 지정된 <b>동일한 호스트</b>를 사용하거나 단순히 <tt>@server@/<project path>/<repo name>:<tag name></tt> 형식을 사용하세요. 여러 대상은 공백으로 구분해야 합니다.");m.put("Specify directory (tenant) ID of the app registered in Entra ID", "Entra ID에 등록된 앱의 디렉터리(테넌트) ID를 지정하세요.");- m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 공간</a> 기준으로 OCI 레이아웃을 저장할 디렉터리를 지정하세요.");+ m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 공간</a> 기준으로 OCI 레이아웃을 저장할 디렉터리를 지정하세요.");m.put("Specify docker image of the service", "서비스의 도커 이미지를 지정하세요.");m.put("Specify dockerx builder used to build docker image. OneDev will create the builder automatically if it does not exist. Check <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>this tutorial</a> on how to customize the builder for instance to allow publishing to insecure registries","도커 이미지를 빌드하는 데 사용되는 dockerx 빌더를 지정하세요. OneDev는 빌더가 존재하지 않을 경우 자동으로 생성합니다. 예를 들어 비보안 레지스트리에 게시를 허용하도록 빌더를 사용자 정의하는 방법에 대한 <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>이 튜토리얼</a>을 확인하세요.");@@ -3557,10 +3557,10 @@ public class Translation_ko extends TranslationResourceBundle {"종속성 업데이트를 조정하기 위해 Renovate가 생성한 다양한 문제의 필드를 지정하세요.");m.put("Specify fields to be displayed in the issue list", "문제 목록에 표시할 필드를 지정하세요.");m.put("Specify fields to display in board card", "보드 카드에 표시할 필드를 지정하세요.");- m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 기준으로 게시할 파일을 지정하세요. 패턴 매칭을 위해 * 또는 ?를 사용하세요.");- m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "md5 체크섬을 생성할 파일을 지정하세요. 여러 파일은 공백으로 구분해야 합니다. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> 패턴이 허용됩니다. 절대 경로가 아닌 파일은 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 공간</a> 기준으로 간주됩니다.");+ m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 기준으로 게시할 파일을 지정하세요. 패턴 매칭을 위해 * 또는 ?를 사용하세요.");+ m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "md5 체크섬을 생성할 파일을 지정하세요. 여러 파일은 공백으로 구분해야 합니다. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> 패턴이 허용됩니다. 절대 경로가 아닌 파일은 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 공간</a> 기준으로 간주됩니다.");m.put("Specify files under above directory to be published", "위 디렉토리 아래에 게시할 파일 지정");m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> <code>index.html</code> should be included in these files to be served as site start page","위 디렉터리 아래에서 게시할 파일을 지정하세요. 패턴 매칭을 위해 * 또는 ?를 사용하세요. <b>참고:</b> <code>index.html</code>은 사이트 시작 페이지로 제공되기 위해 이러한 파일에 포함되어야 합니다.");@@ -3604,8 +3604,8 @@ public class Translation_ko extends TranslationResourceBundle {m.put("Specify manager DN to authenticate OneDev itself to Active Directory. The manager DN should be specified in form of <i><account name>@<domain></i>, for instance: <i>[email protected]</i>","OneDev 자체를 Active Directory에 인증하기 위한 관리자 DN을 지정하세요. 관리자 DN은 <i><계정 이름>@<도메인></i> 형식으로 지정해야 합니다. 예: <i>[email protected]</i>.");m.put("Specify manager DN to authenticate OneDev itself to LDAP server", "OneDev 자체를 LDAP 서버에 인증하기 위한 관리자 DN을 지정하세요.");- m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 기준으로 게시할 마크다운 파일을 지정하세요.");+ m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 기준으로 게시할 마크다운 파일을 지정하세요.");m.put("Specify max git LFS file size in mega bytes", "Git LFS 파일의 최대 크기(메가바이트)를 지정하세요.");m.put("Specify max number of CPU intensive tasks the server can run concurrently, such as Git repository pull/push, repository index, etc.","서버가 동시에 실행할 수 있는 CPU 집약적인 작업의 최대 수를 지정하세요. 예: Git 저장소 가져오기/푸시, 저장소 인덱스 등.");@@ -3621,8 +3621,8 @@ public class Translation_ko extends TranslationResourceBundle {"웹 인터페이스를 통해 업로드된 파일의 최대 크기(메가바이트)를 지정하세요. 이는 저장소에 업로드된 파일, 마크다운 콘텐츠(문제 댓글 등), 빌드 아티팩트에 적용됩니다.");m.put("Specify memory request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","이 실행자를 사용하는 각 작업/서비스에 대한 메모리 요청을 지정하세요. 자세한 내용은 <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes 리소스 관리</a>를 확인하세요.");- m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 기준으로 mypy 출력 파일을 지정하세요. 이 파일은 <b>'--pretty' 옵션 없이</b> mypy 출력을 리디렉션하여 생성할 수 있습니다. 예: <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. 패턴 매칭을 위해 * 또는 ?를 사용하세요.");+ m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 기준으로 mypy 출력 파일을 지정하세요. 이 파일은 <b>'--pretty' 옵션 없이</b> mypy 출력을 리디렉션하여 생성할 수 있습니다. 예: <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. 패턴 매칭을 위해 * 또는 ?를 사용하세요.");m.put("Specify name of the branch", "브랜치 이름을 지정하세요.");m.put("Specify name of the environment variable", "환경 변수 이름을 지정하세요.");m.put("Specify name of the iteration", "반복 이름을 지정하세요.");@@ -3645,23 +3645,23 @@ public class Translation_ko extends TranslationResourceBundle {m.put("Specify project to run job in", "작업을 실행할 프로젝트를 지정하세요.");m.put("Specify projects", "프로젝트를 지정하세요.");m.put("Specify projects to update dependencies. Leave empty for current project", "종속성을 업데이트할 프로젝트를 지정하세요. 현재 프로젝트의 경우 비워 두세요.");- m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 기준으로 pylint JSON 결과 파일을 지정하세요. 이 파일은 pylint JSON 출력 형식 옵션으로 생성할 수 있습니다. 예: <code>--exit-zero --output-format=json:pylint-result.json</code>. 이 단계는 구성된 임계값에 따라 빌드를 실패시키므로 위반 시 pylint 명령을 실패시키지 않습니다. 패턴 매칭을 위해 * 또는 ?를 사용하세요.");+ m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 기준으로 pylint JSON 결과 파일을 지정하세요. 이 파일은 pylint JSON 출력 형식 옵션으로 생성할 수 있습니다. 예: <code>--exit-zero --output-format=json:pylint-result.json</code>. 이 단계는 구성된 임계값에 따라 빌드를 실패시키므로 위반 시 pylint 명령을 실패시키지 않습니다. 패턴 매칭을 위해 * 또는 ?를 사용하세요.");m.put("Specify registry logins if necessary. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token for password","필요한 경우 레지스트리 로그인을 지정하세요. 내장 레지스트리의 경우 레지스트리 URL에 <code>@server_url@</code>, 사용자 이름에 <code>@job_token@</code>, 비밀번호에 액세스 토큰을 사용하세요.");m.put("Specify registry url. Leave empty for official registry", "레지스트리 URL을 지정하세요. 공식 레지스트리의 경우 비워 두세요.");- m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 공간</a> 기준으로 OCI 레이아웃을 저장할 상대 경로를 지정하세요.");+ m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 공간</a> 기준으로 OCI 레이아웃을 저장할 상대 경로를 지정하세요.");m.put("Specify repositories", "저장소를 지정하세요.");m.put("Specify required reviewers if specified path is changed. Note that the user submitting the change is considered to reviewed the change automatically","지정된 경로가 변경된 경우 필요한 검토자를 지정하세요. 변경을 제출한 사용자는 자동으로 변경을 검토한 것으로 간주됩니다.");m.put("Specify root URL to access this server", "이 서버에 액세스할 루트 URL을 지정하세요.");- m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 기준으로 ruff JSON 결과 파일을 지정하세요. 이 파일은 ruff JSON 출력 형식 옵션으로 생성할 수 있습니다. 예: <code>--exit-zero --output-format json --output-file ruff-result.json</code>. 이 단계는 구성된 임계값에 따라 빌드를 실패시키므로 위반 시 ruff 명령을 실패시키지 않습니다. 패턴 매칭을 위해 * 또는 ?를 사용하세요.");- m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 공간</a> 아래에서 실행할 셸 명령(Linux/Unix) 또는 배치 명령(Windows)을 지정하세요.");- m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 공간</a> 아래에서 실행할 셸 명령을 지정하세요.");+ m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 기준으로 ruff JSON 결과 파일을 지정하세요. 이 파일은 ruff JSON 출력 형식 옵션으로 생성할 수 있습니다. 예: <code>--exit-zero --output-format json --output-file ruff-result.json</code>. 이 단계는 구성된 임계값에 따라 빌드를 실패시키므로 위반 시 ruff 명령을 실패시키지 않습니다. 패턴 매칭을 위해 * 또는 ?를 사용하세요.");+ m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 공간</a> 아래에서 실행할 셸 명령(Linux/Unix) 또는 배치 명령(Windows)을 지정하세요.");+ m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 공간</a> 아래에서 실행할 셸 명령을 지정하세요.");m.put("Specify shell to be used", "사용할 셸을 지정하세요.");m.put("Specify source param for SCP command, for instance <code>app.tar.gz</code>", "SCP 명령의 소스 매개변수를 지정하세요. 예: <code>app.tar.gz</code>.");m.put("Specify space separated refs to pull from remote. '*' can be used in ref name for wildcard match<br><b class='text-danger'>NOTE:</b> branch/tag protection rule will be ignored when update branches/tags via this step",@@ -3680,10 +3680,10 @@ public class Translation_ko extends TranslationResourceBundle {"이 항목에 적용 가능한 공백으로 구분된 발신자 이메일 주소를 지정하세요. 와일드카드 매칭을 위해 '*' 또는 '?'를 사용하세요. 제외하려면 '-'로 접두어를 붙이세요. 모든 발신자와 일치하려면 비워 두세요.");m.put("Specify space-separated tags to be protected. Use '**', '*' or '?' for <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>path wildcard match</a>. Prefix with '-' to exclude","보호할 공백으로 구분된 태그를 지정하세요. <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>경로 와일드카드 매칭</a>을 위해 '**', '*' 또는 '?'를 사용하세요. 제외하려면 '-'로 접두어를 붙이세요.");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: <tt>manual/index.md</tt>",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 기준으로 보고서의 시작 페이지를 지정하세요. 예: <tt>manual/index.md</tt>.");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: api/index.html",- "<a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a> 기준으로 보고서의 시작 페이지를 지정하세요. 예: api/index.html.");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: <tt>manual/index.md</tt>",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 기준으로 보고서의 시작 페이지를 지정하세요. 예: <tt>manual/index.md</tt>.");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: api/index.html",+ "<a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a> 기준으로 보고서의 시작 페이지를 지정하세요. 예: api/index.html.");m.put("Specify storage size to request for the build volume. The size should conform to <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>Kubernetes resource capacity format</a>, for instance <i>10Gi</i>","빌드 볼륨에 요청할 저장소 크기를 지정하세요. 크기는 <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>Kubernetes 리소스 용량 형식</a>을 따라야 합니다. 예: <i>10Gi</i>.");m.put("Specify tab width used to calculate column value of found problems in provided report",@@ -3769,8 +3769,8 @@ public class Translation_ko extends TranslationResourceBundle {m.put("Step Templates", "단계 템플릿들");m.put("Step {0} of {1}: ", "{0}단계 중 {1}단계:");m.put("Steps", "단계들");- m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>",- "단계는 동일한 노드에서 직렬로 실행되며 동일한 <a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a>을 공유합니다.");+ m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>",+ "단계는 동일한 노드에서 직렬로 실행되며 동일한 <a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a>을 공유합니다.");m.put("Stop", "중지");m.put("Stop work", "작업 중지");m.put("Stopwatch Overdue", "스톱워치 초과");@@ -4008,9 +4008,9 @@ public class Translation_ko extends TranslationResourceBundle {m.put("This shows number of issues in various states over time", "이 그래프는 시간에 따른 다양한 상태의 이슈 수를 보여줍니다");m.put("This shows number of open and merged pull requests over time", "이 그래프는 시간에 따른 열려 있는 풀 리퀘스트와 병합된 풀 리퀘스트의 수를 보여줍니다");m.put("This step can only be executed by a docker aware executor", "이 단계는 Docker를 인식하는 실행자만 실행할 수 있습니다");- m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "이 단계는 Docker를 인식하는 실행자만 실행할 수 있습니다. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>작업 워크스페이스</a>에서 실행됩니다");- m.put("This step copies files from job workspace to build artifacts directory, so that they can be accessed after job is completed",+ m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "이 단계는 Docker를 인식하는 실행자만 실행할 수 있습니다. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>작업 워크스페이스</a>에서 실행됩니다");+ m.put("This step copies files from job workdir to build artifacts directory, so that they can be accessed after job is completed","이 단계는 작업 공간에서 빌드 아티팩트 디렉토리로 파일을 복사하여 작업이 완료된 후에도 액세스할 수 있도록 합니다");m.put("This step publishes specified files to be served as project web site. Project web site can be accessed publicly via <code>http://<onedev base url>/path/to/project/~site</code>","이 단계는 지정된 파일을 프로젝트 웹 사이트로 제공하도록 게시합니다. 프로젝트 웹 사이트는 <code>http://<onedev base url>/path/to/project/~site</code>를 통해 공개적으로 액세스할 수 있습니다");@@ -4728,8 +4728,8 @@ public class Translation_ko extends TranslationResourceBundle {"커밋 메시지 바닥글 검사를 위한 커밋 유형을 선택적으로 지정하세요 (값을 추가하려면 ENTER를 누르세요). 모든 유형을 위해 비워 두세요.");m.put("Optionally specify extra options for osv source scanner. Multiple options need to be separated with space","osv 소스 스캐너에 대한 추가 옵션을 선택적으로 지정하세요. 여러 옵션은 공백으로 구분해야 합니다.");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",- "trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>비밀 구성</a>으로 사용할 <a href='https://docs.onedev.io/concepts#job-workspace'>작업 공간</a>에 상대적인 경로를 선택적으로 지정하세요.");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",+ "trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>비밀 구성</a>으로 사용할 <a href='https://docs.onedev.io/concepts#job-workdir'>작업 공간</a>에 상대적인 경로를 선택적으로 지정하세요.");m.put("Osv Source Scanner", "Osv 소스 스캐너");m.put("Run osv scanner to scan project source for vulnerabilities in <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>various lock files</a>. It can only be executed by docker aware executor.","프로젝트 소스를 <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>다양한 잠금 파일</a>의 취약점을 위해 osv 스캐너를 실행하세요. 이는 도커 인식 실행자에 의해서만 실행될 수 있습니다.");diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_pt.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_pt.javaindex d46fc34314..b10a251cf1 100644--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_pt.java+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_pt.java@@ -1397,8 +1397,8 @@ public class Translation_pt extends TranslationResourceBundle {"Para commit de build não alcançável a partir do branch padrão, um <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>segredo de trabalho</a> deve ser especificado como token de acesso com permissão para criar tag");m.put("For build commit not reachable from default branch, a <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> should be specified as access token with manage issue permission","Para commit de build não alcançável a partir do branch padrão, um <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>segredo de trabalho</a> deve ser especificado como token de acesso com permissão para gerenciar problema");- m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>). For shell related executors which runs on host machine directly, only relative path is accepted",- "Para executores conscientes de docker, este caminho está dentro do contêiner e aceita tanto caminho absoluto quanto relativo (relativo ao <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espaço de trabalho do trabalho</a>). Para executores relacionados a shell que executam diretamente na máquina host, apenas caminho relativo é aceito");+ m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>). For shell related executors which runs on host machine directly, only relative path is accepted",+ "Para executores conscientes de docker, este caminho está dentro do contêiner e aceita tanto caminho absoluto quanto relativo (relativo ao <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espaço de trabalho do trabalho</a>). Para executores relacionados a shell que executam diretamente na máquina host, apenas caminho relativo é aceito");m.put("For each build, OneDev calculates a list of fixed issues since previous build automatically. This setting provides a default query to further filter/order this list. For a given job, the first matching entry will be used.","Para cada build, o OneDev calcula automaticamente uma lista de problemas corrigidos desde o build anterior. Esta configuração fornece uma consulta padrão para filtrar/ordenar ainda mais esta lista. Para um trabalho específico, a primeira entrada correspondente será usada.");m.put("For each selected branch/tag, a separate build will be generated with branch/tag set to corresponding value",@@ -2346,7 +2346,7 @@ public class Translation_pt extends TranslationResourceBundle {m.put("Optionally filter issues", "Opcionalmente filtre problemas");m.put("Optionally filter pull requests", "Opcionalmente filtre pull requests");m.put("Optionally leave a note", "Opcionalmente deixe uma nota");- m.put("Optionally mount directories or files under job workspace into container", "Opcionalmente monte diretórios ou arquivos no espaço de trabalho do trabalho dentro do contêiner");+ m.put("Optionally mount directories or files under job workdir into container", "Opcionalmente monte diretórios ou arquivos no espaço de trabalho do trabalho dentro do contêiner");m.put("Optionally select fields to prompt when this button is pressed", "Opcionalmente selecione campos para solicitar quando este botão for pressionado");m.put("Optionally select fields to remove when this transition happens", "Opcionalmente selecione campos para remover quando esta transição ocorrer");m.put("Optionally specifies name of the attribute inside the user LDAP entry whose value will be taken as user email. This field is normally set to <i>mail</i> according to RFC 2798",@@ -2366,8 +2366,8 @@ public class Translation_pt extends TranslationResourceBundle {m.put("Optionally specify <span class='text-info'>comma separated</span> platforms to scan, for instance <tt>linux/amd64,linux/arm64</tt>. Leave empty to scan all platforms in OCI layout","Opcionalmente especifique <span class='text-info'>plataformas separadas por vírgula</span> para escanear, por exemplo <tt>linux/amd64,linux/arm64</tt>. Deixe vazio para escanear todas as plataformas no layout OCI");m.put("Optionally specify API key for authentication", "Opcionalmente, especifique a chave de API para autenticação");- m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",- "Opcionalmente especifique o Dockerfile relativo ao <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espaço de trabalho do trabalho</a>. Deixe vazio para usar o arquivo <tt>Dockerfile</tt> no caminho de construção especificado acima");+ m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",+ "Opcionalmente especifique o Dockerfile relativo ao <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espaço de trabalho do trabalho</a>. Deixe vazio para usar o arquivo <tt>Dockerfile</tt> no caminho de construção especificado acima");m.put("Optionally specify JavaScript config to be used by Renovate CLI", "Opcionalmente especifique a configuração JavaScript a ser usada pelo Renovate CLI");m.put("Optionally specify SSH root URL, which will be used to construct project clone url via SSH protocol. Leave empty to derive from server url","Opcionalmente especifique a URL raiz SSH, que será usada para construir a URL de clonagem do projeto via protocolo SSH. Deixe vazio para derivar da URL do servidor");@@ -2385,8 +2385,8 @@ public class Translation_pt extends TranslationResourceBundle {"Opcionalmente especifique uma expressão cron para agendar backup automático do banco de dados. O formato da expressão cron é <em><segundos> <minutos> <horas> <dia-do-mês> <mês> <dia-da-semana></em>. Por exemplo, <em>0 0 1 * * ?</em> significa 1:00 da manhã todos os dias. Para detalhes do formato, consulte o <a href='http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html#format' target='_blank'>tutorial do Quartz</a>. Os arquivos de backup serão colocados na pasta <em>db-backup</em> no diretório de instalação do OneDev. Caso vários servidores se conectem para formar um cluster, o backup automático ocorrerá no <a href='https://docs.onedev.io/concepts#lead-server' target='_blank'>servidor líder</a>. Deixe esta propriedade vazia se você não quiser habilitar o backup automático do banco de dados.");m.put("Optionally specify a date field to hold due date information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Opcionalmente especifique um campo de data para armazenar informações de data de vencimento.<br><b>NOTA: </b> Você pode personalizar os campos de problemas do OneDev caso não haja uma opção apropriada aqui");- m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to put retrieved artifacts. Leave empty to use job workspace itself",- "Opcionalmente especifique um caminho relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a> para colocar artefatos recuperados. Deixe vazio para usar o próprio espaço de trabalho do trabalho");+ m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to put retrieved artifacts. Leave empty to use job workdir itself",+ "Opcionalmente especifique um caminho relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a> para colocar artefatos recuperados. Deixe vazio para usar o próprio espaço de trabalho do trabalho");m.put("Optionally specify a storage class to allocate build volume dynamically. Leave empty to use default storage class. <b class='text-warning'>NOTE:</b> Reclaim policy of the storage class should be set to <code>Delete</code>, as the volume is only used to hold temporary build files","Opcionalmente especifique uma classe de armazenamento para alocar dinamicamente o volume de construção. Deixe vazio para usar a classe de armazenamento padrão. <b class='text-warning'>NOTA:</b> A política de recuperação da classe de armazenamento deve ser configurada como <code>Delete</code>, pois o volume é usado apenas para armazenar arquivos temporários de construção");m.put("Optionally specify a working period field to hold estimated time infomration.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",@@ -2405,17 +2405,17 @@ public class Translation_pt extends TranslationResourceBundle {m.put("Optionally specify applicable jobs of this executor", "Opcionalmente, especifique os trabalhos aplicáveis deste executor");m.put("Optionally specify applicable users who pushed the change", "Opcionalmente especifique usuários aplicáveis que fizeram o push da alteração");m.put("Optionally specify arguments to run above image", "Opcionalmente especifique argumentos para executar a imagem acima");- m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",- "Opcionalmente especifique artefatos para recuperar da dependência no <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a>. Apenas artefatos publicados (via etapa de publicação de artefatos) podem ser recuperados. Deixe vazio para não recuperar nenhum artefato");+ m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",+ "Opcionalmente especifique artefatos para recuperar da dependência no <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a>. Apenas artefatos publicados (via etapa de publicação de artefatos) podem ser recuperados. Deixe vazio para não recuperar nenhum artefato");m.put("Optionally specify authorized roles to press this button. If not specified, all users are allowed","Opcionalmente especifique funções autorizadas para pressionar este botão. Se não especificado, todos os usuários são permitidos");m.put("Optionally specify base query of the list", "Opcionalmente especifique consulta base da lista");m.put("Optionally specify branches/users/groups allowed to access this secret. If left empty, any job can access this secret, including those triggered via external pull requests","Opcionalmente especifique branches/usuários/grupos permitidos para acessar este segredo. Se deixado vazio, qualquer trabalho pode acessar este segredo, incluindo aqueles acionados via pull requests externos");- m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",- "Opcionalmente especifique o caminho do contexto de construção relativo ao <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espaço de trabalho do trabalho</a>. Deixe vazio para usar o próprio espaço de trabalho do trabalho. O arquivo <code>Dockerfile</code> é esperado no diretório do contexto de construção, a menos que você especifique um local diferente com a opção <code>--dockerfile</code>");- m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself",- "Opcionalmente especifique o caminho de construção relativo ao <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espaço de trabalho do trabalho</a>. Deixe vazio para usar o próprio espaço de trabalho do trabalho");+ m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",+ "Opcionalmente especifique o caminho do contexto de construção relativo ao <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espaço de trabalho do trabalho</a>. Deixe vazio para usar o próprio espaço de trabalho do trabalho. O arquivo <code>Dockerfile</code> é esperado no diretório do contexto de construção, a menos que você especifique um local diferente com a opção <code>--dockerfile</code>");+ m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself",+ "Opcionalmente especifique o caminho de construção relativo ao <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espaço de trabalho do trabalho</a>. Deixe vazio para usar o próprio espaço de trabalho do trabalho");m.put("Optionally specify cluster role the job pods service account binding to. This is necessary if you want to do things such as running other Kubernetes pods in job command","Opcionalmente especifique a função de cluster à qual a conta de serviço dos pods de trabalho está vinculada. Isso é necessário se você quiser executar outras pods do Kubernetes no comando do trabalho");m.put("Optionally specify container arguments separated by space. Single argument containing space should be quoted. <b class='text-warning'>Note: </b> do not confuse this with container options which should be specified in executor setting",@@ -2478,13 +2478,13 @@ public class Translation_pt extends TranslationResourceBundle {"Opcionalmente especifique opções para o comando ssh. Múltiplas opções precisam ser separadas por espaço");m.put("Optionally specify options passed to renovate cli. Multiple options should be separated by space, and single option containing spaces should be quoted","Opcionalmente especifique opções passadas para o renovate cli. Múltiplas opções devem ser separadas por espaço, e opção única contendo espaços deve ser citada");- m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. You may ignore particular vulnerabilities via this file",- "Opcionalmente especifique o arquivo de configuração do scanner osv <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> no <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espaço de trabalho do trabalho</a>. Você pode ignorar vulnerabilidades específicas através deste arquivo");+ m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. You may ignore particular vulnerabilities via this file",+ "Opcionalmente especifique o arquivo de configuração do scanner osv <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> no <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espaço de trabalho do trabalho</a>. Você pode ignorar vulnerabilidades específicas através deste arquivo");m.put("Optionally specify path protection rules", "Opcionalmente especifique regras de proteção de caminho");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",- "Opcionalmente especifique caminho relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a> para ser usado como arquivo de ignorar do trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to publish artifacts from. Leave empty to use job workspace itself",- "Opcionalmente especifique caminho relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a> para publicar artefatos. Deixe vazio para usar o próprio espaço de trabalho do trabalho");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",+ "Opcionalmente especifique caminho relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a> para ser usado como arquivo de ignorar do trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to publish artifacts from. Leave empty to use job workdir itself",+ "Opcionalmente especifique caminho relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a> para publicar artefatos. Deixe vazio para usar o próprio espaço de trabalho do trabalho");m.put("Optionally specify platform to pull, for instance <tt>linux/amd64</tt>. Leave empty to pull all platforms in image","Opcionalmente especifique plataforma para puxar, por exemplo <tt>linux/amd64</tt>. Deixe vazio para puxar todas as plataformas na imagem");m.put("Optionally specify project to show builds of. Leave empty to show builds of all projects with permissions",@@ -2498,12 +2498,12 @@ public class Translation_pt extends TranslationResourceBundle {m.put("Optionally specify registry logins to override those defined in job executor. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token secret for password secret","Opcionalmente especifique logins de registro para substituir aqueles definidos no executor do trabalho. Para registro interno, use <code>@server_url@</code> para URL do registro, <code>@job_token@</code> para nome de usuário, e segredo de token de acesso para senha secreta");m.put("Optionally specify relative directory to put uploaded files", "Opcionalmente especifique diretório relativo para colocar arquivos enviados");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to clone code into. Leave empty to use job workspace itself",- "Opcionalmente especifique caminho relativo sob <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a> para clonar código. Deixe vazio para usar o próprio espaço de trabalho do trabalho");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan. Leave empty to use job workspace itself",- "Opcionalmente especifique caminho relativo sob <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a> para escanear. Deixe vazio para usar o próprio espaço de trabalho do trabalho");- m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workspace itself",- "Opcionalmente especifique caminhos relativos sob <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a> para escanear vulnerabilidades de dependência. Múltiplos caminhos podem ser especificados e devem ser separados por espaço. Deixe vazio para usar o próprio espaço de trabalho do trabalho");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to clone code into. Leave empty to use job workdir itself",+ "Opcionalmente especifique caminho relativo sob <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a> para clonar código. Deixe vazio para usar o próprio espaço de trabalho do trabalho");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan. Leave empty to use job workdir itself",+ "Opcionalmente especifique caminho relativo sob <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a> para escanear. Deixe vazio para usar o próprio espaço de trabalho do trabalho");+ m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workdir itself",+ "Opcionalmente especifique caminhos relativos sob <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a> para escanear vulnerabilidades de dependência. Múltiplos caminhos podem ser especificados e devem ser separados por espaço. Deixe vazio para usar o próprio espaço de trabalho do trabalho");m.put("Optionally specify required reviewers for changes of specified branch", "Opcionalmente especifique revisores necessários para mudanças no branch especificado");m.put("Optionally specify revision to create branch from. Leave empty to create from build commit","Opcionalmente especifique revisão para criar branch. Deixe vazio para criar a partir do commit de construção");@@ -3117,8 +3117,8 @@ public class Translation_pt extends TranslationResourceBundle {m.put("Run job", "Executar trabalho");m.put("Run job in another project", "Executar trabalho em outro projeto");m.put("Run on Bare Metal/Virtual Machine", "Executar em Bare Metal/Máquina Virtual");- m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKSPACE</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",- "Execute o contêiner Docker especificado. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>O espaço de trabalho do trabalho</a> é montado no contêiner e seu caminho é colocado na variável de ambiente <code>ONEDEV_WORKSPACE</code>. <b class='text-warning'>Nota: </b> esta etapa só pode ser executada pelo executor docker do servidor ou executor docker remoto");+ m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKDIR</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",+ "Execute o contêiner Docker especificado. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>O espaço de trabalho do trabalho</a> é montado no contêiner e seu caminho é colocado na variável de ambiente <code>ONEDEV_WORKDIR</code>. <b class='text-warning'>Nota: </b> esta etapa só pode ser executada pelo executor docker do servidor ou executor docker remoto");m.put("Run specified step template", "Executar modelo de etapa especificado");m.put("Run this job", "Executar este trabalho");m.put("Run trivy container image scanner to find issues in specified image. For vulnerabilities, it checks various <a href='https://aquasecurity.github.io/trivy/v0.50/docs/coverage/language/#supported-languages' target='_blank'>distribution files</a>. It can only be executed by docker aware executor.",@@ -3391,47 +3391,47 @@ public class Translation_pt extends TranslationResourceBundle {m.put("Specifies who can access this AI service", "Especifica quem pode acessar este serviço de IA");m.put("Specifies who can access this AI service. AI service can be accessed in below approaches:","Especifica quem pode acessar este serviço de IA. O serviço de IA pode ser acessado nas abordagens abaixo:");- m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",- "Especifique o arquivo de resultado de teste .net TRX relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>, por exemplo <tt>TestResults/*.trx</tt>. Use * ou ? para correspondência de padrão");+ m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",+ "Especifique o arquivo de resultado de teste .net TRX relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>, por exemplo <tt>TestResults/*.trx</tt>. Use * ou ? para correspondência de padrão");m.put("Specify <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> whose value is access token with code write permission over above projects. Commits, issues, and pull requests will also be created under name of the access token owner","Especifique o <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>segredo do job</a> cujo valor é um token de acesso com permissão de escrita de código sobre os projetos acima. Commits, issues e pull requests também serão criados sob o nome do proprietário do token de acesso");- m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",- "Especifique o arquivo de saída json do <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>. Este arquivo pode ser gerado com a opção de saída json do clippy, por exemplo <code>cargo clippy --message-format json>check-result.json</code>. Use * ou ? para correspondência de padrão");+ m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",+ "Especifique o arquivo de saída json do <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>. Este arquivo pode ser gerado com a opção de saída json do clippy, por exemplo <code>cargo clippy --message-format json>check-result.json</code>. Use * ou ? para correspondência de padrão");m.put("Specify Build Options", "Especifique Opções de Build");- m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",- "Especifique o arquivo xml de resultado CPD relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>, por exemplo, <tt>target/cpd.xml</tt>. Use * ou ? para correspondência de padrão");+ m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",+ "Especifique o arquivo xml de resultado CPD relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>, por exemplo, <tt>target/cpd.xml</tt>. Use * ou ? para correspondência de padrão");m.put("Specify Commit Message", "Especifique a Mensagem de Commit");- m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",- "Especifique o arquivo de relatório ESLint no formato checkstyle no <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>. Este arquivo pode ser gerado com a opção ESLint <tt>'-f checkstyle'</tt> e <tt>'-o'</tt>. Use * ou ? para correspondência de padrão");+ m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",+ "Especifique o arquivo de relatório ESLint no formato checkstyle no <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>. Este arquivo pode ser gerado com a opção ESLint <tt>'-f checkstyle'</tt> e <tt>'-o'</tt>. Use * ou ? para correspondência de padrão");m.put("Specify GitHub API url, for instance <tt>https://api.github.com</tt>", "Especifique a URL da API do GitHub, por exemplo <tt>https://api.github.com</tt>");m.put("Specify GitLab API url, for instance <tt>https://gitlab.example.com/api/v4</tt>", "Especifique a URL da API do GitLab, por exemplo <tt>https://gitlab.example.com/api/v4</tt>");m.put("Specify Gitea API url, for instance <tt>https://gitea.example.com/api/v1</tt>", "Especifique a URL da API do Gitea, por exemplo <tt>https://gitea.example.com/api/v1</tt>");- m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",- "Especifique o arquivo XML de resultado do GoogleTest relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>. Este relatório pode ser gerado com a variável de ambiente <tt>GTEST_OUTPUT</tt> ao executar testes, por exemplo, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * ou ? para correspondência de padrão");+ m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",+ "Especifique o arquivo XML de resultado do GoogleTest relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>. Este relatório pode ser gerado com a variável de ambiente <tt>GTEST_OUTPUT</tt> ao executar testes, por exemplo, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * ou ? para correspondência de padrão");m.put("Specify IMAP user name.<br><b class='text-danger'>NOTE: </b> This account should be able to receive emails sent to system email address specified above","Especifique o nome de usuário IMAP.<br><b class='text-danger'>NOTA: </b> Esta conta deve ser capaz de receber emails enviados para o endereço de email do sistema especificado acima");- m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",- "Especifique o arquivo de resultado de teste JUnit no formato XML relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>, por exemplo <tt>target/surefire-reports/TEST-*.xml</tt>. Use * ou ? para correspondência de padrão");- m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",- "Especifique o arquivo de relatório de cobertura xml do JaCoCo relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>, por exemplo, <tt>target/site/jacoco/jacoco.xml</tt>. Use * ou ? para correspondência de padrão");- m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",- "Especifique o arquivo de relatório de cobertura do Jest no formato clover relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>, por exemplo <tt>coverage/clover.xml</tt>. Este arquivo pode ser gerado com a opção Jest <tt>'--coverage'</tt>. Use * ou ? para correspondência de padrão");- m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",- "Especifique o arquivo de resultado de teste do Jest no formato json relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>. Este arquivo pode ser gerado via opção Jest <tt>'--json'</tt> e <tt>'--outputFile'</tt>. Use * ou ? para correspondência de padrão");- m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Especifique o diretório de layout OCI da imagem para escanear. Este diretório pode ser gerado via etapa de build de imagem ou etapa de pull de imagem. Deve ser relativo ao <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>workspace do job</a>");- m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to push from",- "Especifique o diretório de layout OCI relativo ao <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>workspace do job</a> para fazer o push");+ m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",+ "Especifique o arquivo de resultado de teste JUnit no formato XML relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>, por exemplo <tt>target/surefire-reports/TEST-*.xml</tt>. Use * ou ? para correspondência de padrão");+ m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",+ "Especifique o arquivo de relatório de cobertura xml do JaCoCo relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>, por exemplo, <tt>target/site/jacoco/jacoco.xml</tt>. Use * ou ? para correspondência de padrão");+ m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",+ "Especifique o arquivo de relatório de cobertura do Jest no formato clover relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>, por exemplo <tt>coverage/clover.xml</tt>. Este arquivo pode ser gerado com a opção Jest <tt>'--coverage'</tt>. Use * ou ? para correspondência de padrão");+ m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",+ "Especifique o arquivo de resultado de teste do Jest no formato json relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>. Este arquivo pode ser gerado via opção Jest <tt>'--json'</tt> e <tt>'--outputFile'</tt>. Use * ou ? para correspondência de padrão");+ m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Especifique o diretório de layout OCI da imagem para escanear. Este diretório pode ser gerado via etapa de build de imagem ou etapa de pull de imagem. Deve ser relativo ao <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>workspace do job</a>");+ m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to push from",+ "Especifique o diretório de layout OCI relativo ao <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>workspace do job</a> para fazer o push");m.put("Specify OpenID scopes to request", "Especifique os escopos OpenID a serem solicitados");- m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",- "Especifique o arquivo xml de resultado PMD relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>, por exemplo, <tt>target/pmd.xml</tt>. Use * ou ? para correspondência de padrão");- m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",- "Especifique os comandos PowerShell para executar no <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>workspace do job</a>.<br><b class='text-warning'>NOTA: </b> O OneDev verifica o código de saída do script para determinar se a etapa foi bem-sucedida. Como o PowerShell sempre sai com 0 mesmo que haja erros no script, você deve lidar com erros no script e sair com um código diferente de zero, ou adicionar a linha <code>$ErrorActionPreference = "Stop"</code> no início do seu script<br>");- m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",- "Especifique o arquivo de saída de diagnósticos Roslynator no formato XML relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>. Este arquivo pode ser gerado com a opção <i>-o</i>. Use * ou ? para correspondência de padrão");+ m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",+ "Especifique o arquivo xml de resultado PMD relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>, por exemplo, <tt>target/pmd.xml</tt>. Use * ou ? para correspondência de padrão");+ m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",+ "Especifique os comandos PowerShell para executar no <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>workspace do job</a>.<br><b class='text-warning'>NOTA: </b> O OneDev verifica o código de saída do script para determinar se a etapa foi bem-sucedida. Como o PowerShell sempre sai com 0 mesmo que haja erros no script, você deve lidar com erros no script e sair com um código diferente de zero, ou adicionar a linha <code>$ErrorActionPreference = "Stop"</code> no início do seu script<br>");+ m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",+ "Especifique o arquivo de saída de diagnósticos Roslynator no formato XML relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>. Este arquivo pode ser gerado com a opção <i>-o</i>. Use * ou ? para correspondência de padrão");m.put("Specify Shell/Batch Commands to Run", "Especifique Comandos Shell/Batch para Executar");- m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",- "Especifique o arquivo xml de resultado SpotBugs relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>, por exemplo, <tt>target/spotbugsXml.xml</tt>. Use * ou ? para correspondência de padrão");+ m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",+ "Especifique o arquivo xml de resultado SpotBugs relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>, por exemplo, <tt>target/spotbugsXml.xml</tt>. Use * ou ? para correspondência de padrão");m.put("Specify System Settings", "Especifique Configurações do Sistema");m.put("Specify URL of remote git repository. Only http/https protocol is supported", "Especifique a URL do repositório git remoto. Apenas o protocolo http/https é suportado");m.put("Specify YouTrack login name. This account should have permission to:<ul><li>Read full information and issues of the projects you want to import<li>Read issue tags<li>Read user basic information</ul>",@@ -3466,14 +3466,14 @@ public class Translation_pt extends TranslationResourceBundle {m.put("Specify a Docker Image to Test Against", "Especifique uma Imagem Docker para Testar");m.put("Specify a custom field of Enum type", "Especifique um campo personalizado do tipo Enum");m.put("Specify a default query to filter/order fixed issues of specified jobs", "Especifique uma consulta padrão para filtrar/ordenar issues resolvidas dos jobs especificados");- m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to write checksum into",- "Especifique um arquivo relativo ao <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>workspace do job</a> para gravar o checksum");+ m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to write checksum into",+ "Especifique um arquivo relativo ao <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>workspace do job</a> para gravar o checksum");m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Especifique um campo de usuário multi-valor para armazenar informações de responsáveis.<b>NOTA: </b> Você pode personalizar os campos de issues do OneDev caso não haja uma opção apropriada aqui");m.put("Specify a multi-value user field to hold assignees information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","Especifique um campo de usuário multi-valor para armazenar informações de responsáveis.<br><b>NOTA: </b> Você pode personalizar os campos de issues do OneDev caso não haja uma opção apropriada aqui");m.put("Specify a path inside container to be used as mount target", "Especifique um caminho dentro do container para ser usado como destino de montagem");- m.put("Specify a path relative to job workspace to be used as mount source. Leave empty to mount job workspace itself",+ m.put("Specify a path relative to job workdir to be used as mount source. Leave empty to mount job workdir itself","Especifique um caminho relativo ao workspace do job para ser usado como fonte de montagem. Deixe vazio para montar o próprio workspace do job");m.put("Specify a secret to be used as access token to create issue in above project if it is not publicly accessible","Especifique um segredo para ser usado como token de acesso para criar uma issue no projeto acima, caso não seja publicamente acessível");@@ -3499,8 +3499,8 @@ public class Translation_pt extends TranslationResourceBundle {m.put("Specify application (client) ID of the app registered in Entra ID", "Especifique o ID do aplicativo (cliente) do app registrado no Entra ID");m.put("Specify arguments for imagetools. For instance <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>","Especifique argumentos para imagetools. Por exemplo <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>");- m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved.",- "Especifique artefatos para recuperar no <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>. Apenas artefatos publicados (via etapa de publicação de artefatos) podem ser recuperados.");+ m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved.",+ "Especifique artefatos para recuperar no <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>. Apenas artefatos publicados (via etapa de publicação de artefatos) podem ser recuperados.");m.put("Specify at least 10 alphanumeric chars to be used as secret, and then add an inbound parse entry at SendGrid side:<ul><li><code>Destination URL</code> should be set to <i><OneDev root url>/~sendgrid/<secret></i>, for instance, <i>https://onedev.example.com/~sendgrid/1234567890</i>. Note that in production environment, <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>https should be enabled</a> to protect the secret</li><li><code>Receiving domain</code> should be the same as domain part of system email address specified above</li><li>Option <code>POST the raw, full MIME message</code> is enabled</li></ul>","Especifique pelo menos 10 caracteres alfanuméricos para serem usados como segredo e, em seguida, adicione uma entrada de análise de entrada no lado do SendGrid:<ul><li><code>URL de Destino</code> deve ser configurado como <i><URL raiz do OneDev>/~sendgrid/<segredo></i>, por exemplo, <i>https://onedev.example.com/~sendgrid/1234567890</i>. Note que em ambiente de produção, <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>https deve ser habilitado</a> para proteger o segredo</li><li><code>Domínio de Recebimento</code> deve ser o mesmo que a parte do domínio do endereço de email do sistema especificado acima</li><li>Opção <code>POST the raw, full MIME message</code> está habilitada</li></ul>");m.put("Specify base nodes for user search. For example: <i>cn=Users, dc=example, dc=com</i>",@@ -3516,13 +3516,13 @@ public class Translation_pt extends TranslationResourceBundle {"Especifique o certificado para confiar caso esteja usando certificado autoassinado para o repositório remoto");m.put("Specify certificates to trust if you are using self-signed certificates for your docker registries","Especifique os certificados para confiar caso esteja usando certificados autoassinados para seus registros docker");- m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",- "Especifique o arquivo xml de resultado checkstyle relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>, por exemplo, <tt>target/checkstyle-result.xml</tt>. Consulte a <a href='https://checkstyle.org/'>documentação do checkstyle</a> sobre como gerar o arquivo xml de resultado. Use * ou ? para correspondência de padrão");+ m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",+ "Especifique o arquivo xml de resultado checkstyle relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>, por exemplo, <tt>target/checkstyle-result.xml</tt>. Consulte a <a href='https://checkstyle.org/'>documentação do checkstyle</a> sobre como gerar o arquivo xml de resultado. Use * ou ? para correspondência de padrão");m.put("Specify client secret of the app registered in Entra ID", "Especifique o segredo do cliente do app registrado no Entra ID");- m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",- "Especifique o arquivo de relatório de cobertura xml do clover relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>, por exemplo, <tt>target/site/clover/clover.xml</tt>. Consulte a <a href='https://openclover.org/documentation'>documentação do OpenClover</a> sobre como gerar o arquivo xml do clover. Use * ou ? para correspondência de padrão");- m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",- "Especifique o arquivo de relatório de cobertura xml do cobertura relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>workspace do job</a>, por exemplo, <tt>target/site/cobertura/coverage.xml</tt>. Use * ou ? para correspondência de padrão");+ m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",+ "Especifique o arquivo de relatório de cobertura xml do clover relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>, por exemplo, <tt>target/site/clover/clover.xml</tt>. Consulte a <a href='https://openclover.org/documentation'>documentação do OpenClover</a> sobre como gerar o arquivo xml do clover. Use * ou ? para correspondência de padrão");+ m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",+ "Especifique o arquivo de relatório de cobertura xml do cobertura relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>workspace do job</a>, por exemplo, <tt>target/site/cobertura/coverage.xml</tt>. Use * ou ? para correspondência de padrão");m.put("Specify color of the state for displaying purpose", "Especifique a cor do estado para fins de exibição");m.put("Specify columns of the board. Each column corresponds to a value of the issue field specified above","Especifique as colunas do quadro. Cada coluna corresponde a um valor do campo de issue especificado acima");@@ -3535,8 +3535,8 @@ public class Translation_pt extends TranslationResourceBundle {"Especifique a URL de descoberta de configuração do seu provedor OpenID, por exemplo: <code>https://openid.example.com/.well-known/openid-configuration</code>. Certifique-se de usar o protocolo HTTPS, pois o OneDev depende da criptografia TLS para garantir a validade do token");m.put("Specify container image to execute commands inside", "Especifique a imagem do contêiner para executar os comandos");m.put("Specify container image to run", "Especifique a imagem do contêiner para executar");- m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",- "Especifique o arquivo de resultados xml do cppcheck relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a>. Este arquivo pode ser gerado com a opção de saída xml do cppcheck, por exemplo <code>cppcheck src --xml 2>check-result.xml</code>. Use * ou ? para correspondência de padrão");+ m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",+ "Especifique o arquivo de resultados xml do cppcheck relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a>. Este arquivo pode ser gerado com a opção de saída xml do cppcheck, por exemplo <code>cppcheck src --xml 2>check-result.xml</code>. Use * ou ? para correspondência de padrão");m.put("Specify cpu request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","Especifique a solicitação de CPU para cada trabalho/serviço usando este executor. Verifique <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>gerenciamento de recursos do Kubernetes</a> para detalhes");m.put("Specify default assignees of pull requests submitted to this project. Only users with the write code permission to the project can be selected",@@ -3545,8 +3545,8 @@ public class Translation_pt extends TranslationResourceBundle {m.put("Specify destinations, for instance <tt>registry-server:5000/myorg/myrepo:latest</tt>. Make sure to use <b>same host</b> as specified in server url of system settings if you want to push to built-in registry, or simply use the form <tt>@server@/<project path>/<repo name>:<tag name></tt>. Multiple destinations should be separated with space","Especifique os destinos, por exemplo <tt>registry-server:5000/myorg/myrepo:latest</tt>. Certifique-se de usar <b>o mesmo host</b> especificado na URL do servidor nas configurações do sistema se quiser enviar para o registro interno, ou simplesmente use o formato <tt>@server@/<project path>/<repo name>:<tag name></tt>. Múltiplos destinos devem ser separados por espaço");m.put("Specify directory (tenant) ID of the app registered in Entra ID", "Especifique o ID do diretório (tenant) do aplicativo registrado no Entra ID");- m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "Especifique o diretório relativo ao <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espaço de trabalho do trabalho</a> para armazenar o layout OCI");+ m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "Especifique o diretório relativo ao <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espaço de trabalho do trabalho</a> para armazenar o layout OCI");m.put("Specify docker image of the service", "Especifique a imagem do docker do serviço");m.put("Specify dockerx builder used to build docker image. OneDev will create the builder automatically if it does not exist. Check <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>this tutorial</a> on how to customize the builder for instance to allow publishing to insecure registries","Especifique o builder dockerx usado para construir a imagem do docker. O OneDev criará o builder automaticamente se ele não existir. Verifique <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>este tutorial</a> sobre como personalizar o builder, por exemplo, para permitir a publicação em registros inseguros");@@ -3557,10 +3557,10 @@ public class Translation_pt extends TranslationResourceBundle {"Especifique os campos de vários problemas criados pelo Renovate para orquestrar a atualização de dependências");m.put("Specify fields to be displayed in the issue list", "Especifique os campos a serem exibidos na lista de problemas");m.put("Specify fields to display in board card", "Especifique os campos a serem exibidos no cartão do quadro");- m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published. Use * or ? for pattern match",- "Especifique os arquivos relativos ao <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a> a serem publicados. Use * ou ? para correspondência de padrão");- m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Especifique os arquivos para criar checksum md5. Múltiplos arquivos devem ser separados por espaço. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Padrões Globstar</a> são aceitos. Arquivos não absolutos são considerados relativos ao <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espaço de trabalho do trabalho</a>");+ m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published. Use * or ? for pattern match",+ "Especifique os arquivos relativos ao <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a> a serem publicados. Use * ou ? para correspondência de padrão");+ m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Especifique os arquivos para criar checksum md5. Múltiplos arquivos devem ser separados por espaço. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Padrões Globstar</a> são aceitos. Arquivos não absolutos são considerados relativos ao <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espaço de trabalho do trabalho</a>");m.put("Specify files under above directory to be published", "Especifique arquivos no diretório acima para serem publicados");m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> <code>index.html</code> should be included in these files to be served as site start page","Especifique os arquivos no diretório acima a serem publicados. Use * ou ? para correspondência de padrão. <b>NOTA:</b> <code>index.html</code> deve ser incluído nesses arquivos para ser servido como página inicial do site");@@ -3604,8 +3604,8 @@ public class Translation_pt extends TranslationResourceBundle {m.put("Specify manager DN to authenticate OneDev itself to Active Directory. The manager DN should be specified in form of <i><account name>@<domain></i>, for instance: <i>[email protected]</i>","Especifique o DN do gerente para autenticar o próprio OneDev no Active Directory. O DN do gerente deve ser especificado na forma de <i><account name>@<domain></i>, por exemplo: <i>[email protected]</i>");m.put("Specify manager DN to authenticate OneDev itself to LDAP server", "Especifique o DN do gerente para autenticar o próprio OneDev no servidor LDAP");- m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published",- "Especifique o arquivo markdown relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a> a ser publicado");+ m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published",+ "Especifique o arquivo markdown relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a> a ser publicado");m.put("Specify max git LFS file size in mega bytes", "Especifique o tamanho máximo do arquivo git LFS em megabytes");m.put("Specify max number of CPU intensive tasks the server can run concurrently, such as Git repository pull/push, repository index, etc.","Especifique o número máximo de tarefas intensivas de CPU que o servidor pode executar simultaneamente, como pull/push de repositório Git, indexação de repositório, etc.");@@ -3621,8 +3621,8 @@ public class Translation_pt extends TranslationResourceBundle {"Especifique o tamanho máximo do arquivo enviado via interface web em megabytes. Isso se aplica ao arquivo enviado para o repositório, conteúdo markdown (comentário de problema etc.) e artefatos de construção");m.put("Specify memory request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","Especifique a solicitação de memória para cada trabalho/serviço usando este executor. Verifique <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>gerenciamento de recursos do Kubernetes</a> para detalhes");- m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",- "Especifique o arquivo de saída do mypy relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a>. Este arquivo pode ser gerado redirecionando a saída do mypy <b>sem a opção '--pretty'</b>, por exemplo <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * ou ? para correspondência de padrão");+ m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",+ "Especifique o arquivo de saída do mypy relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a>. Este arquivo pode ser gerado redirecionando a saída do mypy <b>sem a opção '--pretty'</b>, por exemplo <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * ou ? para correspondência de padrão");m.put("Specify name of the branch", "Especifique o nome do branch");m.put("Specify name of the environment variable", "Especifique o nome da variável de ambiente");m.put("Specify name of the iteration", "Especifique o nome da iteração");@@ -3645,23 +3645,23 @@ public class Translation_pt extends TranslationResourceBundle {m.put("Specify project to run job in", "Especifique o projeto para executar o trabalho");m.put("Specify projects", "Especifique os projetos");m.put("Specify projects to update dependencies. Leave empty for current project", "Especifique os projetos para atualizar dependências. Deixe vazio para o projeto atual");- m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "Especifique o arquivo de resultados json do pylint relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a>. Este arquivo pode ser gerado com a opção de formato de saída json do pylint, por exemplo <code>--exit-zero --output-format=json:pylint-result.json</code>. Observe que não falhamos o comando pylint em caso de violações, pois esta etapa falhará na construção com base no limite configurado. Use * ou ? para correspondência de padrão");+ m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "Especifique o arquivo de resultados json do pylint relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a>. Este arquivo pode ser gerado com a opção de formato de saída json do pylint, por exemplo <code>--exit-zero --output-format=json:pylint-result.json</code>. Observe que não falhamos o comando pylint em caso de violações, pois esta etapa falhará na construção com base no limite configurado. Use * ou ? para correspondência de padrão");m.put("Specify registry logins if necessary. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token for password","Especifique os logins do registro, se necessário. Para o registro interno, use <code>@server_url@</code> para a URL do registro, <code>@job_token@</code> para o nome de usuário e o token de acesso para a senha");m.put("Specify registry url. Leave empty for official registry", "Especifique a URL do registro. Deixe vazio para o registro oficial");- m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "Especifique o caminho relativo sob o <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espaço de trabalho do trabalho</a> para armazenar o layout OCI");+ m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "Especifique o caminho relativo sob o <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espaço de trabalho do trabalho</a> para armazenar o layout OCI");m.put("Specify repositories", "Especifique os repositórios");m.put("Specify required reviewers if specified path is changed. Note that the user submitting the change is considered to reviewed the change automatically","Especifique os revisores necessários se o caminho especificado for alterado. Observe que o usuário que enviou a alteração é considerado automaticamente como tendo revisado a alteração");m.put("Specify root URL to access this server", "Especifique a URL raiz para acessar este servidor");- m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "Especifique o arquivo de resultados json do ruff relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a>. Este arquivo pode ser gerado com a opção de formato de saída json do ruff, por exemplo <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Observe que não falhamos o comando ruff em caso de violações, pois esta etapa falhará na construção com base no limite configurado. Use * ou ? para correspondência de padrão");- m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Especifique os comandos shell (em Linux/Unix) ou comandos batch (em Windows) para executar sob o <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espaço de trabalho do trabalho</a>");- m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Especifique os comandos shell para executar sob o <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espaço de trabalho do trabalho</a>");+ m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "Especifique o arquivo de resultados json do ruff relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a>. Este arquivo pode ser gerado com a opção de formato de saída json do ruff, por exemplo <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Observe que não falhamos o comando ruff em caso de violações, pois esta etapa falhará na construção com base no limite configurado. Use * ou ? para correspondência de padrão");+ m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Especifique os comandos shell (em Linux/Unix) ou comandos batch (em Windows) para executar sob o <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espaço de trabalho do trabalho</a>");+ m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Especifique os comandos shell para executar sob o <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espaço de trabalho do trabalho</a>");m.put("Specify shell to be used", "Especifique o shell a ser usado");m.put("Specify source param for SCP command, for instance <code>app.tar.gz</code>", "Especifique o parâmetro de origem para o comando SCP, por exemplo <code>app.tar.gz</code>");m.put("Specify space separated refs to pull from remote. '*' can be used in ref name for wildcard match<br><b class='text-danger'>NOTE:</b> branch/tag protection rule will be ignored when update branches/tags via this step",@@ -3680,10 +3680,10 @@ public class Translation_pt extends TranslationResourceBundle {"Especifique os endereços de email do remetente separados por espaço aplicáveis para esta entrada. Use '*' ou '?' para correspondência de curinga. Prefixe com '-' para excluir. Deixe vazio para corresponder a todos os remetentes");m.put("Specify space-separated tags to be protected. Use '**', '*' or '?' for <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>path wildcard match</a>. Prefix with '-' to exclude","Especifique as tags separadas por espaço a serem protegidas. Use '**', '*' ou '?' para <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>correspondência de curinga de caminho</a>. Prefixe com '-' para excluir");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: <tt>manual/index.md</tt>",- "Especifique a página inicial do relatório relativa ao <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a>, por exemplo: <tt>manual/index.md</tt>");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: api/index.html",- "Especifique a página inicial do relatório relativa ao <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a>, por exemplo: api/index.html");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: <tt>manual/index.md</tt>",+ "Especifique a página inicial do relatório relativa ao <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a>, por exemplo: <tt>manual/index.md</tt>");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: api/index.html",+ "Especifique a página inicial do relatório relativa ao <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a>, por exemplo: api/index.html");m.put("Specify storage size to request for the build volume. The size should conform to <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>Kubernetes resource capacity format</a>, for instance <i>10Gi</i>","Especifique o tamanho de armazenamento a ser solicitado para o volume de construção. O tamanho deve estar em conformidade com o <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>formato de capacidade de recurso do Kubernetes</a>, por exemplo <i>10Gi</i>");m.put("Specify tab width used to calculate column value of found problems in provided report",@@ -3769,8 +3769,8 @@ public class Translation_pt extends TranslationResourceBundle {m.put("Step Templates", "Templates de Etapas");m.put("Step {0} of {1}: ", "Etapa {0} de {1}:");m.put("Steps", "Etapas");- m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>",- "As etapas serão executadas sequencialmente no mesmo nó, compartilhando o mesmo <a href='https://docs.onedev.io/concepts#job-workspace'>workspace de trabalho</a>");+ m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>",+ "As etapas serão executadas sequencialmente no mesmo nó, compartilhando o mesmo <a href='https://docs.onedev.io/concepts#job-workdir'>workspace de trabalho</a>");m.put("Stop", "Parar");m.put("Stop work", "Parar trabalho");m.put("Stopwatch Overdue", "Cronômetro Atrasado");@@ -4008,9 +4008,9 @@ public class Translation_pt extends TranslationResourceBundle {m.put("This shows number of issues in various states over time", "Isso mostra o número de problemas em vários estados ao longo do tempo");m.put("This shows number of open and merged pull requests over time", "Isso mostra o número de pull requests abertos e mesclados ao longo do tempo");m.put("This step can only be executed by a docker aware executor", "Esta etapa só pode ser executada por um executor compatível com Docker");- m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "Esta etapa só pode ser executada por um executor compatível com Docker. Ela é executada sob <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>espaço de trabalho do trabalho</a>");- m.put("This step copies files from job workspace to build artifacts directory, so that they can be accessed after job is completed",+ m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "Esta etapa só pode ser executada por um executor compatível com Docker. Ela é executada sob <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>espaço de trabalho do trabalho</a>");+ m.put("This step copies files from job workdir to build artifacts directory, so that they can be accessed after job is completed","Esta etapa copia arquivos do espaço de trabalho do job para o diretório de artefatos de build, para que possam ser acessados após a conclusão do job");m.put("This step publishes specified files to be served as project web site. Project web site can be accessed publicly via <code>http://<onedev base url>/path/to/project/~site</code>","Esta etapa publica os arquivos especificados para serem servidos como site web do projeto. O site web do projeto pode ser acessado publicamente via <code>http://<onedev base url>/path/to/project/~site</code>");@@ -4728,8 +4728,8 @@ public class Translation_pt extends TranslationResourceBundle {"Opcionalmente, especifique tipos de commit aplicáveis para verificação de rodapé de mensagem de commit (pressione ENTER para adicionar valor). Deixe vazio para todos os tipos");m.put("Optionally specify extra options for osv source scanner. Multiple options need to be separated with space","Opcionalmente, especifique opções extras para o scanner de fonte osv. Múltiplas opções precisam ser separadas por espaço");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",- "Opcionalmente, especifique o caminho relativo ao <a href='https://docs.onedev.io/concepts#job-workspace'>espaço de trabalho do trabalho</a> a ser usado como <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>configuração de segredo</a> do trivy");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",+ "Opcionalmente, especifique o caminho relativo ao <a href='https://docs.onedev.io/concepts#job-workdir'>espaço de trabalho do trabalho</a> a ser usado como <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>configuração de segredo</a> do trivy");m.put("Osv Source Scanner", "Scanner de Fonte Osv");m.put("Run osv scanner to scan project source for vulnerabilities in <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>various lock files</a>. It can only be executed by docker aware executor.","Execute o scanner osv para escanear a fonte do projeto em busca de vulnerabilidades em <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>vários arquivos de bloqueio</a>. Só pode ser executado por executor compatível com docker.");diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_zh.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_zh.javaindex e69ab2ab23..33b0c35204 100644--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_zh.java+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_zh.java@@ -39,6 +39,7 @@ public class Translation_zh extends TranslationResourceBundle {- 'pull request' should be translated as 合并请求- 'job' should be translated as 任务- 'entitled' should be translated as 被授权的+ - 'pending' alone should be translated as 待处理""")public static void init(Map<String, String> m) {m.clear();@@ -1422,8 +1423,8 @@ public class Translation_zh extends TranslationResourceBundle {"对于从默认分支无法到达的构建提交,应该指定一个具有创建标签权限的访问令牌作为任务密钥");m.put("For build commit not reachable from default branch, a <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> should be specified as access token with manage issue permission","对于从默认分支无法到达的构建提交,应该指定一个具有管理工单权限的访问令牌作为任务密钥");- m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>). For shell related executors which runs on host machine directly, only relative path is accepted",- "对于 docker 相关执行器,此路径在容器内,并接受绝对路径和相对路径(相对于 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>)。对于直接在主机机器上运行的 shell 相关执行器,只接受相对路径");+ m.put("For docker aware executors, this path is inside container, and accepts both absolute path and relative path (relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>). For shell related executors which runs on host machine directly, only relative path is accepted",+ "对于 docker 相关执行器,此路径在容器内,并接受绝对路径和相对路径(相对于 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>)。对于直接在主机机器上运行的 shell 相关执行器,只接受相对路径");m.put("For each build, OneDev calculates a list of fixed issues since previous build automatically. This setting provides a default query to further filter/order this list. For a given job, the first matching entry will be used.","对于每个构建,OneDev 自动计算自上一个构建以来的固定工单列表。此设置提供默认查询以进一步过滤/排序此列表。对于给定的任务,第一个匹配的条目将被使用。");m.put("For each selected branch/tag, a separate build will be generated with branch/tag set to corresponding value",@@ -2371,7 +2372,7 @@ public class Translation_zh extends TranslationResourceBundle {m.put("Optionally filter issues", "可选择过滤工单");m.put("Optionally filter pull requests", "可选择过滤合并请求");m.put("Optionally leave a note", "可选择留一个备注");- m.put("Optionally mount directories or files under job workspace into container", "可选择将任务工作区下的目录或文件挂载到容器中");+ m.put("Optionally mount directories or files under job workdir into container", "可选择将任务工作区下的目录或文件挂载到容器中");m.put("Optionally select fields to prompt when this button is pressed", "可选择在点击此按钮时提示字段");m.put("Optionally select fields to remove when this transition happens", "可选择在转换发生时删除字段");m.put("Optionally specifies name of the attribute inside the user LDAP entry whose value will be taken as user email. This field is normally set to <i>mail</i> according to RFC 2798",@@ -2391,8 +2392,8 @@ public class Translation_zh extends TranslationResourceBundle {m.put("Optionally specify <span class='text-info'>comma separated</span> platforms to scan, for instance <tt>linux/amd64,linux/arm64</tt>. Leave empty to scan all platforms in OCI layout","可选择指定 <span class='text-info'>逗号分隔</span> 的平台,例如 <tt>linux/amd64,linux/arm64</tt>。留空则扫描 OCI 布局中的所有平台");m.put("Optionally specify API key for authentication", "可选地指定 API 密钥进行身份验证");- m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",- "可选择指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>任务工作区</a> 的 Dockerfile。留空则使用上面指定的构建路径下的文件 <tt>Dockerfile</tt>");+ m.put("Optionally specify Dockerfile relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use file <tt>Dockerfile</tt> under build path specified above",+ "可选择指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>任务工作区</a> 的 Dockerfile。留空则使用上面指定的构建路径下的文件 <tt>Dockerfile</tt>");m.put("Optionally specify JavaScript config to be used by Renovate CLI", "可选择指定用于 Renovate CLI 的 JavaScript 配置");m.put("Optionally specify SSH root URL, which will be used to construct project clone url via SSH protocol. Leave empty to derive from server url","可选择指定 SSH 根 URL,用于通过 SSH 协议构造项目克隆 URL。留空则从服务器 URL 推导");@@ -2410,8 +2411,8 @@ public class Translation_zh extends TranslationResourceBundle {"可选择指定一个 cron 表达式来调度数据库自动备份。cron 表达式格式为 <em><秒> <分钟> <小时> <日期> <月份> <星期></em>。例如,<em>0 0 1 * * ?</em> 表示每天凌晨 1 点。有关格式的详细信息,请参阅 <a href='http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html#format' target='_blank'>Quartz 教程</a>。备份文件将放置在 OneDev 安装目录下的 <em>db-backup</em> 文件夹中。如果多个服务器连接形成集群,自动备份将在 <a href='https://docs.onedev.io/concepts#lead-server' target='_blank'>主服务器</a> 上进行。如果不想启用数据库自动备份,请将此属性留空。");m.put("Optionally specify a date field to hold due date information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","可选择指定一个日期字段来保存截止日期信息。<br><b>注意:</b>如果这里没有合适的选项,您可以自定义 OneDev 工单字段");- m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to put retrieved artifacts. Leave empty to use job workspace itself",- "可选择指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的路径来放置获取的制品。留空则使用任务工作区本身");+ m.put("Optionally specify a path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to put retrieved artifacts. Leave empty to use job workdir itself",+ "可选择指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的路径来放置获取的制品。留空则使用任务工作区本身");m.put("Optionally specify a storage class to allocate build volume dynamically. Leave empty to use default storage class. <b class='text-warning'>NOTE:</b> Reclaim policy of the storage class should be set to <code>Delete</code>, as the volume is only used to hold temporary build files","可选择指定一个存储类来动态分配构建卷。留空则使用默认存储类。<b class='text-warning'>注意:</b>存储类的回收策略应设置为 <code>Delete</code>,因为该卷仅用于保存临时构建文件");m.put("Optionally specify a working period field to hold estimated time infomration.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here",@@ -2430,17 +2431,17 @@ public class Translation_zh extends TranslationResourceBundle {m.put("Optionally specify applicable jobs of this executor", "可选地指定此执行器适用的作业");m.put("Optionally specify applicable users who pushed the change", "可选地指定推送更改的适用用户");m.put("Optionally specify arguments to run above image", "可选择指定运行上述镜像的参数");- m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",- "可选择指定从依赖项拷贝到 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的制品。只能拷贝已发布的制品(通过制品发布步骤)。留空则不拷贝任何制品");+ m.put("Optionally specify artifacts to retrieve from the dependency into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved. Leave empty to not retrieve any artifacts",+ "可选择指定从依赖项拷贝到 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的制品。只能拷贝已发布的制品(通过制品发布步骤)。留空则不拷贝任何制品");m.put("Optionally specify authorized roles to press this button. If not specified, all users are allowed","可选择指定允许按此按钮的授权角色。如果未指定,则允许所有用户");m.put("Optionally specify base query of the list", "可选择指定列表的基本查询");m.put("Optionally specify branches/users/groups allowed to access this secret. If left empty, any job can access this secret, including those triggered via external pull requests","可选择指定允许访问此密钥的分支/用户/组。如果留空,任何任务都可以访问此密钥,包括通过外部合并请求触发的任务");- m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",- "可选择指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>任务工作区</a> 的构建上下文路径。留空则使用任务工作区本身。除非使用选项 <code>--dockerfile</code> 指定不同位置,否则文件 <code>Dockerfile</code> 应存在于构建上下文目录中");- m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. Leave empty to use job workspace itself",- "可选择指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>任务工作区</a> 的构建路径。留空则使用任务工作区本身");+ m.put("Optionally specify build context path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself. The file <code>Dockerfile</code> is expected to exist in build context directory, unless you specify a different location with option <code>--dockerfile</code>",+ "可选择指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>任务工作区</a> 的构建上下文路径。留空则使用任务工作区本身。除非使用选项 <code>--dockerfile</code> 指定不同位置,否则文件 <code>Dockerfile</code> 应存在于构建上下文目录中");+ m.put("Optionally specify build path relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. Leave empty to use job workdir itself",+ "可选择指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>任务工作区</a> 的构建路径。留空则使用任务工作区本身");m.put("Optionally specify cluster role the job pods service account binding to. This is necessary if you want to do things such as running other Kubernetes pods in job command","可选择指定任务 pod 服务账户绑定的集群角色。如果要执行诸如在任务命令中运行其他 Kubernetes pod 之类的操作,这是必需的");m.put("Optionally specify container arguments separated by space. Single argument containing space should be quoted. <b class='text-warning'>Note: </b> do not confuse this with container options which should be specified in executor setting",@@ -2503,13 +2504,13 @@ public class Translation_zh extends TranslationResourceBundle {"可选择为 ssh 命令指定选项。多个选项需要用空格分隔");m.put("Optionally specify options passed to renovate cli. Multiple options should be separated by space, and single option containing spaces should be quoted","可选择指定传递给 renovate cli 的选项。多个选项应以空格分隔,包含空格的单个选项应加引号");- m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>. You may ignore particular vulnerabilities via this file",- "可选择在 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>任务工作区</a> 下指定 osv 扫描器 <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>配置文件</a>。您可以通过此文件忽略特定漏洞");+ m.put("Optionally specify osv scanner <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>config file</a> under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>. You may ignore particular vulnerabilities via this file",+ "可选择在 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>任务工作区</a> 下指定 osv 扫描器 <a href='https://google.github.io/osv-scanner/configuration/' target='_blank'>配置文件</a>。您可以通过此文件忽略特定漏洞");m.put("Optionally specify path protection rules", "可选择指定路径保护规则");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",- "可选择指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的路径,用作 trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>忽略文件</a>");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to publish artifacts from. Leave empty to use job workspace itself",- "可选择指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的路径来发布制品。留空则使用任务工作区本身");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>ignore file</a>",+ "可选择指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的路径,用作 trivy <a href='https://aquasecurity.github.io/trivy/v0.50/docs/configuration/filtering/#by-finding-ids' target='_blank'>忽略文件</a>");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to publish artifacts from. Leave empty to use job workdir itself",+ "可选择指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的路径来发布制品。留空则使用任务工作区本身");m.put("Optionally specify platform to pull, for instance <tt>linux/amd64</tt>. Leave empty to pull all platforms in image","可选择指定要拉取的平台,例如 <tt>linux/amd64</tt>。留空则拉取镜像中的所有平台");m.put("Optionally specify project to show builds of. Leave empty to show builds of all projects with permissions",@@ -2523,12 +2524,12 @@ public class Translation_zh extends TranslationResourceBundle {m.put("Optionally specify registry logins to override those defined in job executor. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token secret for password secret","可选择指定注册表登录信息,以覆盖任务执行器中定义的登录信息。对于内置注册表,使用 <code>@server_url@</code> 作为注册表 URL,<code>@job_token@</code> 作为用户名,以及访问令牌密钥作为密码密钥");m.put("Optionally specify relative directory to put uploaded files", "可选地指定要上传的文件的相对目录");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to clone code into. Leave empty to use job workspace itself",- "可选择指定 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 下的相对路径,用于克隆代码。留空则使用任务工作区本身");- m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan. Leave empty to use job workspace itself",- "可选择指定 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 下的相对路径进行扫描。留空则使用任务工作区本身");- m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workspace itself",- "可选择指定 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 下的相对路径,用于扫描依赖项漏洞。可以指定多个路径,应以空格分隔。留空则使用任务工作区本身");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to clone code into. Leave empty to use job workdir itself",+ "可选择指定 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 下的相对路径,用于克隆代码。留空则使用任务工作区本身");+ m.put("Optionally specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan. Leave empty to use job workdir itself",+ "可选择指定 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 下的相对路径进行扫描。留空则使用任务工作区本身");+ m.put("Optionally specify relative paths under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to scan dependency vulnerabilities. Multiple paths can be specified and should be separated with space. Leave empty to use job workdir itself",+ "可选择指定 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 下的相对路径,用于扫描依赖项漏洞。可以指定多个路径,应以空格分隔。留空则使用任务工作区本身");m.put("Optionally specify required reviewers for changes of specified branch", "可选择为指定分支的更改指定所需的审阅者");m.put("Optionally specify revision to create branch from. Leave empty to create from build commit","可选择指定用于创建分支的修订版本。留空则从构建提交创建");@@ -2612,7 +2613,7 @@ public class Translation_zh extends TranslationResourceBundle {m.put("Own:", "自身");m.put("Ownered By", "拥有者");m.put("PEM private key begins with '-----BEGIN RSA PRIVATE KEY-----'", "PEM 私钥以 '-----BEGIN RSA PRIVATE KEY-----' 开头");- m.put("PENDING", "待定");+ m.put("PENDING", "待处理");m.put("PMD Report", "PMD 报告");m.put("Pack", "包");m.put("Pack Notification", "包通知");@@ -3142,8 +3143,8 @@ public class Translation_zh extends TranslationResourceBundle {m.put("Run job", "运行任务");m.put("Run job in another project", "在另一个项目中运行任务");m.put("Run on Bare Metal/Virtual Machine", "在裸机/虚拟机上运行");- m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKSPACE</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",- "运行指定的 docker 容器。<a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>Job workspace</a> 挂载到容器中,其路径放置在环境变量 <code>ONEDEV_WORKSPACE</code> 中。<b class='text-warning'>注意:</b> 此步骤只能由服务器 docker 执行器或远程 docker 执行器执行");+ m.put("Run specified docker container. <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job workspace</a> is mounted into the container and its path is placed in environment variable <code>ONEDEV_WORKDIR</code>. <b class='text-warning'>Note: </b> this step can only be executed by server docker executor or remote docker executor",+ "运行指定的 docker 容器。<a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>Job workspace</a> 挂载到容器中,其路径放置在环境变量 <code>ONEDEV_WORKDIR</code> 中。<b class='text-warning'>注意:</b> 此步骤只能由服务器 docker 执行器或远程 docker 执行器执行");m.put("Run specified step template", "运行指定的步骤模板");m.put("Run this job", "运行此任务");m.put("Run trivy container image scanner to find issues in specified image. For vulnerabilities, it checks various <a href='https://aquasecurity.github.io/trivy/v0.50/docs/coverage/language/#supported-languages' target='_blank'>distribution files</a>. It can only be executed by docker aware executor.",@@ -3416,47 +3417,47 @@ public class Translation_zh extends TranslationResourceBundle {m.put("Specifies who can access this AI service", "指定谁可以访问此 AI 服务");m.put("Specifies who can access this AI service. AI service can be accessed in below approaches:","指定谁可以访问此 AI 服务。AI 服务可以通过以下方式访问:");- m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",- "指定 .net TRX 测试结果文件相对 <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>,例如 <tt>TestResults/*.trx</tt>。使用 * 或 ? 进行模式匹配");+ m.put("Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match",+ "指定 .net TRX 测试结果文件相对 <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>,例如 <tt>TestResults/*.trx</tt>。使用 * 或 ? 进行模式匹配");m.put("Specify <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>job secret</a> whose value is access token with code write permission over above projects. Commits, issues, and pull requests will also be created under name of the access token owner","指定 <a href='https://docs.onedev.io/tutorials/cicd/job-secrets' target='_blank'>任务密钥</a> 的值是具有代码写入权限的访问令牌。提交、问题和合并请求也将以访问令牌所有者的名义创建");- m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",- "指定 <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json 输出文件相对 <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>。此文件可以通过 clippy json 输出选项生成,例如 <code>cargo clippy --message-format json>check-result.json</code>。使用 * 或 ? 进行模式匹配");+ m.put("Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match",+ "指定 <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json 输出文件相对 <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>。此文件可以通过 clippy json 输出选项生成,例如 <code>cargo clippy --message-format json>check-result.json</code>。使用 * 或 ? 进行模式匹配");m.put("Specify Build Options", "指定构建选项");- m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",- "指定 CPD 结果 xml 文件相对 <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>,例如 <tt>target/cpd.xml</tt>。使用 * 或 ? 进行模式匹配");+ m.put("Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match",+ "指定 CPD 结果 xml 文件相对 <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>,例如 <tt>target/cpd.xml</tt>。使用 * 或 ? 进行模式匹配");m.put("Specify Commit Message", "指定提交消息");- m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",- "指定 ESLint 报告文件在 <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> 中以 checkstyle 格式生成。此文件可以通过 ESLint 选项 <tt>'-f checkstyle'</tt> 和 <tt>'-o'</tt> 生成。使用 * 或 ? 进行模式匹配");+ m.put("Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. Use * or ? for pattern match",+ "指定 ESLint 报告文件在 <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> 中以 checkstyle 格式生成。此文件可以通过 ESLint 选项 <tt>'-f checkstyle'</tt> 和 <tt>'-o'</tt> 生成。使用 * 或 ? 进行模式匹配");m.put("Specify GitHub API url, for instance <tt>https://api.github.com</tt>", "指定 GitHub API URL,例如 <tt>https://api.github.com</tt>");m.put("Specify GitLab API url, for instance <tt>https://gitlab.example.com/api/v4</tt>", "指定 GitLab API URL,例如 <tt>https://gitlab.example.com/api/v4</tt>");m.put("Specify Gitea API url, for instance <tt>https://gitea.example.com/api/v1</tt>", "指定 Gitea API URL,例如 <tt>https://gitea.example.com/api/v1</tt>");- m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",- "指定 GoogleTest XML 结果文件相对 <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>。此报告可以通过在运行测试时使用环境变量 <tt>GTEST_OUTPUT</tt> 生成,例如 <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>。使用 * 或 ? 进行模式匹配");+ m.put("Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. Use * or ? for pattern match",+ "指定 GoogleTest XML 结果文件相对 <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>。此报告可以通过在运行测试时使用环境变量 <tt>GTEST_OUTPUT</tt> 生成,例如 <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>。使用 * 或 ? 进行模式匹配");m.put("Specify IMAP user name.<br><b class='text-danger'>NOTE: </b> This account should be able to receive emails sent to system email address specified above","指定 IMAP 用户名。<br><b class='text-danger'>注意:</b> 此帐户应能够接收发送到上面指定的系统电子邮件地址的电子邮件");- m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> 的 JUnit XML 格式测试结果文件,例如 <tt>target/surefire-reports/TEST-*.xml</tt>。使用 * 或 ? 进行模式匹配");- m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> 的 JaCoCo 覆盖率 xml 报告文件,例如 <tt>target/site/jacoco/jacoco.xml</tt>。使用 * 或 ? 进行模式匹配");- m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> 的 clover 格式 Jest 覆盖率报告文件,例如 <tt>coverage/clover.xml</tt>。此文件可以通过 Jest 选项 <tt>'--coverage'</tt> 生成。使用 * 或 ? 进行模式匹配");- m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> 的 json 格式 Jest 测试结果文件。此文件可以通过 Jest 选项 <tt>'--json'</tt> 和 <tt>'--outputFile'</tt> 生成。使用 * 或 ? 进行模式匹配");- m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "指定要扫描的镜像的 OCI 布局目录。此目录可以通过构建镜像步骤或拉取镜像步骤生成。它应该相对于 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>");- m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to push from",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> 的 OCI 布局目录以推送");+ m.put("Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> 的 JUnit XML 格式测试结果文件,例如 <tt>target/surefire-reports/TEST-*.xml</tt>。使用 * 或 ? 进行模式匹配");+ m.put("Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> 的 JaCoCo 覆盖率 xml 报告文件,例如 <tt>target/site/jacoco/jacoco.xml</tt>。使用 * 或 ? 进行模式匹配");+ m.put("Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> 的 clover 格式 Jest 覆盖率报告文件,例如 <tt>coverage/clover.xml</tt>。此文件可以通过 Jest 选项 <tt>'--coverage'</tt> 生成。使用 * 或 ? 进行模式匹配");+ m.put("Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> 的 json 格式 Jest 测试结果文件。此文件可以通过 Jest 选项 <tt>'--json'</tt> 和 <tt>'--outputFile'</tt> 生成。使用 * 或 ? 进行模式匹配");+ m.put("Specify OCI layout directory of the image to scan. This directory can be generated via build image step or pull image step. It should be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "指定要扫描的镜像的 OCI 布局目录。此目录可以通过构建镜像步骤或拉取镜像步骤生成。它应该相对于 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>");+ m.put("Specify OCI layout directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to push from",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> 的 OCI 布局目录以推送");m.put("Specify OpenID scopes to request", "指定要请求的 OpenID 作用域");- m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> 的 PMD 结果 xml 文件,例如 <tt>target/pmd.xml</tt>。使用 * 或 ? 进行模式匹配");- m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",- "指定在 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> 下执行的 PowerShell 命令。<br><b class='text-warning'>注意:</b> OneDev 检查脚本的退出代码以确定步骤是否成功。由于 PowerShell 即使有脚本错误也总是以 0 退出,您应该在脚本中处理错误并以非零代码退出,或在脚本开头添加行 <code>$ErrorActionPreference = "Stop"</code><br>");- m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> 的 XML 格式 Roslynator 诊断输出文件。此文件可以通过 <i>-o</i> 选项生成。使用 * 或 ? 进行模式匹配");+ m.put("Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> 的 PMD 结果 xml 文件,例如 <tt>target/pmd.xml</tt>。使用 * 或 ? 进行模式匹配");+ m.put("Specify PowerShell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>.<br><b class='text-warning'>NOTE: </b> OneDev checks exit code of the script to determine if step is successful. Since PowerShell always exit with 0 even if there are script errors, you should handle errors in the script and exit with non-zero code, or add line <code>$ErrorActionPreference = "Stop"</code> at start of your script<br>",+ "指定在 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> 下执行的 PowerShell 命令。<br><b class='text-warning'>注意:</b> OneDev 检查脚本的退出代码以确定步骤是否成功。由于 PowerShell 即使有脚本错误也总是以 0 退出,您应该在脚本中处理错误并以非零代码退出,或在脚本开头添加行 <code>$ErrorActionPreference = "Stop"</code><br>");+ m.put("Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with <i>-o</i> option. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> 的 XML 格式 Roslynator 诊断输出文件。此文件可以通过 <i>-o</i> 选项生成。使用 * 或 ? 进行模式匹配");m.put("Specify Shell/Batch Commands to Run", "指定要运行的 Shell/Batch 命令");- m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> 的 SpotBugs 结果 xml 文件,例如 <tt>target/spotbugsXml.xml</tt>。使用 * 或 ? 进行模式匹配");+ m.put("Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> 的 SpotBugs 结果 xml 文件,例如 <tt>target/spotbugsXml.xml</tt>。使用 * 或 ? 进行模式匹配");m.put("Specify System Settings", "指定系统设置");m.put("Specify URL of remote git repository. Only http/https protocol is supported", "指定远程 git 仓库的 URL。仅支持 http/https 协议");m.put("Specify YouTrack login name. This account should have permission to:<ul><li>Read full information and issues of the projects you want to import<li>Read issue tags<li>Read user basic information</ul>",@@ -3491,14 +3492,14 @@ public class Translation_zh extends TranslationResourceBundle {m.put("Specify a Docker Image to Test Against", "指定要测试的 Docker 镜像");m.put("Specify a custom field of Enum type", "指定枚举类型的自定义字段");m.put("Specify a default query to filter/order fixed issues of specified jobs", "指定用于过滤/排序指定任务修复工单的默认查询");- m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to write checksum into",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> 的文件以写入校验和");+ m.put("Specify a file relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to write checksum into",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> 的文件以写入校验和");m.put("Specify a multi-value user field to hold assignees information.<b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","指定一个多值用户字段以保存受理人信息。<b>注意:</b>如果这里没有合适的选项,您可以自定义 OneDev 工单字段");m.put("Specify a multi-value user field to hold assignees information.<br><b>NOTE: </b> You may customize OneDev issue fields in case there is no appropriate option here","指定一个多值用户字段以保存受理人信息。<br><b>注意:</b>如果这里没有合适的选项,您可以自定义 OneDev 工单字段");m.put("Specify a path inside container to be used as mount target", "指定容器内用作挂载目标的路径");- m.put("Specify a path relative to job workspace to be used as mount source. Leave empty to mount job workspace itself",+ m.put("Specify a path relative to job workdir to be used as mount source. Leave empty to mount job workdir itself","指定相对于任务工作区用作挂载源的路径。留空以挂载任务工作区本身");m.put("Specify a secret to be used as access token to create issue in above project if it is not publicly accessible","如果上述项目不是公开可访问的,指定一个用作访问令牌的密钥以在其中创建工单");@@ -3524,8 +3525,8 @@ public class Translation_zh extends TranslationResourceBundle {m.put("Specify application (client) ID of the app registered in Entra ID", "指定在 Entra ID 中注册的应用程序(客户端)ID");m.put("Specify arguments for imagetools. For instance <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 manifest digest> myorg/myrepo@<amd64 manifest digest></code>","指定 imagetools 的参数。例如 <code>create -t myorg/myrepo:1.0.0 myorg/myrepo@<arm64 清单摘要> myorg/myrepo@<amd64 清单摘要></code>");- m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. Only published artifacts (via artifact publish step) can be retrieved.",- "指定要拷贝到 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的制品。只能拷贝已发布的制品(通过制品发布步骤)。");+ m.put("Specify artifacts to retrieve into <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. Only published artifacts (via artifact publish step) can be retrieved.",+ "指定要拷贝到 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的制品。只能拷贝已发布的制品(通过制品发布步骤)。");m.put("Specify at least 10 alphanumeric chars to be used as secret, and then add an inbound parse entry at SendGrid side:<ul><li><code>Destination URL</code> should be set to <i><OneDev root url>/~sendgrid/<secret></i>, for instance, <i>https://onedev.example.com/~sendgrid/1234567890</i>. Note that in production environment, <a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>https should be enabled</a> to protect the secret</li><li><code>Receiving domain</code> should be the same as domain part of system email address specified above</li><li>Option <code>POST the raw, full MIME message</code> is enabled</li></ul>","指定至少 10 个字母数字字符作为密钥,然后在 SendGrid 端添加入站解析条目:<ul><li><code>目标 URL</code> 应设置为 <i><OneDev 根 URL>/~sendgrid/<密钥></i>,例如 <i>https://onedev.example.com/~sendgrid/1234567890</i>。注意在生产环境中,应<a href='https://docs.onedev.io/administration-guide/https-setup' target='_blank'>启用 https</a> 以保护密钥</li><li><code>接收域名</code> 应与上面指定的系统电子邮件地址的域名部分相同</li><li>启用选项 <code>POST 原始完整 MIME 消息</code></li></ul>");m.put("Specify base nodes for user search. For example: <i>cn=Users, dc=example, dc=com</i>",@@ -3541,13 +3542,13 @@ public class Translation_zh extends TranslationResourceBundle {"如果您对远程仓库使用自签名证书,请指定要信任的证书");m.put("Specify certificates to trust if you are using self-signed certificates for your docker registries","如果您对 Docker 注册表使用自签名证书,请指定要信任的证书");- m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的 checkstyle 结果 xml 文件,例如 <tt>target/checkstyle-result.xml</tt>。参考 <a href='https://checkstyle.org/'>checkstyle 文档</a> 了解如何生成结果 xml 文件。使用 * 或 ? 进行模式匹配");+ m.put("Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/checkstyle-result.xml</tt>. Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> on how to generate the result xml file. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的 checkstyle 结果 xml 文件,例如 <tt>target/checkstyle-result.xml</tt>。参考 <a href='https://checkstyle.org/'>checkstyle 文档</a> 了解如何生成结果 xml 文件。使用 * 或 ? 进行模式匹配");m.put("Specify client secret of the app registered in Entra ID", "指定在 Entra ID 中注册的应用程序的客户端密钥");- m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的 clover 覆盖率 xml 报告文件,例如 <tt>target/site/clover/clover.xml</tt>。参考 <a href='https://openclover.org/documentation'>OpenClover 文档</a> 了解如何生成 clover xml 文件。使用 * 或 ? 进行模式匹配");- m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的 cobertura 覆盖率 xml 报告文件,例如 <tt>target/site/cobertura/coverage.xml</tt>。使用 * 或 ? 进行模式匹配");+ m.put("Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/clover/clover.xml</tt>. Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> on how to generate clover xml file. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的 clover 覆盖率 xml 报告文件,例如 <tt>target/site/clover/clover.xml</tt>。参考 <a href='https://openclover.org/documentation'>OpenClover 文档</a> 了解如何生成 clover xml 文件。使用 * 或 ? 进行模式匹配");+ m.put("Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的 cobertura 覆盖率 xml 报告文件,例如 <tt>target/site/cobertura/coverage.xml</tt>。使用 * 或 ? 进行模式匹配");m.put("Specify color of the state for displaying purpose", "指定状态的显示颜色");m.put("Specify columns of the board. Each column corresponds to a value of the issue field specified above","指定看板的列。每列对应于上面指定的工单字段的一个值");@@ -3560,8 +3561,8 @@ public class Translation_zh extends TranslationResourceBundle {"指定您的 OpenID 提供者的配置发现 URL,例如:<code>https://openid.example.com/.well-known/openid-configuration</code>。确保使用 HTTPS 协议,因为 OneDev 依赖 TLS 加密来确保令牌有效性");m.put("Specify container image to execute commands inside", "指定用于执行命令的容器镜像");m.put("Specify container image to run", "指定要运行的容器镜像");- m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的 cppcheck xml 结果文件。此文件可以通过 cppcheck xml 输出选项生成,例如 <code>cppcheck src --xml 2>check-result.xml</code>。使用 * 或 ? 进行模式匹配");+ m.put("Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的 cppcheck xml 结果文件。此文件可以通过 cppcheck xml 输出选项生成,例如 <code>cppcheck src --xml 2>check-result.xml</code>。使用 * 或 ? 进行模式匹配");m.put("Specify cpu request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","指定使用此执行器的每个任务/服务的 CPU 请求。查看 <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes 资源管理</a> 了解详情");m.put("Specify default assignees of pull requests submitted to this project. Only users with the write code permission to the project can be selected",@@ -3570,8 +3571,8 @@ public class Translation_zh extends TranslationResourceBundle {m.put("Specify destinations, for instance <tt>registry-server:5000/myorg/myrepo:latest</tt>. Make sure to use <b>same host</b> as specified in server url of system settings if you want to push to built-in registry, or simply use the form <tt>@server@/<project path>/<repo name>:<tag name></tt>. Multiple destinations should be separated with space","指定目标,例如 <tt>registry-server:5000/myorg/myrepo:latest</tt>。如果要推送到内置注册表,请确保使用与系统设置中服务器 URL 指定的<b>相同主机</b>,或者简单地使用格式 <tt>@server@/<项目路径>/<仓库名称>:<标签名称></tt>。多个目标应以空格分隔");m.put("Specify directory (tenant) ID of the app registered in Entra ID", "指定在 Entra ID 中注册的应用程序的目录(租户)ID");- m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>任务工作区</a> 的目录以存储 OCI 布局");+ m.put("Specify directory relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>任务工作区</a> 的目录以存储 OCI 布局");m.put("Specify docker image of the service", "指定服务的 Docker 镜像");m.put("Specify dockerx builder used to build docker image. OneDev will create the builder automatically if it does not exist. Check <a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>this tutorial</a> on how to customize the builder for instance to allow publishing to insecure registries","指定用于构建 Docker 镜像的 dockerx 构建器。如果不存在,OneDev 将自动创建构建器。查看<a href='https://docs.onedev.io/tutorials/cicd/insecure-docker-registry' target='_blank'>此教程</a>了解如何自定义构建器,例如允许发布到不安全的注册表");@@ -3582,10 +3583,10 @@ public class Translation_zh extends TranslationResourceBundle {"指定由 Renovate 创建的各种工单的字段以协调依赖更新");m.put("Specify fields to be displayed in the issue list", "指定要在工单列表中显示的字段");m.put("Specify fields to display in board card", "指定在看板卡片中显示的字段");- m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 要发布的文件。使用 * 或 ? 进行模式匹配");- m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "指定要创建 md5 校验和的文件。多个文件应以空格分隔。接受 <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> 模式。非绝对路径文件被视为相对于 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>任务工作区</a>");+ m.put("Specify files relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 要发布的文件。使用 * 或 ? 进行模式匹配");+ m.put("Specify files to create md5 checksum from. Multiple files should be separated by space. <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> patterns accepted. Non-absolute file is considered to be relative to <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "指定要创建 md5 校验和的文件。多个文件应以空格分隔。接受 <a href='https://www.linuxjournal.com/content/globstar-new-bash-globbing-option' target='_blank'>Globstar</a> 模式。非绝对路径文件被视为相对于 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>任务工作区</a>");m.put("Specify files under above directory to be published", "指定要发布的目录下的文件");m.put("Specify files under above directory to be published. Use * or ? for pattern match. <b>NOTE:</b> <code>index.html</code> should be included in these files to be served as site start page","指定要发布的上述目录下的文件。使用 * 或 ? 进行模式匹配。<b>注意:</b>这些文件中应包含 <code>index.html</code> 作为站点起始页");@@ -3629,8 +3630,8 @@ public class Translation_zh extends TranslationResourceBundle {m.put("Specify manager DN to authenticate OneDev itself to Active Directory. The manager DN should be specified in form of <i><account name>@<domain></i>, for instance: <i>[email protected]</i>","指定管理器 DN 以将 OneDev 自身认证到 Active Directory。管理器 DN 应以 <i><账户名>@<域名></i> 的形式指定,例如:<i>[email protected]</i>");m.put("Specify manager DN to authenticate OneDev itself to LDAP server", "指定用于 OneDev 向 LDAP 服务器进行身份验证的管理者 DN");- m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的 markdown 文件以进行发布");+ m.put("Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的 markdown 文件以进行发布");m.put("Specify max git LFS file size in mega bytes", "指定 Git LFS 文件的最大大小(以兆字节为单位)");m.put("Specify max number of CPU intensive tasks the server can run concurrently, such as Git repository pull/push, repository index, etc.","指定服务器可并发运行的 CPU 密集型任务的最大数量,例如 Git 仓库拉取/推送、仓库索引等");@@ -3646,8 +3647,8 @@ public class Translation_zh extends TranslationResourceBundle {"指定通过 Web 界面上传文件的最大大小(以兆字节为单位)。这适用于上传到仓库的文件、markdown 内容(工单评论等)以及构建产物");m.put("Specify memory request for each job/service using this executor. Check <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes resource management</a> for details","指定使用此执行器的每个任务/服务的内存请求。详情请查看 <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' target='_blank'>Kubernetes 资源管理</a>");- m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的 mypy 输出文件。此文件可通过重定向 mypy 输出生成,且<b>不使用 '--pretty' 选项</b>,例如 <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>。使用 * 或 ? 进行模式匹配");+ m.put("Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的 mypy 输出文件。此文件可通过重定向 mypy 输出生成,且<b>不使用 '--pretty' 选项</b>,例如 <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>。使用 * 或 ? 进行模式匹配");m.put("Specify name of the branch", "指定分支名称");m.put("Specify name of the environment variable", "指定环境变量名称");m.put("Specify name of the iteration", "指定迭代名称");@@ -3670,23 +3671,23 @@ public class Translation_zh extends TranslationResourceBundle {m.put("Specify project to run job in", "指定要运行任务的项目");m.put("Specify projects", "指定项目");m.put("Specify projects to update dependencies. Leave empty for current project", "指定要更新依赖的项目。留空表示当前项目");- m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的 pylint JSON 结果文件。此文件可使用 pylint JSON 输出格式选项生成,例如 <code>--exit-zero --output-format=json:pylint-result.json</code>。注意,违反规则时我们不会使 pylint 命令失败,因为此步骤将根据配置的阈值使构建失败。使用 * 或 ? 进行模式匹配");+ m.put("Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的 pylint JSON 结果文件。此文件可使用 pylint JSON 输出格式选项生成,例如 <code>--exit-zero --output-format=json:pylint-result.json</code>。注意,违反规则时我们不会使 pylint 命令失败,因为此步骤将根据配置的阈值使构建失败。使用 * 或 ? 进行模式匹配");m.put("Specify registry logins if necessary. For built-in registry, use <code>@server_url@</code> for registry url, <code>@job_token@</code> for user name, and access token for password","如有必要,指定注册表登录信息。对于内置注册表,使用 <code>@server_url@</code> 作为注册表 URL,<code>@job_token@</code> 作为用户名,访问令牌作为密码");m.put("Specify registry url. Leave empty for official registry", "指定注册表 URL。留空表示官方注册表");- m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a> to store OCI layout",- "指定在 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>任务工作区</a> 下存储 OCI 布局的相对路径");+ m.put("Specify relative path under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a> to store OCI layout",+ "指定在 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>任务工作区</a> 下存储 OCI 布局的相对路径");m.put("Specify repositories", "指定仓库");m.put("Specify required reviewers if specified path is changed. Note that the user submitting the change is considered to reviewed the change automatically","指定更改指定路径时所需的审阅者。注意,提交更改的用户被视为已自动审阅该更改");m.put("Specify root URL to access this server", "指定访问此服务器的根 URL");- m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的 ruff JSON 结果文件。此文件可使用 ruff JSON 输出格式选项生成,例如 <code>--exit-zero --output-format json --output-file ruff-result.json</code>。注意,违反规则时我们不会使 ruff 命令失败,因为此步骤将根据配置的阈值使构建失败。使用 * 或 ? 进行模式匹配");- m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "指定在 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>任务工作区</a> 下执行的 shell 命令(在 Linux/Unix 上)或批处理命令(在 Windows 上)");- m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "指定在 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>任务工作区</a> 下执行的 shell 命令");+ m.put("Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的 ruff JSON 结果文件。此文件可使用 ruff JSON 输出格式选项生成,例如 <code>--exit-zero --output-format json --output-file ruff-result.json</code>。注意,违反规则时我们不会使 ruff 命令失败,因为此步骤将根据配置的阈值使构建失败。使用 * 或 ? 进行模式匹配");+ m.put("Specify shell commands (on Linux/Unix) or batch commands (on Windows) to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "指定在 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>任务工作区</a> 下执行的 shell 命令(在 Linux/Unix 上)或批处理命令(在 Windows 上)");+ m.put("Specify shell commands to execute under the <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "指定在 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>任务工作区</a> 下执行的 shell 命令");m.put("Specify shell to be used", "指定要使用的 shell");m.put("Specify source param for SCP command, for instance <code>app.tar.gz</code>", "指定 SCP 命令的源参数,例如 <code>app.tar.gz</code>");m.put("Specify space separated refs to pull from remote. '*' can be used in ref name for wildcard match<br><b class='text-danger'>NOTE:</b> branch/tag protection rule will be ignored when update branches/tags via this step",@@ -3705,10 +3706,10 @@ public class Translation_zh extends TranslationResourceBundle {"指定适用于此条目的以空格分隔的发送者电子邮件地址。使用 '*' 或 '?' 进行通配符匹配。以 '-' 为前缀表示排除。留空表示匹配所有发送者");m.put("Specify space-separated tags to be protected. Use '**', '*' or '?' for <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>path wildcard match</a>. Prefix with '-' to exclude","指定要保护的以空格分隔的标签。使用 '**'、'*' 或 '?' 进行 <a href='https://docs.onedev.io/appendix/path-wildcard' target='_blank'>路径通配符匹配</a>。以 '-' 为前缀表示排除");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: <tt>manual/index.md</tt>",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的报告起始页面,例如:<tt>manual/index.md</tt>");- m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: api/index.html",- "指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的报告起始页面,例如:api/index.html");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: <tt>manual/index.md</tt>",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的报告起始页面,例如:<tt>manual/index.md</tt>");+ m.put("Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: api/index.html",+ "指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的报告起始页面,例如:api/index.html");m.put("Specify storage size to request for the build volume. The size should conform to <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>Kubernetes resource capacity format</a>, for instance <i>10Gi</i>","指定为构建卷请求的存储大小。大小应符合 <a href='https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#setting-requests-and-limits-for-local-ephemeral-storage' target='_blank'>Kubernetes 资源容量格式</a>,例如 <i>10Gi</i>");m.put("Specify tab width used to calculate column value of found problems in provided report",@@ -3794,8 +3795,8 @@ public class Translation_zh extends TranslationResourceBundle {m.put("Step Templates", "步骤模板");m.put("Step {0} of {1}: ", "步骤 {0}/{1}:");m.put("Steps", "步骤");- m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>",- "步骤将在同一节点上按顺序执行,共享同一 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a>");+ m.put("Steps will be executed serially on same node, sharing the same <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>",+ "步骤将在同一节点上按顺序执行,共享同一 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a>");m.put("Stop", "停止");m.put("Stop work", "停止工作");m.put("Stopwatch Overdue", "秒表逾期");@@ -4033,9 +4034,9 @@ public class Translation_zh extends TranslationResourceBundle {m.put("This shows number of issues in various states over time", "显示不同状态的工单数量");m.put("This shows number of open and merged pull requests over time", "此图表显示打开和合并的合并请求的数量");m.put("This step can only be executed by a docker aware executor", "此步骤只能由支持 Docker 的执行器执行");- m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>job workspace</a>",- "此步骤只能由支持 Docker 的执行器执行。它在 <a href='https://docs.onedev.io/concepts#job-workspace' target='_blank'>任务工作区</a> 下运行");- m.put("This step copies files from job workspace to build artifacts directory, so that they can be accessed after job is completed",+ m.put("This step can only be executed by a docker aware executor. It runs under <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>job workdir</a>",+ "此步骤只能由支持 Docker 的执行器执行。它在 <a href='https://docs.onedev.io/concepts#job-workdir' target='_blank'>任务工作区</a> 下运行");+ m.put("This step copies files from job workdir to build artifacts directory, so that they can be accessed after job is completed","此步骤将文件从作业工作区复制到构建工件目录,以便在作业完成后可以访问它们");m.put("This step publishes specified files to be served as project web site. Project web site can be accessed publicly via <code>http://<onedev base url>/path/to/project/~site</code>","此步骤发布指定文件作为项目网站。项目网站可以通过 <code>http://<onedev 基础 url>/path/to/project/~site</code> 公开访问");@@ -4753,8 +4754,8 @@ public class Translation_zh extends TranslationResourceBundle {"可选指定适用于提交信息页脚检查的提交类型(按 ENTER 键添加值)。留空以适用于所有类型");m.put("Optionally specify extra options for osv source scanner. Multiple options need to be separated with space","可选指定 osv 源扫描器的额外选项。多个选项需要用空格分隔");- m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",- "可选指定相对于 <a href='https://docs.onedev.io/concepts#job-workspace'>任务工作区</a> 的路径,以用作 trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>密钥配置</a>");+ m.put("Optionally specify path relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be used as trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>secret config</a>",+ "可选指定相对于 <a href='https://docs.onedev.io/concepts#job-workdir'>任务工作区</a> 的路径,以用作 trivy <a href='https://trivy.dev/docs/latest/scanner/secret/#configuration' target='_blank'>密钥配置</a>");m.put("Osv Source Scanner", "Osv 源扫描器");m.put("Run osv scanner to scan project source for vulnerabilities in <a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>various lock files</a>. It can only be executed by docker aware executor.","运行 osv 扫描器以扫描项目源中的漏洞,位于<a href='https://google.github.io/osv-scanner/supported-languages-and-lockfiles/' target='_blank'>各种锁定文件</a>中。它只能由 docker 相关执行器执行。");diff --git a/server-core/src/main/java/io/onedev/server/web/util/NamedWorkspaceQueriesBean.java b/server-core/src/main/java/io/onedev/server/web/util/NamedWorkspaceQueriesBean.javanew file mode 100644index 0000000000..48781d94a4--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/util/NamedWorkspaceQueriesBean.java@@ -0,0 +1,31 @@+package io.onedev.server.web.util;++import java.util.ArrayList;+import java.util.List;++import javax.validation.constraints.NotNull;++import io.onedev.server.annotation.Editable;+import io.onedev.server.annotation.OmitName;+import io.onedev.server.model.support.workspace.NamedWorkspaceQuery;+import io.onedev.server.web.component.savedquery.NamedQueriesBean;++@Editable+public class NamedWorkspaceQueriesBean extends NamedQueriesBean<NamedWorkspaceQuery> {++ private static final long serialVersionUID = 1L;++ private List<NamedWorkspaceQuery> queries = new ArrayList<>();++ @NotNull+ @Editable+ @OmitName+ public List<NamedWorkspaceQuery> getQueries() {+ return queries;+ }++ public void setQueries(List<NamedWorkspaceQuery> queries) {+ this.queries = queries;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/web/util/SuggestionUtils.java b/server-core/src/main/java/io/onedev/server/web/util/SuggestionUtils.javaindex 226102ca82..c827859077 100644--- a/server-core/src/main/java/io/onedev/server/web/util/SuggestionUtils.java+++ b/server-core/src/main/java/io/onedev/server/web/util/SuggestionUtils.java@@ -19,6 +19,7 @@ import java.util.Map;import java.util.Set;import java.util.TreeSet;+import io.onedev.server.service.*;import org.jspecify.annotations.Nullable;import org.apache.commons.lang3.StringUtils;@@ -36,24 +37,12 @@ import io.onedev.server.OneDev;import io.onedev.server.buildspec.BuildSpec;import io.onedev.server.buildspec.job.JobVariable;import io.onedev.server.buildspec.param.spec.ParamSpec;-import io.onedev.server.service.AgentAttributeService;-import io.onedev.server.service.AgentService;-import io.onedev.server.service.BuildService;-import io.onedev.server.service.BuildMetricService;-import io.onedev.server.service.GroupService;-import io.onedev.server.service.IssueService;-import io.onedev.server.service.LabelSpecService;-import io.onedev.server.service.LinkSpecService;-import io.onedev.server.service.PackService;-import io.onedev.server.service.ProjectService;-import io.onedev.server.service.PullRequestService;-import io.onedev.server.service.SettingService;-import io.onedev.server.service.UserService;import io.onedev.server.git.GitUtils;import io.onedev.server.model.AbstractEntity;import io.onedev.server.model.Build;import io.onedev.server.model.LinkSpec;import io.onedev.server.model.Project;+import io.onedev.server.model.support.workspace.spec.WorkspaceSpec;import io.onedev.server.model.support.administration.GroovyScript;import io.onedev.server.model.support.build.JobProperty;import io.onedev.server.model.support.build.JobSecret;@@ -72,6 +61,7 @@ import io.onedev.server.util.facade.UserFacade;import io.onedev.server.util.interpolative.VariableInterpolator;import io.onedev.server.web.asset.emoji.Emojis;import io.onedev.server.web.behavior.inputassist.InputAssistBehavior;+import io.onedev.server.workspace.WorkspaceService;import io.onedev.server.xodus.CommitInfoService;public class SuggestionUtils {@@ -142,6 +132,14 @@ public class SuggestionUtils {suggestions.add(new InputSuggestion("path/to/project:mybranch", "An example branch", null));return suggestions;}++ public static List<InputSuggestion> suggestWorkspaceSpecs(Project project, String matchWith) {+ List<String> names = project.getHierarchyWorkspaceSpecs().stream()+ .map(WorkspaceSpec::getName)+ .sorted()+ .collect(toList());+ return suggest(names, matchWith);+ }public static List<InputSuggestion> suggestTags(@Nullable Project project, String matchWith) {List<InputSuggestion> suggestions = new ArrayList<>();@@ -441,6 +439,29 @@ public class SuggestionUtils {return suggestions;}+ public static List<InputSuggestion> suggestWorkspaces(@Nullable Project project, String matchWith, int count) {+ List<InputSuggestion> suggestions = new ArrayList<>();+ var scopedQuery = ProjectScopedQuery.of(project, matchWith, '#', null);+ if (scopedQuery != null) {+ var subject = SecurityUtils.getSubject();+ for (var session : OneDev.getInstance(WorkspaceService.class)+ .query(subject, scopedQuery.getProject(), scopedQuery.getQuery(), count)) {+ String ref;+ if (project != null && project.equals(scopedQuery.getProject()))+ ref = "#" + session.getNumber();+ else+ ref = session.getProject().getPath() + "#" + session.getNumber();+ suggestions.add(new InputSuggestion(ref, session.getBranch(), null));+ }+ }+ if (suggestions.isEmpty() && matchWith.length() == 0) {+ suggestions.add(new InputSuggestion("path/to/project#100", "An example workspace", null));+ if (project != null)+ suggestions.add(new InputSuggestion("#100", "An example workspace", null));+ }+ return suggestions;+ }+public static List<InputSuggestion> suggestGroups(String matchWith) {List<String> groupNames = OneDev.getInstance(GroupService.class).query().stream()diff --git a/server-core/src/main/java/io/onedev/server/web/websocket/DefaultWebSocketService.java b/server-core/src/main/java/io/onedev/server/web/websocket/DefaultWebSocketService.javaindex 35e9d14db8..44c00b922c 100644--- a/server-core/src/main/java/io/onedev/server/web/websocket/DefaultWebSocketService.java+++ b/server-core/src/main/java/io/onedev/server/web/websocket/DefaultWebSocketService.java@@ -164,19 +164,23 @@ public class DefaultWebSocketService implements WebSocketService, SessionListene@Overridepublic void run() {clusterService.submitToAllServers(() -> {- for (var observable: observables)- notifiedObservables.put(observable, new Pair<>(sourcePageKey, new Date()));- for (IWebSocketConnection connection: getConnectionRegistry().getConnections(application)) {- PageKey pageKey = ((WebSocketConnection) connection).getPageKey();- if (sourcePageKey == null || !sourcePageKey.equals(pageKey)) {- Collection<String> registeredObservables = getRegisteredObservables(connection);- if (registeredObservables != null) {- var registeredChangedObservables =- filterObservables(registeredObservables, observables);- if (!registeredChangedObservables.isEmpty())- notifyObservablesChange(connection, registeredChangedObservables);+ try {+ for (var observable: observables)+ notifiedObservables.put(observable, new Pair<>(sourcePageKey, new Date()));+ for (IWebSocketConnection connection: getConnectionRegistry().getConnections(application)) {+ PageKey pageKey = ((WebSocketConnection) connection).getPageKey();+ if (sourcePageKey == null || !sourcePageKey.equals(pageKey)) {+ Collection<String> registeredObservables = getRegisteredObservables(connection);+ if (registeredObservables != null) {+ var registeredChangedObservables =+ filterObservables(registeredObservables, observables);+ if (!registeredChangedObservables.isEmpty())+ notifyObservablesChange(connection, registeredChangedObservables);+ }}}+ } catch (Throwable t) {+ logger.error("Error notifying observables change", t);}return null;});diff --git a/server-core/src/main/java/io/onedev/server/web/websocket/WorkspaceEventBroadcaster.java b/server-core/src/main/java/io/onedev/server/web/websocket/WorkspaceEventBroadcaster.javanew file mode 100644index 0000000000..f9df42ba8d--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/web/websocket/WorkspaceEventBroadcaster.java@@ -0,0 +1,32 @@+package io.onedev.server.web.websocket;++import java.util.Set;++import javax.inject.Inject;+import javax.inject.Singleton;++import io.onedev.server.event.Listen;+import io.onedev.server.event.project.workspace.WorkspaceActive;+import io.onedev.server.event.project.workspace.WorkspaceError;++@Singleton+public class WorkspaceEventBroadcaster {++ private final WebSocketService webSocketService;++ @Inject+ public WorkspaceEventBroadcaster(WebSocketService webSocketService) {+ this.webSocketService = webSocketService;+ }++ @Listen+ public void on(WorkspaceActive event) {+ webSocketService.notifyObservablesChange(Set.of(event.getWorkspace().getStatusChangeObservable()), event.getSourcePage());+ }++ @Listen+ public void on(WorkspaceError event) {+ webSocketService.notifyObservablesChange(Set.of(event.getWorkspace().getStatusChangeObservable()), event.getSourcePage());+ }++}diff --git a/server-core/src/main/java/io/onedev/server/workspace/DefaultWorkspaceQueryPersonalizationService.java b/server-core/src/main/java/io/onedev/server/workspace/DefaultWorkspaceQueryPersonalizationService.javanew file mode 100644index 0000000000..2d58eb3d88--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/workspace/DefaultWorkspaceQueryPersonalizationService.java@@ -0,0 +1,51 @@+package io.onedev.server.workspace;++import java.util.Collection;+import java.util.HashSet;+import java.util.stream.Collectors;++import javax.inject.Singleton;++import org.hibernate.criterion.Restrictions;++import io.onedev.server.model.WorkspaceQueryPersonalization;+import io.onedev.server.model.Project;+import io.onedev.server.model.User;+import io.onedev.server.model.support.NamedQuery;+import io.onedev.server.persistence.annotation.Sessional;+import io.onedev.server.persistence.annotation.Transactional;+import io.onedev.server.persistence.dao.EntityCriteria;+import io.onedev.server.service.impl.BaseEntityService;++@Singleton+public class DefaultWorkspaceQueryPersonalizationService extends BaseEntityService<WorkspaceQueryPersonalization>+ implements WorkspaceQueryPersonalizationService {++ @Sessional+ @Override+ public WorkspaceQueryPersonalization find(Project project, User user) {+ EntityCriteria<WorkspaceQueryPersonalization> criteria = newCriteria();+ criteria.add(Restrictions.and(Restrictions.eq("project", project), Restrictions.eq("user", user)));+ criteria.setCacheable(true);+ return find(criteria);+ }++ @Transactional+ @Override+ public void createOrUpdate(WorkspaceQueryPersonalization personalization) {+ Collection<String> retainNames = new HashSet<>();+ retainNames.addAll(personalization.getQueries().stream()+ .map(it -> NamedQuery.PERSONAL_NAME_PREFIX + it.getName()).collect(Collectors.toSet()));+ retainNames.addAll(personalization.getProject().getNamedWorkspaceQueries().stream()+ .map(it -> NamedQuery.COMMON_NAME_PREFIX + it.getName()).collect(Collectors.toSet()));+ personalization.getQuerySubscriptionSupport().getQuerySubscriptions().retainAll(retainNames);++ if (personalization.getQuerySubscriptionSupport().getQuerySubscriptions().isEmpty() && personalization.getQueries().isEmpty()) {+ if (!personalization.isNew())+ delete(personalization);+ } else {+ dao.persist(personalization);+ }+ }++}diff --git a/server-core/src/main/java/io/onedev/server/workspace/DefaultWorkspaceService.java b/server-core/src/main/java/io/onedev/server/workspace/DefaultWorkspaceService.javanew file mode 100644index 0000000000..0fc485e95c--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/workspace/DefaultWorkspaceService.java@@ -0,0 +1,1149 @@+package io.onedev.server.workspace;++import static io.onedev.server.search.entity.EntitySort.Direction.ASCENDING;+import static io.onedev.server.util.DirectoryVersionUtils.readVersion;+import static io.onedev.server.util.DirectoryVersionUtils.writeVersion;+import static java.util.stream.Collectors.toMap;++import java.io.ByteArrayOutputStream;+import java.io.File;+import java.io.IOException;+import java.io.ObjectStreamException;+import java.io.Serializable;+import java.io.UncheckedIOException;+import java.util.ArrayDeque;+import java.util.ArrayList;+import java.util.Arrays;+import java.util.Collection;+import java.util.Date;+import java.util.HashMap;+import java.util.List;+import java.util.Map;+import java.util.Objects;+import java.util.concurrent.ConcurrentHashMap;+import java.util.concurrent.ExecutionException;+import java.util.concurrent.ExecutorService;+import java.util.concurrent.Future;+import java.util.concurrent.atomic.AtomicReference;+import java.util.stream.Collectors;++import javax.inject.Inject;+import javax.inject.Singleton;+import javax.persistence.criteria.CriteriaBuilder;+import javax.persistence.criteria.CriteriaQuery;+import javax.persistence.criteria.From;+import javax.persistence.criteria.Order;+import javax.persistence.criteria.Path;+import javax.persistence.criteria.Predicate;+import javax.persistence.criteria.Root;+import javax.servlet.http.HttpServletRequest;++import org.apache.shiro.subject.Subject;+import org.apache.wicket.protocol.ws.api.IWebSocketConnection;+import org.hibernate.criterion.Restrictions;+import org.hibernate.query.Query;+import org.jspecify.annotations.Nullable;+import org.quartz.ScheduleBuilder;+import org.quartz.SimpleScheduleBuilder;+import org.slf4j.Logger;+import org.slf4j.LoggerFactory;++import com.google.common.base.Preconditions;++import io.onedev.agent.AgentUtils;+import io.onedev.commons.loader.ManagedSerializedForm;+import io.onedev.commons.utils.ExceptionUtils;+import io.onedev.commons.utils.ExplicitException;+import io.onedev.commons.utils.FileUtils;+import io.onedev.commons.utils.TaskLogger;+import io.onedev.commons.utils.command.Commandline;+import io.onedev.commons.utils.command.LineConsumer;+import io.onedev.commons.utils.match.WildcardUtils;+import io.onedev.k8shelper.DefaultCloneInfo;+import io.onedev.k8shelper.KubernetesHelper;+import io.onedev.server.OneDev;+import io.onedev.server.buildspec.job.EnvVar;+import io.onedev.server.cluster.ClusterService;+import io.onedev.server.cluster.ClusterTask;+import io.onedev.server.event.Listen;+import io.onedev.server.event.ListenerRegistry;+import io.onedev.server.event.entity.EntityRemoved;+import io.onedev.server.event.project.workspace.WorkspaceActive;+import io.onedev.server.event.project.workspace.WorkspaceCreated;+import io.onedev.server.event.project.workspace.WorkspaceError;+import io.onedev.server.event.system.SystemStarted;+import io.onedev.server.event.system.SystemStopping;+import io.onedev.server.exception.ServerNotFoundException;+import io.onedev.server.git.CommandUtils;+import io.onedev.server.git.GitTask;+import io.onedev.server.git.hook.HookUtils;+import io.onedev.server.logging.LogService;+import io.onedev.server.model.AbstractEntity;+import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.Workspace.Status;+import io.onedev.server.model.support.administration.workspaceprovisioner.WorkspaceProvisioner;+import io.onedev.server.persistence.SequenceGenerator;+import io.onedev.server.persistence.SessionService;+import io.onedev.server.persistence.TransactionService;+import io.onedev.server.persistence.annotation.Sessional;+import io.onedev.server.persistence.annotation.Transactional;+import io.onedev.server.persistence.dao.EntityCriteria;+import io.onedev.server.search.entity.EntityQuery;+import io.onedev.server.search.entity.EntitySort;+import io.onedev.server.search.entity.workspace.WorkspaceQuery;+import io.onedev.server.security.CodePullAuthorizationSource;+import io.onedev.server.security.CodePushAuthorizationSource;+import io.onedev.server.security.SecurityUtils;+import io.onedev.server.security.permission.WriteCode;+import io.onedev.server.service.ProjectService;+import io.onedev.server.service.SettingService;+import io.onedev.server.service.UrlService;+import io.onedev.server.service.impl.BaseEntityService;+import io.onedev.server.taskschedule.SchedulableTask;+import io.onedev.server.taskschedule.TaskScheduler;+import io.onedev.server.terminal.Terminal;+import io.onedev.server.util.FileData;+import io.onedev.server.util.ProjectWorkspaceStatusStat;+import io.onedev.server.util.concurrent.DynamicSemaphore;+import io.onedev.server.util.criteria.Criteria;+import io.onedev.server.web.component.terminal.ShellExit;+import oshi.SystemInfo;++@Singleton+public class DefaultWorkspaceService extends BaseEntityService<Workspace>+ implements WorkspaceService, Runnable, SchedulableTask, CodePullAuthorizationSource, CodePushAuthorizationSource, Serializable {++ private static final long serialVersionUID = 1L;++ private static final Logger logger = LoggerFactory.getLogger(DefaultWorkspaceService.class);++ private static final int CHECK_INTERVAL = 1000; // check internal in milli-seconds++ @Inject+ private ProjectService projectService;++ @Inject+ private ClusterService clusterService;++ @Inject+ private ListenerRegistry listenerRegistry;++ @Inject+ private LogService logService;++ @Inject+ private SessionService sessionService;++ @Inject+ private SettingService settingService;++ @Inject+ private TransactionService transactionService;++ @Inject+ private UrlService urlService;++ @Inject+ private ExecutorService executorService;++ @Inject+ private TaskScheduler taskScheduler;++ private SequenceGenerator numberGenerator;++ private final Map<String, WorkspaceContext> workspaceContexts = new ConcurrentHashMap<>();++ private final Map<Long, Future<Void>> workspaceFutures = new ConcurrentHashMap<>();++ private final Map<Long, WorkspaceRuntime> workspaceRuntimes = new ConcurrentHashMap<>();++ private final Map<IWebSocketConnection, OutputState> workspaceConnections = new ConcurrentHashMap<>();++ private final Map<String, ReplayBuffer> terminalReplayBuffers = new ConcurrentHashMap<>();++ private final Map<String, DynamicSemaphore> workspaceSemaphores = new ConcurrentHashMap<>();++ private volatile Thread thread;++ private volatile String taskId;++ public Object writeReplace() throws ObjectStreamException {+ return new ManagedSerializedForm(WorkspaceService.class);+ }++ private synchronized SequenceGenerator getNumberGenerator() {+ if (numberGenerator == null)+ numberGenerator = new SequenceGenerator(Workspace.class, clusterService, dao);+ return numberGenerator;+ }++ @Sessional+ @Override+ public Workspace find(Project project, long number) {+ EntityCriteria<Workspace> criteria = newCriteria();+ criteria.add(Restrictions.eq("numberScope", project.getForkRoot()));+ criteria.add(Restrictions.eq(AbstractEntity.PROP_NUMBER, number));+ criteria.setCacheable(true);+ return find(criteria);+ }++ @Transactional+ @Override+ public void create(Workspace workspace) {+ Preconditions.checkArgument(workspace.isNew());+ workspace.setNumberScope(workspace.getProject().getForkRoot());+ workspace.setNumber(getNumberGenerator().getNextSequence(workspace.getNumberScope()));+ dao.persist(workspace);++ var projectId = workspace.getProject().getId();+ var workspaceNumber = workspace.getNumber();+ projectService.runOnActiveServer(projectId, new ClusterTask<Void>() {++ @Override+ public Void call() throws Exception {+ FileUtils.cleanDir(getWorkspaceDir(projectId, workspaceNumber));+ return null;+ }++ });+ listenerRegistry.post(new WorkspaceCreated(workspace));+ }++ @Transactional+ @Override+ public void update(Workspace workspace) {+ Preconditions.checkState(!workspace.isNew());+ dao.persist(workspace);+ }++ @Sessional+ @Listen+ public void on(WorkspaceError event) {+ logService.flush(event.getWorkspace().getLoggingSupport());+ }++ @Transactional+ @Listen+ public void on(EntityRemoved event) {+ if (event.getEntity() instanceof Project) {+ Project project = (Project) event.getEntity();+ if (project.getForkRoot().equals(project))+ getNumberGenerator().removeNextSequence(project);+ }+ }++ private Collection<Predicate> getPredicates(Subject subject, @Nullable Project project,+ From<Workspace, Workspace> root, CriteriaBuilder builder) {+ List<Predicate> predicates = new ArrayList<>();+ if (project != null) {+ predicates.add(builder.equal(root.get(Workspace.PROP_PROJECT), project));+ } else if (!SecurityUtils.isAdministrator(subject)) {+ Collection<Project> projects = SecurityUtils.getAuthorizedProjects(subject, new WriteCode());+ if (!projects.isEmpty()) {+ Path<Long> projectIdPath = root.get(Workspace.PROP_PROJECT).get(Project.PROP_ID);+ predicates.add(Criteria.forManyValues(builder, projectIdPath,+ projects.stream().map(it -> it.getId()).collect(Collectors.toSet()),+ projectService.getIds()));+ } else {+ predicates.add(builder.disjunction());+ }+ }+ return predicates;+ }++ private Predicate[] getPredicates(Subject subject, @Nullable Project project,+ @Nullable Criteria<Workspace> criteria, CriteriaQuery<?> query,+ From<Workspace, Workspace> root, CriteriaBuilder builder) {+ Collection<Predicate> predicates = getPredicates(subject, project, root, builder);+ if (criteria != null)+ predicates.add(criteria.getPredicate(null, query, root, builder));+ return predicates.toArray(new Predicate[0]);+ }++ @Sessional+ @Override+ public List<Workspace> query(Subject subject, @Nullable Project project, String numberQuery, int count) {+ CriteriaBuilder builder = getSession().getCriteriaBuilder();+ CriteriaQuery<Workspace> criteriaQuery = builder.createQuery(Workspace.class);+ Root<Workspace> root = criteriaQuery.from(Workspace.class);+ criteriaQuery.select(root);++ Collection<Predicate> predicates = getPredicates(subject, project, root, builder);+ if (!numberQuery.isEmpty()) {+ try {+ predicates.add(builder.equal(root.get(Workspace.PROP_NUMBER), Long.parseLong(numberQuery)));+ } catch (NumberFormatException ignored) {+ predicates.add(builder.disjunction());+ }+ }+ criteriaQuery.where(predicates.toArray(new Predicate[0]));+ criteriaQuery.orderBy(builder.desc(root.get(Workspace.PROP_NUMBER)));++ org.hibernate.query.Query<Workspace> query = getSession().createQuery(criteriaQuery);+ query.setFirstResult(0);+ query.setMaxResults(count);+ return query.getResultList();+ }++ @Sessional+ @Override+ public List<Workspace> query(Subject subject, @Nullable Project project,+ WorkspaceQuery query, int firstResult, int maxResults) {+ CriteriaBuilder builder = getSession().getCriteriaBuilder();+ CriteriaQuery<Workspace> criteriaQuery = builder.createQuery(Workspace.class);+ Root<Workspace> root = criteriaQuery.from(Workspace.class);+ criteriaQuery.select(root);++ criteriaQuery.where(getPredicates(subject, project, query.getCriteria(),+ criteriaQuery, root, builder));++ applyOrders(root, criteriaQuery, builder, query);++ Query<Workspace> hibernateQuery = getSession().createQuery(criteriaQuery);+ hibernateQuery.setFirstResult(firstResult);+ hibernateQuery.setMaxResults(maxResults);+ return hibernateQuery.getResultList();+ }++ @Sessional+ @Override+ public int count(Subject subject, @Nullable Project project, Criteria<Workspace> criteria) {+ CriteriaBuilder builder = getSession().getCriteriaBuilder();+ CriteriaQuery<Long> criteriaQuery = builder.createQuery(Long.class);+ Root<Workspace> root = criteriaQuery.from(Workspace.class);+ criteriaQuery.select(builder.count(root));++ criteriaQuery.where(getPredicates(subject, project, criteria, criteriaQuery, root, builder));++ return getSession().createQuery(criteriaQuery).uniqueResult().intValue();+ }++ @Sessional+ @Override+ public int count(Project project, String branchName) {+ CriteriaBuilder builder = getSession().getCriteriaBuilder();+ CriteriaQuery<Long> criteriaQuery = builder.createQuery(Long.class);+ Root<Workspace> root = criteriaQuery.from(Workspace.class);+ criteriaQuery.select(builder.count(root));+ criteriaQuery.where(builder.and(+ builder.equal(root.get(Workspace.PROP_PROJECT), project),+ builder.equal(root.get(Workspace.PROP_BRANCH), branchName)));+ return getSession().createQuery(criteriaQuery).uniqueResult().intValue();+ }++ @Sessional+ @Override+ public List<ProjectWorkspaceStatusStat> queryStatusStats(Collection<Project> projects) {+ if (projects.isEmpty()) {+ return new ArrayList<>();+ } else {+ CriteriaBuilder builder = getSession().getCriteriaBuilder();+ CriteriaQuery<ProjectWorkspaceStatusStat> criteriaQuery = builder.createQuery(ProjectWorkspaceStatusStat.class);+ Root<Workspace> root = criteriaQuery.from(Workspace.class);+ criteriaQuery.multiselect(+ root.get(Workspace.PROP_PROJECT).get(Project.PROP_ID),+ root.get(Workspace.PROP_STATUS), builder.count(root));+ criteriaQuery.groupBy(root.get(Workspace.PROP_PROJECT), root.get(Workspace.PROP_STATUS));+ criteriaQuery.where(root.get(Workspace.PROP_PROJECT).in(projects));+ criteriaQuery.orderBy(builder.asc(root.get(Workspace.PROP_STATUS)));+ return getSession().createQuery(criteriaQuery).getResultList();+ }+ }++ @Transactional+ @Override+ public void delete(Collection<Workspace> workspaces) {+ for (var workspace : workspaces)+ delete(workspace);+ }++ @Transactional+ @Override+ public void delete(Workspace workspace) {+ var loggingSupport = workspace.getLoggingSupport();+ var projectId = workspace.getProject().getId();+ var workspaceNumber = workspace.getNumber();+ projectService.runOnActiveServer(projectId, new ClusterTask<Void>() {++ @Override+ public Void call() throws Exception {+ logService.flush(loggingSupport);+ FileUtils.deleteDir(getWorkspaceDir(projectId, workspaceNumber));+ return null;+ }++ });+ dao.remove(workspace);+ }++ private void applyOrders(Root<Workspace> root, CriteriaQuery<?> criteriaQuery,+ CriteriaBuilder builder, EntityQuery<Workspace> sessionQuery) {+ List<Order> orders = new ArrayList<>();+ for (EntitySort sort : sessionQuery.getSorts()) {+ var sortField = Workspace.SORT_FIELDS.get(sort.getField());+ if (sort.getDirection() == ASCENDING)+ orders.add(builder.asc(EntityQuery.getPath(root, sortField.getProperty())));+ else+ orders.add(builder.desc(EntityQuery.getPath(root, sortField.getProperty())));+ }+ if (!orders.isEmpty())+ criteriaQuery.orderBy(orders);+ }++ @Listen+ public void on(SystemStarted event) {+ taskId = taskScheduler.schedule(this);+ thread = new Thread(this);+ thread.start();+ }++ @Listen+ public void on(SystemStopping event) {+ if (taskId != null)+ taskScheduler.unschedule(taskId);+ Thread copy = thread;+ thread = null;+ if (copy != null) {+ try {+ copy.join();+ } catch (InterruptedException ignored) {+ }+ }+ }++ @SuppressWarnings("unchecked")+ @Sessional+ protected Map<Long, Long> queryPendingOrActive() {+ Query<?> query = getSession().createQuery("select id, project.id from Workspace where "+ + "status=:pending or status=:active");+ query.setParameter("pending", Workspace.Status.PENDING);+ query.setParameter("active", Workspace.Status.ACTIVE);++ Map<Long, Long> result = new HashMap<>();+ for (Object[] fields: (List<Object[]>)query.list())+ result.put((Long)fields[0], (Long)fields[1]);+ return result;+ }++ @Override+ public void run() {+ var localServer = clusterService.getLocalServerAddress();++ while (!workspaceFutures.isEmpty() || thread != null) {+ if (thread == null) {+ for (var future: workspaceFutures.values())+ future.cancel(true);+ }+ try {+ if (clusterService.isLeaderServer()) {+ Map<String, Collection<Long>> workspaceIds = new HashMap<>();+ for (var entry : queryPendingOrActive().entrySet()) {+ var workspaceId = entry.getKey();+ var projectId = entry.getValue();+ var activeServer = projectService.getActiveServer(projectId, false);+ if (activeServer != null && clusterService.getOnlineServers().contains(activeServer)) {+ var workspaceIdsOfServer = workspaceIds.computeIfAbsent(activeServer, k -> new ArrayList<>());+ workspaceIdsOfServer.add(workspaceId);+ }+ }++ Collection<Future<?>> futures = new ArrayList<>();+ for (var entry : workspaceIds.entrySet()) {+ var server = entry.getKey();+ var workspaceIdsOfServer = entry.getValue();+ futures.add(clusterService.submitToServer(server, () -> {+ try {+ while (thread == null)+ Thread.sleep(1000);+ transactionService.run(() -> {+ for (var workspaceId : workspaceIdsOfServer) {+ var workspace = load(workspaceId);+ if (workspace.getStatus() == Status.PENDING) {+ var future = workspaceFutures.get(workspace.getId());+ if (future == null && thread != null) {+ try {+ workspaceFutures.put(workspace.getId(), provision(workspace));+ } catch (Throwable t) {+ log(logService.newLogger(workspace.getLoggingSupport()), t);+ markWorkspaceError(workspace);+ }+ }+ } else if (workspace.getStatus() == Status.ACTIVE) {+ if (workspaceFutures.get(workspace.getId()) == null) {+ workspace.setActiveDate(null);+ workspace.setStatus(Status.PENDING);+ }+ }+ }+ });+ } catch (Throwable t) {+ logger.error("Error checking pending/active workspaces", t);+ }+ return null;+ }));+ }+ for (var future : futures) {+ try {+ future.get();+ } catch (InterruptedException | ExecutionException e) {+ throw new RuntimeException(e);+ }+ }+ }++ sessionService.run(() -> {+ for (var it = workspaceFutures.entrySet().iterator(); it.hasNext(); ) {+ var entry = it.next();+ var workspace = get(entry.getKey());+ var future = entry.getValue();+ if (workspace == null+ || workspace.getStatus() == Status.ERROR+ || !localServer.equals(projectService.getActiveServer(workspace.getProject().getId(), false))) {+ future.cancel(true);+ it.remove();+ } else if (future.isDone()) {+ var logger = logService.newLogger(workspace.getLoggingSupport());+ try {+ future.get();+ logger.error("Workspace runtime stopped for unknown reason");+ } catch (Throwable t) {+ log(logger, t);+ markWorkspaceError(workspace);+ } finally {+ it.remove();+ }+ }+ }+ });+ Thread.sleep(CHECK_INTERVAL);+ } catch (Throwable t) {+ if (ExceptionUtils.find(t, ServerNotFoundException.class) == null)+ logger.error("Error checking workspaces", t);+ }+ }+ }++ @Override+ public void execute() {+ for (var it = workspaceConnections.entrySet().iterator(); it.hasNext();) {+ if (!it.next().getKey().isOpen())+ it.remove();+ }+ for (var it = terminalReplayBuffers.entrySet().iterator(); it.hasNext();) {+ var terminalKey = it.next().getKey();+ var terminalKeyParts = terminalKey.split(":");+ var workspaceId = Long.parseLong(terminalKeyParts[0]);+ var shellId = terminalKeyParts[1];+ var runtime = workspaceRuntimes.get(workspaceId);+ if (runtime == null || !runtime.getShellIds().contains(shellId))+ it.remove();+ }+ }++ @Override+ public ScheduleBuilder<?> getScheduleBuilder() {+ return SimpleScheduleBuilder.repeatHourlyForever();+ }++ private boolean isApplicable(Workspace workspace, WorkspaceProvisioner provisioner) {+ return provisioner.getApplicableProjects() == null+ || WildcardUtils.matchPath(provisioner.getApplicableProjects(), workspace.getProject().getPath());+ }++ private WorkspaceProvisioner getProvisioner(Workspace workspace, TaskLogger logger) {+ if (!settingService.getWorkspaceProvisioners().isEmpty()) {+ for (var provisioner : settingService.getWorkspaceProvisioners()) {+ if (provisioner.isEnabled() && isApplicable(workspace, provisioner))+ return provisioner;+ }+ throw new ExplicitException("No applicable workspace provisioner");+ } else {+ throw new ExplicitException("No applicable provisioner discovered for current workspace");+ }+ }++ private Future<Void> provision(Workspace workspace) {+ var workspaceSpec = workspace.getProject().getHierarchyWorkspaceSpecs().stream()+ .filter(s -> s.getName().equals(workspace.getSpecName()))+ .findFirst()+ .orElseThrow(() -> new ExplicitException("Spec not found in workspace project hierarchy"));++ String token = workspace.getToken();++ var logger = logService.newLogger(workspace.getLoggingSupport());+ var provisioner = getProvisioner(workspace, logger);++ var project = workspace.getProject();+ var projectId = project.getId();+ var projectPath = project.getPath();+ var projectGitDir = projectService.getGitDir(project.getId()).getAbsolutePath();+ var workspaceId = workspace.getId();+ var workspaceNumber = workspace.getNumber();++ var envVars = workspaceSpec.getEnvVars().stream().collect(toMap(EnvVar::getName, EnvVar::getValue));+ var userConfigs = workspaceSpec.getUserConfigs().stream()+ .collect(toMap(uc -> uc.getPath(), uc -> uc.getContent()));++ var gitEmail = workspace.getUser().getGitEmailAddress();+ if (gitEmail == null)+ throw new ExplicitException("No email address for git operations configured");++ var cloneInfo = new DefaultCloneInfo(urlService.cloneUrlFor(workspace.getProject(), false), token);+ var branch = project.getDefaultBranch() != null? workspace.getBranch(): null;+ var context = new WorkspaceContext(token, projectId, projectPath, projectGitDir, workspaceId,+ workspaceNumber, workspaceSpec.getShell(), envVars, cloneInfo, workspaceSpec.isRetrieveLfs(),+ branch, workspace.getUser().getDisplayName(), gitEmail.getValue(), userConfigs);++ var concurrency = provisioner.getConcurrency();+ if (concurrency == null)+ concurrency = Math.max(1, new SystemInfo().getHardware().getProcessor().getLogicalProcessorCount());+ var semaphore = workspaceSemaphores.computeIfAbsent(provisioner.getName(), k -> new DynamicSemaphore());+ semaphore.setMaxPermits(concurrency);++ logger.log("Waiting for resource allocation...");++ return executorService.submit(() -> {+ workspaceContexts.put(token, context);+ semaphore.acquire();+ try {+ var runtime = provisioner.provision(context, logger);+ workspaceRuntimes.put(context.getWorkspaceId(), runtime);+ try {+ transactionService.run(() -> {+ var innerWorkspace = load(workspaceId);+ innerWorkspace.setStatus(Workspace.Status.ACTIVE);+ innerWorkspace.setActiveDate(new Date());+ update(innerWorkspace);+ listenerRegistry.post(new WorkspaceActive(innerWorkspace));+ });+ logger.success("Workspace provisioned and is active now");++ runtime.await();+ return null;+ } finally {+ for (var shellId : runtime.getShellIds())+ terminateShell(workspaceId, shellId);+ workspaceRuntimes.remove(workspaceId);+ }+ } finally {+ semaphore.release();+ workspaceContexts.remove(token);+ }+ });+ }++ private void markWorkspaceError(Workspace workspace) {+ workspace.setStatus(Workspace.Status.ERROR);+ workspace.setErrorDate(new Date());+ update(workspace);+ listenerRegistry.post(new WorkspaceError(workspace));+ }++ private void log(TaskLogger logger, Throwable throwable) {+ var explicitException = ExceptionUtils.find(throwable, ExplicitException.class);+ if (explicitException != null)+ logger.error(explicitException.getMessage());+ else+ logger.error("Error processing workspace", throwable);+ }++ @Override+ public File getWorkspaceDir(Long projectId, Long workspaceNumber) {+ return projectService.getSubDir(projectId, Workspace.getProjectRelativeDirPath(workspaceNumber));+ }++ @Sessional+ @Override+ public String openShell(Workspace workspace) {+ var projectId = workspace.getProject().getId();+ var workspaceId = workspace.getId();++ return projectService.runOnActiveServer(projectId, new ClusterTask<String>() {++ @Override+ public String call() throws Exception {+ var runtime = workspaceRuntimes.get(workspaceId);+ if (runtime == null)+ throw new ExplicitException("Workspace runtime not found");+ var shellIdRef = new AtomicReference<String>(null);+ shellIdRef.set(runtime.openShell(new Terminal() {++ @Override+ public void onShellOutput(String base64Data) {+ var shellId = shellIdRef.get();+ if (shellId != null)+ // Use runOnAllServers instead of submitToAllServers to preserve output order+ clusterService.runOnAllServers(new HandleShellOutputTask(workspaceId, shellId, base64Data));+ }++ @Override+ public void onShellExit() {+ var shellId = shellIdRef.get();+ if (shellId != null)+ clusterService.submitToAllServers(new HandleShellStopTask(workspaceId, shellId, false));+ }++ }));+ return shellIdRef.get();+ }++ });++ }++ @Sessional+ @Override+ public void onOpen(IWebSocketConnection connection, Workspace workspace, String shellId) {+ var state = new OutputState(workspace.getId(), shellId);+ workspaceConnections.put(connection, state);+ var replayBuffer = terminalReplayBuffers.get(getTerminalKey(workspace.getId(), shellId));+ if (replayBuffer != null) {+ var chunks = replayBuffer.snapshot();+ if (!chunks.isEmpty()) {+ try {+ connection.sendMessage("TERMINAL_REPLAY_START");+ for (var base64Data: chunks)+ connection.sendMessage("SHELL_OUTPUT:" + base64Data);+ connection.sendMessage("TERMINAL_REPLAY_END");+ } catch (Exception e) {+ logger.warn("Error replaying terminal output", e);+ }+ }+ }+ var queuedChunks = state.markReplayCompletedAndGetQueuedChunks();+ if (!queuedChunks.isEmpty()) {+ try {+ for (var base64Data: queuedChunks)+ connection.sendMessage("SHELL_OUTPUT:" + base64Data);+ } catch (Exception e) {+ logger.warn("Error flushing queued terminal output", e);+ }+ }+ }++ @Override+ public void onClose(IWebSocketConnection connection) {+ workspaceConnections.remove(connection);+ }++ @Sessional+ @Override+ public void onMessage(IWebSocketConnection connection, Workspace workspace,+ String shellId, String message) {+ if (message.startsWith("SHELL_INPUT:") || message.startsWith("TERMINAL_RESIZE:")) {+ var workspaceId = workspace.getId();+ var projectId = workspace.getProject().getId();+ projectService.runOnActiveServer(projectId, () -> {+ try {+ var runtime = workspaceRuntimes.get(workspaceId);+ if (runtime != null) {+ if (message.startsWith("SHELL_INPUT:")) {+ runtime.writeShellStdin(shellId, message.substring("SHELL_INPUT:".length()));+ } else {+ var size = message.substring("TERMINAL_RESIZE:".length()).split(",");+ runtime.resizeShell(shellId, Integer.parseInt(size[0]), Integer.parseInt(size[1]));+ }+ }+ } catch (Throwable t) {+ logger.error("Error handling terminal message", t);+ }+ return null;+ });+ }+ }++ @Sessional+ @Override+ public List<String> getShellIds(Workspace workspace) {+ var projectId = workspace.getProject().getId();+ var workspaceId = workspace.getId();++ return projectService.runOnActiveServer(projectId, new ClusterTask<List<String>>() {++ @Override+ public List<String> call() throws Exception {+ var runtime = workspaceRuntimes.get(workspaceId);+ return runtime != null? runtime.getShellIds(): new ArrayList<>();+ }+ });++ }++ private void terminateShell(Long workspaceId, String shellId) {+ var runtime = workspaceRuntimes.get(workspaceId);+ if (runtime != null)+ runtime.terminateShell(shellId);+ clusterService.submitToAllServers(new HandleShellStopTask(workspaceId, shellId, true));+ }++ @Sessional+ @Override+ public void terminateShell(Workspace workspace, String shellId) {+ var workspaceId = workspace.getId();+ var projectId = workspace.getProject().getId();++ projectService.runOnActiveServer(projectId, new ClusterTask<Void>() {++ @Override+ public Void call() throws Exception {+ terminateShell(workspaceId, shellId);+ return null;+ }++ });+ }++ private String getTerminalKey(Long workspaceId, String shellId) {+ return workspaceId + ":" + shellId;+ }++ @Override+ public WorkspaceContext getWorkspaceContext(String token, boolean mustExist) {+ var contextMap = clusterService.runOnAllServers(() -> workspaceContexts.get(token));+ var context = contextMap.values().stream()+ .filter(Objects::nonNull)+ .findFirst()+ .orElse(null);+ if (mustExist && context == null)+ throw new ExplicitException("No workspace context found for specified token");+ return context;+ }++ private boolean isAuthorized(HttpServletRequest request, Project project) {+ String token = SecurityUtils.getBearerToken(request);+ if (token != null) {+ var context = projectService.runOnActiveServer(project.getId(), () -> {+ return workspaceContexts.get(token);+ });+ if (context != null)+ return context.getProjectId().equals(project.getId());+ }+ return false;+ }++ @Override+ public boolean hasLfsObjects(Long projectId, Long workspaceNumber) {+ var workDir = Workspace.getWorkDir(projectId, workspaceNumber);+ var gitDir = new File(workDir, ".git");+ return new File(gitDir, "lfs/objects").exists();+ }++ @Override+ public boolean canPullCode(HttpServletRequest request, Project project) {+ return isAuthorized(request, project);+ }++ @Override+ public boolean canPushCode(HttpServletRequest request, Project project) {+ return isAuthorized(request, project);+ }++ @Override+ public void onPostCommit(WorkspaceContext context) {+ var workspaceDir = getWorkspaceDir(context.getProjectId(), context.getWorkspaceNumber());+ projectService.directoryModified(context.getProjectId(), workspaceDir);+ }++ @Override+ public void syncWorkspaces(Long projectId, String activeServer) {+ projectService.syncDirectory(projectId, Workspace.WORKSPACES_DIR, (suffix) -> {+ projectService.syncDirectory(projectId, Workspace.WORKSPACES_DIR + "/" + suffix, (workspaceNumberStr) -> {+ syncWorkspace(projectId, Long.valueOf(workspaceNumberStr), activeServer);+ }, activeServer);+ }, activeServer);+ }++ private void syncWorkspace(Long projectId, Long workspaceNumber, String activeServer) {+ var workDir = Workspace.getWorkDir(projectId, workspaceNumber);+ var workspaceDir = workDir.getParentFile();+ var gitDir = new File(workDir, ".git");++ var remoteWorkspaceVersion = clusterService.runOnServer(activeServer, () -> {+ var remoteWorkspaceDir = getWorkspaceDir(projectId, workspaceNumber);+ return readVersion(remoteWorkspaceDir);+ });+ var workspaceVersion = readVersion(workspaceDir);+ if (workspaceVersion < remoteWorkspaceVersion) {+ CommandUtils.callWithClusterCredential(new GitTask<Void>() {+ @Override+ public Void call(Commandline git) throws IOException {+ var projectPath = projectService.findFacadeById(projectId).getPath();+ var cloneUrl = clusterService.getServerUrl(activeServer)+ + "/" + projectPath + "/" + GIT_PREFIX + workspaceNumber;+ var debugLogger = new LineConsumer() {+ @Override+ public void consume(String line) {+ logger.debug(line);+ }+ };+ var errorLogger = new LineConsumer() {+ @Override+ public void consume(String line) {+ logger.error(line);+ }+ };++ if (clusterService.runOnServer(activeServer, new HasLfsObjectsTask(projectId, workspaceNumber)))+ KubernetesHelper.installGitLfs(git, debugLogger, errorLogger);++ if (!gitDir.exists()) {+ FileUtils.deleteDir(workDir);+ git.addArgs("clone", cloneUrl, workDir.getAbsolutePath());+ git.execute(debugLogger, new LineConsumer() {+ @Override+ public void consume(String line) {+ if (!line.startsWith("Cloning into"))+ logger.error(line);+ else+ logger.debug(line);+ }+ }).checkReturnCode();+ git.clearArgs();+ } else {+ git.addArgs("ls-remote", "--symref", cloneUrl, "HEAD");+ var branchRef = new AtomicReference<String>();+ git.execute(new LineConsumer() {+ @Override+ public void consume(String line) {+ if (line.startsWith("ref: refs/heads/"))+ branchRef.set(line.substring("ref: refs/heads/".length()).split("\\t")[0]);+ }+ }, errorLogger).checkReturnCode();+ git.clearArgs();++ var branch = branchRef.get();+ if (branch != null) {+ git.workingDir(workDir);++ git.addArgs("remote", "set-url", "origin", cloneUrl);+ git.execute(debugLogger, errorLogger).checkReturnCode();+ git.clearArgs();++ git.addArgs("fetch", "origin", "refs/heads/" + branch);+ git.execute(debugLogger, new LineConsumer() {+ @Override+ public void consume(String line) {+ if (!line.startsWith("From") && !line.contains("->"))+ logger.error(line);+ else+ logger.debug(line);+ }+ }).checkReturnCode();+ git.clearArgs();++ git.addArgs("checkout", "-f", "-B", branch, "FETCH_HEAD");+ git.execute(debugLogger, new LineConsumer() {+ @Override+ public void consume(String line) {+ if (!line.startsWith("Reset branch") && !line.startsWith("Switched to"))+ logger.error(line);+ }+ }).checkReturnCode();+ git.clearArgs();+ }+ }+ return null;+ }+ });++ writeVersion(workspaceDir, remoteWorkspaceVersion);+ }+ }++ @Sessional+ @Override+ public GitExecutionResult executeGitCommand(Workspace workspace, String[] gitArgs) {+ var projectId = workspace.getProject().getId();+ var workspaceNumber = workspace.getNumber();+ var workspaceToken = workspace.getToken();+ return projectService.runOnActiveServer(projectId, () -> {+ var git = CommandUtils.newGit();+ var workDir = Workspace.getWorkDir(projectId, workspaceNumber);+ git.workingDir(workDir);+ git.environments().putAll(HookUtils.getWorkspacePostCommitHookEnvs(workspaceToken));+ git.arguments(Arrays.asList(gitArgs));++ var stdoutStream = new ByteArrayOutputStream();+ var stderrStream = new ByteArrayOutputStream();+ var returnCode = git.execute(stdoutStream, stderrStream).getReturnCode();+ return new GitExecutionResult(stdoutStream.toByteArray(), stderrStream.toByteArray(), returnCode);+ });+ }++ @Sessional+ @Override+ public FileData readFileData(Workspace workspace, String path) {+ var projectId = workspace.getProject().getId();+ var workspaceNumber = workspace.getNumber();+ return projectService.runOnActiveServer(projectId, () -> {+ var workDir = Workspace.getWorkDir(projectId, workspaceNumber);+ try {+ return FileData.from(new File(workDir, path));+ } catch (IOException e) {+ throw new UncheckedIOException(e);+ }+ });+ }++ private static class HandleShellOutputTask implements ClusterTask<Void> {++ private static final long serialVersionUID = 1L;++ private final Long workspaceId;++ private final String shellId;++ private final String base64Data;++ public HandleShellOutputTask(Long workspaceId, String shellId, String base64Data) {+ this.workspaceId = workspaceId;+ this.shellId = shellId;+ this.base64Data = base64Data;+ }++ @Override+ public Void call() throws Exception {+ var workspaceService = OneDev.getInstance(DefaultWorkspaceService.class);+ workspaceService.terminalReplayBuffers+ .computeIfAbsent(workspaceService.getTerminalKey(workspaceId, shellId), key -> new ReplayBuffer())+ .append(base64Data);++ var connections = workspaceService.workspaceConnections;++ for (var entry : connections.entrySet()) {+ var connection = entry.getKey();+ var state = entry.getValue();+ if (state.matches(workspaceId, shellId) && !state.queueIfReplaying(base64Data))+ connection.sendMessage("SHELL_OUTPUT:" + base64Data);+ }+ return null;+ }++ }++ private static class HandleShellStopTask implements ClusterTask<Void> {++ private static final long serialVersionUID = 1L;++ private final Long workspaceId;++ private final String shellId;++ private final boolean terminated;++ /**+ * @param workspaceId+ * @param shellId+ * @param terminated whether or not the shell is terminated by closing terminal tab+ */+ public HandleShellStopTask(Long workspaceId, String shellId, boolean terminated) {+ this.workspaceId = workspaceId;+ this.shellId = shellId;+ this.terminated = terminated;+ }++ @Override+ public Void call() throws Exception {+ var workspaceService = OneDev.getInstance(DefaultWorkspaceService.class);++ var connections = workspaceService.workspaceConnections;+ for (var entry : connections.entrySet()) {+ var connection = entry.getKey();+ var state = entry.getValue();+ if (state.matches(workspaceId, shellId)) {+ if (terminated) {+ connection.sendMessage("SHELL_OUTPUT:" + AgentUtils.encodeBase64Error("Shell terminated"));+ } else {+ workspaceService.sessionService.run(() -> {+ connection.sendMessage(new ShellExit());+ });+ }+ }+ }+ workspaceService.terminalReplayBuffers.remove(workspaceService.getTerminalKey(workspaceId, shellId));+ return null;+ }++ }++ private static class OutputState {++ private final Long workspaceId;++ private final String shellId;++ private final ArrayDeque<String> queuedChunks = new ArrayDeque<>();++ private boolean replaying = true;++ public OutputState(Long workspaceId, String shellId) {+ this.workspaceId = workspaceId;+ this.shellId = shellId;+ }++ public boolean matches(Long workspaceId, String shellId) {+ return this.workspaceId.equals(workspaceId) && this.shellId.equals(shellId);+ }++ public synchronized boolean queueIfReplaying(String base64Data) {+ if (replaying) {+ queuedChunks.addLast(base64Data);+ return true;+ } else {+ return false;+ }+ }++ public synchronized List<String> markReplayCompletedAndGetQueuedChunks() {+ replaying = false;+ var chunks = new ArrayList<>(queuedChunks);+ queuedChunks.clear();+ return chunks;+ }++ }++ private static class ReplayBuffer {++ private static final int MAX_TOTAL_CHARS = 512 * 1024;++ private final ArrayDeque<String> chunks = new ArrayDeque<>();++ private int totalChars;++ public synchronized void append(String base64Data) {+ chunks.addLast(base64Data);+ totalChars += base64Data.length();+ while (totalChars > MAX_TOTAL_CHARS && chunks.size() > 1) {+ totalChars -= chunks.removeFirst().length();+ }+ }++ public synchronized List<String> snapshot() {+ return new ArrayList<>(chunks);+ }++ }++ private static class HasLfsObjectsTask implements ClusterTask<Boolean> {++ private static final long serialVersionUID = 1L;++ private final Long projectId;++ private final Long workspaceNumber;++ public HasLfsObjectsTask(Long projectId, Long workspaceNumber) {+ this.projectId = projectId;+ this.workspaceNumber = workspaceNumber;+ }++ @Override+ public Boolean call() throws Exception {+ var workspaceService = OneDev.getInstance(DefaultWorkspaceService.class);+ return workspaceService.projectService.runOnActiveServer(projectId, () -> workspaceService.hasLfsObjects(projectId, workspaceNumber));+ }++ }+}diff --git a/server-core/src/main/java/io/onedev/server/workspace/GitExecutionResult.java b/server-core/src/main/java/io/onedev/server/workspace/GitExecutionResult.javanew file mode 100644index 0000000000..3d0d51aa87--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/workspace/GitExecutionResult.java@@ -0,0 +1,33 @@+package io.onedev.server.workspace;++import java.io.Serializable;++public class GitExecutionResult implements Serializable {++ private static final long serialVersionUID = 1L;++ private final byte[] stdout;++ private final byte[] stderr;++ private final int returnCode;++ public GitExecutionResult(byte[] stdout, byte[] stderr, int returnCode) {+ this.stdout = stdout;+ this.stderr = stderr;+ this.returnCode = returnCode;+ }++ public byte[] getStdout() {+ return stdout;+ }++ public byte[] getStderr() {+ return stderr;+ }++ public int getReturnCode() {+ return returnCode;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/workspace/WorkspaceContext.java b/server-core/src/main/java/io/onedev/server/workspace/WorkspaceContext.javanew file mode 100644index 0000000000..bba62ad9ac--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/workspace/WorkspaceContext.java@@ -0,0 +1,120 @@+package io.onedev.server.workspace;++import java.io.Serializable;+import java.util.Map;++import org.jspecify.annotations.Nullable;++import io.onedev.k8shelper.CloneInfo;++public class WorkspaceContext implements Serializable {++ private static final long serialVersionUID = 1L;++ private final String token;++ private final Long projectId;++ private final String projectPath;++ private final String projectGitDir;++ private final Long workspaceId;++ private final Long workspaceNumber;++ private final String shell;++ private final Map<String, String> envVars;++ private final CloneInfo cloneInfo;++ private final boolean retrieveLfs;++ private final String branch;++ private final String userName;++ private final String userEmail;++ private final Map<String, String> userConfigs;++ public WorkspaceContext(String token, Long projectId, String projectPath, String projectGitDir,+ Long workspaceId, Long workspaceNumber, String shell, Map<String, String> envVars,+ CloneInfo cloneInfo, boolean retrieveLfs, @Nullable String branch, String userName,+ String userEmail, Map<String, String> userConfigs) {+ this.token = token;+ this.projectId = projectId;+ this.projectPath = projectPath;+ this.projectGitDir = projectGitDir;+ this.workspaceId = workspaceId;+ this.workspaceNumber = workspaceNumber;+ this.shell = shell;+ this.envVars = envVars;+ this.cloneInfo = cloneInfo;+ this.retrieveLfs = retrieveLfs;+ this.branch = branch;+ this.userName = userName;+ this.userEmail = userEmail;+ this.userConfigs = userConfigs;+ }++ public String getToken() {+ return token;+ }++ public Long getWorkspaceId() {+ return workspaceId;+ }++ public Long getProjectId() {+ return projectId;+ }++ public String getProjectPath() {+ return projectPath;+ }++ public String getProjectGitDir() {+ return projectGitDir;+ }++ public Long getWorkspaceNumber() {+ return workspaceNumber;+ }++ @Nullable+ public String getShell() {+ return shell;+ }++ public Map<String, String> getEnvVars() {+ return envVars;+ }++ public CloneInfo getCloneInfo() {+ return cloneInfo;+ }++ public boolean isRetrieveLfs() {+ return retrieveLfs;+ }++ @Nullable+ public String getBranch() {+ return branch;+ }++ public String getUserName() {+ return userName;+ }++ public String getUserEmail() {+ return userEmail;+ }++ public Map<String, String> getUserConfigs() {+ return userConfigs;+ }++}diff --git a/server-core/src/main/java/io/onedev/server/workspace/WorkspacePostCommitCallback.java b/server-core/src/main/java/io/onedev/server/workspace/WorkspacePostCommitCallback.javanew file mode 100644index 0000000000..e9ebf8323f--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/workspace/WorkspacePostCommitCallback.java@@ -0,0 +1,47 @@+package io.onedev.server.workspace;++import java.io.IOException;+import java.util.List;++import javax.inject.Inject;+import javax.inject.Singleton;+import javax.servlet.ServletException;+import javax.servlet.http.HttpServlet;+import javax.servlet.http.HttpServletRequest;+import javax.servlet.http.HttpServletResponse;+import javax.ws.rs.BadRequestException;+import javax.ws.rs.NotFoundException;++import io.onedev.commons.utils.StringUtils;++@Singleton+public class WorkspacePostCommitCallback extends HttpServlet {++ public static final String PATH = "/git-workspace-postcommit-callback";++ private final WorkspaceService workspaceService;++ @Inject+ public WorkspacePostCommitCallback(WorkspaceService workspaceService) {+ this.workspaceService = workspaceService;+ }++ @Override+ protected void doGet(HttpServletRequest request, HttpServletResponse response)+ throws ServletException, IOException {+ response.setContentType("text/plain");+ List<String> fields = StringUtils.splitAndTrim(request.getPathInfo(), "/");+ if (fields.size() != 1)+ throw new BadRequestException("Invalid request path");++ String workspaceToken = fields.get(0);++ var context = workspaceService.getWorkspaceContext(workspaceToken, false);+ if (context == null)+ throw new NotFoundException("No workspace found with specified token");++ workspaceService.onPostCommit(context);+ response.setStatus(HttpServletResponse.SC_OK);+ }++}diff --git a/server-core/src/main/java/io/onedev/server/workspace/WorkspaceQueryPersonalizationService.java b/server-core/src/main/java/io/onedev/server/workspace/WorkspaceQueryPersonalizationService.javanew file mode 100644index 0000000000..2888e4abd5--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/workspace/WorkspaceQueryPersonalizationService.java@@ -0,0 +1,14 @@+package io.onedev.server.workspace;++import io.onedev.server.model.WorkspaceQueryPersonalization;+import io.onedev.server.service.EntityService;+import io.onedev.server.model.Project;+import io.onedev.server.model.User;++public interface WorkspaceQueryPersonalizationService extends EntityService<WorkspaceQueryPersonalization> {++ WorkspaceQueryPersonalization find(Project project, User user);++ void createOrUpdate(WorkspaceQueryPersonalization personalization);++}diff --git a/server-core/src/main/java/io/onedev/server/workspace/WorkspaceRunnable.java b/server-core/src/main/java/io/onedev/server/workspace/WorkspaceRunnable.javanew file mode 100644index 0000000000..4b46baa528--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/workspace/WorkspaceRunnable.java@@ -0,0 +1,11 @@+package io.onedev.server.workspace;++import java.io.Serializable;++import io.onedev.commons.utils.TaskLogger;++public interface WorkspaceRunnable extends Serializable {++ String run(TaskLogger workspaceLogger);++}diff --git a/server-core/src/main/java/io/onedev/server/workspace/WorkspaceRuntime.java b/server-core/src/main/java/io/onedev/server/workspace/WorkspaceRuntime.javanew file mode 100644index 0000000000..f7f92f29d4--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/workspace/WorkspaceRuntime.java@@ -0,0 +1,61 @@+package io.onedev.server.workspace;++import java.util.ArrayList;+import java.util.LinkedHashMap;+import java.util.List;+import java.util.Map;+import java.util.UUID;++import io.onedev.server.terminal.Shell;+import io.onedev.server.terminal.Terminal;++public abstract class WorkspaceRuntime {++ private final Map<String, Shell> shells = new LinkedHashMap<>();++ public synchronized String openShell(Terminal terminal) {+ var shellId = UUID.randomUUID().toString();+ shells.put(shellId, doOpenShell(new Terminal() {++ @Override+ public void onShellOutput(String base64Data) {+ terminal.onShellOutput(base64Data);+ }++ @Override+ public void onShellExit() {+ shells.remove(shellId);+ terminal.onShellExit();+ }++ }));+ return shellId;+ }++ public synchronized List<String> getShellIds() {+ return new ArrayList<>(shells.keySet());+ }++ public synchronized void terminateShell(String shellId) {+ var shell = shells.remove(shellId);+ if (shell != null)+ shell.terminate();+ }++ public synchronized void writeShellStdin(String shellId, String data) {+ var shell = shells.get(shellId);+ if (shell != null)+ shell.writeToStdin(data);+ }++ public synchronized void resizeShell(String shellId, int rows, int cols) {+ var shell = shells.get(shellId);+ if (shell != null)+ shell.resize(rows, cols);+ }++ protected abstract Shell doOpenShell(Terminal terminal);++ public abstract void await();++}diff --git a/server-core/src/main/java/io/onedev/server/workspace/WorkspaceService.java b/server-core/src/main/java/io/onedev/server/workspace/WorkspaceService.javanew file mode 100644index 0000000000..71876c62af--- /dev/null+++ b/server-core/src/main/java/io/onedev/server/workspace/WorkspaceService.java@@ -0,0 +1,70 @@+package io.onedev.server.workspace;++import java.io.File;+import java.util.Collection;+import java.util.List;++import org.apache.shiro.subject.Subject;+import org.apache.wicket.protocol.ws.api.IWebSocketConnection;+import org.jspecify.annotations.Nullable;++import io.onedev.server.model.Project;+import io.onedev.server.model.Workspace;+import io.onedev.server.search.entity.workspace.WorkspaceQuery;+import io.onedev.server.service.EntityService;+import io.onedev.server.util.FileData;+import io.onedev.server.util.ProjectWorkspaceStatusStat;+import io.onedev.server.util.criteria.Criteria;++public interface WorkspaceService extends EntityService<Workspace> {++ public static final String GIT_PREFIX = "~workspaces/";++ @Nullable Workspace find(Project project, long number);++ void create(Workspace workspace);++ void update(Workspace workspace);++ List<Workspace> query(Subject subject, @Nullable Project project, String numberQuery, int count);++ List<Workspace> query(Subject subject, @Nullable Project project, WorkspaceQuery query,+ int firstResult, int maxResults);++ int count(Subject subject, @Nullable Project project, Criteria<Workspace> criteria);++ int count(Project project, String branchName);++ List<ProjectWorkspaceStatusStat> queryStatusStats(Collection<Project> projects);++ void delete(Collection<Workspace> workspaces);++ File getWorkspaceDir(Long projectId, Long workspaceNumber);++ String openShell(Workspace workspace);++ List<String> getShellIds(Workspace workspace);++ void terminateShell(Workspace workspace, String shellId);++ void onOpen(IWebSocketConnection connection, Workspace workspace, String shellId);++ void onClose(IWebSocketConnection connection);++ void onMessage(IWebSocketConnection connection, Workspace workspace,+ String shellId, String message);++ @Nullable+ WorkspaceContext getWorkspaceContext(String token, boolean mustExist);++ void onPostCommit(WorkspaceContext context);++ boolean hasLfsObjects(Long projectId, Long workspaceNumber);++ void syncWorkspaces(Long projectId, String activeServer);++ GitExecutionResult executeGitCommand(Workspace workspace, String[] gitArgs);++ FileData readFileData(Workspace workspace, String path);++}diff --git a/server-core/src/main/java/io/onedev/server/xodus/DefaultIssueInfoService.java b/server-core/src/main/java/io/onedev/server/xodus/DefaultIssueInfoService.javaindex 9f57baf1f8..4761aefe5d 100644--- a/server-core/src/main/java/io/onedev/server/xodus/DefaultIssueInfoService.java+++ b/server-core/src/main/java/io/onedev/server/xodus/DefaultIssueInfoService.java@@ -270,7 +270,7 @@ public class DefaultIssueInfoService extends AbstractEnvironmentServicepublic Void call() {try {event.getIssueIds().forEach(it -> remove(sourceProjectId, it));- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error removing issue info", e);}return null;diff --git a/server-core/src/main/java/io/onedev/server/xodus/DefaultVisitInfoService.java b/server-core/src/main/java/io/onedev/server/xodus/DefaultVisitInfoService.javaindex d69f42aa31..71246579dd 100644--- a/server-core/src/main/java/io/onedev/server/xodus/DefaultVisitInfoService.java+++ b/server-core/src/main/java/io/onedev/server/xodus/DefaultVisitInfoService.java@@ -57,16 +57,12 @@ public class DefaultVisitInfoService extends AbstractEnvironmentServiceprivate static final String ISSUE_STORE = "issueVisit";- private final ProjectService projectService;-- private final ClusterService clusterService;-@Inject- public DefaultVisitInfoService(ProjectService projectService, ClusterService clusterService) {- this.projectService = projectService;- this.clusterService = clusterService;- }+ private ProjectService projectService;+ @Inject+ private ClusterService clusterService;+public Object writeReplace() throws ObjectStreamException {return new ManagedSerializedForm(VisitInfoService.class);}@@ -111,7 +107,7 @@ public class DefaultVisitInfoService extends AbstractEnvironmentServicelong time = new DateTime().plusSeconds(1).getMillis();writeLong(store, txn, new LongsByteIterable(Lists.newArrayList(userId, issueId)), time);});- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error writing issue visit timestamp", e);}return null;@@ -131,7 +127,7 @@ public class DefaultVisitInfoService extends AbstractEnvironmentServicelong time = new DateTime().plusSeconds(1).getMillis();writeLong(store, txn, new LongsByteIterable(Lists.newArrayList(userId, requestId)), time);});- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error writing pull request visit timestamp", e);}return null;@@ -151,7 +147,7 @@ public class DefaultVisitInfoService extends AbstractEnvironmentServicelong time = new DateTime().plusSeconds(1).getMillis();writeLong(store, txn, new LongsByteIterable(Lists.newArrayList(userId, commentId)), time);});- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error writing code comment visit timestamp", e);}return null;@@ -171,7 +167,7 @@ public class DefaultVisitInfoService extends AbstractEnvironmentServicelong time = new DateTime().plusSeconds(1).getMillis();writeLong(store, txn, new LongsByteIterable(Lists.newArrayList(userId, requestId)), time);});- } catch (Exception e) {+ } catch (Throwable e) {logger.error("Error writing pull request code comments visit timestamp", e);}return null;diff --git a/server-core/src/main/resources/git-workspace-postcommit-hook b/server-core/src/main/resources/git-workspace-postcommit-hooknew file mode 100644index 0000000000..c85981bdf2--- /dev/null+++ b/server-core/src/main/resources/git-workspace-postcommit-hook@@ -0,0 +1,19 @@+#!/bin/sh+set -e+unset http_proxy+unset https_proxy+%s+response=$(${ONEDEV_CURL} -k -s -S -w '\n%%{http_code}' ${ONEDEV_URL}/git-workspace-postcommit-callback/${ONEDEV_HOOK_TOKEN} 2>&1) || {+ echo "$response"+ exit 1+}+http_code=$(echo "$response" | tail -n1)+body=$(echo "$response" | sed '$d')+if [ "$http_code" -ge 400 ] 2>/dev/null; then+ if [ -n "$body" ]; then+ echo "curl($http_code): $body"+ else+ echo "curl($http_code): HTTP error"+ fi+ exit 1+fidiff --git a/server-core/src/test/java/io/onedev/server/buildspec/job/log/JobLogEntryExTest.java b/server-core/src/test/java/io/onedev/server/buildspec/job/log/JobLogEntryExTest.javaindex 2fa547b81c..913ae54794 100644--- a/server-core/src/test/java/io/onedev/server/buildspec/job/log/JobLogEntryExTest.java+++ b/server-core/src/test/java/io/onedev/server/buildspec/job/log/JobLogEntryExTest.java@@ -6,7 +6,7 @@ import org.junit.Test;import com.google.common.collect.Lists;-import io.onedev.server.job.log.StyleBuilder;+import io.onedev.server.logging.StyleBuilder;public class JobLogEntryExTest {diff --git a/server-core/src/test/java/io/onedev/server/entityreference/ReferenceUtilsTest.java b/server-core/src/test/java/io/onedev/server/entityreference/ReferenceUtilsTest.javaindex 9648048935..93a4daa107 100644--- a/server-core/src/test/java/io/onedev/server/entityreference/ReferenceUtilsTest.java+++ b/server-core/src/test/java/io/onedev/server/entityreference/ReferenceUtilsTest.java@@ -88,6 +88,13 @@ public class ReferenceUtilsTest extends AppLoaderMocker {assertEquals(1, references.size());assertTrue(references.get(0) instanceof PullRequestReference);assertEquals(3L, references.get(0).getNumber().longValue());++ references = extractReferences("feat(docs): this is doc (workspace ONE-3, workspace #4)", project1);+ assertEquals(2, references.size());+ assertTrue(references.get(0) instanceof WorkspaceReference);+ assertEquals(3L, references.get(0).getNumber().longValue());+ assertTrue(references.get(1) instanceof WorkspaceReference);+ assertEquals(4L, references.get(1).getNumber().longValue());}@Overridediff --git a/server-ee b/server-eeindex c6075dc911..59ce273ff8 160000--- a/server-ee+++ b/server-ee@@ -1 +1 @@-Subproject commit c6075dc91131fff61c25c169ca96053364df9a2f+Subproject commit 59ce273ff8bd9e1b1f7a5e38616e8ca2efb093c2diff --git a/server-plugin/pom.xml b/server-plugin/pom.xmlindex 64f58ccdf0..d42e2b0d14 100644--- a/server-plugin/pom.xml+++ b/server-plugin/pom.xml@@ -43,6 +43,7 @@<module>server-plugin-executor-remotedocker</module><module>server-plugin-executor-servershell</module><module>server-plugin-executor-remoteshell</module>+ <module>server-plugin-provisioner-shell</module><module>server-plugin-report-unittest</module><module>server-plugin-report-junit</module><module>server-plugin-report-gtest</module>diff --git a/server-plugin/server-plugin-buildspec-bazel/src/main/java/io/onedev/server/plugin/buildspec/bazel/BazelJobSuggestion.java b/server-plugin/server-plugin-buildspec-bazel/src/main/java/io/onedev/server/plugin/buildspec/bazel/BazelJobSuggestion.javaindex da900f9ee5..c3a67b4a0c 100644--- a/server-plugin/server-plugin-buildspec-bazel/src/main/java/io/onedev/server/plugin/buildspec/bazel/BazelJobSuggestion.java+++ b/server-plugin/server-plugin-buildspec-bazel/src/main/java/io/onedev/server/plugin/buildspec/bazel/BazelJobSuggestion.java@@ -7,8 +7,8 @@ import io.onedev.server.buildspec.job.trigger.BranchUpdateTrigger;import io.onedev.server.buildspec.job.trigger.PullRequestUpdateTrigger;import io.onedev.server.buildspec.step.CheckoutStep;import io.onedev.server.buildspec.step.CommandStep;-import io.onedev.server.buildspec.step.GenerateChecksumStep;import io.onedev.server.buildspec.step.SetupCacheStep;+import io.onedev.server.buildspec.step.CachePath;import io.onedev.server.git.BlobIdent;import io.onedev.server.model.Project;import org.eclipse.jgit.lib.FileMode;@@ -20,14 +20,6 @@ import java.util.List;public class BazelJobSuggestion implements JobSuggestion {- private GenerateChecksumStep newChecksumGenerateStep(String name, String files) {- var generateChecksum = new GenerateChecksumStep();- generateChecksum.setName(name);- generateChecksum.setFiles(files);- generateChecksum.setTargetFile("checksum");- return generateChecksum;- }-private Job newJob() {Job job = new Job();job.setName("bazel ci");@@ -49,12 +41,14 @@ public class BazelJobSuggestion implements JobSuggestion {project.getBlob(new BlobIdent(commitId.name(), "BUILD.bazel", FileMode.TYPE_FILE), false) != null ||project.getBlob(new BlobIdent(commitId.name(), "WORKSPACE.bazel", FileMode.TYPE_FILE), false) != null) {Job job = newJob();- job.getSteps().add(newChecksumGenerateStep("generate bazel checksum", ".bazelversion MODULE.bazel MODULE.bazel.lock **/BUILD **/BUILD.bazel"));var setupCache = new SetupCacheStep();setupCache.setName("set up bazel cache");- setupCache.setKey("bazel_cache_@file:checksum@");- setupCache.setPaths(Lists.newArrayList("/root/.cache/bazelisk", "/root/.cache/bazel"));- setupCache.getLoadKeys().add("bazel_cache");+ setupCache.setKey("bazel_cache");++ setupCache.setChecksumFiles(".bazelversion MODULE.bazel MODULE.bazel.lock **/BUILD **/BUILD.bazel");+ setupCache.setPaths(Lists.newArrayList(+ CachePath.of(false, "/root/.cache/bazelisk"),+ CachePath.of(false, "/root/.cache/bazel")));job.getSteps().add(setupCache);CommandStep buildAndTest = new CommandStep();diff --git a/server-plugin/server-plugin-buildspec-cmake/src/main/java/io/onedev/server/plugin/buildspec/cmake/CmakeJobSuggestion.java b/server-plugin/server-plugin-buildspec-cmake/src/main/java/io/onedev/server/plugin/buildspec/cmake/CmakeJobSuggestion.javaindex 3a551b66b2..8eb83862f4 100644--- a/server-plugin/server-plugin-buildspec-cmake/src/main/java/io/onedev/server/plugin/buildspec/cmake/CmakeJobSuggestion.java+++ b/server-plugin/server-plugin-buildspec-cmake/src/main/java/io/onedev/server/plugin/buildspec/cmake/CmakeJobSuggestion.java@@ -16,8 +16,8 @@ import io.onedev.server.buildspec.job.trigger.BranchUpdateTrigger;import io.onedev.server.buildspec.job.trigger.PullRequestUpdateTrigger;import io.onedev.server.buildspec.step.CheckoutStep;import io.onedev.server.buildspec.step.CommandStep;-import io.onedev.server.buildspec.step.GenerateChecksumStep;import io.onedev.server.buildspec.step.SetupCacheStep;+import io.onedev.server.buildspec.step.CachePath;import io.onedev.server.git.BlobIdent;import io.onedev.server.model.Project;import io.onedev.server.plugin.report.cobertura.PublishCoberturaReportStep;@@ -25,39 +25,34 @@ import io.onedev.server.plugin.report.coverage.PublishCoverageReportStep;import io.onedev.server.plugin.report.cppcheck.PublishCppcheckReportStep;public class CmakeJobSuggestion implements JobSuggestion {-- private GenerateChecksumStep newChecksumGenerateStep(String files) {- var generateChecksum = new GenerateChecksumStep();- generateChecksum.setName("generate dependency checksum");- generateChecksum.setFiles(files);- generateChecksum.setTargetFile("checksum");- return generateChecksum;- }private SetupCacheStep newVcpkgCacheSetupStep() {var setupCache = new SetupCacheStep();setupCache.setName("set up dependency cache");- setupCache.setKey("vcpkg_cache_@file:checksum@");- setupCache.setPaths(Lists.newArrayList("/root/.cache/vcpkg"));- setupCache.getLoadKeys().add("vcpkg_cache");+ setupCache.setKey("vcpkg_cache");++ setupCache.setChecksumFiles("**/vcpkg.json");+ setupCache.setPaths(Lists.newArrayList(CachePath.of(false, "/root/.cache/vcpkg")));return setupCache;}private SetupCacheStep newFetchContentCacheSetupStep() {var setupCache = new SetupCacheStep();setupCache.setName("set up dependency cache");- setupCache.setKey("fetchcontent_cache_@file:checksum@");- setupCache.setPaths(Lists.newArrayList("build/.deps"));- setupCache.getLoadKeys().add("fetchcontent_cache");+ setupCache.setKey("fetchcontent_cache");++ setupCache.setChecksumFiles("**/CMakeLists.txt");+ setupCache.setPaths(Lists.newArrayList(CachePath.of(false, "build/.deps")));return setupCache;}private SetupCacheStep newConanCacheSetupStep() {var setupCache = new SetupCacheStep();setupCache.setName("set up dependency cache");- setupCache.setKey("conan_cache_@file:checksum@");- setupCache.setPaths(Lists.newArrayList("/root/.conan2/p"));- setupCache.getLoadKeys().add("conan_cache");+ setupCache.setKey("conan_cache");++ setupCache.setChecksumFiles("**/conanfile.txt **/conanfile.py");+ setupCache.setPaths(Lists.newArrayList(CachePath.of(false, "/root/.conan2/p")));return setupCache;}@@ -103,13 +98,10 @@ public class CmakeJobSuggestion implements JobSuggestion {if (project.getBlob(new BlobIdent(commitId.name(), "CMakeLists.txt", FileMode.TYPE_FILE), false) != null) {Job job = newJob();if (hasVcpkg) {- job.getSteps().add(newChecksumGenerateStep("vcpkg.json vcpkg-configuration.json"));job.getSteps().add(newVcpkgCacheSetupStep());} else if (hasConan) {- job.getSteps().add(newChecksumGenerateStep("conanfile.txt"));job.getSteps().add(newConanCacheSetupStep());} else {- job.getSteps().add(newChecksumGenerateStep("**/CMakeLists.txt"));job.getSteps().add(newFetchContentCacheSetupStep());}diff --git a/server-plugin/server-plugin-buildspec-dotnet/src/main/java/io/onedev/server/plugin/buildspec/dotnet/DotnetJobSuggestion.java b/server-plugin/server-plugin-buildspec-dotnet/src/main/java/io/onedev/server/plugin/buildspec/dotnet/DotnetJobSuggestion.javaindex 139ac3b1f2..7b7ff94b50 100644--- a/server-plugin/server-plugin-buildspec-dotnet/src/main/java/io/onedev/server/plugin/buildspec/dotnet/DotnetJobSuggestion.java+++ b/server-plugin/server-plugin-buildspec-dotnet/src/main/java/io/onedev/server/plugin/buildspec/dotnet/DotnetJobSuggestion.java@@ -8,8 +8,8 @@ import io.onedev.server.buildspec.job.trigger.BranchUpdateTrigger;import io.onedev.server.buildspec.job.trigger.PullRequestUpdateTrigger;import io.onedev.server.buildspec.step.CheckoutStep;import io.onedev.server.buildspec.step.CommandStep;-import io.onedev.server.buildspec.step.GenerateChecksumStep;import io.onedev.server.buildspec.step.SetupCacheStep;+import io.onedev.server.buildspec.step.CachePath;import io.onedev.server.git.BlobIdent;import io.onedev.server.git.BlobIdentFilter;import io.onedev.server.model.Project;@@ -37,17 +37,12 @@ public class DotnetJobSuggestion implements JobSuggestion {checkout.setName("checkout code");job.getSteps().add(checkout);- var generateChecksum = new GenerateChecksumStep();- generateChecksum.setName("generate project checksum");- generateChecksum.setFiles("**/*.csproj");- generateChecksum.setTargetFile("checksum");- job.getSteps().add(generateChecksum);-var setupCache = new SetupCacheStep();setupCache.setName("set up nuget cache");- setupCache.setKey("nuget_packages_@file:checksum@");- setupCache.setPaths(Lists.newArrayList("/root/.nuget/packages"));- setupCache.getLoadKeys().add("nuget_packages");+ setupCache.setKey("nuget_packages");++ setupCache.setChecksumFiles("**/*.csproj");+ setupCache.setPaths(Lists.newArrayList(CachePath.of(false, "/root/.nuget/packages")));job.getSteps().add(setupCache);var testAndAnalyze = new CommandStep();diff --git a/server-plugin/server-plugin-buildspec-golang/src/main/java/io/onedev/server/plugin/buildspec/golang/GolangJobSuggestion.java b/server-plugin/server-plugin-buildspec-golang/src/main/java/io/onedev/server/plugin/buildspec/golang/GolangJobSuggestion.javaindex 12575f282b..cab38aea96 100644--- a/server-plugin/server-plugin-buildspec-golang/src/main/java/io/onedev/server/plugin/buildspec/golang/GolangJobSuggestion.java+++ b/server-plugin/server-plugin-buildspec-golang/src/main/java/io/onedev/server/plugin/buildspec/golang/GolangJobSuggestion.java@@ -16,8 +16,8 @@ import io.onedev.server.buildspec.job.trigger.BranchUpdateTrigger;import io.onedev.server.buildspec.job.trigger.PullRequestUpdateTrigger;import io.onedev.server.buildspec.step.CheckoutStep;import io.onedev.server.buildspec.step.CommandStep;-import io.onedev.server.buildspec.step.GenerateChecksumStep;import io.onedev.server.buildspec.step.SetupCacheStep;+import io.onedev.server.buildspec.step.CachePath;import io.onedev.server.git.BlobIdent;import io.onedev.server.model.Build;import io.onedev.server.model.Project;@@ -32,14 +32,6 @@ public class GolangJobSuggestion implements JobSuggestion {public static final String DETERMINE_GO_VERSION = "golang:determine-go-version";- private GenerateChecksumStep newChecksumGenerateStep(String name, String files) {- var generateChecksum = new GenerateChecksumStep();- generateChecksum.setName(name);- generateChecksum.setFiles(files);- generateChecksum.setTargetFile("checksum");- return generateChecksum;- }-private Job newJob() {Job job = new Job();job.setName("go ci");@@ -90,12 +82,15 @@ public class GolangJobSuggestion implements JobSuggestion {List<Job> jobs = new ArrayList<>();if (project.getBlob(new BlobIdent(commitId.name(), "go.mod", FileMode.TYPE_FILE), false) != null) {Job job = newJob();- job.getSteps().add(newChecksumGenerateStep("generate dependency checksum", "**/go.mod"));var setupCache = new SetupCacheStep();setupCache.setName("set up dependency cache");- setupCache.setKey("go_cache_@file:checksum@");- setupCache.setPaths(Lists.newArrayList("/root/.cache/go_build", "/root/.cache/golangci-lint", "/go/pkg/mod"));- setupCache.getLoadKeys().add("go_cache");+ setupCache.setKey("go_cache");++ setupCache.setChecksumFiles("**/go.mod");+ setupCache.setPaths(Lists.newArrayList(+ CachePath.of(false, "/root/.cache/go_build"),+ CachePath.of(false, "/root/.cache/golangci-lint"),+ CachePath.of(false, "/go/pkg/mod")));job.getSteps().add(setupCache);CommandStep buildAndTest = new CommandStep();diff --git a/server-plugin/server-plugin-buildspec-gradle/src/main/java/io/onedev/server/plugin/buildspec/gradle/GradleJobSuggestion.java b/server-plugin/server-plugin-buildspec-gradle/src/main/java/io/onedev/server/plugin/buildspec/gradle/GradleJobSuggestion.javaindex ed1434871c..1c48bd09de 100644--- a/server-plugin/server-plugin-buildspec-gradle/src/main/java/io/onedev/server/plugin/buildspec/gradle/GradleJobSuggestion.java+++ b/server-plugin/server-plugin-buildspec-gradle/src/main/java/io/onedev/server/plugin/buildspec/gradle/GradleJobSuggestion.java@@ -7,6 +7,7 @@ import io.onedev.server.buildspec.job.JobSuggestion;import io.onedev.server.buildspec.job.trigger.BranchUpdateTrigger;import io.onedev.server.buildspec.job.trigger.PullRequestUpdateTrigger;import io.onedev.server.buildspec.step.*;+import io.onedev.server.buildspec.step.CachePath;import io.onedev.server.git.Blob;import io.onedev.server.git.BlobIdent;import io.onedev.server.model.Project;@@ -33,21 +34,16 @@ public class GradleJobSuggestion implements JobSuggestion {checkout.setName("checkout code");job.getSteps().add(checkout);- var generateChecksum = new GenerateChecksumStep();- generateChecksum.setName("generate gradle checksum");- generateChecksum.setFiles("**/build.gradle **/build.gradle.kts");- generateChecksum.setTargetFile("checksum");- job.getSteps().add(generateChecksum);-var setupCache = new SetupCacheStep();setupCache.setName("set up gradle cache");- setupCache.setKey("gradle_@file:checksum@");+ setupCache.setKey("gradle");++ setupCache.setChecksumFiles("**/build.gradle **/build.gradle.kts");setupCache.setPaths(Lists.newArrayList(- "/home/gradle/.gradle/caches",- "/home/gradle/.gradle/jdks",- "/home/gradle/.gradle/native",- "/home/gradle/.gradle/wrapper"));- setupCache.getLoadKeys().add("gradle");+ CachePath.of(false, "/home/gradle/.gradle/caches"),+ CachePath.of(false, "/home/gradle/.gradle/jdks"),+ CachePath.of(false, "/home/gradle/.gradle/native"),+ CachePath.of(false, "/home/gradle/.gradle/wrapper")));job.getSteps().add(setupCache);String imageName = "gradle";diff --git a/server-plugin/server-plugin-buildspec-maven/src/main/java/io/onedev/server/plugin/buildspec/maven/MavenJobSuggestion.java b/server-plugin/server-plugin-buildspec-maven/src/main/java/io/onedev/server/plugin/buildspec/maven/MavenJobSuggestion.javaindex babb0c1b90..2782ebc2f9 100644--- a/server-plugin/server-plugin-buildspec-maven/src/main/java/io/onedev/server/plugin/buildspec/maven/MavenJobSuggestion.java+++ b/server-plugin/server-plugin-buildspec-maven/src/main/java/io/onedev/server/plugin/buildspec/maven/MavenJobSuggestion.java@@ -15,9 +15,9 @@ import io.onedev.server.buildspec.job.trigger.BranchUpdateTrigger;import io.onedev.server.buildspec.job.trigger.PullRequestUpdateTrigger;import io.onedev.server.buildspec.step.CheckoutStep;import io.onedev.server.buildspec.step.CommandStep;-import io.onedev.server.buildspec.step.GenerateChecksumStep;import io.onedev.server.buildspec.step.SetBuildVersionStep;import io.onedev.server.buildspec.step.SetupCacheStep;+import io.onedev.server.buildspec.step.CachePath;import io.onedev.server.git.Blob;import io.onedev.server.git.BlobIdent;import io.onedev.server.model.Project;@@ -37,18 +37,13 @@ public class MavenJobSuggestion implements JobSuggestion {CheckoutStep checkout = new CheckoutStep();checkout.setName("checkout code");job.getSteps().add(checkout);-- var generateChecksum = new GenerateChecksumStep();- generateChecksum.setName("generate pom checksum");- generateChecksum.setFiles("**/pom.xml");- generateChecksum.setTargetFile("checksum");- job.getSteps().add(generateChecksum);var setupCache = new SetupCacheStep();setupCache.setName("set up maven cache");- setupCache.setKey("maven_repository_@file:checksum@");- setupCache.setPaths(Lists.newArrayList("/root/.m2/repository"));- setupCache.getLoadKeys().add("maven_repository");+ setupCache.setKey("maven_repository");++ setupCache.setChecksumFiles("**/pom.xml");+ setupCache.setPaths(Lists.newArrayList(CachePath.of(false, "/root/.m2/repository")));job.getSteps().add(setupCache);CommandStep runTests = new CommandStep();diff --git a/server-plugin/server-plugin-buildspec-node/src/main/java/io/onedev/server/plugin/buildspec/node/NodeJobSuggestion.java b/server-plugin/server-plugin-buildspec-node/src/main/java/io/onedev/server/plugin/buildspec/node/NodeJobSuggestion.javaindex 96cfa32fbd..61fb2ebc73 100644--- a/server-plugin/server-plugin-buildspec-node/src/main/java/io/onedev/server/plugin/buildspec/node/NodeJobSuggestion.java+++ b/server-plugin/server-plugin-buildspec-node/src/main/java/io/onedev/server/plugin/buildspec/node/NodeJobSuggestion.java@@ -8,6 +8,7 @@ import io.onedev.server.buildspec.job.Job;import io.onedev.server.buildspec.job.JobSuggestion;import io.onedev.server.buildspec.job.trigger.BranchUpdateTrigger;import io.onedev.server.buildspec.step.*;+import io.onedev.server.buildspec.step.CachePath;import io.onedev.server.git.Blob;import io.onedev.server.git.BlobIdent;import io.onedev.server.model.Build;@@ -221,18 +222,14 @@ public class NodeJobSuggestion implements JobSuggestion {}private List<Step> newCacheSteps() {- var generateChecksum = new GenerateChecksumStep();- generateChecksum.setName("generate package checksum");- generateChecksum.setFiles("package-lock.json yarn.lock");- generateChecksum.setTargetFile("checksum");-var setupCache = new SetupCacheStep();setupCache.setName("set up npm cache");- setupCache.setKey("node_modules_@file:checksum@");- setupCache.setPaths(Lists.newArrayList("node_modules"));- setupCache.getLoadKeys().add("node_modules");+ setupCache.setKey("node_modules");++ setupCache.setChecksumFiles("package-lock.json yarn.lock");+ setupCache.setPaths(Lists.newArrayList(CachePath.of(false, "node_modules")));- return Lists.newArrayList(generateChecksum, setupCache);+ return Lists.newArrayList(setupCache);}private void setupTriggers(Job job) {diff --git a/server-plugin/server-plugin-buildspec-python/src/main/java/io/onedev/server/plugin/buildspec/python/PythonJobSuggestion.java b/server-plugin/server-plugin-buildspec-python/src/main/java/io/onedev/server/plugin/buildspec/python/PythonJobSuggestion.javaindex 8351e54ccb..3b3d0339b7 100644--- a/server-plugin/server-plugin-buildspec-python/src/main/java/io/onedev/server/plugin/buildspec/python/PythonJobSuggestion.java+++ b/server-plugin/server-plugin-buildspec-python/src/main/java/io/onedev/server/plugin/buildspec/python/PythonJobSuggestion.java@@ -26,9 +26,9 @@ import io.onedev.server.buildspec.job.trigger.BranchUpdateTrigger;import io.onedev.server.buildspec.job.trigger.PullRequestUpdateTrigger;import io.onedev.server.buildspec.step.CheckoutStep;import io.onedev.server.buildspec.step.CommandStep;-import io.onedev.server.buildspec.step.GenerateChecksumStep;import io.onedev.server.buildspec.step.SetBuildVersionStep;import io.onedev.server.buildspec.step.SetupCacheStep;+import io.onedev.server.buildspec.step.CachePath;import io.onedev.server.buildspec.step.commandinterpreter.ShellInterpreter;import io.onedev.server.git.Blob;import io.onedev.server.git.BlobIdent;@@ -76,9 +76,10 @@ public class PythonJobSuggestion implements JobSuggestion {private SetupCacheStep newPipCacheSetupStep() {var setupCache = new SetupCacheStep();setupCache.setName("set up dependency cache");- setupCache.setKey("pip_cache_@file:checksum@");- setupCache.setPaths(Lists.newArrayList("/root/.cache/pip"));- setupCache.getLoadKeys().add("pip_cache");+ setupCache.setKey("pip_cache");++ setupCache.setChecksumFiles("requirements.txt setup.py setup.cfg pyproject.toml");+ setupCache.setPaths(Lists.newArrayList(CachePath.of(false, "/root/.cache/pip")));return setupCache;}@@ -107,14 +108,6 @@ public class PythonJobSuggestion implements JobSuggestion {return buildAndTest;}- private GenerateChecksumStep newChecksumGenerateStep(String files) {- var generateChecksum = new GenerateChecksumStep();- generateChecksum.setName("generate dependency checksum");- generateChecksum.setFiles(files);- generateChecksum.setTargetFile("checksum");- return generateChecksum;- }-@Nullableprivate String guessPoetryOptionalTestGroup(Toml pyprojectToml) {if (pyprojectToml.getBoolean("tool.poetry.group.test.optional", false))@@ -189,12 +182,12 @@ public class PythonJobSuggestion implements JobSuggestion {Blob blob;if ((blob = project.getBlob(new BlobIdent(commitId.name(), "tox.ini", FileMode.TYPE_FILE), false)) != null) {var job = newJob();- job.getSteps().add(newChecksumGenerateStep("tox.ini"));var setupCache = new SetupCacheStep();setupCache.setName("set up dependency cache");- setupCache.setKey("tox_cache_@file:checksum@");- setupCache.setPaths(Lists.newArrayList(".tox"));- setupCache.getLoadKeys().add("tox_cache");+ setupCache.setKey("tox_cache");++ setupCache.setChecksumFiles("tox.ini");+ setupCache.setPaths(Lists.newArrayList(CachePath.of(false, ".tox")));job.getSteps().add(setupCache);CommandStep buildAndTest = new CommandStep();@@ -208,13 +201,13 @@ public class PythonJobSuggestion implements JobSuggestion {jobs.add(job);} else if ((blob = project.getBlob(new BlobIdent(commitId.name(), "poetry.lock", FileMode.TYPE_FILE), false)) != null) {var job = newJob();- job.getSteps().add(newChecksumGenerateStep("poetry.lock"));var setupCache = new SetupCacheStep();setupCache.setName("set up dependency cache");- setupCache.setKey("poetry_cache_@file:checksum@");- setupCache.setPaths(Lists.newArrayList("/root/.cache/pypoetry"));- setupCache.getLoadKeys().add("poetry_cache");+ setupCache.setKey("poetry_cache");++ setupCache.setChecksumFiles("poetry.lock");+ setupCache.setPaths(Lists.newArrayList(CachePath.of(false, "/root/.cache/pypoetry")));job.getSteps().add(setupCache);var pyproject = project.getBlob(new BlobIdent(commitId.name(), "pyproject.toml", FileMode.TYPE_FILE), false);@@ -258,18 +251,10 @@ public class PythonJobSuggestion implements JobSuggestion {jobs.add(job);} else if ((blob = project.getBlob(new BlobIdent(commitId.name(), "pyproject.toml", FileMode.TYPE_FILE), false)) != null) {var job = newJob();- var dependencyFiles = "pyproject.toml";var setupPy = project.getBlob(new BlobIdent(commitId.name(), "setup.py", FileMode.TYPE_FILE), false);- if (setupPy != null)- dependencyFiles += " setup.py";var setupCfg = project.getBlob(new BlobIdent(commitId.name(), "setup.cfg", FileMode.TYPE_FILE), false);- if (setupCfg != null)- dependencyFiles += " setup.cfg";var requirements = project.getBlob(new BlobIdent(commitId.name(), "requirements.txt", FileMode.TYPE_FILE), false);- if (requirements != null)- dependencyFiles += " requirements.txt";- job.getSteps().add(newChecksumGenerateStep(dependencyFiles));job.getSteps().add(newPipCacheSetupStep());var blobContent = blob.getText().getContent();@@ -309,15 +294,9 @@ public class PythonJobSuggestion implements JobSuggestion {jobs.add(job);} else if ((blob = project.getBlob(new BlobIdent(commitId.name(), "setup.py", FileMode.TYPE_FILE), false)) != null) {var job = newJob();- var dependencyFiles = "setup.py";var setupCfg = project.getBlob(new BlobIdent(commitId.name(), "setup.cfg", FileMode.TYPE_FILE), false);- if (setupCfg != null)- dependencyFiles += " setup.cfg";var requirements = project.getBlob(new BlobIdent(commitId.name(), "requirements.txt", FileMode.TYPE_FILE), false);- if (requirements != null)- dependencyFiles += " requirements.txt";-- job.getSteps().add(newChecksumGenerateStep(dependencyFiles));+job.getSteps().add(newPipCacheSetupStep());var blobContent = blob.getText().getContent();@@ -340,7 +319,6 @@ public class PythonJobSuggestion implements JobSuggestion {jobs.add(job);} else if ((blob = project.getBlob(new BlobIdent(commitId.name(), "requirements.txt", FileMode.TYPE_FILE), false)) != null) {var job = newJob();- job.getSteps().add(newChecksumGenerateStep("requirements.txt"));job.getSteps().add(newPipCacheSetupStep());var withPytest = blob.getText().getContent().contains("pytest");@@ -351,13 +329,13 @@ public class PythonJobSuggestion implements JobSuggestion {jobs.add(job);} else if ((blob = project.getBlob(new BlobIdent(commitId.name(), "environment.yml", FileMode.TYPE_FILE), false)) != null) {var job = newJob();- job.getSteps().add(newChecksumGenerateStep("environment.yml"));var setupCache = new SetupCacheStep();setupCache.setName("set up dependency cache");- setupCache.setKey("conda_cache_@file:checksum@");- setupCache.setPaths(Lists.newArrayList("/root/miniconda3/envs"));- setupCache.getLoadKeys().add("conda_cache");+ setupCache.setKey("conda_cache");++ setupCache.setChecksumFiles("environment.yml");+ setupCache.setPaths(Lists.newArrayList(CachePath.of(false, "/root/miniconda3/envs")));job.getSteps().add(setupCache);var blobContent = blob.getText().getContent();diff --git a/server-plugin/server-plugin-buildspec-rust/src/main/java/io/onedev/server/plugin/buildspec/rust/RustJobSuggestion.java b/server-plugin/server-plugin-buildspec-rust/src/main/java/io/onedev/server/plugin/buildspec/rust/RustJobSuggestion.javaindex e998429022..0d2aac52a4 100644--- a/server-plugin/server-plugin-buildspec-rust/src/main/java/io/onedev/server/plugin/buildspec/rust/RustJobSuggestion.java+++ b/server-plugin/server-plugin-buildspec-rust/src/main/java/io/onedev/server/plugin/buildspec/rust/RustJobSuggestion.java@@ -8,6 +8,7 @@ import io.onedev.server.buildspec.job.JobSuggestion;import io.onedev.server.buildspec.job.trigger.BranchUpdateTrigger;import io.onedev.server.buildspec.job.trigger.PullRequestUpdateTrigger;import io.onedev.server.buildspec.step.*;+import io.onedev.server.buildspec.step.CachePath;import io.onedev.server.git.Blob;import io.onedev.server.git.BlobIdent;import io.onedev.server.model.Project;@@ -23,14 +24,6 @@ import java.util.List;public class RustJobSuggestion implements JobSuggestion {- private GenerateChecksumStep newChecksumGenerateStep(String name, String files) {- var generateChecksum = new GenerateChecksumStep();- generateChecksum.setName(name);- generateChecksum.setFiles(files);- generateChecksum.setTargetFile("checksum");- return generateChecksum;- }-private Job newJob() {Job job = new Job();job.setName("rust ci");@@ -95,12 +88,12 @@ public class RustJobSuggestion implements JobSuggestion {job.getSteps().add(setBuildVersion);}- job.getSteps().add(newChecksumGenerateStep("generate dependency checksum", "**/Cargo.toml **/Cargo.lock"));var setupCache = new SetupCacheStep();setupCache.setName("set up dependency cache");- setupCache.setKey("rust_cache_@file:checksum@");- setupCache.setPaths(Lists.newArrayList("/root/.cache/cargo"));- setupCache.getLoadKeys().add("rust_cache");+ setupCache.setKey("rust_cache");++ setupCache.setChecksumFiles("**/Cargo.toml **/Cargo.lock");+ setupCache.setPaths(Lists.newArrayList(CachePath.of(false, "/root/.cache/cargo")));job.getSteps().add(setupCache);CommandStep buildAndTest = new CommandStep();diff --git a/server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java b/server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.javaindex a345675509..142f2dfbbd 100644--- a/server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java+++ b/server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java@@ -28,6 +28,7 @@ import java.util.Collection;import java.util.HashMap;import java.util.HashSet;import java.util.LinkedHashMap;+import java.util.LinkedHashSet;import java.util.List;import java.util.Map;import java.util.UUID;@@ -35,14 +36,13 @@ import java.util.concurrent.TimeoutException;import java.util.concurrent.atomic.AtomicBoolean;import java.util.concurrent.atomic.AtomicReference;-import org.jspecify.annotations.Nullable;import javax.validation.Valid;import javax.validation.constraints.NotEmpty;-import org.apache.commons.io.FilenameUtils;import org.apache.commons.lang.SerializationUtils;import org.apache.commons.lang3.RandomUtils;import org.apache.commons.lang3.SystemUtils;+import org.jspecify.annotations.Nullable;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.yaml.snakeyaml.Yaml;@@ -65,6 +65,7 @@ import io.onedev.commons.utils.command.Commandline;import io.onedev.commons.utils.command.LineConsumer;import io.onedev.k8shelper.Action;import io.onedev.k8shelper.BuildImageFacade;+import io.onedev.k8shelper.CachePathFacade;import io.onedev.k8shelper.CommandFacade;import io.onedev.k8shelper.CompositeFacade;import io.onedev.k8shelper.KubernetesHelper;@@ -81,19 +82,19 @@ import io.onedev.server.annotation.Editable;import io.onedev.server.annotation.OmitName;import io.onedev.server.buildspecmodel.inputspec.SecretInput;import io.onedev.server.cluster.ClusterService;-import io.onedev.server.service.SettingService;import io.onedev.server.job.JobContext;-import io.onedev.server.job.JobService;import io.onedev.server.job.JobRunnable;+import io.onedev.server.job.JobService;+import io.onedev.server.job.JobTerminal;import io.onedev.server.model.support.administration.jobexecutor.JobExecutor;import io.onedev.server.model.support.administration.jobexecutor.KubernetesAware;import io.onedev.server.model.support.administration.jobexecutor.NodeSelectorEntry;import io.onedev.server.model.support.administration.jobexecutor.RegistryLogin;import io.onedev.server.model.support.administration.jobexecutor.ServiceLocator;import io.onedev.server.plugin.executor.kubernetes.KubernetesExecutor.TestData;+import io.onedev.server.service.SettingService;import io.onedev.server.terminal.CommandlineShell;import io.onedev.server.terminal.Shell;-import io.onedev.server.terminal.Terminal;import io.onedev.server.web.util.Testable;@Editable(order=KubernetesExecutor.ORDER, description="This executor runs build jobs as pods in a kubernetes cluster. "@@ -308,7 +309,7 @@ public class KubernetesExecutor extends JobExecutor implements KubernetesAware,var clusterService = OneDev.getInstance(ClusterService.class);var servers = clusterService.getServerAddresses();var server = servers.get(RandomUtils.secure().randomInt(0, servers.size()));- return getJobService().runJob(server, ()-> getJobService().runJob(jobContext, new JobRunnable() {+ return clusterService.runOnServer(server, ()-> getJobService().runJob(jobContext, new JobRunnable() {private static final long serialVersionUID = 1L;@@ -340,7 +341,7 @@ public class KubernetesExecutor extends JobExecutor implements KubernetesAware,}@Override- public Shell openShell(JobContext jobContext, Terminal terminal) {+ public Shell openShell(JobContext jobContext, JobTerminal terminal) {String containerNameCopy = containerName;if (containerNameCopy != null) {Commandline kubectl = newKubeCtl();@@ -942,19 +943,19 @@ public class KubernetesExecutor extends JobExecutor implements KubernetesAware,List<Map<Object, Object>> containerSpecs = new ArrayList<>();- var containerBuildHome = "/onedev-build";- var containerWorkspace = containerBuildHome +"/workspace";- var containerCommandDir = containerBuildHome + "/command";- var containerTrustCertsDir = containerBuildHome + "/trust-certs";+ var containerBuildDirPath = "/onedev-build";+ var containerWorkDirPath = containerBuildDirPath +"/workspace";+ var containerCommandDirPath = containerBuildDirPath + "/command";+ var containerTrustCertsDirPath = containerBuildDirPath + "/trust-certs";- Map<String, String> buildHomeMount = newLinkedHashMap(+ Map<String, String> buildDirMount = newLinkedHashMap("name", "build-home",- "mountPath", containerBuildHome);+ "mountPath", containerBuildDirPath);Map<String, String> trustCertsMount = newLinkedHashMap("name", "trust-certs",- "mountPath", containerTrustCertsDir);+ "mountPath", containerTrustCertsDirPath);- var commonVolumeMounts = newArrayList(buildHomeMount);+ var commonVolumeMounts = newArrayList(buildDirMount);if (trustCertsConfigMapName != null)commonVolumeMounts.add(trustCertsMount);@@ -981,11 +982,15 @@ public class KubernetesExecutor extends JobExecutor implements KubernetesAware,"name", ENV_JOB_TOKEN,"value", jobToken));commonEnvs.add(newLinkedHashMap(- "name", "ONEDEV_WORKSPACE",- "value", containerWorkspace+ "name", "ONEDEV_WORKDIR",+ "value", containerWorkDirPath));-- Collection<String> cachePaths = new HashSet<>();+ commonEnvs.add(newLinkedHashMap(+ "name", "ONEDEV_WORKSPACE",+ "value", containerWorkDirPath+ ));++ Collection<CachePathFacade> cachePaths = new LinkedHashSet<>();entryFacade.traverse((facade, position) -> {String containerName = getContainerName(position);containerNames.add(containerName);@@ -1033,7 +1038,7 @@ public class KubernetesExecutor extends JobExecutor implements KubernetesAware,if (stepContainerSpec != null) {String positionStr = stringifyStepPosition(position);stepContainerSpec.put("command", newArrayList("sh"));- stepContainerSpec.put("args", newArrayList(containerCommandDir + "/" + positionStr + ".sh"));+ stepContainerSpec.put("args", newArrayList(containerCommandDirPath + "/" + positionStr + ".sh"));Map<Object, Object> requestsSpec = newLinkedHashMap("cpu", "0",@@ -1108,18 +1113,18 @@ public class KubernetesExecutor extends JobExecutor implements KubernetesAware,if (!getNodeSelector().isEmpty())podSpec.put("nodeSelector", toMap(getNodeSelector()));- Map<Object, Object> buildHomeVolume;+ Map<Object, Object> buildDirVolume;if (isBuildWithPV()) {- buildHomeVolume = newLinkedHashMap(+ buildDirVolume = newLinkedHashMap("name", "build-home","persistentVolumeClaim", newLinkedHashMap("claimName", "build-home"));} else {- buildHomeVolume = newLinkedHashMap(+ buildDirVolume = newLinkedHashMap("name", "build-home","emptyDir", newLinkedHashMap());}- List<Object> volumes = newArrayList(buildHomeVolume);+ List<Object> volumes = newArrayList(buildDirVolume);if (trustCertsConfigMapName != null) {volumes.add(newLinkedHashMap("name", "trust-certs",@@ -1271,14 +1276,14 @@ public class KubernetesExecutor extends JobExecutor implements KubernetesAware,}}- private ArrayList<Object> buildVolumeMounts(Collection<String> cachePaths) {+ private ArrayList<Object> buildVolumeMounts(Collection<io.onedev.k8shelper.CachePathFacade> cachePaths) {var volumeMounts = new ArrayList<>();int index = 1;for (var cachePath: cachePaths) {- if (FilenameUtils.getPrefixLength(cachePath) > 0) {+ if (cachePath.isAbsolute()) {var volumeMount = newLinkedHashMap("name", "build-home",- "mountPath", cachePath,+ "mountPath", cachePath.getPathValue(),"subPath", "cache/" + index);volumeMounts.add(volumeMount);}diff --git a/server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesResource.java b/server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesResource.javaindex 6f768ec0db..3e6f9a3051 100644--- a/server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesResource.java+++ b/server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesResource.java@@ -1,50 +1,60 @@package io.onedev.server.plugin.executor.kubernetes;-import com.google.common.base.Joiner;-import com.google.common.base.Splitter;+import static io.onedev.k8shelper.KubernetesHelper.readInt;+import static io.onedev.k8shelper.KubernetesHelper.readString;+import static io.onedev.server.util.IOUtils.BUFFER_SIZE;+import static org.apache.commons.io.IOUtils.copy;++import java.io.File;+import java.io.IOException;+import java.io.InputStream;+import java.util.ArrayList;+import java.util.HashMap;+import java.util.List;+import java.util.Map;++import javax.inject.Inject;+import javax.inject.Singleton;+import javax.servlet.http.HttpServletRequest;+import javax.ws.rs.Consumes;+import javax.ws.rs.GET;+import javax.ws.rs.NotFoundException;+import javax.ws.rs.POST;+import javax.ws.rs.Path;+import javax.ws.rs.Produces;+import javax.ws.rs.QueryParam;+import javax.ws.rs.client.Client;+import javax.ws.rs.client.ClientBuilder;+import javax.ws.rs.client.Entity;+import javax.ws.rs.client.Invocation;+import javax.ws.rs.core.Context;+import javax.ws.rs.core.HttpHeaders;+import javax.ws.rs.core.MediaType;+import javax.ws.rs.core.Response;+import javax.ws.rs.core.StreamingOutput;++import org.apache.commons.lang.SerializationUtils;+import org.apache.shiro.authz.UnauthorizedException;+import org.glassfish.jersey.client.ClientProperties;+import org.jspecify.annotations.Nullable;+import io.onedev.commons.utils.FileUtils;import io.onedev.commons.utils.StringUtils;import io.onedev.commons.utils.TarUtils;import io.onedev.commons.utils.TaskLogger;+import io.onedev.k8shelper.CacheAvailability;import io.onedev.k8shelper.K8sJobData;import io.onedev.k8shelper.KubernetesHelper;import io.onedev.server.cluster.ClusterService;-import io.onedev.server.service.JobCacheService;-import io.onedev.server.service.ProjectService;import io.onedev.server.job.JobContext;import io.onedev.server.job.JobService;import io.onedev.server.model.Project;import io.onedev.server.persistence.SessionService;import io.onedev.server.rest.annotation.Api;import io.onedev.server.security.SecurityUtils;+import io.onedev.server.service.ProjectService;+import io.onedev.server.service.RunCacheService;import io.onedev.server.util.IOUtils;-import org.apache.commons.lang.SerializationUtils;-import org.apache.commons.lang3.tuple.Pair;-import org.apache.shiro.authz.UnauthorizedException;-import org.glassfish.jersey.client.ClientProperties;--import org.jspecify.annotations.Nullable;-import javax.inject.Inject;-import javax.inject.Singleton;-import javax.servlet.http.HttpServletRequest;-import javax.ws.rs.*;-import javax.ws.rs.client.Client;-import javax.ws.rs.client.ClientBuilder;-import javax.ws.rs.client.Entity;-import javax.ws.rs.client.Invocation;-import javax.ws.rs.core.*;-import java.io.File;-import java.io.IOException;-import java.io.InputStream;-import java.util.ArrayList;-import java.util.HashMap;-import java.util.List;-import java.util.Map;--import static io.onedev.k8shelper.KubernetesHelper.readInt;-import static io.onedev.k8shelper.KubernetesHelper.readString;-import static io.onedev.server.util.IOUtils.BUFFER_SIZE;-import static org.apache.commons.io.IOUtils.copy;@Api(internal=true)@Path("/k8s")@@ -52,38 +62,32 @@ import static org.apache.commons.io.IOUtils.copy;@Singletonpublic class KubernetesResource {- private final JobService jobService;+ @Inject+ private JobService jobService;- private final JobCacheService jobCacheService;+ @Inject+ private RunCacheService cacheService;- private final SessionService sessionService;+ @Inject+ private SessionService sessionService;- private final ProjectService projectService;+ @Inject+ private ProjectService projectService;- private final ClusterService clusterService;+ @Inject+ private ClusterService clusterService;@Contextprivate HttpServletRequest request;-- @Inject- public KubernetesResource(JobService jobService, JobCacheService jobCacheService,- SessionService sessionService, ProjectService projectService,- ClusterService clusterService) {- this.jobService = jobService;- this.jobCacheService = jobCacheService;- this.sessionService = sessionService;- this.projectService = projectService;- this.clusterService = clusterService;- }-+@Path("/job-data")@Produces(MediaType.APPLICATION_OCTET_STREAM)@GETpublic byte[] getJobData(@QueryParam("jobToken") String jobToken,- @QueryParam("jobWorkspace") @Nullable String jobWorkspace) {+ @QueryParam("jobWorkDir") @Nullable String jobWorkDir) {JobContext jobContext = jobService.getJobContext(jobToken, true);- if (StringUtils.isNotBlank(jobWorkspace))- jobService.reportJobWorkspace(jobContext, jobWorkspace);+ if (StringUtils.isNotBlank(jobWorkDir))+ jobService.reportJobWorkDir(jobContext, jobWorkDir);K8sJobData k8sJobData = new K8sJobData(jobContext.getJobExecutor().getName(),jobContext.getRefName(),@@ -166,25 +170,18 @@ public class KubernetesResource {@GETpublic StreamingOutput downloadCache(@QueryParam("jobToken") String jobToken,- @QueryParam("cacheKey") @Nullable String cacheKey,- @QueryParam("loadKeys") @Nullable String joinedLoadKeys,- @QueryParam("cachePaths") String joinedCachePaths) {+ @QueryParam("key") String key,+ @QueryParam("checksum") @Nullable String checksum,+ @QueryParam("cachePathsString") String cachePathsString) {return os -> {sessionService.closeSession();try {var jobContext = jobService.getJobContext(jobToken, true);- Pair<Long, Long> cacheInfo;- if (cacheKey != null) {- cacheInfo = jobCacheService.getCacheInfoForDownload(jobContext.getProjectId(), cacheKey);- } else {- var loadKeys = Splitter.on('\n').splitToList(joinedLoadKeys);- cacheInfo = jobCacheService.getCacheInfoForDownload(jobContext.getProjectId(), loadKeys);- }- if (cacheInfo != null) {- var cachePaths = Splitter.on('\n').splitToList(joinedCachePaths);- var activeServer = projectService.getActiveServer(cacheInfo.getLeft(), true);+ var cacheQueryResult = cacheService.queryCache(jobContext.getProjectId(), key, checksum);+ if (cacheQueryResult != null) {+ var activeServer = projectService.getActiveServer(cacheQueryResult.getProjectId(), true);if (activeServer.equals(clusterService.getLocalServerAddress())) {- jobCacheService.downloadCache(cacheInfo.getLeft(), cacheInfo.getRight(), cachePaths, os);+ cacheService.downloadCache(cacheQueryResult, cachePathsString, os);} else {Client client = ClientBuilder.newClient();client.property(ClientProperties.REQUEST_ENTITY_PROCESSING, "CHUNKED");@@ -192,9 +189,10 @@ public class KubernetesResource {String serverUrl = clusterService.getServerUrl(activeServer);var target = client.target(serverUrl).path("~api/cluster/cache")- .queryParam("projectId", cacheInfo.getLeft())- .queryParam("cacheId", cacheInfo.getRight())- .queryParam("cachePaths", Joiner.on('\n').join(cachePaths));+ .queryParam("projectId", cacheQueryResult.getProjectId())+ .queryParam("cacheId", cacheQueryResult.getCacheId())+ .queryParam("exactMatch", cacheQueryResult.isExactMatch())+ .queryParam("cachePathsString", cachePathsString);Invocation.Builder builder = target.request();builder.header(HttpHeaders.AUTHORIZATION,KubernetesHelper.BEARER + " " + clusterService.getCredential());@@ -211,7 +209,7 @@ public class KubernetesResource {}}} else {- os.write(0);+ os.write(CacheAvailability.NOT_FOUND.ordinal());}} finally {sessionService.openSession();@@ -247,17 +245,17 @@ public class KubernetesResource {public Response uploadCache(@QueryParam("jobToken") String jobToken,@QueryParam("projectPath") @Nullable String projectPath,- @QueryParam("cacheKey") String cacheKey,- @QueryParam("cachePaths") String joinedCachePaths,+ @QueryParam("key") String key,+ @QueryParam("checksum") @Nullable String checksum,+ @QueryParam("cachePathsString") String cachePathsString,InputStream is) {var projectId = checkUploadCache(jobToken, projectPath);sessionService.closeSession();try {- Long cacheId = jobCacheService.getCacheIdForUpload(projectId, cacheKey);- var cachePaths = Splitter.on('\n').splitToList(joinedCachePaths);+ Long cacheId = cacheService.createCache(projectId, key, checksum);var activeServer = projectService.getActiveServer(projectId, true);if (activeServer.equals(clusterService.getLocalServerAddress())) {- jobCacheService.uploadCache(projectId, cacheId, cachePaths, is);+ cacheService.uploadCache(projectId, cacheId, cachePathsString, is);} else {Client client = ClientBuilder.newClient();client.property(ClientProperties.REQUEST_ENTITY_PROCESSING, "CHUNKED");@@ -267,7 +265,7 @@ public class KubernetesResource {.path("~api/cluster/cache").queryParam("projectId", projectId).queryParam("cacheId", cacheId)- .queryParam("cachePaths", joinedCachePaths);+ .queryParam("cachePathsString", cachePathsString);Invocation.Builder builder = target.request();builder.header(HttpHeaders.AUTHORIZATION,KubernetesHelper.BEARER + " " + clusterService.getCredential());diff --git a/server-plugin/server-plugin-executor-remotedocker/src/main/java/io/onedev/server/plugin/executor/remotedocker/RemoteDockerExecutor.java b/server-plugin/server-plugin-executor-remotedocker/src/main/java/io/onedev/server/plugin/executor/remotedocker/RemoteDockerExecutor.javaindex 1e3492718e..89fd1190e2 100644--- a/server-plugin/server-plugin-executor-remotedocker/src/main/java/io/onedev/server/plugin/executor/remotedocker/RemoteDockerExecutor.java+++ b/server-plugin/server-plugin-executor-remotedocker/src/main/java/io/onedev/server/plugin/executor/remotedocker/RemoteDockerExecutor.java@@ -1,5 +1,13 @@package io.onedev.server.plugin.executor.remotedocker;+import static io.onedev.agent.WebsocketUtils.call;+import static java.util.stream.Collectors.toList;++import java.util.UUID;+import java.util.concurrent.TimeoutException;++import org.eclipse.jetty.websocket.api.Session;+import io.onedev.agent.Message;import io.onedev.agent.MessageTypes;import io.onedev.agent.job.DockerJobData;@@ -10,24 +18,21 @@ import io.onedev.server.OneDev;import io.onedev.server.annotation.Editable;import io.onedev.server.annotation.Numeric;import io.onedev.server.cluster.ClusterService;-import io.onedev.server.service.AgentService;-import io.onedev.server.service.SettingService;-import io.onedev.server.job.*;-import io.onedev.server.job.log.LogService;-import io.onedev.server.job.log.ServerJobLogger;+import io.onedev.server.job.AgentShell;+import io.onedev.server.job.JobContext;+import io.onedev.server.job.JobRunnable;+import io.onedev.server.job.JobService;+import io.onedev.server.job.JobTerminal;+import io.onedev.server.logging.LogService;+import io.onedev.server.logging.ServerLogger;import io.onedev.server.persistence.SessionService;import io.onedev.server.plugin.executor.serverdocker.ServerDockerExecutor;import io.onedev.server.search.entity.agent.AgentQuery;-import io.onedev.server.terminal.AgentShell;+import io.onedev.server.service.AgentService;+import io.onedev.server.service.ResourceService;+import io.onedev.server.service.SettingService;+import io.onedev.server.service.support.AgentRunnable;import io.onedev.server.terminal.Shell;-import io.onedev.server.terminal.Terminal;-import org.eclipse.jetty.websocket.api.Session;--import java.util.UUID;-import java.util.concurrent.TimeoutException;--import static io.onedev.agent.WebsocketUtils.call;-import static java.util.stream.Collectors.toList;@Editable(order=210, description="This executor runs build jobs as docker containers on remote machines via <a href='/~administration/agents' target='_blank'>agents</a>")public class RemoteDockerExecutor extends ServerDockerExecutor {@@ -84,7 +89,7 @@ public class RemoteDockerExecutor extends ServerDockerExecutor {@Overridepublic boolean execute(JobContext jobContext, TaskLogger logger) {- AgentRunnable runnable = (agentId) -> {+ AgentRunnable<Boolean> runnable = (agentId) -> {return getJobService().runJob(jobContext, new JobRunnable() {@Override@@ -125,7 +130,7 @@ public class RemoteDockerExecutor extends ServerDockerExecutor {}@Override- public Shell openShell(JobContext jobContext, Terminal terminal) {+ public Shell openShell(JobContext jobContext, JobTerminal terminal) {if (agentSession != null)return new AgentShell(terminal, agentSession, jobContext.getJobToken());else@@ -136,9 +141,9 @@ public class RemoteDockerExecutor extends ServerDockerExecutor {};logger.log("Pending resource allocation...");- return getResourceAllocator().runAgentJob(- AgentQuery.parse(agentQuery, true), getName(), getConcurrencyNumber(),- jobContext.getServices().size()+1, runnable);+ return getResourceService().runAgentJob(+ AgentQuery.parse(agentQuery, true), getName(),+ getConcurrencyNumber(), jobContext.getServices().size()+1, runnable);}private LogService getLogService() {@@ -149,19 +154,19 @@ public class RemoteDockerExecutor extends ServerDockerExecutor {return OneDev.getInstance(ClusterService.class);}- private ResourceAllocator getResourceAllocator() {- return OneDev.getInstance(ResourceAllocator.class);+ private ResourceService getResourceService() {+ return OneDev.getInstance(ResourceService.class);}@Overridepublic void test(TestData testData, TaskLogger jobLogger) {String jobToken = UUID.randomUUID().toString();- getLogService().addJobLogger(jobToken, jobLogger);+ getLogService().addLogger(jobToken, jobLogger);try {String testServer = getClusterService().getLocalServerAddress();jobLogger.log("Pending resource allocation...");- AgentRunnable runnable = agentId -> {- TaskLogger currentJobLogger = new ServerJobLogger(testServer, jobToken);+ AgentRunnable<Boolean> runnable = agentId -> {+ TaskLogger currentJobLogger = new ServerLogger(testServer, jobToken);var agentData = getSessionService().call(() -> getAgentService().load(agentId).getAgentData());@@ -177,15 +182,15 @@ public class RemoteDockerExecutor extends ServerDockerExecutor {getRunOptions());long timeout = 300*1000L;- if (getLogService().getJobLogger(jobToken) == null) {- getLogService().addJobLogger(jobToken, currentJobLogger);+ if (getLogService().getLogger(jobToken) == null) {+ getLogService().addLogger(jobToken, currentJobLogger);try {return call(agentSession, jobData, timeout);} catch (InterruptedException | TimeoutException e) {new Message(MessageTypes.CANCEL_JOB, jobToken).sendBy(agentSession);throw new RuntimeException(e);} finally {- getLogService().removeJobLogger(jobToken);+ getLogService().removeLogger(jobToken);}} else {try {@@ -197,11 +202,11 @@ public class RemoteDockerExecutor extends ServerDockerExecutor {}};- getResourceAllocator().runAgentJob(- AgentQuery.parse(agentQuery, true), getName(),- getConcurrencyNumber(), 1, runnable);+ getResourceService().runAgentJob(+ AgentQuery.parse(agentQuery, true),+ getName(), getConcurrencyNumber(), 1, runnable);} finally {- getLogService().removeJobLogger(jobToken);+ getLogService().removeLogger(jobToken);}}diff --git a/server-plugin/server-plugin-executor-remoteshell/src/main/java/io/onedev/server/plugin/executor/remoteshell/RemoteShellExecutor.java b/server-plugin/server-plugin-executor-remoteshell/src/main/java/io/onedev/server/plugin/executor/remoteshell/RemoteShellExecutor.javaindex 582a21d9e3..01d58ad8bc 100644--- a/server-plugin/server-plugin-executor-remoteshell/src/main/java/io/onedev/server/plugin/executor/remoteshell/RemoteShellExecutor.java+++ b/server-plugin/server-plugin-executor-remoteshell/src/main/java/io/onedev/server/plugin/executor/remoteshell/RemoteShellExecutor.java@@ -1,5 +1,12 @@package io.onedev.server.plugin.executor.remoteshell;+import static io.onedev.agent.WebsocketUtils.call;++import java.util.UUID;+import java.util.concurrent.TimeoutException;++import org.eclipse.jetty.websocket.api.Session;+import io.onedev.agent.Message;import io.onedev.agent.MessageTypes;import io.onedev.agent.job.ShellJobData;@@ -10,22 +17,20 @@ import io.onedev.server.OneDev;import io.onedev.server.annotation.Editable;import io.onedev.server.annotation.Numeric;import io.onedev.server.cluster.ClusterService;-import io.onedev.server.service.AgentService;-import io.onedev.server.job.*;-import io.onedev.server.job.log.LogService;-import io.onedev.server.job.log.ServerJobLogger;+import io.onedev.server.job.AgentShell;+import io.onedev.server.job.JobContext;+import io.onedev.server.job.JobRunnable;+import io.onedev.server.job.JobService;+import io.onedev.server.job.JobTerminal;+import io.onedev.server.logging.LogService;+import io.onedev.server.logging.ServerLogger;import io.onedev.server.persistence.SessionService;import io.onedev.server.plugin.executor.servershell.ServerShellExecutor;import io.onedev.server.search.entity.agent.AgentQuery;-import io.onedev.server.terminal.AgentShell;+import io.onedev.server.service.AgentService;+import io.onedev.server.service.ResourceService;+import io.onedev.server.service.support.AgentRunnable;import io.onedev.server.terminal.Shell;-import io.onedev.server.terminal.Terminal;-import org.eclipse.jetty.websocket.api.Session;--import java.util.UUID;-import java.util.concurrent.TimeoutException;--import static io.onedev.agent.WebsocketUtils.call;@Editable(order=500, name="Remote Shell Executor", description=""+ "This executor runs build jobs with remote machines's shell facility via <a href='/~administration/agents' target='_blank'>agents</a><br>"@@ -72,7 +77,7 @@ public class RemoteShellExecutor extends ServerShellExecutor {@Overridepublic boolean execute(JobContext jobContext, TaskLogger jobLogger) {- AgentRunnable runnable = (agentId) -> getJobService().runJob(jobContext, new JobRunnable() {+ AgentRunnable<Boolean> runnable = (agentId) -> getJobService().runJob(jobContext, new JobRunnable() {private static final long serialVersionUID = 1L;@@ -116,7 +121,7 @@ public class RemoteShellExecutor extends ServerShellExecutor {}@Override- public Shell openShell(JobContext jobContext, Terminal terminal) {+ public Shell openShell(JobContext jobContext, JobTerminal terminal) {if (agentSession != null)return new AgentShell(terminal, agentSession, jobContext.getJobToken());else@@ -126,8 +131,8 @@ public class RemoteShellExecutor extends ServerShellExecutor {});jobLogger.log("Pending resource allocation...");- return getResourceAllocator().runAgentJob(AgentQuery.parse(agentQuery, true), getName(),- getConcurrencyNumber(), 1, runnable);+ return getResourceService().runAgentJob(AgentQuery.parse(agentQuery, true),+ getName(), getConcurrencyNumber(), 1, runnable);}private LogService getLogService() {@@ -142,8 +147,8 @@ public class RemoteShellExecutor extends ServerShellExecutor {return OneDev.getInstance(JobService.class);}- private ResourceAllocator getResourceAllocator() {- return OneDev.getInstance(ResourceAllocator.class);+ private ResourceService getResourceService() {+ return OneDev.getInstance(ResourceService.class);}private AgentService getAgentService() {@@ -157,12 +162,12 @@ public class RemoteShellExecutor extends ServerShellExecutor {@Overridepublic void test(TestData testData, TaskLogger jobLogger) {String jobToken = UUID.randomUUID().toString();- getLogService().addJobLogger(jobToken, jobLogger);+ getLogService().addLogger(jobToken, jobLogger);try {String testServer = getClusterService().getLocalServerAddress();jobLogger.log("Pending resource allocation...");- AgentRunnable runnable = agentId -> {- TaskLogger currentJobLogger = new ServerJobLogger(testServer, jobToken);+ AgentRunnable<Boolean> runnable = agentId -> {+ TaskLogger currentJobLogger = new ServerLogger(testServer, jobToken);var agentData = getSessionService().call(() -> getAgentService().load(agentId).getAgentData());@@ -175,15 +180,15 @@ public class RemoteShellExecutor extends ServerShellExecutor {TestShellJobData jobData = new TestShellJobData(jobToken, testData.getCommands());long timeout = 300*1000L;- if (getLogService().getJobLogger(jobToken) == null) {- getLogService().addJobLogger(jobToken, currentJobLogger);+ if (getLogService().getLogger(jobToken) == null) {+ getLogService().addLogger(jobToken, currentJobLogger);try {return call(agentSession, jobData, timeout);} catch (InterruptedException | TimeoutException e) {new Message(MessageTypes.CANCEL_JOB, jobToken).sendBy(agentSession);throw new RuntimeException(e);} finally {- getLogService().removeJobLogger(jobToken);+ getLogService().removeLogger(jobToken);}} else {try {@@ -195,10 +200,10 @@ public class RemoteShellExecutor extends ServerShellExecutor {}};- getResourceAllocator().runAgentJob(AgentQuery.parse(agentQuery, true), getName(),- getConcurrencyNumber(), 1, runnable);+ getResourceService().runAgentJob(AgentQuery.parse(agentQuery, true),+ getName(), getConcurrencyNumber(), 1, runnable);} finally {- getLogService().removeJobLogger(jobToken);+ getLogService().removeLogger(jobToken);}}diff --git a/server-plugin/server-plugin-executor-serverdocker/src/main/java/io/onedev/server/plugin/executor/serverdocker/ServerDockerExecutor.java b/server-plugin/server-plugin-executor-serverdocker/src/main/java/io/onedev/server/plugin/executor/serverdocker/ServerDockerExecutor.javaindex 4a4902b25e..7d100db8e1 100644--- a/server-plugin/server-plugin-executor-serverdocker/src/main/java/io/onedev/server/plugin/executor/serverdocker/ServerDockerExecutor.java+++ b/server-plugin/server-plugin-executor-serverdocker/src/main/java/io/onedev/server/plugin/executor/serverdocker/ServerDockerExecutor.java@@ -1,21 +1,20 @@package io.onedev.server.plugin.executor.serverdocker;-import static io.onedev.agent.DockerExecutorUtils.buildImage;-import static io.onedev.agent.DockerExecutorUtils.callWithDockerConfig;-import static io.onedev.agent.DockerExecutorUtils.changeOwner;-import static io.onedev.agent.DockerExecutorUtils.createNetwork;-import static io.onedev.agent.DockerExecutorUtils.deleteDir;-import static io.onedev.agent.DockerExecutorUtils.deleteNetwork;-import static io.onedev.agent.DockerExecutorUtils.getEntrypoint;-import static io.onedev.agent.DockerExecutorUtils.getOwner;-import static io.onedev.agent.DockerExecutorUtils.isUseProcessIsolation;-import static io.onedev.agent.DockerExecutorUtils.newDockerKiller;-import static io.onedev.agent.DockerExecutorUtils.pruneBuilderCache;-import static io.onedev.agent.DockerExecutorUtils.runImagetools;-import static io.onedev.agent.DockerExecutorUtils.startService;-import static io.onedev.agent.DockerExecutorUtils.useDockerSock;-import static io.onedev.agent.ExecutorUtils.newErrorLogger;-import static io.onedev.agent.ExecutorUtils.newInfoLogger;+import static io.onedev.agent.AgentUtils.buildImage;+import static io.onedev.agent.AgentUtils.callWithDockerConfig;+import static io.onedev.agent.AgentUtils.changeOwner;+import static io.onedev.agent.AgentUtils.createNetwork;+import static io.onedev.agent.AgentUtils.deleteDir;+import static io.onedev.agent.AgentUtils.deleteNetwork;+import static io.onedev.agent.AgentUtils.getEntrypoint;+import static io.onedev.agent.AgentUtils.getOwner;+import static io.onedev.agent.AgentUtils.newDockerKiller;+import static io.onedev.agent.AgentUtils.newErrorLogger;+import static io.onedev.agent.AgentUtils.newInfoLogger;+import static io.onedev.agent.AgentUtils.pruneBuilderCache;+import static io.onedev.agent.AgentUtils.runImagetools;+import static io.onedev.agent.AgentUtils.startService;+import static io.onedev.agent.AgentUtils.useDockerSock;import static io.onedev.k8shelper.KubernetesHelper.cloneRepository;import static io.onedev.k8shelper.KubernetesHelper.installGitCert;import static io.onedev.k8shelper.KubernetesHelper.stringifyStepPosition;@@ -34,20 +33,18 @@ import java.util.Set;import java.util.UUID;import java.util.concurrent.atomic.AtomicBoolean;-import org.jspecify.annotations.Nullable;import javax.validation.ConstraintValidatorContext;import javax.validation.Valid;import javax.validation.constraints.NotEmpty;import org.apache.commons.lang3.SystemUtils;+import org.jspecify.annotations.Nullable;import com.google.common.base.Preconditions;-import io.onedev.agent.DockerExecutorUtils;-import io.onedev.agent.ExecutorUtils;+import io.onedev.agent.AgentUtils;import io.onedev.commons.bootstrap.Bootstrap;import io.onedev.commons.bootstrap.SecretMasker;-import io.onedev.commons.loader.AppLoader;import io.onedev.commons.utils.ExplicitException;import io.onedev.commons.utils.FileUtils;import io.onedev.commons.utils.StringUtils;@@ -62,7 +59,6 @@ import io.onedev.k8shelper.CompositeFacade;import io.onedev.k8shelper.KubernetesHelper;import io.onedev.k8shelper.LeafFacade;import io.onedev.k8shelper.LeafHandler;-import io.onedev.k8shelper.OsInfo;import io.onedev.k8shelper.PruneBuilderCacheFacade;import io.onedev.k8shelper.RegistryLoginFacade;import io.onedev.k8shelper.RunContainerFacade;@@ -78,19 +74,19 @@ import io.onedev.server.annotation.OmitName;import io.onedev.server.annotation.ReservedOptions;import io.onedev.server.cluster.ClusterService;import io.onedev.server.cluster.ClusterTask;-import io.onedev.server.git.location.GitLocation;+import io.onedev.server.git.CommandUtils;import io.onedev.server.job.JobContext;-import io.onedev.server.job.JobService;import io.onedev.server.job.JobRunnable;-import io.onedev.server.job.ResourceAllocator;+import io.onedev.server.job.JobService;+import io.onedev.server.job.JobTerminal;import io.onedev.server.job.ServerCacheHelper;import io.onedev.server.model.support.administration.jobexecutor.DockerAware;import io.onedev.server.model.support.administration.jobexecutor.JobExecutor;import io.onedev.server.model.support.administration.jobexecutor.RegistryLogin;import io.onedev.server.plugin.executor.serverdocker.ServerDockerExecutor.TestData;+import io.onedev.server.service.ResourceService;import io.onedev.server.terminal.CommandlineShell;import io.onedev.server.terminal.Shell;-import io.onedev.server.terminal.Terminal;import io.onedev.server.validation.Validatable;import io.onedev.server.web.util.Testable;@@ -125,7 +121,7 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Teprivate String concurrency;- private transient volatile File hostBuildHome;+ private transient volatile File hostBuildDir;private transient volatile LeafFacade runningStep;@@ -158,7 +154,7 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Te}@Editable(order=510, group="More Settings", placeholder="Default", description="Optionally specify docker sock to use. "- + "Defaults to <i>/var/run/docker.sock</i> on Linux, and <i>//./pipe/docker_engine</i> on Windows")+ + "Defaults to <i>/var/run/docker.sock</i>")public String getDockerSockPath() {return dockerSockPath;}@@ -282,8 +278,8 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Tereturn OneDev.getInstance(JobService.class);}- private ResourceAllocator getResourceAllocator() {- return OneDev.getInstance(ResourceAllocator.class);+ private ResourceService getResourceService() {+ return OneDev.getInstance(ResourceService.class);}private int getConcurrencyNumber() {@@ -312,9 +308,9 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, TenotifyJobRunning(jobContext.getBuildId(), null);checkApplicable();- hostBuildHome = new File(Bootstrap.getTempDir(),+ hostBuildDir = new File(Bootstrap.getTempDir(),"onedev-build-" + jobContext.getProjectId() + "-" + jobContext.getBuildNumber() + "-" + jobContext.getSubmitSequence());- FileUtils.createDir(hostBuildHome);+ FileUtils.createDir(hostBuildDir);SecretMasker.push(jobContext.getSecretMasker());try {String network = getName() + "-" + jobContext.getProjectId() + "-"@@ -326,45 +322,33 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, TecreateNetwork(newDocker(), network, getNetworkOptions(), jobLogger);try {- OsInfo osInfo = OneDev.getInstance(OsInfo.class);-var jobToken = jobContext.getJobToken();for (var jobService : jobContext.getServices()) {var docker = newDocker();var registryLogins = merge(jobService.getRegistryLogins(), getRegistryLogins(jobToken));callWithDockerConfig(docker, registryLogins, () -> {- startService(docker, network, jobService, osInfo,- getCpuLimit(), getMemoryLimit(), jobLogger);+ startService(docker, network, jobService, getCpuLimit(), getMemoryLimit(), jobLogger);return null;});}- File hostWorkspace = new File(hostBuildHome, "workspace");- File hostUserHome = new File(hostBuildHome, "user");- FileUtils.createDir(hostWorkspace);- FileUtils.createDir(hostUserHome);+ File hostWorkDir = new File(hostBuildDir, "workspace");+ File hostUserDir = new File(hostBuildDir, "user");+ FileUtils.createDir(hostWorkDir);+ FileUtils.createDir(hostUserDir);- var cacheHelper = new ServerCacheHelper(hostBuildHome, jobContext, jobLogger);+ var cacheHelper = new ServerCacheHelper(hostBuildDir, jobContext, jobLogger);try {jobLogger.log("Copying job dependencies...");- getJobService().copyDependencies(jobContext, hostWorkspace);+ getJobService().copyDependencies(jobContext, hostWorkDir);- String containerBuildHome;- String containerWorkspace;- String containerTrustCerts;- if (SystemUtils.IS_OS_WINDOWS) {- containerBuildHome = "C:\\onedev-build";- containerWorkspace = "C:\\onedev-build\\workspace";- containerTrustCerts = "C:\\onedev-build\\trust-certs.pem";- } else {- containerBuildHome = "/onedev-build";- containerWorkspace = "/onedev-build/workspace";- containerTrustCerts = "/onedev-build/trust-certs.pem";- }+ var containerBuildDirPath = "/onedev-build";+ var containerWorkDirPath = "/onedev-build/workspace";+ var containerTrustCertsPath = "/onedev-build/trust-certs.pem";var ownerChanged = new AtomicBoolean(false);- getJobService().reportJobWorkspace(jobContext, containerWorkspace);+ getJobService().reportJobWorkDir(jobContext, containerWorkDirPath);CompositeFacade entryFacade = new CompositeFacade(jobContext.getActions());var successful = entryFacade.execute(new LeafHandler() {@@ -374,7 +358,6 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, TeMap<String, String> volumeMounts, List<Integer> position, boolean useTTY) {containerName = network + "-step-" + stringifyStepPosition(position);try {- var useProcessIsolation = isUseProcessIsolation(docker, image, osInfo, jobLogger);docker.clearArgs();docker.addArgs("run", "--name=" + containerName, "--network=" + network);@@ -382,7 +365,7 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Tedocker.addArgs("--pull=always");if (runAs != null)docker.addArgs("--user", runAs);- else if (!SystemUtils.IS_OS_WINDOWS)+ elsedocker.addArgs("--user", "0:0");if (getCpuLimit() != null)@@ -392,56 +375,47 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Teif (getRunOptions() != null)docker.addArgs(StringUtils.parseQuoteTokens(getRunOptions()));- docker.addArgs("-v", getHostPath(hostBuildHome.getAbsolutePath()) + ":" + containerBuildHome);+ docker.addArgs("-v", getHostPath(hostBuildDir.getAbsolutePath()) + ":" + containerBuildDirPath);for (Map.Entry<String, String> entry : volumeMounts.entrySet()) {if (entry.getKey().contains(".."))throw new ExplicitException("Volume mount source path should not contain '..'");- String hostPath = getHostPath(new File(hostWorkspace, entry.getKey()).getAbsolutePath());+ String hostPath = getHostPath(new File(hostWorkDir, entry.getKey()).getAbsolutePath());docker.addArgs("-v", hostPath + ":" + entry.getValue());}if (entrypoint != null)- docker.addArgs("-w", containerWorkspace);+ docker.addArgs("-w", containerWorkDirPath);else if (workingDir != null)docker.addArgs("-w", workingDir);cacheHelper.mountVolumes(docker, ServerDockerExecutor.this::getHostPath);if (isMountDockerSock()) {- if (getDockerSockPath() != null) {- if (SystemUtils.IS_OS_WINDOWS)- docker.addArgs("-v", getDockerSockPath() + "://./pipe/docker_engine");- else- docker.addArgs("-v", getDockerSockPath() + ":/var/run/docker.sock");- } else {- if (SystemUtils.IS_OS_WINDOWS)- docker.addArgs("-v", "//./pipe/docker_engine://./pipe/docker_engine");- else- docker.addArgs("-v", "/var/run/docker.sock:/var/run/docker.sock");- }+ if (getDockerSockPath() != null)+ docker.addArgs("-v", getDockerSockPath() + ":/var/run/docker.sock");+ else+ docker.addArgs("-v", "/var/run/docker.sock:/var/run/docker.sock");}for (Map.Entry<String, String> entry : environments.entrySet())docker.addArgs("-e", entry.getKey() + "=" + entry.getValue());- docker.addArgs("-e", "ONEDEV_WORKSPACE=" + containerWorkspace);+ docker.addArgs("-e", "ONEDEV_WORKDIR=" + containerWorkDirPath);+ docker.addArgs("-e", "ONEDEV_WORKSPACE=" + containerWorkDirPath);if (useTTY)docker.addArgs("-t");if (entrypoint != null)docker.addArgs("--entrypoint=" + entrypoint);-- if (useProcessIsolation)- docker.addArgs("--isolation=process");docker.addArgs(image);docker.addArgs(arguments.toArray(new String[0]));docker.processKiller(newDockerKiller(newDocker(), containerName, jobLogger));- var result = docker.execute(ExecutorUtils.newInfoLogger(jobLogger),- ExecutorUtils.newWarningLogger(jobLogger), null);+ var result = docker.execute(AgentUtils.newInfoLogger(jobLogger),+ AgentUtils.newWarningLogger(jobLogger), null);return result.getReturnCode();} finally {containerName = null;@@ -450,7 +424,7 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Te@Overridepublic boolean execute(LeafFacade facade, List<Integer> position) {- return ExecutorUtils.runStep(entryFacade, position, jobLogger, () -> {+ return AgentUtils.runStep(entryFacade, position, jobLogger, () -> {runningStep = facade;try {return doExecute(facade, position);@@ -462,20 +436,20 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Teprivate boolean doExecute(LeafFacade facade, List<Integer> position) {if (ownerChanged.get() && !Bootstrap.isInDocker()) {- changeOwner(hostBuildHome, getOwner(), newDocker(), false);+ changeOwner(hostBuildDir, getOwner(), newDocker(), false);ownerChanged.set(false);}if (facade instanceof CommandFacade) {- CommandFacade commandFacade = ((CommandFacade) facade).replacePlaceholders(hostBuildHome);+ CommandFacade commandFacade = ((CommandFacade) facade).replacePlaceholders(hostBuildDir);if (commandFacade.getImage() == null) {throw new ExplicitException("This step can only be executed by server shell "+ "executor or remote shell executor");}- Commandline entrypoint = getEntrypoint(hostBuildHome, commandFacade, position);+ Commandline entrypoint = getEntrypoint(hostBuildDir, commandFacade, position);var docker = newDocker();- if (changeOwner(hostBuildHome, commandFacade.getRunAs(), docker, Bootstrap.isInDocker()))+ if (changeOwner(hostBuildDir, commandFacade.getRunAs(), docker, Bootstrap.isInDocker()))ownerChanged.set(true);var registryLogins = merge(commandFacade.getRegistryLogins(), getRegistryLogins(jobToken));@@ -496,7 +470,7 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Tevar docker = newDocker();var registryLogins = merge(buildImageFacade.getRegistryLogins(), getRegistryLogins(jobToken));callWithDockerConfig(docker, registryLogins, () -> {- buildImage(docker, getDockerBuilder(), buildImageFacade, hostBuildHome,+ buildImage(docker, getDockerBuilder(), buildImageFacade, hostBuildDir,isAlwaysPullImage(), jobLogger);return null;});@@ -505,7 +479,7 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Tevar docker = newDocker();var registryLogins = merge(runImagetoolsFacade.getRegistryLogins(), getRegistryLogins(jobToken));callWithDockerConfig(docker, registryLogins, () -> {- runImagetools(docker, runImagetoolsFacade, hostBuildHome, jobLogger);+ runImagetools(docker, runImagetoolsFacade, hostBuildDir, jobLogger);return null;});} else if (facade instanceof PruneBuilderCacheFacade) {@@ -513,18 +487,18 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Tevar docker = newDocker();callWithDockerConfig(docker, new ArrayList<>(), () -> {pruneBuilderCache(docker, getDockerBuilder(), pruneBuilderCacheFacade,- hostBuildHome, jobLogger);+ hostBuildDir, jobLogger);return null;});} else if (facade instanceof RunContainerFacade) {- RunContainerFacade runContainerFacade = ((RunContainerFacade) facade).replacePlaceholders(hostBuildHome);+ RunContainerFacade runContainerFacade = ((RunContainerFacade) facade).replacePlaceholders(hostBuildDir);List<String> arguments = new ArrayList<>();if (runContainerFacade.getArgs() != null)arguments.addAll(Arrays.asList(StringUtils.parseQuoteTokens(runContainerFacade.getArgs())));var registryLogins = merge(runContainerFacade.getRegistryLogins(), getRegistryLogins(jobToken));var docker = newDocker();- if (changeOwner(hostBuildHome, runContainerFacade.getRunAs(), docker, Bootstrap.isInDocker()))+ if (changeOwner(hostBuildDir, runContainerFacade.getRunAs(), docker, Bootstrap.isInDocker()))ownerChanged.set(true);docker.clearArgs();@@ -541,27 +515,27 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, TeCheckoutFacade checkoutFacade = (CheckoutFacade) facade;jobLogger.log("Checking out code...");- Commandline git = new Commandline(AppLoader.getInstance(GitLocation.class).getExecutable());+ Commandline git = CommandUtils.newGit();- git.environments().put("HOME", hostUserHome.getAbsolutePath());+ git.environments().put("HOME", hostUserDir.getAbsolutePath());- checkoutFacade.setupWorkingDir(git, hostWorkspace);+ checkoutFacade.setupWorkingDir(git, hostWorkDir);if (!Bootstrap.isInDocker()) {- checkoutFacade.setupSafeDirectory(git, containerWorkspace,+ checkoutFacade.setupSafeDirectory(git, containerWorkDirPath,newInfoLogger(jobLogger), newErrorLogger(jobLogger));}- File trustCertsFile = new File(hostBuildHome, "trust-certs.pem");+ File trustCertsFile = new File(hostBuildDir, "trust-certs.pem");installGitCert(git, Bootstrap.getTrustCertsDir(),- trustCertsFile, containerTrustCerts,- ExecutorUtils.newInfoLogger(jobLogger),- ExecutorUtils.newWarningLogger(jobLogger));+ trustCertsFile, containerTrustCertsPath,+ AgentUtils.newInfoLogger(jobLogger),+ AgentUtils.newWarningLogger(jobLogger));CloneInfo cloneInfo = checkoutFacade.getCloneInfo();- cloneInfo.writeAuthData(hostUserHome, git, true,- ExecutorUtils.newInfoLogger(jobLogger),- ExecutorUtils.newWarningLogger(jobLogger));+ cloneInfo.writeAuthData(hostUserDir, git, true,+ AgentUtils.newInfoLogger(jobLogger),+ AgentUtils.newWarningLogger(jobLogger));if (trustCertsFile.exists())git.addArgs("-c", "http.sslCAInfo=" + trustCertsFile.getAbsolutePath());@@ -571,13 +545,17 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, TecloneRepository(git, jobContext.getProjectGitDir(), cloneInfo.getCloneUrl(),jobContext.getRefName(), jobContext.getCommitId().name(),checkoutFacade.isWithLfs(), checkoutFacade.isWithSubmodules(),- cloneDepth, ExecutorUtils.newInfoLogger(jobLogger), ExecutorUtils.newWarningLogger(jobLogger));+ cloneDepth, AgentUtils.newInfoLogger(jobLogger), AgentUtils.newWarningLogger(jobLogger));} else if (facade instanceof SetupCacheFacade) {SetupCacheFacade setupCacheFacade = (SetupCacheFacade) facade;+ for (var cachePath: setupCacheFacade.getPaths()) {+ if (cachePath.isRelativeToHomeIfNotAbsolute() && !cachePath.isAbsolute())+ throw new ExplicitException("Docker executor does not allow home relative cache path (" + cachePath.getPathValue() + "). Use absolute path instead");+ }cacheHelper.setupCache(setupCacheFacade);} else if (facade instanceof ServerSideFacade) {ServerSideFacade serverSideFacade = (ServerSideFacade) facade;- return serverSideFacade.execute(hostBuildHome, new ServerSideFacade.Runner() {+ return serverSideFacade.execute(hostBuildDir, new ServerSideFacade.Runner() {@Overridepublic ServerStepResult run(File inputDir, Map<String, String> placeholderValues) {@@ -605,7 +583,7 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Te} finally {// Fix https://code.onedev.io/onedev/server/~issues/597if (SystemUtils.IS_OS_WINDOWS) {- FileUtils.deleteDir(hostWorkspace);+ FileUtils.deleteDir(hostWorkDir);}}} finally {@@ -613,42 +591,40 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Te}} finally {SecretMasker.pop();- synchronized (hostBuildHome) {- deleteDir(hostBuildHome, newDocker(), Bootstrap.isInDocker());+ synchronized (hostBuildDir) {+ deleteDir(hostBuildDir, newDocker(), Bootstrap.isInDocker());}}}@Overridepublic void resume(JobContext jobContext) {- if (hostBuildHome != null) synchronized (hostBuildHome) {- if (hostBuildHome.exists())- FileUtils.touchFile(new File(hostBuildHome, "continue"));+ if (hostBuildDir != null) synchronized (hostBuildDir) {+ if (hostBuildDir.exists())+ FileUtils.touchFile(new File(hostBuildDir, "continue"));}}@Override- public Shell openShell(JobContext jobContext, Terminal terminal) {+ public Shell openShell(JobContext jobContext, JobTerminal terminal) {String containerNameCopy = containerName;if (containerNameCopy != null) {Commandline docker = newDocker();docker.addArgs("exec", "-it", containerNameCopy);if (runningStep instanceof CommandFacade) {CommandFacade commandStep = (CommandFacade) runningStep;- docker.addArgs(commandStep.getShell(SystemUtils.IS_OS_WINDOWS, null));- } else if (SystemUtils.IS_OS_WINDOWS) {- docker.addArgs("cmd");+ docker.addArgs(commandStep.getShell(false, null));} else {docker.addArgs("sh");}return new CommandlineShell(terminal, docker);- } else if (hostBuildHome != null) {+ } else if (hostBuildDir != null) {Commandline shell;if (SystemUtils.IS_OS_WINDOWS)shell = new Commandline("cmd");elseshell = new Commandline("sh");- shell.workingDir(new File(hostBuildHome, "workspace"));+ shell.workingDir(new File(hostBuildDir, "workspace"));return new CommandlineShell(terminal, shell);} else {throw new ExplicitException("Shell not ready");@@ -657,7 +633,7 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Te});jobLogger.log("Pending resource allocation...");- return getResourceAllocator().runServerJob(getName(), getConcurrencyNumber(),+ return getResourceService().runServerJob(getName(), getConcurrencyNumber(),jobContext.getServices().size() + 1, runnable);}@@ -689,7 +665,7 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Te|| path.startsWith(installPath + "\\"));if (hostInstallPath == null) {if (Bootstrap.isInDocker())- hostInstallPath = DockerExecutorUtils.getHostPath(newDocker(), installPath);+ hostInstallPath = AgentUtils.getHostPath(newDocker(), installPath);elsehostInstallPath = installPath;}@@ -706,9 +682,9 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, TecheckApplicable();var docker = newDocker();callWithDockerConfig(docker, getRegistryLogins(UUID.randomUUID().toString()), () -> {- File workspaceDir = null;+ File workDir = null;try {- workspaceDir = FileUtils.createTempDir("workspace");+ workDir = FileUtils.createTempDir("workspace");jobLogger.log("Testing specified docker image...");docker.clearArgs();docker.addArgs("run", "--rm");@@ -718,20 +694,12 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Tedocker.addArgs("--memory", getMemoryLimit());if (getRunOptions() != null)docker.addArgs(StringUtils.parseQuoteTokens(getRunOptions()));- String containerWorkspacePath;- if (SystemUtils.IS_OS_WINDOWS)- containerWorkspacePath = "C:\\onedev-build\\workspace";- else- containerWorkspacePath = "/onedev-build/workspace";- docker.addArgs("-v", getHostPath(workspaceDir.getAbsolutePath()) + ":" + containerWorkspacePath);- docker.addArgs("-w", containerWorkspacePath);- docker.addArgs(testData.getDockerImage());+ var containerWorkspacePath = "/onedev-build/workspace";+ docker.addArgs("-v", getHostPath(workDir.getAbsolutePath()) + ":" + containerWorkspacePath);- if (SystemUtils.IS_OS_WINDOWS)- docker.addArgs("cmd", "/c", "echo hello from container");- else- docker.addArgs("sh", "-c", "echo hello from container");+ docker.addArgs("-w", containerWorkspacePath);+ docker.addArgs(testData.getDockerImage(), "sh", "-c", "echo hello from container");docker.execute(new LineConsumer() {@@ -749,32 +717,30 @@ public class ServerDockerExecutor extends JobExecutor implements DockerAware, Te}).checkReturnCode();} finally {- if (workspaceDir != null)- FileUtils.deleteDir(workspaceDir);+ if (workDir != null)+ FileUtils.deleteDir(workDir);}- if (!SystemUtils.IS_OS_WINDOWS) {- jobLogger.log("Checking busybox availability...");- docker.clearArgs();- docker.addArgs("run", "--rm", "busybox", "sh", "-c", "echo hello from busybox");- docker.execute(new LineConsumer() {+ jobLogger.log("Checking busybox availability...");+ docker.clearArgs();+ docker.addArgs("run", "--rm", "busybox", "sh", "-c", "echo hello from busybox");+ docker.execute(new LineConsumer() {- @Override- public void consume(String line) {- jobLogger.log(line);- }+ @Override+ public void consume(String line) {+ jobLogger.log(line);+ }- }, new LineConsumer() {+ }, new LineConsumer() {- @Override- public void consume(String line) {- jobLogger.log(line);- }+ @Override+ public void consume(String line) {+ jobLogger.log(line);+ }- }).checkReturnCode();- }+ }).checkReturnCode();- Commandline git = new Commandline(AppLoader.getInstance(GitLocation.class).getExecutable());+ Commandline git = CommandUtils.newGit();KubernetesHelper.testGitLfsAvailability(git, jobLogger);return null;diff --git a/server-plugin/server-plugin-executor-servershell/src/main/java/io/onedev/server/plugin/executor/servershell/ServerShellExecutor.java b/server-plugin/server-plugin-executor-servershell/src/main/java/io/onedev/server/plugin/executor/servershell/ServerShellExecutor.javaindex e936b372e9..c6d9a57187 100644--- a/server-plugin/server-plugin-executor-servershell/src/main/java/io/onedev/server/plugin/executor/servershell/ServerShellExecutor.java+++ b/server-plugin/server-plugin-executor-servershell/src/main/java/io/onedev/server/plugin/executor/servershell/ServerShellExecutor.java@@ -1,11 +1,10 @@package io.onedev.server.plugin.executor.servershell;-import static io.onedev.agent.ExecutorUtils.newInfoLogger;-import static io.onedev.agent.ExecutorUtils.newWarningLogger;-import static io.onedev.agent.ShellExecutorUtils.testCommands;+import static io.onedev.agent.AgentUtils.newInfoLogger;+import static io.onedev.agent.AgentUtils.newWarningLogger;import static io.onedev.k8shelper.KubernetesHelper.cloneRepository;-import static io.onedev.k8shelper.KubernetesHelper.installGitCert;import static io.onedev.k8shelper.KubernetesHelper.replacePlaceholders;+import static io.onedev.k8shelper.KubernetesHelper.setupGitForRemoteAccess;import static io.onedev.k8shelper.KubernetesHelper.stringifyStepPosition;import java.io.File;@@ -21,7 +20,7 @@ import javax.validation.constraints.NotEmpty;import org.apache.commons.lang.SystemUtils;-import io.onedev.agent.ExecutorUtils;+import io.onedev.agent.AgentUtils;import io.onedev.commons.bootstrap.Bootstrap;import io.onedev.commons.bootstrap.SecretMasker;import io.onedev.commons.loader.AppLoader;@@ -31,7 +30,6 @@ import io.onedev.commons.utils.TaskLogger;import io.onedev.commons.utils.command.Commandline;import io.onedev.k8shelper.BuildImageFacade;import io.onedev.k8shelper.CheckoutFacade;-import io.onedev.k8shelper.CloneInfo;import io.onedev.k8shelper.CommandFacade;import io.onedev.k8shelper.CompositeFacade;import io.onedev.k8shelper.LeafFacade;@@ -49,17 +47,18 @@ import io.onedev.server.annotation.Numeric;import io.onedev.server.annotation.OmitName;import io.onedev.server.cluster.ClusterService;import io.onedev.server.cluster.ClusterTask;+import io.onedev.server.git.CommandUtils;import io.onedev.server.git.location.GitLocation;import io.onedev.server.job.JobContext;-import io.onedev.server.job.JobService;import io.onedev.server.job.JobRunnable;-import io.onedev.server.job.ResourceAllocator;+import io.onedev.server.job.JobService;+import io.onedev.server.job.JobTerminal;import io.onedev.server.job.ServerCacheHelper;import io.onedev.server.model.support.administration.jobexecutor.JobExecutor;import io.onedev.server.plugin.executor.servershell.ServerShellExecutor.TestData;+import io.onedev.server.service.ResourceService;import io.onedev.server.terminal.CommandlineShell;import io.onedev.server.terminal.Shell;-import io.onedev.server.terminal.Terminal;import io.onedev.server.web.util.Testable;@Editable(order=ServerShellExecutor.ORDER, name="Server Shell Executor", description="" +@@ -76,7 +75,7 @@ public class ServerShellExecutor extends JobExecutor implements Testable<TestDatprivate transient volatile LeafFacade runningStep;- private transient volatile File buildHome;+ private transient volatile File buildDir;@Editable(order=1000, description = "" +"Specify max number of jobs this executor can run concurrently. " +@@ -98,8 +97,8 @@ public class ServerShellExecutor extends JobExecutor implements Testable<TestDatreturn OneDev.getInstance(JobService.class);}- private ResourceAllocator getResourceAllocator() {- return OneDev.getInstance(ResourceAllocator.class);+ private ResourceService getResourceService() {+ return OneDev.getInstance(ResourceService.class);}private int getConcurrencyNumber() {@@ -118,10 +117,10 @@ public class ServerShellExecutor extends JobExecutor implements Testable<TestDatnotifyJobRunning(jobContext.getBuildId(), null);checkApplicable();- buildHome = new File(Bootstrap.getTempDir(),+ buildDir = new File(Bootstrap.getTempDir(),"onedev-build-" + jobContext.getProjectId() + "-" + jobContext.getBuildNumber() + "-" + jobContext.getSubmitSequence());- FileUtils.createDir(buildHome);- File workspaceDir = new File(buildHome, "workspace");+ FileUtils.createDir(buildDir);+ File workDir = new File(buildDir, "workspace");SecretMasker.push(jobContext.getSecretMasker());try {String localServer = getClusterService().getLocalServerAddress();@@ -134,24 +133,24 @@ public class ServerShellExecutor extends JobExecutor implements Testable<TestDatthrow new ExplicitException("This job requires services, which can only be supported "+ "by docker aware executors");}- FileUtils.createDir(workspaceDir);+ FileUtils.createDir(workDir);- var cacheHelper = new ServerCacheHelper(buildHome, jobContext, jobLogger);+ var cacheHelper = new ServerCacheHelper(buildDir, jobContext, jobLogger);jobLogger.log("Copying job dependencies...");- getJobService().copyDependencies(jobContext, workspaceDir);+ getJobService().copyDependencies(jobContext, workDir);- File userHome = new File(buildHome, "user");- FileUtils.createDir(userHome);+ File userDir = new File(buildDir, "user");+ FileUtils.createDir(userDir);- getJobService().reportJobWorkspace(jobContext, workspaceDir.getAbsolutePath());+ getJobService().reportJobWorkDir(jobContext, workDir.getAbsolutePath());CompositeFacade entryFacade = new CompositeFacade(jobContext.getActions());var successful = entryFacade.execute(new LeafHandler() {@Overridepublic boolean execute(LeafFacade facade, List<Integer> position) {- return ExecutorUtils.runStep(entryFacade, position, jobLogger, () -> {+ return AgentUtils.runStep(entryFacade, position, jobLogger, () -> {runningStep = facade;try {return doExecute(facade, position);@@ -169,15 +168,15 @@ public class ServerShellExecutor extends JobExecutor implements Testable<TestDat+ "remote docker executor, or kubernetes executor");}- commandFacade.generatePauseCommand(buildHome);+ commandFacade.generatePauseCommand(buildDir);- var commandDir = new File(buildHome, "command");+ var commandDir = new File(buildDir, "command");FileUtils.createDir(commandDir);File stepScriptFile = new File(commandDir, "step-" + stringifyStepPosition(position) + commandFacade.getScriptExtension());try {FileUtils.writeStringToFile(stepScriptFile,- commandFacade.normalizeCommands(replacePlaceholders(commandFacade.getCommands(), buildHome)),+ commandFacade.normalizeCommands(replacePlaceholders(commandFacade.getCommands(), buildDir)),StandardCharsets.UTF_8);} catch (IOException e) {throw new RuntimeException(e);@@ -185,10 +184,11 @@ public class ServerShellExecutor extends JobExecutor implements Testable<TestDatCommandline interpreter = commandFacade.getScriptInterpreter();Map<String, String> environments = new HashMap<>();- environments.put("GIT_HOME", userHome.getAbsolutePath());- environments.put("ONEDEV_WORKSPACE", workspaceDir.getAbsolutePath());+ environments.put("HOME", userDir.getAbsolutePath());+ environments.put("ONEDEV_WORKDIR", workDir.getAbsolutePath());+ environments.put("ONEDEV_WORKSPACE", workDir.getAbsolutePath());environments.putAll(commandFacade.getEnvMap());- interpreter.workingDir(workspaceDir).environments(environments);+ interpreter.workingDir(workDir).environments(environments);interpreter.addArgs(stepScriptFile.getAbsolutePath());var result = interpreter.execute(newInfoLogger(jobLogger), newWarningLogger(jobLogger));@@ -200,44 +200,32 @@ public class ServerShellExecutor extends JobExecutor implements Testable<TestDat|| facade instanceof RunImagetoolsFacade || facade instanceof PruneBuilderCacheFacade) {throw new ExplicitException("This step can only be executed by server docker executor or "+ "remote docker executor");- } else if (facade instanceof CheckoutFacade) {- CheckoutFacade checkoutFacade = (CheckoutFacade) facade;- jobLogger.log("Checking out code...");-- Commandline git = new Commandline(AppLoader.getInstance(GitLocation.class).getExecutable());-- Map<String, String> environments = new HashMap<>();- environments.put("HOME", userHome.getAbsolutePath());- git.environments(environments);-- checkoutFacade.setupWorkingDir(git, workspaceDir);-- File trustCertsFile = new File(buildHome, "trust-certs.pem");- installGitCert(git, Bootstrap.getTrustCertsDir(), trustCertsFile,- trustCertsFile.getAbsolutePath(),- newInfoLogger(jobLogger),- newWarningLogger(jobLogger));-- CloneInfo cloneInfo = checkoutFacade.getCloneInfo();- cloneInfo.writeAuthData(userHome, git, false,- newInfoLogger(jobLogger),- newWarningLogger(jobLogger));-- int cloneDepth = checkoutFacade.getCloneDepth();-- cloneRepository(git, jobContext.getProjectGitDir(), cloneInfo.getCloneUrl(), jobContext.getRefName(),- jobContext.getCommitId().name(), checkoutFacade.isWithLfs(), checkoutFacade.isWithSubmodules(),- cloneDepth, newInfoLogger(jobLogger), newWarningLogger(jobLogger));+ } else if (facade instanceof CheckoutFacade) {+ CheckoutFacade checkoutFacade = (CheckoutFacade) facade;+ jobLogger.log("Checking out code...");++ Commandline git = new Commandline(AppLoader.getInstance(GitLocation.class).getExecutable());+ checkoutFacade.setupWorkingDir(git, workDir);++ var cloneInfo = checkoutFacade.getCloneInfo();+ setupGitForRemoteAccess(git, userDir, Bootstrap.getTrustCertsDir(),+ new File(buildDir, "trust-certs.pem"),+ cloneInfo, newInfoLogger(jobLogger), newWarningLogger(jobLogger));+ cloneRepository(git, jobContext.getProjectGitDir(), cloneInfo.getCloneUrl(),+ jobContext.getRefName(), jobContext.getCommitId().name(),+ checkoutFacade.isWithLfs(), checkoutFacade.isWithSubmodules(),+ checkoutFacade.getCloneDepth(),+ newInfoLogger(jobLogger), newWarningLogger(jobLogger));} else if (facade instanceof SetupCacheFacade) {SetupCacheFacade setupCacheFacade = (SetupCacheFacade) facade;for (var cachePath: setupCacheFacade.getPaths()) {- if (new File(cachePath).isAbsolute())- throw new ExplicitException("Shell executor does not allow absolute cache path: " + cachePath);+ if (cachePath.isAbsolute())+ throw new ExplicitException("Shell executor does not allow absolute cache path: " + cachePath.getPathValue());}cacheHelper.setupCache(setupCacheFacade);} else if (facade instanceof ServerSideFacade) {ServerSideFacade serverSideFacade = (ServerSideFacade) facade;- return serverSideFacade.execute(buildHome, new ServerSideFacade.Runner() {+ return serverSideFacade.execute(buildDir, new ServerSideFacade.Runner() {@Overridepublic ServerStepResult run(File inputDir, Map<String, String> placeholderValues) {@@ -265,36 +253,36 @@ public class ServerShellExecutor extends JobExecutor implements Testable<TestDat} finally {SecretMasker.pop();// Fix https://code.onedev.io/onedev/server/~issues/597- if (SystemUtils.IS_OS_WINDOWS && workspaceDir.exists())- FileUtils.deleteDir(workspaceDir);- synchronized (buildHome) {- FileUtils.deleteDir(buildHome);+ if (SystemUtils.IS_OS_WINDOWS && workDir.exists())+ FileUtils.deleteDir(workDir);+ synchronized (buildDir) {+ FileUtils.deleteDir(buildDir);}}}@Overridepublic void resume(JobContext jobContext) {- if (buildHome != null) synchronized (buildHome) {- if (buildHome.exists())- FileUtils.touchFile(new File(buildHome, "continue"));+ if (buildDir != null) synchronized (buildDir) {+ if (buildDir.exists())+ FileUtils.touchFile(new File(buildDir, "continue"));}}@Override- public Shell openShell(JobContext jobContext, Terminal terminal) {- if (buildHome != null) {- Commandline shell;+ public Shell openShell(JobContext jobContext, JobTerminal terminal) {+ if (buildDir != null) {+ Commandline cmdline;if (runningStep instanceof CommandFacade) {CommandFacade commandStep = (CommandFacade) runningStep;- shell = new Commandline(commandStep.getShell(SystemUtils.IS_OS_WINDOWS, null)[0]);+ cmdline = new Commandline(commandStep.getShell(SystemUtils.IS_OS_WINDOWS, null)[0]);} else if (SystemUtils.IS_OS_WINDOWS) {- shell = new Commandline("cmd");+ cmdline = new Commandline("cmd");} else {- shell = new Commandline("sh");+ cmdline = new Commandline("sh");}- shell.workingDir(new File(buildHome, "workspace"));- return new CommandlineShell(terminal, shell);+ cmdline.workingDir(new File(buildDir, "workspace"));+ return new CommandlineShell(terminal, cmdline);} else {throw new ExplicitException("Shell not ready");}@@ -302,8 +290,7 @@ public class ServerShellExecutor extends JobExecutor implements Testable<TestDat});jobLogger.log("Pending resource allocation...");- return getResourceAllocator().runServerJob(getName(), getConcurrencyNumber(),- 1, runnable);+ return getResourceService().runServerJob(getName(), getConcurrencyNumber(), 1, runnable);}private void checkApplicable() {@@ -321,8 +308,8 @@ public class ServerShellExecutor extends JobExecutor implements Testable<TestDatpublic void test(TestData testData, TaskLogger jobLogger) {checkApplicable();- Commandline git = new Commandline(AppLoader.getInstance(GitLocation.class).getExecutable());- testCommands(git, testData.getCommands(), jobLogger);+ Commandline git = CommandUtils.newGit();+ AgentUtils.testCommands(git, testData.getCommands(), jobLogger);}@Editable(name="Specify Shell/Batch Commands to Run")diff --git a/server-plugin/server-plugin-provisioner-shell/pom.xml b/server-plugin/server-plugin-provisioner-shell/pom.xmlnew file mode 100644index 0000000000..1f0addc744--- /dev/null+++ b/server-plugin/server-plugin-provisioner-shell/pom.xml@@ -0,0 +1,13 @@+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">+ <modelVersion>4.0.0</modelVersion>+ <artifactId>server-plugin-provisioner-shell</artifactId>+ <parent>+ <groupId>io.onedev</groupId>+ <artifactId>server-plugin</artifactId>+ <version>14.1.7</version>+ </parent>+ <properties>+ <moduleClass>io.onedev.server.plugin.provisioner.shell.ShellModule</moduleClass>+ </properties>+</project>diff --git a/server-plugin/server-plugin-provisioner-shell/src/main/java/io/onedev/server/plugin/provisioner/shell/ShellModule.java b/server-plugin/server-plugin-provisioner-shell/src/main/java/io/onedev/server/plugin/provisioner/shell/ShellModule.javanew file mode 100644index 0000000000..335ab17613--- /dev/null+++ b/server-plugin/server-plugin-provisioner-shell/src/main/java/io/onedev/server/plugin/provisioner/shell/ShellModule.java@@ -0,0 +1,40 @@+package io.onedev.server.plugin.provisioner.shell;++import java.util.Collection;++import com.google.common.collect.Sets;++import io.onedev.commons.bootstrap.Bootstrap;+import io.onedev.commons.loader.AbstractPluginModule;+import io.onedev.commons.loader.ImplementationProvider;+import io.onedev.server.model.support.administration.workspaceprovisioner.WorkspaceProvisioner;++/**+ * NOTE: Do not forget to rename moduleClass property defined in the pom if you've renamed this class.+ *+ */+public class ShellModule extends AbstractPluginModule {++ @Override+ protected void configure() {+ super.configure();++ // put your guice bindings here+ if (!Bootstrap.isInDocker()) {+ contribute(ImplementationProvider.class, new ImplementationProvider() {++ @Override+ public Class<?> getAbstractClass() {+ return WorkspaceProvisioner.class;+ }++ @Override+ public Collection<Class<?>> getImplementations() {+ return Sets.newHashSet(ShellProvisioner.class);+ }++ });+ }+ }++}diff --git a/server-plugin/server-plugin-provisioner-shell/src/main/java/io/onedev/server/plugin/provisioner/shell/ShellProvisioner.java b/server-plugin/server-plugin-provisioner-shell/src/main/java/io/onedev/server/plugin/provisioner/shell/ShellProvisioner.javanew file mode 100644index 0000000000..a180569fa0--- /dev/null+++ b/server-plugin/server-plugin-provisioner-shell/src/main/java/io/onedev/server/plugin/provisioner/shell/ShellProvisioner.java@@ -0,0 +1,216 @@+package io.onedev.server.plugin.provisioner.shell;++import static io.onedev.k8shelper.KubernetesHelper.cloneRepository;+import static io.onedev.k8shelper.KubernetesHelper.installGitLfs;+import static io.onedev.k8shelper.KubernetesHelper.setupGitForRemoteAccess;++import java.io.File;+import java.io.IOException;+import java.io.Serializable;+import java.nio.file.Files;+import java.util.concurrent.CountDownLatch;++import javax.validation.constraints.NotEmpty;++import org.apache.commons.lang3.SystemUtils;+import org.jspecify.annotations.Nullable;++import io.onedev.agent.AgentUtils;+import io.onedev.commons.bootstrap.Bootstrap;+import io.onedev.commons.utils.ExplicitException;+import io.onedev.commons.utils.FileUtils;+import io.onedev.commons.utils.TaskLogger;+import io.onedev.commons.utils.command.Commandline;+import io.onedev.server.OneDev;+import io.onedev.server.annotation.Code;+import io.onedev.server.annotation.Editable;+import io.onedev.server.annotation.OmitName;+import io.onedev.server.git.CommandUtils;+import io.onedev.server.git.GitUtils;+import io.onedev.server.git.hook.HookUtils;+import io.onedev.server.model.Workspace;+import io.onedev.server.model.support.administration.workspaceprovisioner.WorkspaceProvisioner;+import io.onedev.server.plugin.provisioner.shell.ShellProvisioner.TestData;+import io.onedev.server.terminal.CommandlineShell;+import io.onedev.server.terminal.Shell;+import io.onedev.server.terminal.Terminal;+import io.onedev.server.web.util.Testable;+import io.onedev.server.workspace.WorkspaceContext;+import io.onedev.server.workspace.WorkspaceRuntime;++@Editable(order=ShellProvisioner.ORDER, name="Shell Provisioner", description="" ++ "This provisioner creates workspaces with OneDev server's shell facility.<br>" ++ "<b class='text-danger'>WARNING</b>: Workspaces created by this provisioner has same " ++ "permission as OneDev server process. Make sure it can only be used by trusted projects")+public class ShellProvisioner extends WorkspaceProvisioner implements Testable<TestData> {++ private static final long serialVersionUID = 1L;++ static final int ORDER = 400;++ private void checkApplicable() {+ if (OneDev.getK8sService() != null) {+ throw new ExplicitException(""+ + "OneDev running inside kubernetes cluster does not support server shell provider. "+ + "Please use kubernetes provider instead");+ } else if (Bootstrap.isInDocker()) {+ throw new ExplicitException("Server shell provider is only supported when OneDev is installed "+ + "directly on bare metal/virtual machine");+ }+ }++ @Override+ public void test(TestData testData, TaskLogger jobLogger) {+ checkApplicable();+ }++ @Editable(name="Specify Shell/Batch Commands to Run")+ public static class TestData implements Serializable {++ private static final long serialVersionUID = 1L;++ private String commands;++ @Editable+ @OmitName+ @Code(language=Code.SHELL)+ @NotEmpty+ public String getCommands() {+ return commands;+ }++ public void setCommands(String commands) {+ this.commands = commands;+ }++ }++ @Override+ public WorkspaceRuntime provision(WorkspaceContext context, TaskLogger logger) {+ checkApplicable();++ var localServer = getClusterService().getLocalServerAddress();+ logger.log(String.format("Provisioning workspace (provisioner: %s, server: %s)...",+ getName(), localServer));++ var workDir = Workspace.getWorkDir(context.getProjectId(), context.getWorkspaceNumber());+ var workspaceDir = workDir.getParentFile();+ FileUtils.createDir(workDir);++ var cloneInfo = context.getCloneInfo();++ var infoLogger = AgentUtils.newInfoLogger(logger);+ var errorLogger = AgentUtils.newWarningLogger(logger);++ var git = CommandUtils.newGit();+ git.workingDir(workDir);++ var userDir = new File(workspaceDir, "user");+ FileUtils.createDir(userDir);++ logger.log("Populating user configs...");++ for (var entry : context.getUserConfigs().entrySet()) {+ var configFile = new File(userDir, entry.getKey());+ FileUtils.createDir(configFile.getParentFile());+ try {+ Files.writeString(configFile.toPath(), entry.getValue());+ } catch (IOException e) {+ throw new RuntimeException(e);+ }+ }++ setupGitForRemoteAccess(git, userDir, Bootstrap.getTrustCertsDir(),+ new File(workspaceDir, "trust-certs.pem"),+ cloneInfo, infoLogger, errorLogger);++ git.addArgs("config", "--global", "user.name", context.getUserName());+ git.execute(infoLogger, errorLogger).checkReturnCode();+ git.clearArgs();++ git.addArgs("config", "--global", "pull.rebase", "false");+ git.execute(infoLogger, errorLogger).checkReturnCode();+ git.clearArgs();++ git.addArgs("config", "--global", "user.email", context.getUserEmail());+ git.execute(infoLogger, errorLogger).checkReturnCode();+ git.clearArgs();++ boolean repositoryCloned = false;++ if (new File(workDir, ".git").exists()) {+ git.addArgs("status");+ var statusResult = git.execute(infoLogger, errorLogger);+ git.clearArgs();++ if (statusResult.getReturnCode() == 0)+ repositoryCloned = true;+ }++ if (repositoryCloned) {+ // Fix origin url in case this is a backup replica just getting active+ git.addArgs("remote", "set-url", "origin", cloneInfo.getCloneUrl());+ git.execute(infoLogger, errorLogger).checkReturnCode();+ git.clearArgs();++ installGitLfs(git, infoLogger, errorLogger);++ logger.log("Repository already exists, skipping clone");+ } else {+ logger.log("Cloning repository...");+ if (context.getBranch() != null) {+ cloneRepository(git, context.getProjectGitDir(), cloneInfo.getCloneUrl(),+ GitUtils.branch2ref(context.getBranch()), null,+ context.isRetrieveLfs(), false, 0,+ infoLogger, errorLogger);+ } else {+ git.addArgs("config", "--global", "init.defaultBranch", "main");+ git.execute(infoLogger, errorLogger).checkReturnCode();+ git.clearArgs();++ git.addArgs("clone", cloneInfo.getCloneUrl(), ".");+ git.execute(infoLogger, errorLogger).checkReturnCode();+ git.clearArgs();++ installGitLfs(git, infoLogger, errorLogger);+ }+ }++ HookUtils.setupWorkspacePostCommitHook(new File(workDir, ".git"), context.isRetrieveLfs());++ context.getEnvVars().put("HOME", userDir.getAbsolutePath());+ context.getEnvVars().putAll(HookUtils.getWorkspacePostCommitHookEnvs(context.getToken()));++ return new WorkspaceRuntime() {++ private String getShellCmd(@Nullable String shell) {+ if (shell != null)+ return shell;+ else if (SystemUtils.IS_OS_WINDOWS)+ return "cmd";+ else+ return "sh";+ }++ @Override+ public Shell doOpenShell(Terminal terminal) {+ var shellCmd = getShellCmd(context.getShell());+ var workDir = Workspace.getWorkDir(context.getProjectId(), context.getWorkspaceNumber());+ FileUtils.createDir(workDir);+ var cmdline = new Commandline(shellCmd).workingDir(workDir).environments(context.getEnvVars());+ return new CommandlineShell(terminal, cmdline);+ }++ @Override+ public void await() {+ try {+ new CountDownLatch(1).await();+ } catch (InterruptedException e) {+ throw new RuntimeException(e);+ }+ }++ };+ }++}diff --git a/server-plugin/server-plugin-report-checkstyle/src/main/java/io/onedev/server/plugin/report/checkstyle/PublishCheckstyleReportStep.java b/server-plugin/server-plugin-report-checkstyle/src/main/java/io/onedev/server/plugin/report/checkstyle/PublishCheckstyleReportStep.javaindex 9cf8601c83..bd2576dfdf 100644--- a/server-plugin/server-plugin-report-checkstyle/src/main/java/io/onedev/server/plugin/report/checkstyle/PublishCheckstyleReportStep.java+++ b/server-plugin/server-plugin-report-checkstyle/src/main/java/io/onedev/server/plugin/report/checkstyle/PublishCheckstyleReportStep.java@@ -37,7 +37,7 @@ public class PublishCheckstyleReportStep extends PublishProblemReportStep {private int tabWidth = 8;- @Editable(order=100, description="Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, "+ @Editable(order=100, description="Specify checkstyle result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, "+ "for instance, <tt>target/checkstyle-result.xml</tt>. "+ "Refer to <a href='https://checkstyle.org/'>checkstyle documentation</a> "+ "on how to generate the result xml file. Use * or ? for pattern match")diff --git a/server-plugin/server-plugin-report-checkstyle/src/main/java/io/onedev/server/plugin/report/checkstyle/PublishESLintReportStep.java b/server-plugin/server-plugin-report-checkstyle/src/main/java/io/onedev/server/plugin/report/checkstyle/PublishESLintReportStep.javaindex 584d59615b..24e618b49d 100644--- a/server-plugin/server-plugin-report-checkstyle/src/main/java/io/onedev/server/plugin/report/checkstyle/PublishESLintReportStep.java+++ b/server-plugin/server-plugin-report-checkstyle/src/main/java/io/onedev/server/plugin/report/checkstyle/PublishESLintReportStep.java@@ -12,7 +12,7 @@ public class PublishESLintReportStep extends PublishCheckstyleReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. "+ @Editable(order=100, description="Specify ESLint report file in checkstyle format under <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. "+ "This file can be generated with ESLint option <tt>'-f checkstyle'</tt> and <tt>'-o'</tt>. "+ "Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")diff --git a/server-plugin/server-plugin-report-clippy/src/main/java/io/onedev/server/plugin/report/clippy/PublishClippyReportStep.java b/server-plugin/server-plugin-report-clippy/src/main/java/io/onedev/server/plugin/report/clippy/PublishClippyReportStep.javaindex 053d9c960e..fdca694fa8 100644--- a/server-plugin/server-plugin-report-clippy/src/main/java/io/onedev/server/plugin/report/clippy/PublishClippyReportStep.java+++ b/server-plugin/server-plugin-report-clippy/src/main/java/io/onedev/server/plugin/report/clippy/PublishClippyReportStep.java@@ -28,7 +28,7 @@ public class PublishClippyReportStep extends PublishProblemReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. "+ @Editable(order=100, description="Specify <a href='https://github.com/rust-lang/rust-clippy'>rust clippy</a> json output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. "+ "This file can be generated with clippy json output option, for instance <code>cargo clippy --message-format json>check-result.json</code>. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")@Patterns(path=true)diff --git a/server-plugin/server-plugin-report-clover/src/main/java/io/onedev/server/plugin/report/clover/PublishCloverReportStep.java b/server-plugin/server-plugin-report-clover/src/main/java/io/onedev/server/plugin/report/clover/PublishCloverReportStep.javaindex 3ea39970b3..89cfae1857 100644--- a/server-plugin/server-plugin-report-clover/src/main/java/io/onedev/server/plugin/report/clover/PublishCloverReportStep.java+++ b/server-plugin/server-plugin-report-clover/src/main/java/io/onedev/server/plugin/report/clover/PublishCloverReportStep.java@@ -31,7 +31,7 @@ public class PublishCloverReportStep extends PublishCoverageReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, "+ @Editable(order=100, description="Specify clover coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, "+ "for instance, <tt>target/site/clover/clover.xml</tt>. "+ "Refer to <a href='https://openclover.org/documentation'>OpenClover documentation</a> "+ "on how to generate clover xml file. Use * or ? for pattern match")diff --git a/server-plugin/server-plugin-report-clover/src/main/java/io/onedev/server/plugin/report/clover/PublishJestCoverageReportStep.java b/server-plugin/server-plugin-report-clover/src/main/java/io/onedev/server/plugin/report/clover/PublishJestCoverageReportStep.javaindex f12c9c8908..6d095c934c 100644--- a/server-plugin/server-plugin-report-clover/src/main/java/io/onedev/server/plugin/report/clover/PublishJestCoverageReportStep.java+++ b/server-plugin/server-plugin-report-clover/src/main/java/io/onedev/server/plugin/report/clover/PublishJestCoverageReportStep.java@@ -12,7 +12,7 @@ public class PublishJestCoverageReportStep extends PublishCloverReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, "+ @Editable(order=100, description="Specify Jest coverage report file in clover format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, "+ "for instance <tt>coverage/clover.xml</tt>. This file can be generated with Jest option <tt>'--coverage'</tt>. "+ "Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")diff --git a/server-plugin/server-plugin-report-cobertura/src/main/java/io/onedev/server/plugin/report/cobertura/PublishCoberturaReportStep.java b/server-plugin/server-plugin-report-cobertura/src/main/java/io/onedev/server/plugin/report/cobertura/PublishCoberturaReportStep.javaindex 4c89631702..cf75b64b06 100644--- a/server-plugin/server-plugin-report-cobertura/src/main/java/io/onedev/server/plugin/report/cobertura/PublishCoberturaReportStep.java+++ b/server-plugin/server-plugin-report-cobertura/src/main/java/io/onedev/server/plugin/report/cobertura/PublishCoberturaReportStep.java@@ -34,7 +34,7 @@ public class PublishCoberturaReportStep extends PublishCoverageReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, "+ @Editable(order=100, description="Specify cobertura coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, "+ "for instance, <tt>target/site/cobertura/coverage.xml</tt>. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")@Patterns(path=true)diff --git a/server-plugin/server-plugin-report-cpd/src/main/java/io/onedev/server/plugin/report/cpd/PublishCPDReportStep.java b/server-plugin/server-plugin-report-cpd/src/main/java/io/onedev/server/plugin/report/cpd/PublishCPDReportStep.javaindex a1a6cd3517..228f494895 100644--- a/server-plugin/server-plugin-report-cpd/src/main/java/io/onedev/server/plugin/report/cpd/PublishCPDReportStep.java+++ b/server-plugin/server-plugin-report-cpd/src/main/java/io/onedev/server/plugin/report/cpd/PublishCPDReportStep.java@@ -40,7 +40,7 @@ public class PublishCPDReportStep extends PublishProblemReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, "+ @Editable(order=100, description="Specify CPD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, "+ "for instance, <tt>target/cpd.xml</tt>. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")@Patterns(path=true)diff --git a/server-plugin/server-plugin-report-cppcheck/src/main/java/io/onedev/server/plugin/report/cppcheck/PublishCppcheckReportStep.java b/server-plugin/server-plugin-report-cppcheck/src/main/java/io/onedev/server/plugin/report/cppcheck/PublishCppcheckReportStep.javaindex 5b007f87f3..2162c56531 100644--- a/server-plugin/server-plugin-report-cppcheck/src/main/java/io/onedev/server/plugin/report/cppcheck/PublishCppcheckReportStep.java+++ b/server-plugin/server-plugin-report-cppcheck/src/main/java/io/onedev/server/plugin/report/cppcheck/PublishCppcheckReportStep.java@@ -32,7 +32,7 @@ public class PublishCppcheckReportStep extends PublishProblemReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. "+ @Editable(order=100, description="Specify cppcheck xml result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. "+ "This file can be generated with cppcheck xml output option, for instance <code>cppcheck src --xml 2>check-result.xml</code>. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")@Patterns(path=true)diff --git a/server-plugin/server-plugin-report-gtest/src/main/java/io/onedev/server/plugin/report/gtest/PublishGTestReportStep.java b/server-plugin/server-plugin-report-gtest/src/main/java/io/onedev/server/plugin/report/gtest/PublishGTestReportStep.javaindex 2b5c39d507..7826b4bbc1 100644--- a/server-plugin/server-plugin-report-gtest/src/main/java/io/onedev/server/plugin/report/gtest/PublishGTestReportStep.java+++ b/server-plugin/server-plugin-report-gtest/src/main/java/io/onedev/server/plugin/report/gtest/PublishGTestReportStep.java@@ -30,7 +30,7 @@ public class PublishGTestReportStep extends PublishUnitTestReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. " ++ @Editable(order=100, description="Specify GoogleTest XML result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. " +"This report can be generated with environment variable <tt>GTEST_OUTPUT</tt> when running tests, " +"For instance, <code>export GTEST_OUTPUT="xml:gtest-result.xml"</code>. " +"Use * or ? for pattern match")diff --git a/server-plugin/server-plugin-report-html/src/main/java/io/onedev/server/plugin/report/html/PublishHtmlReportStep.java b/server-plugin/server-plugin-report-html/src/main/java/io/onedev/server/plugin/report/html/PublishHtmlReportStep.javaindex 88dee36eb9..ea839a887e 100644--- a/server-plugin/server-plugin-report-html/src/main/java/io/onedev/server/plugin/report/html/PublishHtmlReportStep.java+++ b/server-plugin/server-plugin-report-html/src/main/java/io/onedev/server/plugin/report/html/PublishHtmlReportStep.java@@ -36,7 +36,7 @@ public class PublishHtmlReportStep extends PublishReportStep {private String startPage;- @Editable(order=1000, description="Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: api/index.html")+ @Editable(order=1000, description="Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: api/index.html")@Interpolative(variableSuggester="suggestVariables")@NotEmptypublic String getStartPage() {diff --git a/server-plugin/server-plugin-report-jacoco/src/main/java/io/onedev/server/plugin/report/jacoco/PublishJacocoReportStep.java b/server-plugin/server-plugin-report-jacoco/src/main/java/io/onedev/server/plugin/report/jacoco/PublishJacocoReportStep.javaindex 7a4a33533d..5ca22eeb41 100644--- a/server-plugin/server-plugin-report-jacoco/src/main/java/io/onedev/server/plugin/report/jacoco/PublishJacocoReportStep.java+++ b/server-plugin/server-plugin-report-jacoco/src/main/java/io/onedev/server/plugin/report/jacoco/PublishJacocoReportStep.java@@ -42,7 +42,7 @@ public class PublishJacocoReportStep extends PublishCoverageReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, "+ @Editable(order=100, description="Specify JaCoCo coverage xml report file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, "+ "for instance, <tt>target/site/jacoco/jacoco.xml</tt>. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")@Patterns(path=true)diff --git a/server-plugin/server-plugin-report-jest/src/main/java/io/onedev/server/plugin/report/jest/PublishJestReportStep.java b/server-plugin/server-plugin-report-jest/src/main/java/io/onedev/server/plugin/report/jest/PublishJestReportStep.javaindex 858f3c5126..ee2e9a0a2f 100644--- a/server-plugin/server-plugin-report-jest/src/main/java/io/onedev/server/plugin/report/jest/PublishJestReportStep.java+++ b/server-plugin/server-plugin-report-jest/src/main/java/io/onedev/server/plugin/report/jest/PublishJestReportStep.java@@ -29,7 +29,7 @@ public class PublishJestReportStep extends PublishUnitTestReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. "+ @Editable(order=100, description="Specify Jest test result file in json format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. "+ "This file can be generated via Jest option <tt>'--json'</tt> and <tt>'--outputFile'</tt>. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")@Patterns(path=true)diff --git a/server-plugin/server-plugin-report-junit/src/main/java/io/onedev/server/plugin/report/junit/PublishJUnitReportStep.java b/server-plugin/server-plugin-report-junit/src/main/java/io/onedev/server/plugin/report/junit/PublishJUnitReportStep.javaindex 8d2259b12b..56c010e71a 100644--- a/server-plugin/server-plugin-report-junit/src/main/java/io/onedev/server/plugin/report/junit/PublishJUnitReportStep.java+++ b/server-plugin/server-plugin-report-junit/src/main/java/io/onedev/server/plugin/report/junit/PublishJUnitReportStep.java@@ -30,7 +30,7 @@ public class PublishJUnitReportStep extends PublishUnitTestReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, "+ @Editable(order=100, description="Specify JUnit test result file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, "+ "for instance <tt>target/surefire-reports/TEST-*.xml</tt>. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")@Patterns(path=true)diff --git a/server-plugin/server-plugin-report-markdown/src/main/java/io/onedev/server/plugin/report/markdown/PublishMarkdownReportStep.java b/server-plugin/server-plugin-report-markdown/src/main/java/io/onedev/server/plugin/report/markdown/PublishMarkdownReportStep.javaindex 5e27bdd28e..bedde722c3 100644--- a/server-plugin/server-plugin-report-markdown/src/main/java/io/onedev/server/plugin/report/markdown/PublishMarkdownReportStep.java+++ b/server-plugin/server-plugin-report-markdown/src/main/java/io/onedev/server/plugin/report/markdown/PublishMarkdownReportStep.java@@ -33,7 +33,7 @@ public class PublishMarkdownReportStep extends PublishReportStep {private String startPage;- @Editable(order=1100, description="Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, for instance: <tt>manual/index.md</tt>")+ @Editable(order=1100, description="Specify start page of the report relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, for instance: <tt>manual/index.md</tt>")@Interpolative(variableSuggester="suggestVariables")@NotEmptypublic String getStartPage() {diff --git a/server-plugin/server-plugin-report-markdown/src/main/java/io/onedev/server/plugin/report/markdown/PublishPullRequestMarkdownReportStep.java b/server-plugin/server-plugin-report-markdown/src/main/java/io/onedev/server/plugin/report/markdown/PublishPullRequestMarkdownReportStep.javaindex 2ef0964667..7f18fdd796 100644--- a/server-plugin/server-plugin-report-markdown/src/main/java/io/onedev/server/plugin/report/markdown/PublishPullRequestMarkdownReportStep.java+++ b/server-plugin/server-plugin-report-markdown/src/main/java/io/onedev/server/plugin/report/markdown/PublishPullRequestMarkdownReportStep.java@@ -33,7 +33,7 @@ public class PublishPullRequestMarkdownReportStep extends PublishReportStep {private String file;- @Editable(order=1100, description="Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a> to be published")+ @Editable(order=1100, description="Specify markdown file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a> to be published")@Interpolative(variableSuggester="suggestVariables")@NotEmptypublic String getFile() {diff --git a/server-plugin/server-plugin-report-mypy/src/main/java/io/onedev/server/plugin/report/mypy/PublishMypyReportStep.java b/server-plugin/server-plugin-report-mypy/src/main/java/io/onedev/server/plugin/report/mypy/PublishMypyReportStep.javaindex 26b854d7e0..4a68cb99b4 100644--- a/server-plugin/server-plugin-report-mypy/src/main/java/io/onedev/server/plugin/report/mypy/PublishMypyReportStep.java+++ b/server-plugin/server-plugin-report-mypy/src/main/java/io/onedev/server/plugin/report/mypy/PublishMypyReportStep.java@@ -31,7 +31,7 @@ public class PublishMypyReportStep extends PublishProblemReportStep {setFailThreshold(CodeProblem.Severity.MEDIUM);}- @Editable(order=100, description="Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. " ++ @Editable(order=100, description="Specify mypy output file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. " +"This file can be generated by redirecting mypy output <b>without option '--pretty'</b>, " +"for instance <code>mypy --exclude=.git --exclude=.venv . > mypy-output</code>. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")diff --git a/server-plugin/server-plugin-report-pmd/src/main/java/io/onedev/server/plugin/report/pmd/PublishPMDReportStep.java b/server-plugin/server-plugin-report-pmd/src/main/java/io/onedev/server/plugin/report/pmd/PublishPMDReportStep.javaindex 02dc5c7f57..6357f6dcf7 100644--- a/server-plugin/server-plugin-report-pmd/src/main/java/io/onedev/server/plugin/report/pmd/PublishPMDReportStep.java+++ b/server-plugin/server-plugin-report-pmd/src/main/java/io/onedev/server/plugin/report/pmd/PublishPMDReportStep.java@@ -37,7 +37,7 @@ public class PublishPMDReportStep extends PublishProblemReportStep {private static final int TAB_WIDTH = 8;- @Editable(order=100, description="Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, "+ @Editable(order=100, description="Specify PMD result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, "+ "for instance, <tt>target/pmd.xml</tt>. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")@Patterns(path=true)diff --git a/server-plugin/server-plugin-report-pylint/src/main/java/io/onedev/server/plugin/report/pylint/PublishPylintReportStep.java b/server-plugin/server-plugin-report-pylint/src/main/java/io/onedev/server/plugin/report/pylint/PublishPylintReportStep.javaindex dfd76ee292..2441f4a5a4 100644--- a/server-plugin/server-plugin-report-pylint/src/main/java/io/onedev/server/plugin/report/pylint/PublishPylintReportStep.java+++ b/server-plugin/server-plugin-report-pylint/src/main/java/io/onedev/server/plugin/report/pylint/PublishPylintReportStep.java@@ -26,7 +26,7 @@ public class PublishPylintReportStep extends PublishProblemReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. "+ @Editable(order=100, description="Specify pylint json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. "+ "This file can be generated with pylint json output format option, for instance <code>--exit-zero --output-format=json:pylint-result.json</code>. "+ "Note that we do not fail pylint command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")diff --git a/server-plugin/server-plugin-report-roslynator/src/main/java/io/onedev/server/plugin/report/roslynator/PublishRoslynatorReportStep.java b/server-plugin/server-plugin-report-roslynator/src/main/java/io/onedev/server/plugin/report/roslynator/PublishRoslynatorReportStep.javaindex ace4c04998..f6aea37ea7 100644--- a/server-plugin/server-plugin-report-roslynator/src/main/java/io/onedev/server/plugin/report/roslynator/PublishRoslynatorReportStep.java+++ b/server-plugin/server-plugin-report-roslynator/src/main/java/io/onedev/server/plugin/report/roslynator/PublishRoslynatorReportStep.java@@ -35,7 +35,7 @@ public class PublishRoslynatorReportStep extends PublishProblemReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. "+ @Editable(order=100, description="Specify Roslynator diagnostics output file in XML format relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. "+ "This file can be generated with <i>-o</i> option. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")@Patterns(path=true)diff --git a/server-plugin/server-plugin-report-ruff/src/main/java/io/onedev/server/plugin/report/ruff/PublishRuffReportStep.java b/server-plugin/server-plugin-report-ruff/src/main/java/io/onedev/server/plugin/report/ruff/PublishRuffReportStep.javaindex 15b09f695a..01b7f17dfa 100644--- a/server-plugin/server-plugin-report-ruff/src/main/java/io/onedev/server/plugin/report/ruff/PublishRuffReportStep.java+++ b/server-plugin/server-plugin-report-ruff/src/main/java/io/onedev/server/plugin/report/ruff/PublishRuffReportStep.java@@ -30,7 +30,7 @@ public class PublishRuffReportStep extends PublishProblemReportStep {setFailThreshold(CodeProblem.Severity.MEDIUM);}- @Editable(order=100, description="Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>. "+ @Editable(order=100, description="Specify ruff json result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>. "+ "This file can be generated with ruff json output format option, for instance <code>--exit-zero --output-format json --output-file ruff-result.json</code>. "+ "Note that we do not fail ruff command upon violations, as this step will fail build based on configured threshold. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")diff --git a/server-plugin/server-plugin-report-spotbugs/src/main/java/io/onedev/server/plugin/report/spotbugs/PublishSpotBugsReportStep.java b/server-plugin/server-plugin-report-spotbugs/src/main/java/io/onedev/server/plugin/report/spotbugs/PublishSpotBugsReportStep.javaindex 40ed304ee1..a2ec3f82a0 100644--- a/server-plugin/server-plugin-report-spotbugs/src/main/java/io/onedev/server/plugin/report/spotbugs/PublishSpotBugsReportStep.java+++ b/server-plugin/server-plugin-report-spotbugs/src/main/java/io/onedev/server/plugin/report/spotbugs/PublishSpotBugsReportStep.java@@ -37,7 +37,7 @@ public class PublishSpotBugsReportStep extends PublishProblemReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, "+ @Editable(order=100, description="Specify SpotBugs result xml file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, "+ "for instance, <tt>target/spotbugsXml.xml</tt>. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")@Patterns(path=true)diff --git a/server-plugin/server-plugin-report-trx/src/main/java/io/onedev/server/plugin/report/trx/PublishTRXReportStep.java b/server-plugin/server-plugin-report-trx/src/main/java/io/onedev/server/plugin/report/trx/PublishTRXReportStep.javaindex d621e0d02d..a9c3f1fdbb 100644--- a/server-plugin/server-plugin-report-trx/src/main/java/io/onedev/server/plugin/report/trx/PublishTRXReportStep.java+++ b/server-plugin/server-plugin-report-trx/src/main/java/io/onedev/server/plugin/report/trx/PublishTRXReportStep.java@@ -31,7 +31,7 @@ public class PublishTRXReportStep extends PublishUnitTestReportStep {private static final long serialVersionUID = 1L;- @Editable(order=100, description="Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workspace'>job workspace</a>, "+ @Editable(order=100, description="Specify .net TRX test result file relative to <a href='https://docs.onedev.io/concepts#job-workdir'>job workdir</a>, "+ "for instance <tt>TestResults/*.trx</tt>. Use * or ? for pattern match")@Interpolative(variableSuggester="suggestVariables")@Patterns(path=true)diff --git a/server-product/pom.xml b/server-product/pom.xmlindex 863c57419a..364a891dc9 100644--- a/server-product/pom.xml+++ b/server-product/pom.xml@@ -125,6 +125,11 @@<artifactId>server-plugin-executor-remoteshell</artifactId><version>${project.version}</version></dependency>+ <dependency>+ <groupId>io.onedev</groupId>+ <artifactId>server-plugin-provisioner-shell</artifactId>+ <version>${project.version}</version>+ </dependency><dependency><groupId>io.onedev</groupId><artifactId>server-plugin-authenticator-ldap</artifactId>diff --git a/server-product/src/main/java/io/onedev/server/product/ProductServletConfigurator.java b/server-product/src/main/java/io/onedev/server/product/ProductServletConfigurator.javaindex b93272b362..b6a4b2379f 100644--- a/server-product/src/main/java/io/onedev/server/product/ProductServletConfigurator.java+++ b/server-product/src/main/java/io/onedev/server/product/ProductServletConfigurator.java@@ -26,6 +26,7 @@ import io.onedev.server.git.GitLfsFilter;import io.onedev.server.git.GoGetFilter;import io.onedev.server.git.hook.GitPostReceiveCallback;import io.onedev.server.git.hook.GitPreReceiveCallback;+import io.onedev.server.workspace.WorkspacePostCommitCallback;import io.onedev.server.jetty.ClasspathAssetServlet;import io.onedev.server.jetty.FileAssetServlet;import io.onedev.server.jetty.ServletConfigurator;@@ -59,6 +60,9 @@ public class ProductServletConfigurator implements ServletConfigurator {@Injectprivate GitPostReceiveCallback postReceiveServlet;++ @Inject+ private WorkspacePostCommitCallback workspacePostCommitServlet;@Injectprivate WicketServlet wicketServlet;@@ -89,6 +93,7 @@ public class ProductServletConfigurator implements ServletConfigurator {context.addServlet(new ServletHolder(preReceiveServlet), GitPreReceiveCallback.PATH + "/*");context.addServlet(new ServletHolder(postReceiveServlet), GitPostReceiveCallback.PATH + "/*");+ context.addServlet(new ServletHolder(workspacePostCommitServlet), WorkspacePostCommitCallback.PATH + "/*");/** Add wicket servlet as the default servlet which will serve all requests failed to