From c8a238b91c10ed0dfd7915c6ee5ce36f2f780ef2 Mon Sep 17 00:00:00 2001 From: byteblogs168 <598092184@qq.com> Date: Sat, 13 Jan 2024 22:53:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=202.6.0=201.=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=9B=9E=E8=B0=83=E9=87=8D?= =?UTF-8?q?=E8=AF=95=202.=20=E4=BC=98=E5=8C=96=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/job/core/client/JobEndPoint.java | 24 ++-- .../executor/JobExecutorFutureCallback.java | 10 +- .../server/model/dto/CallbackParamsDTO.java | 2 + .../handler/ClientNodeAllocateHandler.java | 14 +-- .../job/task/support/JobTaskConverter.java | 2 +- .../AbstractClientCallbackHandler.java | 114 ++++++++++++++++++ .../BroadcastClientCallbackHandler.java | 27 +---- .../callback/ClientCallbackContext.java | 8 ++ .../ClusterClientCallbackHandler.java | 52 +++----- .../ShardingClientCallbackHandler.java | 45 ++----- .../dispatch/JobExecutorResultActor.java | 8 +- .../executor/job/RequestClientActor.java | 3 + .../workflow/CallbackWorkflowExecutor.java | 4 +- .../model/response/JobBatchResponseVO.java | 5 + .../web/service/impl/JobBatchServiceImpl.java | 33 ++--- .../web/service/impl/JobLogServiceImpl.java | 29 +++-- .../service/impl/SystemUserServiceImpl.java | 17 ++- .../lib/assets/{MlqLg9-Y.js => YpO3912B.js} | 4 +- .../lib/assets/{vhU7tY2l.css => yQfA4Ykm.css} | 2 +- frontend/public/lib/index.html | 4 +- 20 files changed, 247 insertions(+), 160 deletions(-) rename frontend/public/lib/assets/{MlqLg9-Y.js => YpO3912B.js} (74%) rename frontend/public/lib/assets/{vhU7tY2l.css => yQfA4Ykm.css} (99%) diff --git a/easy-retry-client/easy-retry-client-job-core/src/main/java/com/aizuda/easy/retry/client/job/core/client/JobEndPoint.java b/easy-retry-client/easy-retry-client-job-core/src/main/java/com/aizuda/easy/retry/client/job/core/client/JobEndPoint.java index 7bce8c126..ed5858986 100644 --- a/easy-retry-client/easy-retry-client-job-core/src/main/java/com/aizuda/easy/retry/client/job/core/client/JobEndPoint.java +++ b/easy-retry-client/easy-retry-client-job-core/src/main/java/com/aizuda/easy/retry/client/job/core/client/JobEndPoint.java @@ -11,6 +11,7 @@ import com.aizuda.easy.retry.client.model.request.DispatchJobRequest; import com.aizuda.easy.retry.common.core.context.SpringContext; import com.aizuda.easy.retry.common.core.model.JobContext; import com.aizuda.easy.retry.common.core.model.Result; +import com.aizuda.easy.retry.common.log.EasyRetryLog; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; @@ -36,19 +37,26 @@ public class JobEndPoint { JobContext jobContext = buildJobContext(dispatchJob); JobExecutorInfo jobExecutorInfo = JobExecutorInfoCache.get(jobContext.getExecutorInfo()); if (Objects.isNull(jobExecutorInfo)) { + EasyRetryLog.REMOTE.error("执行器配置有误. executorInfo:[{}]", dispatchJob.getExecutorInfo()); return new Result<>("执行器配置有误", Boolean.FALSE); } - // 选择执行器 - Object executor = jobExecutorInfo.getExecutor(); - IJobExecutor jobExecutor; - if (IJobExecutor.class.isAssignableFrom(executor.getClass())) { - jobExecutor = (AbstractJobExecutor) executor; - } else { - jobExecutor = SpringContext.getBeanByType(AnnotationJobExecutor.class); + try { + // 选择执行器 + Object executor = jobExecutorInfo.getExecutor(); + IJobExecutor jobExecutor; + if (IJobExecutor.class.isAssignableFrom(executor.getClass())) { + jobExecutor = (AbstractJobExecutor) executor; + } else { + jobExecutor = SpringContext.getBeanByType(AnnotationJobExecutor.class); + } + + jobExecutor.jobExecute(jobContext); + } catch (Exception e) { + EasyRetryLog.REMOTE.error("客户端发生非预期异常. taskBatchId:[{}]", dispatchJob.getTaskBatchId()); + throw e; } - jobExecutor.jobExecute(jobContext); return new Result<>(Boolean.TRUE); } diff --git a/easy-retry-client/easy-retry-client-job-core/src/main/java/com/aizuda/easy/retry/client/job/core/executor/JobExecutorFutureCallback.java b/easy-retry-client/easy-retry-client-job-core/src/main/java/com/aizuda/easy/retry/client/job/core/executor/JobExecutorFutureCallback.java index 31f0a0a43..1b36ab59f 100644 --- a/easy-retry-client/easy-retry-client-job-core/src/main/java/com/aizuda/easy/retry/client/job/core/executor/JobExecutorFutureCallback.java +++ b/easy-retry-client/easy-retry-client-job-core/src/main/java/com/aizuda/easy/retry/client/job/core/executor/JobExecutorFutureCallback.java @@ -30,7 +30,7 @@ public class JobExecutorFutureCallback implements FutureCallback private static final JobNettyClient CLIENT = RequestBuilder.newBuilder() .client(JobNettyClient.class) - .callback(nettyResult -> LogUtils.info(log, "Data report successfully requestId:[{}]", nettyResult.getRequestId())).build(); + .callback(nettyResult -> EasyRetryLog.LOCAL.info("Job execute result report successfully requestId:[{}]", nettyResult.getRequestId())).build(); private final JobContext jobContext; @@ -41,7 +41,7 @@ public class JobExecutorFutureCallback implements FutureCallback @Override public void onSuccess(ExecuteResult result) { // 上报执行成功 - EasyRetryLog.LOCAL.warn("任务执行成功 taskBatchId:[{}] [{}]", jobContext.getTaskBatchId(), JsonUtil.toJsonString(result)); + EasyRetryLog.REMOTE.info("任务执行成功 taskBatchId:[{}] [{}]", jobContext.getTaskBatchId(), JsonUtil.toJsonString(result)); if (Objects.isNull(result)) { result = ExecuteResult.success(); @@ -57,7 +57,7 @@ public class JobExecutorFutureCallback implements FutureCallback try { CLIENT.dispatchResult(buildDispatchJobResultRequest(result, taskStatus)); } catch (Exception e) { - EasyRetryLog.LOCAL.error("执行结果上报异常.[{}]", jobContext.getTaskId(), e); + EasyRetryLog.REMOTE.error("执行结果上报异常.[{}]", jobContext.getTaskId(), e); } finally { stopThreadPool(); ThreadLocalLogUtil.removeContext(); @@ -67,7 +67,7 @@ public class JobExecutorFutureCallback implements FutureCallback @Override public void onFailure(final Throwable t) { // 上报执行失败 - log.error("任务执行失败 任务执行成功 taskBatchId:[{}]", jobContext.getTaskBatchId(), t); + EasyRetryLog.REMOTE.error("任务执行失败 taskBatchId:[{}]", jobContext.getTaskBatchId(), t); try { ExecuteResult failure = ExecuteResult.failure(); @@ -81,7 +81,7 @@ public class JobExecutorFutureCallback implements FutureCallback buildDispatchJobResultRequest(failure, JobTaskStatusEnum.FAIL.getStatus()) ); } catch (Exception e) { - EasyRetryLog.LOCAL.error("执行结果上报异常.[{}]", jobContext.getTaskId(), e); + EasyRetryLog.REMOTE.error("执行结果上报异常.[{}]", jobContext.getTaskId(), e); } finally { stopThreadPool(); ThreadLocalLogUtil.removeContext(); diff --git a/easy-retry-common/easy-retry-common-server-api/src/main/java/com/aizuda/easy/retry/server/model/dto/CallbackParamsDTO.java b/easy-retry-common/easy-retry-common-server-api/src/main/java/com/aizuda/easy/retry/server/model/dto/CallbackParamsDTO.java index 4fd874cbf..7a5198974 100644 --- a/easy-retry-common/easy-retry-common-server-api/src/main/java/com/aizuda/easy/retry/server/model/dto/CallbackParamsDTO.java +++ b/easy-retry-common/easy-retry-common-server-api/src/main/java/com/aizuda/easy/retry/server/model/dto/CallbackParamsDTO.java @@ -3,6 +3,8 @@ package com.aizuda.easy.retry.server.model.dto; import lombok.Data; /** + * 工作流回调节点参数模型 + * * @author: xiaowoniu * @date : 2024-01-02 * @since : 2.6.0 diff --git a/easy-retry-server/easy-retry-server-common/src/main/java/com/aizuda/easy/retry/server/common/handler/ClientNodeAllocateHandler.java b/easy-retry-server/easy-retry-server-common/src/main/java/com/aizuda/easy/retry/server/common/handler/ClientNodeAllocateHandler.java index 79d5b4178..783e0ff88 100644 --- a/easy-retry-server/easy-retry-server-common/src/main/java/com/aizuda/easy/retry/server/common/handler/ClientNodeAllocateHandler.java +++ b/easy-retry-server/easy-retry-server-common/src/main/java/com/aizuda/easy/retry/server/common/handler/ClientNodeAllocateHandler.java @@ -1,13 +1,13 @@ package com.aizuda.easy.retry.server.common.handler; -import com.aizuda.easy.retry.common.core.log.LogUtils; +import com.aizuda.easy.retry.common.log.EasyRetryLog; import com.aizuda.easy.retry.server.common.ClientLoadBalance; import com.aizuda.easy.retry.server.common.allocate.client.ClientLoadBalanceManager; import com.aizuda.easy.retry.server.common.allocate.client.ClientLoadBalanceManager.AllocationAlgorithmEnum; -import com.aizuda.easy.retry.server.common.dto.RegisterNodeInfo; import com.aizuda.easy.retry.server.common.cache.CacheRegisterTable; +import com.aizuda.easy.retry.server.common.dto.RegisterNodeInfo; import com.aizuda.easy.retry.template.datasource.access.AccessTemplate; -import lombok.extern.slf4j.Slf4j; +import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; @@ -22,11 +22,9 @@ import java.util.stream.Stream; * @date : 2023-01-10 14:18 */ @Component -@Slf4j +@RequiredArgsConstructor public class ClientNodeAllocateHandler { - - @Autowired - protected AccessTemplate accessTemplate; + private final AccessTemplate accessTemplate; /** * 获取分配的节点 @@ -39,7 +37,7 @@ public class ClientNodeAllocateHandler { Set serverNodes = CacheRegisterTable.getServerNodeSet(groupName, namespaceId); if (CollectionUtils.isEmpty(serverNodes)) { - LogUtils.warn(log, "client node is null. groupName:[{}]", groupName); + EasyRetryLog.LOCAL.warn("client node is null. groupName:[{}]", groupName); return null; } diff --git a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/JobTaskConverter.java b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/JobTaskConverter.java index cceaf45af..116e7e30f 100644 --- a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/JobTaskConverter.java +++ b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/JobTaskConverter.java @@ -63,7 +63,7 @@ public interface JobTaskConverter { JobLogMessage toJobLogMessage(LogTaskDTO logTaskDTO); - JobLogDTO toJobLogDTO(JobExecutorContext context); + LogMetaDTO toJobLogDTO(ClientCallbackContext context); LogMetaDTO toJobLogDTO(JobExecutorResultDTO resultDTO); diff --git a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/AbstractClientCallbackHandler.java b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/AbstractClientCallbackHandler.java index f16a12ac3..4b878bedc 100644 --- a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/AbstractClientCallbackHandler.java +++ b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/AbstractClientCallbackHandler.java @@ -1,9 +1,28 @@ package com.aizuda.easy.retry.server.job.task.support.callback; +import akka.actor.ActorRef; +import cn.hutool.core.util.StrUtil; +import com.aizuda.easy.retry.common.core.enums.JobTaskStatusEnum; +import com.aizuda.easy.retry.common.log.EasyRetryLog; +import com.aizuda.easy.retry.server.common.akka.ActorGenerator; +import com.aizuda.easy.retry.server.common.dto.RegisterNodeInfo; +import com.aizuda.easy.retry.server.common.util.ClientInfoUtils; +import com.aizuda.easy.retry.server.job.task.dto.LogMetaDTO; +import com.aizuda.easy.retry.server.job.task.dto.RealJobExecutorDTO; import com.aizuda.easy.retry.server.job.task.support.ClientCallbackHandler; +import com.aizuda.easy.retry.server.job.task.support.JobTaskConverter; +import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobMapper; +import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobTaskMapper; +import com.aizuda.easy.retry.template.datasource.persistence.po.Job; +import com.aizuda.easy.retry.template.datasource.persistence.po.JobTask; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; +import java.util.Objects; + /** * @author www.byteblogs.com * @date 2023-10-03 23:12:33 @@ -11,12 +30,107 @@ import org.springframework.transaction.annotation.Transactional; */ public abstract class AbstractClientCallbackHandler implements ClientCallbackHandler, InitializingBean { + @Autowired + private JobTaskMapper jobTaskMapper; + @Autowired + private JobMapper jobMapper; + @Override @Transactional public void callback(ClientCallbackContext context) { + + // 判定是否需要重试 + boolean needRetry = isNeedRetry(context); + if (needRetry) { + // 更新重试次数 + if (updateRetryCount(context)) { + Job job = context.getJob(); + JobTask jobTask = context.getJobTask(); + RealJobExecutorDTO realJobExecutor = JobTaskConverter.INSTANCE.toRealJobExecutorDTO(JobTaskConverter.INSTANCE.toJobExecutorContext(job), jobTask); + realJobExecutor.setClientId(ClientInfoUtils.clientId(context.getClientInfo())); + ActorRef actorRef = ActorGenerator.jobRealTaskExecutorActor(); + actorRef.tell(realJobExecutor, actorRef); + LogMetaDTO logMetaDTO = JobTaskConverter.INSTANCE.toJobLogDTO(context); + EasyRetryLog.REMOTE.info("任务执行/调度失败执行重试. 重试次数:[{}] <|>{}<|>", + jobTask.getRetryCount() + 1, logMetaDTO); + return; + } + } + + // 不需要重试执行回调 doCallback(context); } + private boolean updateRetryCount(ClientCallbackContext context) { + JobTask updateJobTask = new JobTask(); + updateJobTask.setRetryCount(1); + String newClient = chooseNewClient(context); + if (StrUtil.isNotBlank(newClient)) { + updateJobTask.setClientInfo(newClient); + // 覆盖老的的客户端信息 + context.setClientInfo(newClient); + } + + Job job = context.getJob(); + return SqlHelper.retBool(jobTaskMapper.update(updateJobTask, Wrappers.lambdaUpdate() + .lt(JobTask::getRetryCount, job.getMaxRetryTimes()) + .eq(JobTask::getId, context.getTaskId()) + )); + + } + + private boolean isNeedRetry(ClientCallbackContext context) { + + if (context.getTaskStatus().equals(JobTaskStatusEnum.FAIL.getStatus())) { + + JobTask jobTask = jobTaskMapper.selectById(context.getTaskId()); + Job job = jobMapper.selectById(context.getJobId()); + if (Objects.isNull(jobTask) || Objects.isNull(job)) { + return Boolean.FALSE; + } + + if (jobTask.getRetryCount() < job.getMaxRetryTimes()) { + context.setClientInfo(jobTask.getClientInfo()); + context.setJob(job); + context.setJobTask(jobTask); + return Boolean.TRUE; + } + } + + return Boolean.FALSE; + } + + protected String chooseNewClient(ClientCallbackContext context) { + return null; + } + + private void failRetry(ClientCallbackContext context) { + + if (context.getTaskStatus().equals(JobTaskStatusEnum.FAIL.getStatus())) { + JobTask jobTask = jobTaskMapper.selectById(context.getTaskId()); + Job job = jobMapper.selectById(context.getJobId()); + if (jobTask == null || job == null) { + return; + } + + if (jobTask.getRetryCount() < job.getMaxRetryTimes()) { + // 更新重试次数 + JobTask updateJobTask = new JobTask(); + updateJobTask.setRetryCount(1); + boolean success = SqlHelper.retBool(jobTaskMapper.update(updateJobTask, Wrappers.lambdaUpdate() + .lt(JobTask::getRetryCount, job.getMaxRetryTimes()) + .eq(JobTask::getId, context.getTaskId()) + )); + + if (success) { + + } + + return; + } + } + } + protected abstract void doCallback(ClientCallbackContext context); @Override diff --git a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/BroadcastClientCallbackHandler.java b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/BroadcastClientCallbackHandler.java index 869e63158..b9a3dbbea 100644 --- a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/BroadcastClientCallbackHandler.java +++ b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/BroadcastClientCallbackHandler.java @@ -2,8 +2,10 @@ package com.aizuda.easy.retry.server.job.task.support.callback; import akka.actor.ActorRef; import com.aizuda.easy.retry.common.core.enums.JobTaskStatusEnum; +import com.aizuda.easy.retry.common.log.EasyRetryLog; import com.aizuda.easy.retry.server.common.akka.ActorGenerator; import com.aizuda.easy.retry.server.common.util.ClientInfoUtils; +import com.aizuda.easy.retry.server.job.task.dto.LogMetaDTO; import com.aizuda.easy.retry.server.job.task.dto.RealJobExecutorDTO; import com.aizuda.easy.retry.server.job.task.support.JobTaskConverter; import com.aizuda.easy.retry.server.job.task.dto.JobExecutorResultDTO; @@ -39,30 +41,7 @@ public class BroadcastClientCallbackHandler extends AbstractClientCallbackHandle @Override protected void doCallback(final ClientCallbackContext context) { - if (context.getTaskStatus().equals(JobTaskStatusEnum.FAIL.getStatus())) { - JobTask jobTask = jobTaskMapper.selectById(context.getTaskId()); - Job job = jobMapper.selectById(context.getJobId()); - if (jobTask == null || job == null) { - return; - } - if (jobTask.getRetryCount() < job.getMaxRetryTimes()) { - // 更新重试次数 - JobTask updateJobTask = new JobTask(); - updateJobTask.setRetryCount(1); - boolean success = SqlHelper.retBool(jobTaskMapper.update(updateJobTask, Wrappers.lambdaUpdate() - .lt(JobTask::getRetryCount, job.getMaxRetryTimes()) - .eq(JobTask::getId, context.getTaskId()) - )); - if (success) { - RealJobExecutorDTO realJobExecutor = JobTaskConverter.INSTANCE.toRealJobExecutorDTO(JobTaskConverter.INSTANCE.toJobExecutorContext(job), jobTask); - realJobExecutor.setClientId(ClientInfoUtils.clientId(jobTask.getClientInfo())); - ActorRef actorRef = ActorGenerator.jobRealTaskExecutorActor(); - actorRef.tell(realJobExecutor, actorRef); - // TODO 记录日志 - } - return; - } - } + JobExecutorResultDTO jobExecutorResultDTO = JobTaskConverter.INSTANCE.toJobExecutorResultDTO(context); jobExecutorResultDTO.setTaskId(context.getTaskId()); jobExecutorResultDTO.setMessage(context.getExecuteResult().getMessage()); diff --git a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/ClientCallbackContext.java b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/ClientCallbackContext.java index 3ef02d3f8..c36ff1634 100644 --- a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/ClientCallbackContext.java +++ b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/ClientCallbackContext.java @@ -1,6 +1,8 @@ package com.aizuda.easy.retry.server.job.task.support.callback; import com.aizuda.easy.retry.client.model.ExecuteResult; +import com.aizuda.easy.retry.template.datasource.persistence.po.Job; +import com.aizuda.easy.retry.template.datasource.persistence.po.JobTask; import lombok.Data; /** @@ -35,5 +37,11 @@ public class ClientCallbackContext { private ExecuteResult executeResult; + private String clientInfo; + + private Job job; + + private JobTask jobTask; + } diff --git a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/ClusterClientCallbackHandler.java b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/ClusterClientCallbackHandler.java index 02fb8211a..06887d04f 100644 --- a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/ClusterClientCallbackHandler.java +++ b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/ClusterClientCallbackHandler.java @@ -3,11 +3,14 @@ package com.aizuda.easy.retry.server.job.task.support.callback; import akka.actor.ActorRef; import com.aizuda.easy.retry.common.core.enums.JobTaskStatusEnum; import com.aizuda.easy.retry.common.core.enums.JobTaskTypeEnum; +import com.aizuda.easy.retry.common.log.EasyRetryLog; import com.aizuda.easy.retry.server.common.akka.ActorGenerator; +import com.aizuda.easy.retry.server.common.cache.CacheRegisterTable; import com.aizuda.easy.retry.server.common.dto.RegisterNodeInfo; import com.aizuda.easy.retry.server.common.handler.ClientNodeAllocateHandler; import com.aizuda.easy.retry.server.common.util.ClientInfoUtils; import com.aizuda.easy.retry.server.job.task.dto.JobExecutorResultDTO; +import com.aizuda.easy.retry.server.job.task.dto.LogMetaDTO; import com.aizuda.easy.retry.server.job.task.dto.RealJobExecutorDTO; import com.aizuda.easy.retry.server.job.task.support.JobTaskConverter; import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobMapper; @@ -21,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.Objects; +import java.util.Set; /** * @author www.byteblogs.com @@ -43,43 +47,23 @@ public class ClusterClientCallbackHandler extends AbstractClientCallbackHandler return JobTaskTypeEnum.CLUSTER; } + @Override + protected String chooseNewClient(ClientCallbackContext context) { + + // 选择重试的节点 + RegisterNodeInfo serverNode = clientNodeAllocateHandler.getServerNode(context.getJobId().toString(), + context.getGroupName(), context.getNamespaceId(), context.getJob().getRouteKey()); + if (Objects.isNull(serverNode)) { + log.error("无可执行的客户端信息. jobId:[{}]", context.getJobId()); + return null; + } + + return ClientInfoUtils.generate(serverNode); + } + @Override protected void doCallback(ClientCallbackContext context) { - if (context.getTaskStatus().equals(JobTaskStatusEnum.FAIL.getStatus())) { - JobTask jobTask = jobTaskMapper.selectById(context.getTaskId()); - Job job = jobMapper.selectById(context.getJobId()); - if (jobTask == null || job == null) { - return; - } - if (jobTask.getRetryCount() < job.getMaxRetryTimes()) { - // 选择重试的节点 - RegisterNodeInfo serverNode = clientNodeAllocateHandler.getServerNode(context.getJobId().toString(), - context.getGroupName(), context.getNamespaceId(), job.getRouteKey()); - if (Objects.isNull(serverNode)) { - log.error("无可执行的客户端信息. jobId:[{}]", context.getJobId()); - return; - } - String newClient = ClientInfoUtils.generate(serverNode); - // 更新重试次数 - JobTask updateJobTask = new JobTask(); - updateJobTask.setClientInfo(newClient); - updateJobTask.setRetryCount(1); - boolean success = SqlHelper.retBool(jobTaskMapper.update(updateJobTask, Wrappers.lambdaUpdate() - .lt(JobTask::getRetryCount, job.getMaxRetryTimes()) - .eq(JobTask::getId, context.getTaskId()) - )); - // 更新成功执行重试 - if (success) { - RealJobExecutorDTO realJobExecutor = JobTaskConverter.INSTANCE.toRealJobExecutorDTO(JobTaskConverter.INSTANCE.toJobExecutorContext(job), jobTask); - realJobExecutor.setClientId(ClientInfoUtils.clientId(newClient)); - ActorRef actorRef = ActorGenerator.jobRealTaskExecutorActor(); - actorRef.tell(realJobExecutor, actorRef); - // TODO 记录日志 - } - return; - } - } JobExecutorResultDTO jobExecutorResultDTO = JobTaskConverter.INSTANCE.toJobExecutorResultDTO(context); jobExecutorResultDTO.setTaskId(context.getTaskId()); jobExecutorResultDTO.setMessage(context.getExecuteResult().getMessage()); diff --git a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/ShardingClientCallbackHandler.java b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/ShardingClientCallbackHandler.java index 49197bb97..dcc066c43 100644 --- a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/ShardingClientCallbackHandler.java +++ b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/callback/ShardingClientCallbackHandler.java @@ -45,40 +45,6 @@ public class ShardingClientCallbackHandler extends AbstractClientCallbackHandler @Override protected void doCallback(final ClientCallbackContext context) { - if (context.getTaskStatus().equals(JobTaskStatusEnum.FAIL.getStatus())) { - JobTask jobTask = jobTaskMapper.selectById(context.getTaskId()); - Job job = jobMapper.selectById(context.getJobId()); - if (jobTask == null || job == null) { - return; - } - if (jobTask.getRetryCount() < job.getMaxRetryTimes()) { - Set nodes = CacheRegisterTable.getServerNodeSet(context.getGroupName(), context.getNamespaceId()); - if (CollUtil.isEmpty(nodes)) { - log.error("无可执行的客户端信息. jobId:[{}]", context.getJobId()); - return; - } - RegisterNodeInfo serverNode = RandomUtil.randomEle(nodes.toArray(new RegisterNodeInfo[0])); - String newClient = ClientInfoUtils.generate(serverNode); - // 更新重试次数 - JobTask updateJobTask = new JobTask(); - updateJobTask.setClientInfo(newClient); - updateJobTask.setRetryCount(1); - boolean success = SqlHelper.retBool( - jobTaskMapper.update(updateJobTask, Wrappers.lambdaUpdate() - .lt(JobTask::getRetryCount, job.getMaxRetryTimes()) - .eq(JobTask::getId, context.getTaskId()) - ) - ); - if (success) { - RealJobExecutorDTO realJobExecutor = JobTaskConverter.INSTANCE.toRealJobExecutorDTO(JobTaskConverter.INSTANCE.toJobExecutorContext(job), jobTask); - realJobExecutor.setClientId(ClientInfoUtils.clientId(newClient)); - ActorRef actorRef = ActorGenerator.jobRealTaskExecutorActor(); - actorRef.tell(realJobExecutor, actorRef); - // TODO 记录日志 - } - return; - } - } JobExecutorResultDTO jobExecutorResultDTO = JobTaskConverter.INSTANCE.toJobExecutorResultDTO(context); jobExecutorResultDTO.setTaskId(context.getTaskId()); @@ -90,4 +56,15 @@ public class ShardingClientCallbackHandler extends AbstractClientCallbackHandler actorRef.tell(jobExecutorResultDTO, actorRef); } + @Override + protected String chooseNewClient(ClientCallbackContext context) { + Set nodes = CacheRegisterTable.getServerNodeSet(context.getGroupName(), context.getNamespaceId()); + if (CollUtil.isEmpty(nodes)) { + log.error("无可执行的客户端信息. jobId:[{}]", context.getJobId()); + return null; + } + + RegisterNodeInfo serverNode = RandomUtil.randomEle(nodes.toArray(new RegisterNodeInfo[0])); + return ClientInfoUtils.generate(serverNode); + } } diff --git a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/dispatch/JobExecutorResultActor.java b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/dispatch/JobExecutorResultActor.java index d90da3812..78afe2117 100644 --- a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/dispatch/JobExecutorResultActor.java +++ b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/dispatch/JobExecutorResultActor.java @@ -88,10 +88,10 @@ public class JobExecutorResultActor extends AbstractActor { } }); - LogMetaDTO logMetaDTO = JobTaskConverter.INSTANCE.toJobLogDTO(result); - // 防止客户端日志还未上报完成,导致日志时序错误 - logMetaDTO.setTimestamp(DateUtils.toEpochMilli(LocalDateTime.now().plusHours(1))); - EasyRetryLog.REMOTE.info("taskId:[{}] 任务执行成功. <|>{}<|>", logMetaDTO.getTaskId(), logMetaDTO); +// LogMetaDTO logMetaDTO = JobTaskConverter.INSTANCE.toJobLogDTO(result); +// // 防止客户端日志还未上报完成,导致日志时序错误 +// logMetaDTO.setTimestamp(DateUtils.toEpochMilli(LocalDateTime.now().plusHours(1))); +// EasyRetryLog.REMOTE.info("taskId:[{}] 任务执行成功. <|>{}<|>", logMetaDTO.getTaskId(), logMetaDTO); } catch (Exception e) { LogUtils.error(log, " job executor result exception. [{}]", result, e); diff --git a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/executor/job/RequestClientActor.java b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/executor/job/RequestClientActor.java index e5f1c4468..7da25240a 100644 --- a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/executor/job/RequestClientActor.java +++ b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/executor/job/RequestClientActor.java @@ -14,6 +14,7 @@ import com.aizuda.easy.retry.server.common.akka.ActorGenerator; import com.aizuda.easy.retry.server.common.cache.CacheRegisterTable; import com.aizuda.easy.retry.server.common.client.RequestBuilder; import com.aizuda.easy.retry.server.common.dto.RegisterNodeInfo; +import com.aizuda.easy.retry.server.common.util.DateUtils; import com.aizuda.easy.retry.server.job.task.client.JobRpcClient; import com.aizuda.easy.retry.server.job.task.dto.JobExecutorResultDTO; import com.aizuda.easy.retry.server.job.task.dto.JobLogDTO; @@ -69,10 +70,12 @@ public class RequestClientActor extends AbstractActor { try { // 构建请求客户端对象 + Long timestamp = DateUtils.toNowMilli(); JobRpcClient rpcClient = buildRpcClient(registerNodeInfo, realJobExecutorDTO); Result dispatch = rpcClient.dispatch(dispatchJobRequest); if (dispatch.getStatus() == StatusEnum.YES.getStatus() && Objects.equals(dispatch.getData(), Boolean.TRUE)) { LogMetaDTO logMetaDTO = JobTaskConverter.INSTANCE.toJobLogDTO(realJobExecutorDTO); + logMetaDTO.setTimestamp(timestamp); EasyRetryLog.REMOTE.info("taskId:[{}] 任务调度成功. <|>{}<|>", logMetaDTO.getTaskId(), logMetaDTO); } else { // 客户端返回失败,则认为任务执行失败 diff --git a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/executor/workflow/CallbackWorkflowExecutor.java b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/executor/workflow/CallbackWorkflowExecutor.java index 86fae4edc..1fa388344 100644 --- a/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/executor/workflow/CallbackWorkflowExecutor.java +++ b/easy-retry-server/easy-retry-server-job-task/src/main/java/com/aizuda/easy/retry/server/job/task/support/executor/workflow/CallbackWorkflowExecutor.java @@ -92,9 +92,7 @@ public class CallbackWorkflowExecutor extends AbstractWorkflowExecutor { result = exchange.getBody(); log.info("回调结果. webHook:[{}],参数: [{}]", decisionConfig.getWebhook(), result); } catch (Exception e) { -// log.error("回调异常. webHook:[{}],参数: [{}]", decisionConfig.getWebhook(), context.getTaskResult(), e); - - EasyRetryLog.LOCAL.error("回调异常. webHook:[{}],参数: [{}]", decisionConfig.getWebhook(), context.getTaskResult(), e); + EasyRetryLog.REMOTE.error("回调异常. webHook:[{}],参数: [{}]", decisionConfig.getWebhook(), context.getTaskResult(), e); taskBatchStatus = JobTaskBatchStatusEnum.FAIL.getStatus(); operationReason = JobOperationReasonEnum.WORKFLOW_CALLBACK_NODE_EXECUTOR_ERROR.getReason(); jobTaskStatus = JobTaskStatusEnum.FAIL.getStatus(); diff --git a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/model/response/JobBatchResponseVO.java b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/model/response/JobBatchResponseVO.java index 7dec4da4c..8b4101807 100644 --- a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/model/response/JobBatchResponseVO.java +++ b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/model/response/JobBatchResponseVO.java @@ -27,6 +27,11 @@ public class JobBatchResponseVO { */ private String jobName; + /** + * 工作流节点名称 + */ + private String nodeName; + /** * 任务信息id */ diff --git a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobBatchServiceImpl.java b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobBatchServiceImpl.java index 1b34d5b97..7d13695a3 100644 --- a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobBatchServiceImpl.java +++ b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobBatchServiceImpl.java @@ -102,25 +102,26 @@ public class JobBatchServiceImpl implements JobBatchService { return null; } - if (jobTaskBatch.getTaskType().equals(TaskTypeEnum.JOB.getType())) { - Job job = jobMapper.selectById(jobTaskBatch.getJobId()); - return JobBatchResponseVOConverter.INSTANCE.toJobBatchResponseVO(jobTaskBatch, job); - } + Job job = jobMapper.selectById(jobTaskBatch.getJobId()); + JobBatchResponseVO jobBatchResponseVO = JobBatchResponseVOConverter.INSTANCE.toJobBatchResponseVO(jobTaskBatch, job); - JobBatchResponseVO jobBatchResponseVO = JobBatchResponseVOConverter.INSTANCE.toJobBatchResponseVO(jobTaskBatch); - - // 回调节点 - if (SystemConstants.CALLBACK_JOB_ID.equals(jobTaskBatch.getJobId())) { + if (jobTaskBatch.getTaskType().equals(TaskTypeEnum.WORKFLOW.getType())) { WorkflowNode workflowNode = workflowNodeMapper.selectById(jobTaskBatch.getWorkflowNodeId()); - jobBatchResponseVO.setJobName(workflowNode.getNodeName()); - jobBatchResponseVO.setCallback(JsonUtil.parseObject(workflowNode.getNodeInfo(), CallbackConfig.class)); - } + jobBatchResponseVO.setNodeName(workflowNode.getNodeName()); - // 条件节点 - if (SystemConstants.DECISION_JOB_ID.equals(jobTaskBatch.getJobId())) { - WorkflowNode workflowNode = workflowNodeMapper.selectById(jobTaskBatch.getWorkflowNodeId()); - jobBatchResponseVO.setJobName(workflowNode.getNodeName()); - jobBatchResponseVO.setDecision(JsonUtil.parseObject(workflowNode.getNodeInfo(), DecisionConfig.class)); + // 回调节点 + if (SystemConstants.CALLBACK_JOB_ID.equals(jobTaskBatch.getJobId())) { + jobBatchResponseVO.setCallback(JsonUtil.parseObject(workflowNode.getNodeInfo(), CallbackConfig.class)); + jobBatchResponseVO.setExecutionAt(jobTaskBatch.getCreateDt()); + return jobBatchResponseVO; + } + + // 条件节点 + if (SystemConstants.DECISION_JOB_ID.equals(jobTaskBatch.getJobId())) { + jobBatchResponseVO.setDecision(JsonUtil.parseObject(workflowNode.getNodeInfo(), DecisionConfig.class)); + jobBatchResponseVO.setExecutionAt(jobTaskBatch.getCreateDt()); + return jobBatchResponseVO; + } } return jobBatchResponseVO; diff --git a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobLogServiceImpl.java b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobLogServiceImpl.java index 518eae550..7718340d3 100644 --- a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobLogServiceImpl.java +++ b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobLogServiceImpl.java @@ -1,14 +1,18 @@ package com.aizuda.easy.retry.server.web.service.impl; +import com.aizuda.easy.retry.common.core.enums.JobTaskBatchStatusEnum; import com.aizuda.easy.retry.common.core.util.JsonUtil; import com.aizuda.easy.retry.server.web.model.request.JobLogQueryVO; import com.aizuda.easy.retry.server.web.model.response.JobLogResponseVO; import com.aizuda.easy.retry.server.web.service.JobLogService; import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobLogMessageMapper; +import com.aizuda.easy.retry.template.datasource.persistence.mapper.JobTaskBatchMapper; import com.aizuda.easy.retry.template.datasource.persistence.po.JobLogMessage; +import com.aizuda.easy.retry.template.datasource.persistence.po.JobTaskBatch; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; import com.google.common.collect.Lists; +import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -23,10 +27,10 @@ import java.util.stream.Collectors; * @since :2.4.0 */ @Service +@RequiredArgsConstructor public class JobLogServiceImpl implements JobLogService { - - @Autowired - private JobLogMessageMapper jobLogMessageMapper; + private final JobLogMessageMapper jobLogMessageMapper; + private final JobTaskBatchMapper jobTaskBatchMapper; @Override public JobLogResponseVO getJobLogPage(final JobLogQueryVO queryVO) { @@ -35,16 +39,25 @@ public class JobLogServiceImpl implements JobLogService { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper - .select(JobLogMessage::getId, JobLogMessage::getLogNum) - .ge(JobLogMessage::getId, queryVO.getStartId()) - .eq(JobLogMessage::getTaskId, queryVO.getTaskId()); + .select(JobLogMessage::getId, JobLogMessage::getLogNum) + .ge(JobLogMessage::getId, queryVO.getStartId()) + .eq(JobLogMessage::getTaskId, queryVO.getTaskId()); queryWrapper.orderByAsc(JobLogMessage::getRealTime).orderByDesc(JobLogMessage::getId); PageDTO selectPage = jobLogMessageMapper.selectPage(pageDTO, queryWrapper); List records = selectPage.getRecords(); if (CollectionUtils.isEmpty(records)) { + + Long count = jobTaskBatchMapper.selectCount( + new LambdaQueryWrapper() + .in(JobTaskBatch::getTaskBatchStatus, JobTaskBatchStatusEnum.COMPLETED) + ); + JobLogResponseVO jobLogResponseVO = new JobLogResponseVO(); - jobLogResponseVO.setFinished(Boolean.TRUE); + if (count > 0) { + jobLogResponseVO.setFinished(Boolean.TRUE); + } + return jobLogResponseVO; } @@ -70,7 +83,7 @@ public class JobLogServiceImpl implements JobLogService { List originalList = JsonUtil.parseObject(jobLogMessage.getMessage(), List.class); int size = originalList.size() - fromIndex; List pageList = originalList.stream().skip(fromIndex).limit(queryVO.getSize()) - .collect(Collectors.toList()); + .collect(Collectors.toList()); if (messages.size() + size >= queryVO.getSize()) { messages.addAll(pageList); diff --git a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/SystemUserServiceImpl.java b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/SystemUserServiceImpl.java index 62d984860..4b656b3a5 100644 --- a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/SystemUserServiceImpl.java +++ b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/SystemUserServiceImpl.java @@ -31,6 +31,7 @@ import com.aizuda.easy.retry.server.web.model.request.SystemUserQueryVO; import com.aizuda.easy.retry.server.web.model.request.SystemUserRequestVO; import com.aizuda.easy.retry.server.web.model.response.SystemUserResponseVO; import com.google.common.collect.Lists; +import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -48,18 +49,14 @@ import java.util.stream.Collectors; * @since 2022-03-05 */ @Service +@RequiredArgsConstructor public class SystemUserServiceImpl implements SystemUserService { + public static final long EXPIRE_TIME = 3600 * 24 * 1000; - public static final long EXPIRE_TIME = 3600 * 7 * 1000; - - @Autowired - private SystemUserMapper systemUserMapper; - @Autowired - private SystemUserPermissionMapper systemUserPermissionMapper; - @Autowired - private NamespaceMapper namespaceMapper; - @Autowired - private SystemProperties systemProperties; + private final SystemUserMapper systemUserMapper; + private final SystemUserPermissionMapper systemUserPermissionMapper; + private final NamespaceMapper namespaceMapper; + private final SystemProperties systemProperties; @Override public SystemUserResponseVO login(SystemUserRequestVO requestVO) { diff --git a/frontend/public/lib/assets/MlqLg9-Y.js b/frontend/public/lib/assets/YpO3912B.js similarity index 74% rename from frontend/public/lib/assets/MlqLg9-Y.js rename to frontend/public/lib/assets/YpO3912B.js index 5db87216d..a4527c508 100644 --- a/frontend/public/lib/assets/MlqLg9-Y.js +++ b/frontend/public/lib/assets/YpO3912B.js @@ -1,4 +1,4 @@ -var e,t,n=Object.getOwnPropertyNames,o=(e={"assets/MlqLg9-Y.js"(e,t){function n(e,t){const n=new Set(e.split(","));return t?e=>n.has(e.toLowerCase()):e=>n.has(e)}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const o={},r=[],i=()=>{},l=()=>!1,a=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),s=e=>e.startsWith("onUpdate:"),c=Object.assign,u=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,p=(e,t)=>d.call(e,t),h=Array.isArray,f=e=>"[object Map]"===x(e),g=e=>"[object Set]"===x(e),m=e=>"function"==typeof e,v=e=>"string"==typeof e,b=e=>"symbol"==typeof e,y=e=>null!==e&&"object"==typeof e,O=e=>(y(e)||m(e))&&m(e.then)&&m(e.catch),w=Object.prototype.toString,x=e=>w.call(e),$=e=>"[object Object]"===x(e),S=e=>v(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,C=n(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),k=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},P=/-(\w)/g,T=k((e=>e.replace(P,((e,t)=>t?t.toUpperCase():"")))),M=/\B([A-Z])/g,I=k((e=>e.replace(M,"-$1").toLowerCase())),E=k((e=>e.charAt(0).toUpperCase()+e.slice(1))),A=k((e=>e?`on${E(e)}`:"")),R=(e,t)=>!Object.is(e,t),D=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},B=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let N;const z=()=>N||(N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function _(e){if(h(e)){const t={};for(let n=0;n{if(e){const n=e.split(Q);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function W(e){let t="";if(v(e))t=e;else if(h(e))for(let n=0;nv(e)?e:null==e?"":h(e)||y(e)&&(e.toString===w||!m(e.toString))?JSON.stringify(e,Y,2):String(e),Y=(e,t)=>t&&t.__v_isRef?Y(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],o)=>(e[K(t,o)+" =>"]=n,e)),{})}:g(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>K(e)))}:b(t)?K(t):!y(t)||h(t)||$(t)?t:String(t),K=(e,t="")=>{var n;return b(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let G,U;class q{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=G,!e&&G&&(this.index=(G.scopes||(G.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=G;try{return G=this,e()}finally{G=t}}}on(){G=this}off(){G=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t=2))break;ue(),this._queryings--}return this._dirtyLevel>=2}set dirty(e){this._dirtyLevel=e?3:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=le,t=U;try{return le=!0,U=this,this._runnings++,oe(this),this.fn()}finally{re(this),this._runnings--,U=t,le=e}}stop(){var e;this.active&&(oe(this),re(this),null==(e=this.onStop)||e.call(this),this.active=!1)}}function oe(e){e._trackId++,e._depsLength=0}function re(e){if(e.deps&&e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},ve=new WeakMap,be=Symbol(""),ye=Symbol("");function Oe(e,t,n){if(le&&U){let t=ve.get(e);t||ve.set(e,t=new Map);let o=t.get(n);o||t.set(n,o=me((()=>t.delete(n)))),he(U,o)}}function we(e,t,n,o,r,i){const l=ve.get(e);if(!l)return;let a=[];if("clear"===t)a=[...l.values()];else if("length"===n&&h(e)){const e=Number(o);l.forEach(((t,n)=>{("length"===n||!b(n)&&n>=e)&&a.push(t)}))}else switch(void 0!==n&&a.push(l.get(n)),t){case"add":h(e)?S(n)&&a.push(l.get("length")):(a.push(l.get(be)),f(e)&&a.push(l.get(ye)));break;case"delete":h(e)||(a.push(l.get(be)),f(e)&&a.push(l.get(ye)));break;case"set":f(e)&&a.push(l.get(be))}de();for(const s of a)s&&ge(s,3);pe()}const xe=n("__proto__,__v_isRef,__isVue"),$e=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(b)),Se=Ce();function Ce(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=pt(this);for(let t=0,r=this.length;t{e[t]=function(...e){ce(),de();const n=pt(this)[t].apply(this,e);return pe(),ue(),n}})),e}function ke(e){const t=pt(this);return Oe(t,0,e),t.hasOwnProperty(e)}class Pe{constructor(e=!1,t=!1){this._isReadonly=e,this._shallow=t}get(e,t,n){const o=this._isReadonly,r=this._shallow;if("__v_isReactive"===t)return!o;if("__v_isReadonly"===t)return o;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(o?r?ot:nt:r?tt:et).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const i=h(e);if(!o){if(i&&p(Se,t))return Reflect.get(Se,t,n);if("hasOwnProperty"===t)return ke}const l=Reflect.get(e,t,n);return(b(t)?$e.has(t):xe(t))?l:(o||Oe(e,0,t),r?l:yt(l)?i&&S(t)?l:l.value:y(l)?o?lt(l):it(l):l)}}class Te extends Pe{constructor(e=!1){super(!1,e)}set(e,t,n,o){let r=e[t];if(!this._shallow){const t=ct(r);if(ut(n)||ct(n)||(r=pt(r),n=pt(n)),!h(e)&&yt(r)&&!yt(n))return!t&&(r.value=n,!0)}const i=h(e)&&S(t)?Number(t)e,De=e=>Reflect.getPrototypeOf(e);function je(e,t,n=!1,o=!1){const r=pt(e=e.__v_raw),i=pt(t);n||(R(t,i)&&Oe(r,0,t),Oe(r,0,i));const{has:l}=De(r),a=o?Re:n?gt:ft;return l.call(r,t)?a(e.get(t)):l.call(r,i)?a(e.get(i)):void(e!==r&&e.get(t))}function Be(e,t=!1){const n=this.__v_raw,o=pt(n),r=pt(e);return t||(R(e,r)&&Oe(o,0,e),Oe(o,0,r)),e===r?n.has(e):n.has(e)||n.has(r)}function Ne(e,t=!1){return e=e.__v_raw,!t&&Oe(pt(e),0,be),Reflect.get(e,"size",e)}function ze(e){e=pt(e);const t=pt(this);return De(t).has.call(t,e)||(t.add(e),we(t,"add",e,e)),this}function _e(e,t){t=pt(t);const n=pt(this),{has:o,get:r}=De(n);let i=o.call(n,e);i||(e=pt(e),i=o.call(n,e));const l=r.call(n,e);return n.set(e,t),i?R(t,l)&&we(n,"set",e,t):we(n,"add",e,t),this}function Le(e){const t=pt(this),{has:n,get:o}=De(t);let r=n.call(t,e);r||(e=pt(e),r=n.call(t,e)),o&&o.call(t,e);const i=t.delete(e);return r&&we(t,"delete",e,void 0),i}function Qe(){const e=pt(this),t=0!==e.size,n=e.clear();return t&&we(e,"clear",void 0,void 0),n}function He(e,t){return function(n,o){const r=this,i=r.__v_raw,l=pt(i),a=t?Re:e?gt:ft;return!e&&Oe(l,0,be),i.forEach(((e,t)=>n.call(o,a(e),a(t),r)))}}function Fe(e,t,n){return function(...o){const r=this.__v_raw,i=pt(r),l=f(i),a="entries"===e||e===Symbol.iterator&&l,s="keys"===e&&l,c=r[e](...o),u=n?Re:t?gt:ft;return!t&&Oe(i,0,s?ye:be),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function We(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Ve(){const e={get(e){return je(this,e)},get size(){return Ne(this)},has:Be,add:ze,set:_e,delete:Le,clear:Qe,forEach:He(!1,!1)},t={get(e){return je(this,e,!1,!0)},get size(){return Ne(this)},has:Be,add:ze,set:_e,delete:Le,clear:Qe,forEach:He(!1,!0)},n={get(e){return je(this,e,!0)},get size(){return Ne(this,!0)},has(e){return Be.call(this,e,!0)},add:We("add"),set:We("set"),delete:We("delete"),clear:We("clear"),forEach:He(!0,!1)},o={get(e){return je(this,e,!0,!0)},get size(){return Ne(this,!0)},has(e){return Be.call(this,e,!0)},add:We("add"),set:We("set"),delete:We("delete"),clear:We("clear"),forEach:He(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((r=>{e[r]=Fe(r,!1,!1),n[r]=Fe(r,!0,!1),t[r]=Fe(r,!1,!0),o[r]=Fe(r,!0,!0)})),[e,n,t,o]}const[Ze,Xe,Ye,Ke]=Ve();function Ge(e,t){const n=t?e?Ke:Ye:e?Xe:Ze;return(t,o,r)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(p(n,o)&&o in t?n:t,o,r)}const Ue={get:Ge(!1,!1)},qe={get:Ge(!1,!0)},Je={get:Ge(!0,!1)},et=new WeakMap,tt=new WeakMap,nt=new WeakMap,ot=new WeakMap;function rt(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>x(e).slice(8,-1))(e))}function it(e){return ct(e)?e:at(e,!1,Ie,Ue,et)}function lt(e){return at(e,!0,Ee,Je,nt)}function at(e,t,n,o,r){if(!y(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const l=rt(e);if(0===l)return e;const a=new Proxy(e,2===l?o:n);return r.set(e,a),a}function st(e){return ct(e)?st(e.__v_raw):!(!e||!e.__v_isReactive)}function ct(e){return!(!e||!e.__v_isReadonly)}function ut(e){return!(!e||!e.__v_isShallow)}function dt(e){return st(e)||ct(e)}function pt(e){const t=e&&e.__v_raw;return t?pt(t):e}function ht(e){return j(e,"__v_skip",!0),e}const ft=e=>y(e)?it(e):e,gt=e=>y(e)?lt(e):e;class mt{constructor(e,t,n,o){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new ne((()=>e(this._value)),(()=>bt(this,1))),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=pt(this);return vt(e),e._cacheable&&!e.effect.dirty||R(e._value,e._value=e.effect.run())&&bt(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function vt(e){le&&U&&(e=pt(e),he(U,e.dep||(e.dep=me((()=>e.dep=void 0),e instanceof mt?e:void 0))))}function bt(e,t=3,n){const o=(e=pt(e)).dep;o&&ge(o,t)}function yt(e){return!(!e||!0!==e.__v_isRef)}function Ot(e){return xt(e,!1)}function wt(e){return xt(e,!0)}function xt(e,t){return yt(e)?e:new $t(e,t)}class $t{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:pt(e),this._value=t?e:ft(e)}get value(){return vt(this),this._value}set value(e){const t=this.__v_isShallow||ut(e)||ct(e);e=t?e:pt(e),R(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:ft(e),bt(this,3))}}function St(e){bt(e,3)}function Ct(e){return yt(e)?e.value:e}const kt={get:(e,t,n)=>Ct(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return yt(r)&&!yt(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Pt(e){return st(e)?e:new Proxy(e,kt)}function Tt(e){const t=h(e)?new Array(e.length):{};for(const n in e)t[n]=At(e,n);return t}class Mt{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=pt(this._object),t=this._key,null==(n=ve.get(e))?void 0:n.get(t);var e,t,n}}class It{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Et(e,t,n){return yt(e)?e:m(e)?new It(e):y(e)&&arguments.length>1?At(e,t,n):Ot(e)}function At(e,t,n){const o=e[t];return yt(o)?o:new Mt(e,t,n)}function Rt(e,t,n,o){let r;try{r=o?e(...o):e()}catch(i){jt(i,t,n)}return r}function Dt(e,t,n,o){if(m(e)){const r=Rt(e,t,n,o);return r&&O(r)&&r.catch((e=>{jt(e,t,n)})),r}const r=[];for(let i=0;i>>1,r=zt[o],i=Gt(r);iGt(e)-Gt(t))),Ht=0;Htnull==e.id?1/0:e.id,Ut=(e,t)=>{const n=Gt(e)-Gt(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function qt(e){Nt=!1,Bt=!0,zt.sort(Ut);try{for(_t=0;_tv(e)?e.trim():e))),t&&(i=n.map(B))}let s,c=r[s=A(t)]||r[s=A(T(t))];!c&&l&&(c=r[s=A(I(t))]),c&&Dt(c,e,6,i);const u=r[s+"Once"];if(u){if(e.emitted){if(e.emitted[s])return}else e.emitted={};e.emitted[s]=!0,Dt(u,e,6,i)}}function en(e,t,n=!1){const o=t.emitsCache,r=o.get(e);if(void 0!==r)return r;const i=e.emits;let l={},a=!1;if(!m(e)){const o=e=>{const n=en(e,t,!0);n&&(a=!0,c(l,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return i||a?(h(i)?i.forEach((e=>l[e]=null)):c(l,i),y(e)&&o.set(e,l),l):(y(e)&&o.set(e,null),null)}function tn(e,t){return!(!e||!a(t))&&(t=t.slice(2).replace(/Once$/,""),p(e,t[0].toLowerCase()+t.slice(1))||p(e,I(t))||p(e,t))}let nn=null,on=null;function rn(e){const t=nn;return nn=e,on=e&&e.type.__scopeId||null,t}function ln(e){on=e}function an(){on=null}function sn(e,t=nn,n){if(!t)return e;if(e._n)return e;const o=(...n)=>{o._d&&gr(-1);const r=rn(t);let i;try{i=e(...n)}finally{rn(r),o._d&&gr(1)}return i};return o._n=!0,o._c=!0,o._d=!0,o}function cn(e){const{type:t,vnode:n,proxy:o,withProxy:r,props:i,propsOptions:[l],slots:a,attrs:c,emit:u,render:d,renderCache:p,data:h,setupState:f,ctx:g,inheritAttrs:m}=e;let v,b;const y=rn(e);try{if(4&n.shapeFlag){const e=r||o,t=e;v=Mr(d.call(t,e,p,i,f,h,g)),b=c}else{const e=t;v=Mr(e.length>1?e(i,{attrs:c,slots:a,emit:u}):e(i,null)),b=t.props?c:un(c)}}catch(w){dr.length=0,jt(w,e,1),v=Cr(cr)}let O=v;if(b&&!1!==m){const e=Object.keys(b),{shapeFlag:t}=O;e.length&&7&t&&(l&&e.some(s)&&(b=dn(b,l)),O=kr(O,b))}return n.dirs&&(O=kr(O),O.dirs=O.dirs?O.dirs.concat(n.dirs):n.dirs),n.transition&&(O.transition=n.transition),v=O,rn(y),v}const un=e=>{let t;for(const n in e)("class"===n||"style"===n||a(n))&&((t||(t={}))[n]=e[n]);return t},dn=(e,t)=>{const n={};for(const o in e)s(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function pn(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;r{e(...t),k()}}const d=jr,p=e=>!0===r?e:Cn(e,!1===r?1:void 0);let f,g,v=!1,b=!1;if(yt(e)?(f=()=>e.value,v=ut(e)):st(e)?(f=()=>p(e),v=!0):h(e)?(b=!0,v=e.some((e=>st(e)||ut(e))),f=()=>e.map((e=>yt(e)?e.value:st(e)?p(e):m(e)?Rt(e,d,2):void 0))):f=m(e)?t?()=>Rt(e,d,2):()=>(g&&g(),Dt(e,d,3,[O])):i,t&&r){const e=f;f=()=>Cn(e())}let y,O=e=>{g=S.onStop=()=>{Rt(e,d,4),g=S.onStop=void 0}};if(Hr){if(O=i,t?n&&Dt(t,d,3,[f(),b?[]:void 0,O]):f(),"sync"!==l)return i;{const e=Ro(bn);y=e.__watcherHandles||(e.__watcherHandles=[])}}let w=b?new Array(e.length).fill(On):On;const x=()=>{if(S.active&&S.dirty)if(t){const e=S.run();(r||v||(b?e.some(((e,t)=>R(e,w[t]))):R(e,w)))&&(g&&g(),Dt(t,d,3,[e,w===On?void 0:b&&w[0]===On?[]:w,O]),w=e)}else S.run()};let $;x.allowRecurse=!!t,"sync"===l?$=x:"post"===l?$=()=>Yo(x,d&&d.suspense):(x.pre=!0,d&&(x.id=d.uid),$=()=>Zt(x));const S=new ne(f,i,$),C=ee(),k=()=>{S.stop(),C&&u(C.effects,S)};return t?n?x():w=S.run():"post"===l?Yo(S.run.bind(S),d&&d.suspense):S.run(),y&&y.push(k),k}function $n(e,t,n){const o=this.proxy,r=v(e)?e.includes(".")?Sn(o,e):()=>o[e]:e.bind(o,o);let i;m(t)?i=t:(i=t.handler,n=t);const l=jr;_r(this);const a=xn(r,i.bind(o),n);return l?_r(l):Lr(),a}function Sn(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e0){if(n>=t)return e;n++}if((o=o||new Set).has(e))return e;if(o.add(e),yt(e))Cn(e.value,t,n,o);else if(h(e))for(let r=0;r{Cn(e,t,n,o)}));else if($(e))for(const r in e)Cn(e[r],t,n,o);return e}function kn(e,t){const n=nn;if(null===n)return e;const r=Zr(n)||n.proxy,i=e.dirs||(e.dirs=[]);for(let l=0;l{e.isMounted=!0})),Jn((()=>{e.isUnmounting=!0})),e}const En=[Function,Array],An={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:En,onEnter:En,onAfterEnter:En,onEnterCancelled:En,onBeforeLeave:En,onLeave:En,onAfterLeave:En,onLeaveCancelled:En,onBeforeAppear:En,onAppear:En,onAfterAppear:En,onAppearCancelled:En},Rn={name:"BaseTransition",props:An,setup(e,{slots:t}){const n=Br(),o=In();let r;return()=>{const i=t.default&&_n(t.default(),!0);if(!i||!i.length)return;let l=i[0];if(i.length>1)for(const e of i)if(e.type!==cr){l=e;break}const a=pt(e),{mode:s}=a;if(o.isLeaving)return Bn(l);const c=Nn(l);if(!c)return Bn(l);const u=jn(c,a,o,n);zn(c,u);const d=n.subTree,p=d&&Nn(d);let h=!1;const{getTransitionKey:f}=c.type;if(f){const e=f();void 0===r?r=e:e!==r&&(r=e,h=!0)}if(p&&p.type!==cr&&(!Or(c,p)||h)){const e=jn(p,a,o,n);if(zn(p,e),"out-in"===s)return o.isLeaving=!0,e.afterLeave=()=>{o.isLeaving=!1,!1!==n.update.active&&(n.effect.dirty=!0,n.update())},Bn(l);"in-out"===s&&c.type!==cr&&(e.delayLeave=(e,t,n)=>{Dn(o,p)[String(p.key)]=p,e[Tn]=()=>{t(),e[Tn]=void 0,delete u.delayedLeave},u.delayedLeave=n})}return l}}};function Dn(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function jn(e,t,n,o){const{appear:r,mode:i,persisted:l=!1,onBeforeEnter:a,onEnter:s,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:p,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:m,onAppear:v,onAfterAppear:b,onAppearCancelled:y}=t,O=String(e.key),w=Dn(n,e),x=(e,t)=>{e&&Dt(e,o,9,t)},$=(e,t)=>{const n=t[1];x(e,t),h(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},S={mode:i,persisted:l,beforeEnter(t){let o=a;if(!n.isMounted){if(!r)return;o=m||a}t[Tn]&&t[Tn](!0);const i=w[O];i&&Or(e,i)&&i.el[Tn]&&i.el[Tn](),x(o,[t])},enter(e){let t=s,o=c,i=u;if(!n.isMounted){if(!r)return;t=v||s,o=b||c,i=y||u}let l=!1;const a=e[Mn]=t=>{l||(l=!0,x(t?i:o,[e]),S.delayedLeave&&S.delayedLeave(),e[Mn]=void 0)};t?$(t,[e,a]):a()},leave(t,o){const r=String(e.key);if(t[Mn]&&t[Mn](!0),n.isUnmounting)return o();x(d,[t]);let i=!1;const l=t[Tn]=n=>{i||(i=!0,o(),x(n?g:f,[t]),t[Tn]=void 0,w[r]===e&&delete w[r])};w[r]=e,p?$(p,[t,l]):l()},clone:e=>jn(e,t,n,o)};return S}function Bn(e){if(Hn(e))return(e=kr(e)).children=null,e}function Nn(e){return Hn(e)?e.children?e.children[0]:void 0:e}function zn(e,t){6&e.shapeFlag&&e.component?zn(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function _n(e,t=!1,n){let o=[],r=0;for(let i=0;i1)for(let i=0;in.has(e.toLowerCase()):e=>n.has(e)}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const o={},r=[],i=()=>{},l=()=>!1,a=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),s=e=>e.startsWith("onUpdate:"),c=Object.assign,u=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,p=(e,t)=>d.call(e,t),h=Array.isArray,f=e=>"[object Map]"===x(e),g=e=>"[object Set]"===x(e),m=e=>"function"==typeof e,v=e=>"string"==typeof e,b=e=>"symbol"==typeof e,y=e=>null!==e&&"object"==typeof e,O=e=>(y(e)||m(e))&&m(e.then)&&m(e.catch),w=Object.prototype.toString,x=e=>w.call(e),$=e=>"[object Object]"===x(e),S=e=>v(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,C=n(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),k=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},P=/-(\w)/g,T=k((e=>e.replace(P,((e,t)=>t?t.toUpperCase():"")))),M=/\B([A-Z])/g,I=k((e=>e.replace(M,"-$1").toLowerCase())),E=k((e=>e.charAt(0).toUpperCase()+e.slice(1))),A=k((e=>e?`on${E(e)}`:"")),R=(e,t)=>!Object.is(e,t),D=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},B=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let N;const z=()=>N||(N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function _(e){if(h(e)){const t={};for(let n=0;n{if(e){const n=e.split(Q);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function W(e){let t="";if(v(e))t=e;else if(h(e))for(let n=0;nv(e)?e:null==e?"":h(e)||y(e)&&(e.toString===w||!m(e.toString))?JSON.stringify(e,Y,2):String(e),Y=(e,t)=>t&&t.__v_isRef?Y(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],o)=>(e[K(t,o)+" =>"]=n,e)),{})}:g(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>K(e)))}:b(t)?K(t):!y(t)||h(t)||$(t)?t:String(t),K=(e,t="")=>{var n;return b(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let G,U;class q{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=G,!e&&G&&(this.index=(G.scopes||(G.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=G;try{return G=this,e()}finally{G=t}}}on(){G=this}off(){G=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t=2))break;ue(),this._queryings--}return this._dirtyLevel>=2}set dirty(e){this._dirtyLevel=e?3:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=le,t=U;try{return le=!0,U=this,this._runnings++,oe(this),this.fn()}finally{re(this),this._runnings--,U=t,le=e}}stop(){var e;this.active&&(oe(this),re(this),null==(e=this.onStop)||e.call(this),this.active=!1)}}function oe(e){e._trackId++,e._depsLength=0}function re(e){if(e.deps&&e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},ve=new WeakMap,be=Symbol(""),ye=Symbol("");function Oe(e,t,n){if(le&&U){let t=ve.get(e);t||ve.set(e,t=new Map);let o=t.get(n);o||t.set(n,o=me((()=>t.delete(n)))),he(U,o)}}function we(e,t,n,o,r,i){const l=ve.get(e);if(!l)return;let a=[];if("clear"===t)a=[...l.values()];else if("length"===n&&h(e)){const e=Number(o);l.forEach(((t,n)=>{("length"===n||!b(n)&&n>=e)&&a.push(t)}))}else switch(void 0!==n&&a.push(l.get(n)),t){case"add":h(e)?S(n)&&a.push(l.get("length")):(a.push(l.get(be)),f(e)&&a.push(l.get(ye)));break;case"delete":h(e)||(a.push(l.get(be)),f(e)&&a.push(l.get(ye)));break;case"set":f(e)&&a.push(l.get(be))}de();for(const s of a)s&&ge(s,3);pe()}const xe=n("__proto__,__v_isRef,__isVue"),$e=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(b)),Se=Ce();function Ce(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=pt(this);for(let t=0,r=this.length;t{e[t]=function(...e){ce(),de();const n=pt(this)[t].apply(this,e);return pe(),ue(),n}})),e}function ke(e){const t=pt(this);return Oe(t,0,e),t.hasOwnProperty(e)}class Pe{constructor(e=!1,t=!1){this._isReadonly=e,this._shallow=t}get(e,t,n){const o=this._isReadonly,r=this._shallow;if("__v_isReactive"===t)return!o;if("__v_isReadonly"===t)return o;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(o?r?ot:nt:r?tt:et).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const i=h(e);if(!o){if(i&&p(Se,t))return Reflect.get(Se,t,n);if("hasOwnProperty"===t)return ke}const l=Reflect.get(e,t,n);return(b(t)?$e.has(t):xe(t))?l:(o||Oe(e,0,t),r?l:yt(l)?i&&S(t)?l:l.value:y(l)?o?lt(l):it(l):l)}}class Te extends Pe{constructor(e=!1){super(!1,e)}set(e,t,n,o){let r=e[t];if(!this._shallow){const t=ct(r);if(ut(n)||ct(n)||(r=pt(r),n=pt(n)),!h(e)&&yt(r)&&!yt(n))return!t&&(r.value=n,!0)}const i=h(e)&&S(t)?Number(t)e,De=e=>Reflect.getPrototypeOf(e);function je(e,t,n=!1,o=!1){const r=pt(e=e.__v_raw),i=pt(t);n||(R(t,i)&&Oe(r,0,t),Oe(r,0,i));const{has:l}=De(r),a=o?Re:n?gt:ft;return l.call(r,t)?a(e.get(t)):l.call(r,i)?a(e.get(i)):void(e!==r&&e.get(t))}function Be(e,t=!1){const n=this.__v_raw,o=pt(n),r=pt(e);return t||(R(e,r)&&Oe(o,0,e),Oe(o,0,r)),e===r?n.has(e):n.has(e)||n.has(r)}function Ne(e,t=!1){return e=e.__v_raw,!t&&Oe(pt(e),0,be),Reflect.get(e,"size",e)}function ze(e){e=pt(e);const t=pt(this);return De(t).has.call(t,e)||(t.add(e),we(t,"add",e,e)),this}function _e(e,t){t=pt(t);const n=pt(this),{has:o,get:r}=De(n);let i=o.call(n,e);i||(e=pt(e),i=o.call(n,e));const l=r.call(n,e);return n.set(e,t),i?R(t,l)&&we(n,"set",e,t):we(n,"add",e,t),this}function Le(e){const t=pt(this),{has:n,get:o}=De(t);let r=n.call(t,e);r||(e=pt(e),r=n.call(t,e)),o&&o.call(t,e);const i=t.delete(e);return r&&we(t,"delete",e,void 0),i}function Qe(){const e=pt(this),t=0!==e.size,n=e.clear();return t&&we(e,"clear",void 0,void 0),n}function He(e,t){return function(n,o){const r=this,i=r.__v_raw,l=pt(i),a=t?Re:e?gt:ft;return!e&&Oe(l,0,be),i.forEach(((e,t)=>n.call(o,a(e),a(t),r)))}}function Fe(e,t,n){return function(...o){const r=this.__v_raw,i=pt(r),l=f(i),a="entries"===e||e===Symbol.iterator&&l,s="keys"===e&&l,c=r[e](...o),u=n?Re:t?gt:ft;return!t&&Oe(i,0,s?ye:be),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function We(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Ve(){const e={get(e){return je(this,e)},get size(){return Ne(this)},has:Be,add:ze,set:_e,delete:Le,clear:Qe,forEach:He(!1,!1)},t={get(e){return je(this,e,!1,!0)},get size(){return Ne(this)},has:Be,add:ze,set:_e,delete:Le,clear:Qe,forEach:He(!1,!0)},n={get(e){return je(this,e,!0)},get size(){return Ne(this,!0)},has(e){return Be.call(this,e,!0)},add:We("add"),set:We("set"),delete:We("delete"),clear:We("clear"),forEach:He(!0,!1)},o={get(e){return je(this,e,!0,!0)},get size(){return Ne(this,!0)},has(e){return Be.call(this,e,!0)},add:We("add"),set:We("set"),delete:We("delete"),clear:We("clear"),forEach:He(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((r=>{e[r]=Fe(r,!1,!1),n[r]=Fe(r,!0,!1),t[r]=Fe(r,!1,!0),o[r]=Fe(r,!0,!0)})),[e,n,t,o]}const[Ze,Xe,Ye,Ke]=Ve();function Ge(e,t){const n=t?e?Ke:Ye:e?Xe:Ze;return(t,o,r)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(p(n,o)&&o in t?n:t,o,r)}const Ue={get:Ge(!1,!1)},qe={get:Ge(!1,!0)},Je={get:Ge(!0,!1)},et=new WeakMap,tt=new WeakMap,nt=new WeakMap,ot=new WeakMap;function rt(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>x(e).slice(8,-1))(e))}function it(e){return ct(e)?e:at(e,!1,Ie,Ue,et)}function lt(e){return at(e,!0,Ee,Je,nt)}function at(e,t,n,o,r){if(!y(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const l=rt(e);if(0===l)return e;const a=new Proxy(e,2===l?o:n);return r.set(e,a),a}function st(e){return ct(e)?st(e.__v_raw):!(!e||!e.__v_isReactive)}function ct(e){return!(!e||!e.__v_isReadonly)}function ut(e){return!(!e||!e.__v_isShallow)}function dt(e){return st(e)||ct(e)}function pt(e){const t=e&&e.__v_raw;return t?pt(t):e}function ht(e){return j(e,"__v_skip",!0),e}const ft=e=>y(e)?it(e):e,gt=e=>y(e)?lt(e):e;class mt{constructor(e,t,n,o){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new ne((()=>e(this._value)),(()=>bt(this,1))),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=pt(this);return vt(e),e._cacheable&&!e.effect.dirty||R(e._value,e._value=e.effect.run())&&bt(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function vt(e){le&&U&&(e=pt(e),he(U,e.dep||(e.dep=me((()=>e.dep=void 0),e instanceof mt?e:void 0))))}function bt(e,t=3,n){const o=(e=pt(e)).dep;o&&ge(o,t)}function yt(e){return!(!e||!0!==e.__v_isRef)}function Ot(e){return xt(e,!1)}function wt(e){return xt(e,!0)}function xt(e,t){return yt(e)?e:new $t(e,t)}class $t{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:pt(e),this._value=t?e:ft(e)}get value(){return vt(this),this._value}set value(e){const t=this.__v_isShallow||ut(e)||ct(e);e=t?e:pt(e),R(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:ft(e),bt(this,3))}}function St(e){bt(e,3)}function Ct(e){return yt(e)?e.value:e}const kt={get:(e,t,n)=>Ct(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return yt(r)&&!yt(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Pt(e){return st(e)?e:new Proxy(e,kt)}function Tt(e){const t=h(e)?new Array(e.length):{};for(const n in e)t[n]=At(e,n);return t}class Mt{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=pt(this._object),t=this._key,null==(n=ve.get(e))?void 0:n.get(t);var e,t,n}}class It{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Et(e,t,n){return yt(e)?e:m(e)?new It(e):y(e)&&arguments.length>1?At(e,t,n):Ot(e)}function At(e,t,n){const o=e[t];return yt(o)?o:new Mt(e,t,n)}function Rt(e,t,n,o){let r;try{r=o?e(...o):e()}catch(i){jt(i,t,n)}return r}function Dt(e,t,n,o){if(m(e)){const r=Rt(e,t,n,o);return r&&O(r)&&r.catch((e=>{jt(e,t,n)})),r}const r=[];for(let i=0;i>>1,r=zt[o],i=Gt(r);iGt(e)-Gt(t))),Ht=0;Htnull==e.id?1/0:e.id,Ut=(e,t)=>{const n=Gt(e)-Gt(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function qt(e){Nt=!1,Bt=!0,zt.sort(Ut);try{for(_t=0;_tv(e)?e.trim():e))),t&&(i=n.map(B))}let s,c=r[s=A(t)]||r[s=A(T(t))];!c&&l&&(c=r[s=A(I(t))]),c&&Dt(c,e,6,i);const u=r[s+"Once"];if(u){if(e.emitted){if(e.emitted[s])return}else e.emitted={};e.emitted[s]=!0,Dt(u,e,6,i)}}function en(e,t,n=!1){const o=t.emitsCache,r=o.get(e);if(void 0!==r)return r;const i=e.emits;let l={},a=!1;if(!m(e)){const o=e=>{const n=en(e,t,!0);n&&(a=!0,c(l,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return i||a?(h(i)?i.forEach((e=>l[e]=null)):c(l,i),y(e)&&o.set(e,l),l):(y(e)&&o.set(e,null),null)}function tn(e,t){return!(!e||!a(t))&&(t=t.slice(2).replace(/Once$/,""),p(e,t[0].toLowerCase()+t.slice(1))||p(e,I(t))||p(e,t))}let nn=null,on=null;function rn(e){const t=nn;return nn=e,on=e&&e.type.__scopeId||null,t}function ln(e){on=e}function an(){on=null}function sn(e,t=nn,n){if(!t)return e;if(e._n)return e;const o=(...n)=>{o._d&&gr(-1);const r=rn(t);let i;try{i=e(...n)}finally{rn(r),o._d&&gr(1)}return i};return o._n=!0,o._c=!0,o._d=!0,o}function cn(e){const{type:t,vnode:n,proxy:o,withProxy:r,props:i,propsOptions:[l],slots:a,attrs:c,emit:u,render:d,renderCache:p,data:h,setupState:f,ctx:g,inheritAttrs:m}=e;let v,b;const y=rn(e);try{if(4&n.shapeFlag){const e=r||o,t=e;v=Mr(d.call(t,e,p,i,f,h,g)),b=c}else{const e=t;v=Mr(e.length>1?e(i,{attrs:c,slots:a,emit:u}):e(i,null)),b=t.props?c:un(c)}}catch(w){dr.length=0,jt(w,e,1),v=Cr(cr)}let O=v;if(b&&!1!==m){const e=Object.keys(b),{shapeFlag:t}=O;e.length&&7&t&&(l&&e.some(s)&&(b=dn(b,l)),O=kr(O,b))}return n.dirs&&(O=kr(O),O.dirs=O.dirs?O.dirs.concat(n.dirs):n.dirs),n.transition&&(O.transition=n.transition),v=O,rn(y),v}const un=e=>{let t;for(const n in e)("class"===n||"style"===n||a(n))&&((t||(t={}))[n]=e[n]);return t},dn=(e,t)=>{const n={};for(const o in e)s(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function pn(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;r{e(...t),k()}}const d=jr,p=e=>!0===r?e:Cn(e,!1===r?1:void 0);let f,g,v=!1,b=!1;if(yt(e)?(f=()=>e.value,v=ut(e)):st(e)?(f=()=>p(e),v=!0):h(e)?(b=!0,v=e.some((e=>st(e)||ut(e))),f=()=>e.map((e=>yt(e)?e.value:st(e)?p(e):m(e)?Rt(e,d,2):void 0))):f=m(e)?t?()=>Rt(e,d,2):()=>(g&&g(),Dt(e,d,3,[O])):i,t&&r){const e=f;f=()=>Cn(e())}let y,O=e=>{g=S.onStop=()=>{Rt(e,d,4),g=S.onStop=void 0}};if(Hr){if(O=i,t?n&&Dt(t,d,3,[f(),b?[]:void 0,O]):f(),"sync"!==l)return i;{const e=Ro(bn);y=e.__watcherHandles||(e.__watcherHandles=[])}}let w=b?new Array(e.length).fill(On):On;const x=()=>{if(S.active&&S.dirty)if(t){const e=S.run();(r||v||(b?e.some(((e,t)=>R(e,w[t]))):R(e,w)))&&(g&&g(),Dt(t,d,3,[e,w===On?void 0:b&&w[0]===On?[]:w,O]),w=e)}else S.run()};let $;x.allowRecurse=!!t,"sync"===l?$=x:"post"===l?$=()=>Yo(x,d&&d.suspense):(x.pre=!0,d&&(x.id=d.uid),$=()=>Zt(x));const S=new ne(f,i,$),C=ee(),k=()=>{S.stop(),C&&u(C.effects,S)};return t?n?x():w=S.run():"post"===l?Yo(S.run.bind(S),d&&d.suspense):S.run(),y&&y.push(k),k}function $n(e,t,n){const o=this.proxy,r=v(e)?e.includes(".")?Sn(o,e):()=>o[e]:e.bind(o,o);let i;m(t)?i=t:(i=t.handler,n=t);const l=jr;_r(this);const a=xn(r,i.bind(o),n);return l?_r(l):Lr(),a}function Sn(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e0){if(n>=t)return e;n++}if((o=o||new Set).has(e))return e;if(o.add(e),yt(e))Cn(e.value,t,n,o);else if(h(e))for(let r=0;r{Cn(e,t,n,o)}));else if($(e))for(const r in e)Cn(e[r],t,n,o);return e}function kn(e,t){const n=nn;if(null===n)return e;const r=Zr(n)||n.proxy,i=e.dirs||(e.dirs=[]);for(let l=0;l{e.isMounted=!0})),Jn((()=>{e.isUnmounting=!0})),e}const En=[Function,Array],An={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:En,onEnter:En,onAfterEnter:En,onEnterCancelled:En,onBeforeLeave:En,onLeave:En,onAfterLeave:En,onLeaveCancelled:En,onBeforeAppear:En,onAppear:En,onAfterAppear:En,onAppearCancelled:En},Rn={name:"BaseTransition",props:An,setup(e,{slots:t}){const n=Br(),o=In();let r;return()=>{const i=t.default&&_n(t.default(),!0);if(!i||!i.length)return;let l=i[0];if(i.length>1)for(const e of i)if(e.type!==cr){l=e;break}const a=pt(e),{mode:s}=a;if(o.isLeaving)return Bn(l);const c=Nn(l);if(!c)return Bn(l);const u=jn(c,a,o,n);zn(c,u);const d=n.subTree,p=d&&Nn(d);let h=!1;const{getTransitionKey:f}=c.type;if(f){const e=f();void 0===r?r=e:e!==r&&(r=e,h=!0)}if(p&&p.type!==cr&&(!Or(c,p)||h)){const e=jn(p,a,o,n);if(zn(p,e),"out-in"===s)return o.isLeaving=!0,e.afterLeave=()=>{o.isLeaving=!1,!1!==n.update.active&&(n.effect.dirty=!0,n.update())},Bn(l);"in-out"===s&&c.type!==cr&&(e.delayLeave=(e,t,n)=>{Dn(o,p)[String(p.key)]=p,e[Tn]=()=>{t(),e[Tn]=void 0,delete u.delayedLeave},u.delayedLeave=n})}return l}}};function Dn(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function jn(e,t,n,o){const{appear:r,mode:i,persisted:l=!1,onBeforeEnter:a,onEnter:s,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:p,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:m,onAppear:v,onAfterAppear:b,onAppearCancelled:y}=t,O=String(e.key),w=Dn(n,e),x=(e,t)=>{e&&Dt(e,o,9,t)},$=(e,t)=>{const n=t[1];x(e,t),h(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},S={mode:i,persisted:l,beforeEnter(t){let o=a;if(!n.isMounted){if(!r)return;o=m||a}t[Tn]&&t[Tn](!0);const i=w[O];i&&Or(e,i)&&i.el[Tn]&&i.el[Tn](),x(o,[t])},enter(e){let t=s,o=c,i=u;if(!n.isMounted){if(!r)return;t=v||s,o=b||c,i=y||u}let l=!1;const a=e[Mn]=t=>{l||(l=!0,x(t?i:o,[e]),S.delayedLeave&&S.delayedLeave(),e[Mn]=void 0)};t?$(t,[e,a]):a()},leave(t,o){const r=String(e.key);if(t[Mn]&&t[Mn](!0),n.isUnmounting)return o();x(d,[t]);let i=!1;const l=t[Tn]=n=>{i||(i=!0,o(),x(n?g:f,[t]),t[Tn]=void 0,w[r]===e&&delete w[r])};w[r]=e,p?$(p,[t,l]):l()},clone:e=>jn(e,t,n,o)};return S}function Bn(e){if(Hn(e))return(e=kr(e)).children=null,e}function Nn(e){return Hn(e)?e.children?e.children[0]:void 0:e}function zn(e,t){6&e.shapeFlag&&e.component?zn(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function _n(e,t=!1,n){let o=[],r=0;for(let i=0;i1)for(let i=0;ic({name:e.name},t,{setup:e}))():e}const Qn=e=>!!e.type.__asyncLoader,Hn=e=>e.type.__isKeepAlive;function Fn(e,t){Vn(e,"a",t)}function Wn(e,t){Vn(e,"da",t)}function Vn(e,t,n=jr){const o=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Xn(t,o,n),n){let e=n.parent;for(;e&&e.parent;)Hn(e.parent.vnode)&&Zn(o,t,n,e),e=e.parent}}function Zn(e,t,n,o){const r=Xn(t,e,o,!0);eo((()=>{u(o[t],r)}),n)}function Xn(e,t,n=jr,o=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;ce(),_r(n);const r=Dt(t,n,e,o);return Lr(),ue(),r});return o?r.unshift(i):r.push(i),i}}const Yn=e=>(t,n=jr)=>(!Hr||"sp"===e)&&Xn(e,((...e)=>t(...e)),n),Kn=Yn("bm"),Gn=Yn("m"),Un=Yn("bu"),qn=Yn("u"),Jn=Yn("bum"),eo=Yn("um"),to=Yn("sp"),no=Yn("rtg"),oo=Yn("rtc");function ro(e,t=jr){Xn("ec",e,t)}function io(e,t,n,o){let r;const i=n&&n[o];if(h(e)||v(e)){r=new Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,i&&i[n])));else{const n=Object.keys(e);r=new Array(n.length);for(let o=0,l=n.length;o{const t=o.fn(...e);return t&&(t.key=o.key),t}:o.fn)}return e}function ao(e,t,n={},o,r){if(nn.isCE||nn.parent&&Qn(nn.parent)&&nn.parent.isCE)return"default"!==t&&(n.name=t),Cr("slot",n,o&&o());let i=e[t];i&&i._c&&(i._d=!1),hr();const l=i&&so(i(n)),a=br(ar,{key:n.key||l&&l.key||`_${t}`},l||(o?o():[]),l&&1===e._?64:-2);return!r&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function so(e){return e.some((e=>!yr(e)||e.type!==cr&&!(e.type===ar&&!so(e.children))))?e:null}const co=e=>e?Qr(e)?Zr(e)||e.proxy:co(e.parent):null,uo=c(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>co(e.parent),$root:e=>co(e.root),$emit:e=>e.emit,$options:e=>Oo(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Zt(e.update)}),$nextTick:e=>e.n||(e.n=Vt.bind(e.proxy)),$watch:e=>$n.bind(e)}),po=(e,t)=>e!==o&&!e.__isScriptSetup&&p(e,t),ho={get({_:e},t){const{ctx:n,setupState:r,data:i,props:l,accessCache:a,type:s,appContext:c}=e;let u;if("$"!==t[0]){const s=a[t];if(void 0!==s)switch(s){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return l[t]}else{if(po(r,t))return a[t]=1,r[t];if(i!==o&&p(i,t))return a[t]=2,i[t];if((u=e.propsOptions[0])&&p(u,t))return a[t]=3,l[t];if(n!==o&&p(n,t))return a[t]=4,n[t];mo&&(a[t]=0)}}const d=uo[t];let h,f;return d?("$attrs"===t&&Oe(e,0,t),d(e)):(h=s.__cssModules)&&(h=h[t])?h:n!==o&&p(n,t)?(a[t]=4,n[t]):(f=c.config.globalProperties,p(f,t)?f[t]:void 0)},set({_:e},t,n){const{data:r,setupState:i,ctx:l}=e;return po(i,t)?(i[t]=n,!0):r!==o&&p(r,t)?(r[t]=n,!0):!(p(e.props,t)||"$"===t[0]&&t.slice(1)in e||(l[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:l}},a){let s;return!!n[a]||e!==o&&p(e,a)||po(t,a)||(s=l[0])&&p(s,a)||p(r,a)||p(uo,a)||p(i.config.globalProperties,a)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:p(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function fo(){const e=Br();return e.setupContext||(e.setupContext=Vr(e))}function go(e){return h(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}let mo=!0;function vo(e){const t=Oo(e),n=e.proxy,o=e.ctx;mo=!1,t.beforeCreate&&bo(t.beforeCreate,e,"bc");const{data:r,computed:l,methods:a,watch:s,provide:c,inject:u,created:d,beforeMount:p,mounted:f,beforeUpdate:g,updated:v,activated:b,deactivated:O,beforeDestroy:w,beforeUnmount:x,destroyed:$,unmounted:S,render:C,renderTracked:k,renderTriggered:P,errorCaptured:T,serverPrefetch:M,expose:I,inheritAttrs:E,components:A,directives:R,filters:D}=t;if(u&&function(e,t,n=i){h(e)&&(e=So(e));for(const o in e){const n=e[o];let r;r=y(n)?"default"in n?Ro(n.from||o,n.default,!0):Ro(n.from||o):Ro(n),yt(r)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[o]=r}}(u,o,null),a)for(const i in a){const e=a[i];m(e)&&(o[i]=e.bind(n))}if(r){const t=r.call(n,n);y(t)&&(e.data=it(t))}if(mo=!0,l)for(const h in l){const e=l[h],t=m(e)?e.bind(n,n):m(e.get)?e.get.bind(n,n):i,r=!m(e)&&m(e.set)?e.set.bind(n):i,a=Yr({get:t,set:r});Object.defineProperty(o,h,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(s)for(const i in s)yo(s[i],o,n,i);if(c){const e=m(c)?c.call(n):c;Reflect.ownKeys(e).forEach((t=>{Ao(t,e[t])}))}function j(e,t){h(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(d&&bo(d,e,"c"),j(Kn,p),j(Gn,f),j(Un,g),j(qn,v),j(Fn,b),j(Wn,O),j(ro,T),j(oo,k),j(no,P),j(Jn,x),j(eo,S),j(to,M),h(I))if(I.length){const t=e.exposed||(e.exposed={});I.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});C&&e.render===i&&(e.render=C),null!=E&&(e.inheritAttrs=E),A&&(e.components=A),R&&(e.directives=R)}function bo(e,t,n){Dt(h(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function yo(e,t,n,o){const r=o.includes(".")?Sn(n,o):()=>n[o];if(v(e)){const n=t[e];m(n)&&wn(r,n)}else if(m(e))wn(r,e.bind(n));else if(y(e))if(h(e))e.forEach((e=>yo(e,t,n,o)));else{const o=m(e.handler)?e.handler.bind(n):t[e.handler];m(o)&&wn(r,o,e)}}function Oo(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:l}}=e.appContext,a=i.get(t);let s;return a?s=a:r.length||n||o?(s={},r.length&&r.forEach((e=>wo(s,e,l,!0))),wo(s,t,l)):s=t,y(t)&&i.set(t,s),s}function wo(e,t,n,o=!1){const{mixins:r,extends:i}=t;i&&wo(e,i,n,!0),r&&r.forEach((t=>wo(e,t,n,!0)));for(const l in t)if(o&&"expose"===l);else{const o=xo[l]||n&&n[l];e[l]=o?o(e[l],t[l]):t[l]}return e}const xo={data:$o,props:Po,emits:Po,methods:ko,computed:ko,beforeCreate:Co,created:Co,beforeMount:Co,mounted:Co,beforeUpdate:Co,updated:Co,beforeDestroy:Co,beforeUnmount:Co,destroyed:Co,unmounted:Co,activated:Co,deactivated:Co,errorCaptured:Co,serverPrefetch:Co,components:ko,directives:ko,watch:function(e,t){if(!e)return t;if(!t)return e;const n=c(Object.create(null),e);for(const o in t)n[o]=Co(e[o],t[o]);return n},provide:$o,inject:function(e,t){return ko(So(e),So(t))}};function $o(e,t){return t?e?function(){return c(m(e)?e.call(this,this):e,m(t)?t.call(this,this):t)}:t:e}function So(e){if(h(e)){const t={};for(let n=0;n(i.has(e)||(e&&m(e.install)?(i.add(e),e.install(a,...t)):m(e)&&(i.add(e),e(a,...t))),a),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),a),component:(e,t)=>t?(r.components[e]=t,a):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,a):r.directives[e],mount(i,s,c){if(!l){const u=Cr(n,o);return u.appContext=r,!0===c?c="svg":!1===c&&(c=void 0),s&&t?t(u,i):e(u,i,c),l=!0,a._container=i,i.__vue_app__=a,Zr(u.component)||u.component.proxy}},unmount(){l&&(e(null,a._container),delete a._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,a),runWithContext(e){Eo=a;try{return e()}finally{Eo=null}}};return a}}let Eo=null;function Ao(e,t){if(jr){let n=jr.provides;const o=jr.parent&&jr.parent.provides;o===n&&(n=jr.provides=Object.create(o)),n[e]=t}}function Ro(e,t,n=!1){const o=jr||nn;if(o||Eo){const r=o?null==o.parent?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:Eo._context.provides;if(r&&e in r)return r[e];if(arguments.length>1)return n&&m(t)?t.call(o&&o.proxy):t}}function Do(e,t,n,o=!1){const r={},i={};j(i,wr,1),e.propsDefaults=Object.create(null),jo(e,t,r,i);for(const l in e.propsOptions[0])l in r||(r[l]=void 0);n?e.props=o?r:at(r,!1,Ae,qe,tt):e.type.props?e.props=r:e.props=i,e.attrs=i}function jo(e,t,n,r){const[i,l]=e.propsOptions;let a,s=!1;if(t)for(let o in t){if(C(o))continue;const c=t[o];let u;i&&p(i,u=T(o))?l&&l.includes(u)?(a||(a={}))[u]=c:n[u]=c:tn(e.emitsOptions,o)||o in r&&c===r[o]||(r[o]=c,s=!0)}if(l){const t=pt(n),r=a||o;for(let o=0;o{d=!0;const[n,o]=No(e,t,!0);c(s,n),o&&u.push(...o)};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}if(!a&&!d)return y(e)&&i.set(e,r),r;if(h(a))for(let r=0;r-1,n[1]=o<0||t-1||p(n,"default"))&&u.push(e)}}}const f=[s,u];return y(e)&&i.set(e,f),f}function zo(e){return"$"!==e[0]}function _o(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:null===e?"null":""}function Lo(e,t){return _o(e)===_o(t)}function Qo(e,t){return h(t)?t.findIndex((t=>Lo(t,e))):m(t)&&Lo(t,e)?0:-1}const Ho=e=>"_"===e[0]||"$stable"===e,Fo=e=>h(e)?e.map(Mr):[Mr(e)],Wo=(e,t,n)=>{if(t._n)return t;const o=sn(((...e)=>Fo(t(...e))),n);return o._c=!1,o},Vo=(e,t,n)=>{const o=e._ctx;for(const r in e){if(Ho(r))continue;const n=e[r];if(m(n))t[r]=Wo(0,n,o);else if(null!=n){const e=Fo(n);t[r]=()=>e}}},Zo=(e,t)=>{const n=Fo(t);e.slots.default=()=>n};function Xo(e,t,n,r,i=!1){if(h(e))return void e.forEach(((e,o)=>Xo(e,t&&(h(t)?t[o]:t),n,r,i)));if(Qn(r)&&!i)return;const l=4&r.shapeFlag?Zr(r.component)||r.component.proxy:r.el,a=i?null:l,{i:s,r:c}=e,d=t&&t.r,f=s.refs===o?s.refs={}:s.refs,g=s.setupState;if(null!=d&&d!==c&&(v(d)?(f[d]=null,p(g,d)&&(g[d]=null)):yt(d)&&(d.value=null)),m(c))Rt(c,s,12,[a,f]);else{const t=v(c),o=yt(c);if(t||o){const r=()=>{if(e.f){const n=t?p(g,c)?g[c]:f[c]:c.value;i?h(n)&&u(n,l):h(n)?n.includes(l)||n.push(l):t?(f[c]=[l],p(g,c)&&(g[c]=f[c])):(c.value=[l],e.k&&(f[e.k]=c.value))}else t?(f[c]=a,p(g,c)&&(g[c]=a)):o&&(c.value=a,e.k&&(f[e.k]=a))};a?(r.id=-1,Yo(r,n)):r()}}}const Yo=function(e,t){var n;t&&t.pendingBranch?h(e)?t.effects.push(...e):t.effects.push(e):(h(n=e)?Lt.push(...n):Qt&&Qt.includes(n,n.allowRecurse?Ht+1:Ht)||Lt.push(n),Xt())};function Ko(e){return function(e,t){z().__VUE__=!0;const{insert:n,remove:l,patchProp:a,createElement:s,createText:u,createComment:d,setText:h,setElementText:f,parentNode:g,nextSibling:m,setScopeId:v=i,insertStaticContent:b}=e,y=(e,t,n,o=null,r=null,i=null,l=void 0,a=null,s=!!t.dynamicChildren)=>{if(e===t)return;e&&!Or(e,t)&&(o=te(e),K(e,r,i,!0),e=null),-2===t.patchFlag&&(s=!1,t.dynamicChildren=null);const{type:c,ref:u,shapeFlag:d}=t;switch(c){case sr:w(e,t,n,o);break;case cr:x(e,t,n,o);break;case ur:null==e&&$(t,n,o,l);break;case ar:_(e,t,n,o,r,i,l,a,s);break;default:1&d?P(e,t,n,o,r,i,l,a,s):6&d?L(e,t,n,o,r,i,l,a,s):(64&d||128&d)&&c.process(e,t,n,o,r,i,l,a,s,re)}null!=u&&r&&Xo(u,e&&e.ref,i,t||e,!t)},w=(e,t,o,r)=>{if(null==e)n(t.el=u(t.children),o,r);else{const n=t.el=e.el;t.children!==e.children&&h(n,t.children)}},x=(e,t,o,r)=>{null==e?n(t.el=d(t.children||""),o,r):t.el=e.el},$=(e,t,n,o)=>{[e.el,e.anchor]=b(e.children,t,n,o,e.el,e.anchor)},S=({el:e,anchor:t},o,r)=>{let i;for(;e&&e!==t;)i=m(e),n(e,o,r),e=i;n(t,o,r)},k=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=m(e),l(e),e=n;l(t)},P=(e,t,n,o,r,i,l,a,s)=>{"svg"===t.type?l="svg":"math"===t.type&&(l="mathml"),null==e?M(t,n,o,r,i,l,a,s):R(e,t,r,i,l,a,s)},M=(e,t,o,r,i,l,c,u)=>{let d,p;const{props:h,shapeFlag:g,transition:m,dirs:v}=e;if(d=e.el=s(e.type,l,h&&h.is,h),8&g?f(d,e.children):16&g&&A(e.children,d,null,r,i,Go(e,l),c,u),v&&Pn(e,null,r,"created"),E(d,e,e.scopeId,c,r),h){for(const t in h)"value"===t||C(t)||a(d,t,null,h[t],l,e.children,r,i,ee);"value"in h&&a(d,"value",null,h.value,l),(p=h.onVnodeBeforeMount)&&Ar(p,r,e)}v&&Pn(e,null,r,"beforeMount");const b=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(i,m);b&&m.beforeEnter(d),n(d,t,o),((p=h&&h.onVnodeMounted)||b||v)&&Yo((()=>{p&&Ar(p,r,e),b&&m.enter(d),v&&Pn(e,null,r,"mounted")}),i)},E=(e,t,n,o,r)=>{if(n&&v(e,n),o)for(let i=0;i{for(let c=s;c{const c=t.el=e.el;let{patchFlag:u,dynamicChildren:d,dirs:p}=t;u|=16&e.patchFlag;const h=e.props||o,g=t.props||o;let m;if(n&&Uo(n,!1),(m=g.onVnodeBeforeUpdate)&&Ar(m,n,t,e),p&&Pn(t,e,n,"beforeUpdate"),n&&Uo(n,!0),d?B(e.dynamicChildren,d,c,n,r,Go(t,i),l):s||V(e,t,c,null,n,r,Go(t,i),l,!1),u>0){if(16&u)N(c,t,h,g,n,r,i);else if(2&u&&h.class!==g.class&&a(c,"class",null,g.class,i),4&u&&a(c,"style",h.style,g.style,i),8&u){const o=t.dynamicProps;for(let t=0;t{m&&Ar(m,n,t,e),p&&Pn(t,e,n,"updated")}),r)},B=(e,t,n,o,r,i,l)=>{for(let a=0;a{if(n!==r){if(n!==o)for(const o in n)C(o)||o in r||a(e,o,n[o],null,s,t.children,i,l,ee);for(const o in r){if(C(o))continue;const c=r[o],u=n[o];c!==u&&"value"!==o&&a(e,o,u,c,s,t.children,i,l,ee)}"value"in r&&a(e,"value",n.value,r.value,s)}},_=(e,t,o,r,i,l,a,s,c)=>{const d=t.el=e?e.el:u(""),p=t.anchor=e?e.anchor:u("");let{patchFlag:h,dynamicChildren:f,slotScopeIds:g}=t;g&&(s=s?s.concat(g):g),null==e?(n(d,o,r),n(p,o,r),A(t.children,o,p,i,l,a,s,c)):h>0&&64&h&&f&&e.dynamicChildren?(B(e.dynamicChildren,f,o,i,l,a,s),(null!=t.key||i&&t===i.subTree)&&qo(e,t,!0)):V(e,t,o,p,i,l,a,s,c)},L=(e,t,n,o,r,i,l,a,s)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?r.ctx.activate(t,n,o,l,s):Q(t,n,o,r,i,l,s):H(e,t,s)},Q=(e,t,n,r,i,l,a)=>{const s=e.component=function(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||Rr,l={uid:Dr++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new q(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:No(r,i),emitsOptions:en(r,i),emit:null,emitted:null,propsDefaults:o,inheritAttrs:r.inheritAttrs,ctx:o,data:o,props:o,attrs:o,slots:o,refs:o,setupState:o,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return l.ctx={_:l},l.root=t?t.root:l,l.emit=Jt.bind(null,l),e.ce&&e.ce(l),l}(e,r,i);if(Hn(e)&&(s.ctx.renderer=re),function(e,t=!1){t&&zr(t);const{props:n,children:o}=e.vnode,r=Qr(e);Do(e,n,r,t),((e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=pt(t),j(t,"_",n)):Vo(t,e.slots={})}else e.slots={},t&&Zo(e,t);j(e.slots,wr,1)})(e,o);r&&function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=ht(new Proxy(e.ctx,ho));const{setup:o}=n;if(o){const n=e.setupContext=o.length>1?Vr(e):null;_r(e),ce();const r=Rt(o,e,0,[e.props,n]);if(ue(),Lr(),O(r)){if(r.then(Lr,Lr),t)return r.then((n=>{Fr(e,n,t)})).catch((t=>{jt(t,e,0)}));e.asyncDep=r}else Fr(e,r,t)}else Wr(e)}(e,t);t&&zr(!1)}(s),s.asyncDep){if(i&&i.registerDep(s,F),!e.el){const e=s.subTree=Cr(cr);x(null,e,t,n)}}else F(s,e,t,n,i,l,a)},H=(e,t,n)=>{const o=t.component=e.component;if(function(e,t,n){const{props:o,children:r,component:i}=e,{props:l,children:a,patchFlag:s}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&s>=0))return!(!r&&!a||a&&a.$stable)||o!==l&&(o?!l||pn(o,l,c):!!l);if(1024&s)return!0;if(16&s)return o?pn(o,l,c):!!l;if(8&s){const e=t.dynamicProps;for(let t=0;t_t&&zt.splice(t,1)}(o.update),o.effect.dirty=!0,o.update()}else t.el=e.el,o.vnode=t},F=(e,t,n,o,r,l,a)=>{const s=()=>{if(e.isMounted){let{next:t,bu:n,u:o,parent:i,vnode:c}=e;{const n=Jo(e);if(n)return t&&(t.el=c.el,W(e,t,a)),void n.asyncDep.then((()=>{e.isUnmounted||s()}))}let u,d=t;Uo(e,!1),t?(t.el=c.el,W(e,t,a)):t=c,n&&D(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&Ar(u,i,t,c),Uo(e,!0);const p=cn(e),h=e.subTree;e.subTree=p,y(h,p,g(h.el),te(h),e,r,l),t.el=p.el,null===d&&function({vnode:e,parent:t},n){if(n)for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.el=e.el),o!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,p.el),o&&Yo(o,r),(u=t.props&&t.props.onVnodeUpdated)&&Yo((()=>Ar(u,i,t,c)),r)}else{let i;const{el:a,props:s}=t,{bm:c,m:u,parent:d}=e,p=Qn(t);if(Uo(e,!1),c&&D(c),!p&&(i=s&&s.onVnodeBeforeMount)&&Ar(i,d,t),Uo(e,!0),a&&le){const n=()=>{e.subTree=cn(e),le(a,e.subTree,e,r,null)};p?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const i=e.subTree=cn(e);y(null,i,n,o,e,r,l),t.el=i.el}if(u&&Yo(u,r),!p&&(i=s&&s.onVnodeMounted)){const e=t;Yo((()=>Ar(i,d,e)),r)}(256&t.shapeFlag||d&&Qn(d.vnode)&&256&d.vnode.shapeFlag)&&e.a&&Yo(e.a,r),e.isMounted=!0,t=n=o=null}},c=e.effect=new ne(s,i,(()=>Zt(u)),e.scope),u=e.update=()=>{c.dirty&&c.run()};u.id=e.uid,Uo(e,!0),u()},W=(e,t,n)=>{t.component=e;const r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,o){const{props:r,attrs:i,vnode:{patchFlag:l}}=e,a=pt(r),[s]=e.propsOptions;let c=!1;if(!(o||l>0)||16&l){let o;jo(e,t,r,i)&&(c=!0);for(const i in a)t&&(p(t,i)||(o=I(i))!==i&&p(t,o))||(s?!n||void 0===n[i]&&void 0===n[o]||(r[i]=Bo(s,a,i,void 0,e,!0)):delete r[i]);if(i!==a)for(const e in i)t&&p(t,e)||(delete i[e],c=!0)}else if(8&l){const n=e.vnode.dynamicProps;for(let o=0;o{const{vnode:r,slots:i}=e;let l=!0,a=o;if(32&r.shapeFlag){const e=t._;e?n&&1===e?l=!1:(c(i,t),n||1!==e||delete i._):(l=!t.$stable,Vo(t,i)),a=t}else t&&(Zo(e,t),a={default:1});if(l)for(const o in i)Ho(o)||null!=a[o]||delete i[o]})(e,t.children,n),ce(),Yt(e),ue()},V=(e,t,n,o,r,i,l,a,s=!1)=>{const c=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:p,shapeFlag:h}=t;if(p>0){if(128&p)return void X(c,d,n,o,r,i,l,a,s);if(256&p)return void Z(c,d,n,o,r,i,l,a,s)}8&h?(16&u&&ee(c,r,i),d!==c&&f(n,d)):16&u?16&h?X(c,d,n,o,r,i,l,a,s):ee(c,r,i,!0):(8&u&&f(n,""),16&h&&A(d,n,o,r,i,l,a,s))},Z=(e,t,n,o,i,l,a,s,c)=>{t=t||r;const u=(e=e||r).length,d=t.length,p=Math.min(u,d);let h;for(h=0;hd?ee(e,i,l,!0,!1,p):A(t,n,o,i,l,a,s,c,p)},X=(e,t,n,o,i,l,a,s,c)=>{let u=0;const d=t.length;let p=e.length-1,h=d-1;for(;u<=p&&u<=h;){const o=e[u],r=t[u]=c?Ir(t[u]):Mr(t[u]);if(!Or(o,r))break;y(o,r,n,null,i,l,a,s,c),u++}for(;u<=p&&u<=h;){const o=e[p],r=t[h]=c?Ir(t[h]):Mr(t[h]);if(!Or(o,r))break;y(o,r,n,null,i,l,a,s,c),p--,h--}if(u>p){if(u<=h){const e=h+1,r=eh)for(;u<=p;)K(e[u],i,l,!0),u++;else{const f=u,g=u,m=new Map;for(u=g;u<=h;u++){const e=t[u]=c?Ir(t[u]):Mr(t[u]);null!=e.key&&m.set(e.key,u)}let v,b=0;const O=h-g+1;let w=!1,x=0;const $=new Array(O);for(u=0;u=O){K(o,i,l,!0);continue}let r;if(null!=o.key)r=m.get(o.key);else for(v=g;v<=h;v++)if(0===$[v-g]&&Or(o,t[v])){r=v;break}void 0===r?K(o,i,l,!0):($[r-g]=u+1,r>=x?x=r:w=!0,y(o,t[r],n,null,i,l,a,s,c),b++)}const S=w?function(e){const t=e.slice(),n=[0];let o,r,i,l,a;const s=e.length;for(o=0;o>1,e[n[a]]0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,l=n[i-1];i-- >0;)n[i]=l,l=t[l];return n}($):r;for(v=S.length-1,u=O-1;u>=0;u--){const e=g+u,r=t[e],p=e+1{const{el:l,type:a,transition:s,children:c,shapeFlag:u}=e;if(6&u)Y(e.component.subTree,t,o,r);else if(128&u)e.suspense.move(t,o,r);else if(64&u)a.move(e,t,o,re);else if(a!==ar)if(a!==ur)if(2!==r&&1&u&&s)if(0===r)s.beforeEnter(l),n(l,t,o),Yo((()=>s.enter(l)),i);else{const{leave:e,delayLeave:r,afterLeave:i}=s,a=()=>n(l,t,o),c=()=>{e(l,(()=>{a(),i&&i()}))};r?r(l,a,c):c()}else n(l,t,o);else S(e,t,o);else{n(l,t,o);for(let e=0;e{const{type:i,props:l,ref:a,children:s,dynamicChildren:c,shapeFlag:u,patchFlag:d,dirs:p}=e;if(null!=a&&Xo(a,null,n,e,!0),256&u)return void t.ctx.deactivate(e);const h=1&u&&p,f=!Qn(e);let g;if(f&&(g=l&&l.onVnodeBeforeUnmount)&&Ar(g,t,e),6&u)J(e.component,n,o);else{if(128&u)return void e.suspense.unmount(n,o);h&&Pn(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,r,re,o):c&&(i!==ar||d>0&&64&d)?ee(c,t,n,!1,!0):(i===ar&&384&d||!r&&16&u)&&ee(s,t,n),o&&G(e)}(f&&(g=l&&l.onVnodeUnmounted)||h)&&Yo((()=>{g&&Ar(g,t,e),h&&Pn(e,null,t,"unmounted")}),n)},G=e=>{const{type:t,el:n,anchor:o,transition:r}=e;if(t===ar)return void U(n,o);if(t===ur)return void k(e);const i=()=>{l(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){const{leave:t,delayLeave:o}=r,l=()=>t(n,i);o?o(e.el,i,l):l()}else i()},U=(e,t)=>{let n;for(;e!==t;)n=m(e),l(e),e=n;l(t)},J=(e,t,n)=>{const{bum:o,scope:r,update:i,subTree:l,um:a}=e;o&&D(o),r.stop(),i&&(i.active=!1,K(l,e,t,n)),a&&Yo(a,t),Yo((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},ee=(e,t,n,o=!1,r=!1,i=0)=>{for(let l=i;l6&e.shapeFlag?te(e.component.subTree):128&e.shapeFlag?e.suspense.next():m(e.anchor||e.el),oe=(e,t,n)=>{null==e?t._vnode&&K(t._vnode,null,null,!0):y(t._vnode||null,e,t,null,null,null,n),Yt(),Kt(),t._vnode=e},re={p:y,um:K,m:Y,r:G,mt:Q,mc:A,pc:V,pbc:B,n:te,o:e};let ie,le;return t&&([ie,le]=t(re)),{render:oe,hydrate:ie,createApp:Io(oe,ie)}}(e)}function Go({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Uo({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function qo(e,t,n=!1){const o=e.children,r=t.children;if(h(o)&&h(r))for(let i=0;ie&&(e.disabled||""===e.disabled),tr=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,nr=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,or=(e,t)=>{const n=e&&e.to;return v(n)?t?t(n):null:n};function rr(e,t,n,{o:{insert:o},m:r},i=2){0===i&&o(e.targetAnchor,t,n);const{el:l,anchor:a,shapeFlag:s,children:c,props:u}=e,d=2===i;if(d&&o(l,t,n),(!d||er(u))&&16&s)for(let p=0;p{16&b&&u(y,e,t,r,i,l,a,s)};v?m(n,c):d&&m(d,p)}else{t.el=e.el;const o=t.anchor=e.anchor,u=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=er(e.props),m=g?n:u,b=g?o:h;if("svg"===l||tr(u)?l="svg":("mathml"===l||nr(u))&&(l="mathml"),O?(p(e.dynamicChildren,O,m,r,i,l,a),qo(e,t,!0)):s||d(e,t,m,b,r,i,l,a,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):rr(t,n,o,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=or(t.props,f);e&&rr(t,e,null,c,0)}else g&&rr(t,u,h,c,1)}lr(t)},remove(e,t,n,o,{um:r,o:{remove:i}},l){const{shapeFlag:a,children:s,anchor:c,targetAnchor:u,target:d,props:p}=e;if(d&&i(u),l&&i(c),16&a){const e=l||!er(p);for(let o=0;o0?pr||r:null,dr.pop(),pr=dr[dr.length-1]||null,fr>0&&pr&&pr.push(e),e}function vr(e,t,n,o,r,i){return mr(Sr(e,t,n,o,r,i,!0))}function br(e,t,n,o,r){return mr(Cr(e,t,n,o,r,!0))}function yr(e){return!!e&&!0===e.__v_isVNode}function Or(e,t){return e.type===t.type&&e.key===t.key}const wr="__vInternal",xr=({key:e})=>null!=e?e:null,$r=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?v(e)||yt(e)||m(e)?{i:nn,r:e,k:t,f:!!n}:e:null);function Sr(e,t=null,n=null,o=0,r=null,i=(e===ar?0:1),l=!1,a=!1){const s={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&xr(t),ref:t&&$r(t),scopeId:on,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:nn};return a?(Er(s,n),128&i&&e.normalize(s)):n&&(s.shapeFlag|=v(n)?8:16),fr>0&&!l&&pr&&(s.patchFlag>0||6&i)&&32!==s.patchFlag&&pr.push(s),s}const Cr=function(e,t=null,n=null,o=0,r=null,i=!1){if(e&&e!==gn||(e=cr),yr(e)){const o=kr(e,t,!0);return n&&Er(o,n),fr>0&&!i&&pr&&(6&o.shapeFlag?pr[pr.indexOf(e)]=o:pr.push(o)),o.patchFlag|=-2,o}var l;if(m(l=e)&&"__vccOpts"in l&&(e=e.__vccOpts),t){t=function(e){return e?dt(e)||wr in e?c({},e):e:null}(t);let{class:e,style:n}=t;e&&!v(e)&&(t.class=W(e)),y(n)&&(dt(n)&&!h(n)&&(n=c({},n)),t.style=_(n))}const a=v(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:y(e)?4:m(e)?2:0;return Sr(e,t,n,o,r,a,i,!0)};function kr(e,t,n=!1){const{props:o,ref:r,patchFlag:i,children:l}=e,s=t?function(...e){const t={};for(let n=0;njr||nn;let Nr,zr;{const e=z(),t=(t,n)=>{let o;return(o=e[t])||(o=e[t]=[]),o.push(n),e=>{o.length>1?o.forEach((t=>t(e))):o[0](e)}};Nr=t("__VUE_INSTANCE_SETTERS__",(e=>jr=e)),zr=t("__VUE_SSR_SETTERS__",(e=>Hr=e))}const _r=e=>{Nr(e),e.scope.on()},Lr=()=>{jr&&jr.scope.off(),Nr(null)};function Qr(e){return 4&e.vnode.shapeFlag}let Hr=!1;function Fr(e,t,n){m(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:y(t)&&(e.setupState=Pt(t)),Wr(e)}function Wr(e,t,n){const o=e.type;e.render||(e.render=o.render||i),_r(e),ce();try{vo(e)}finally{ue(),Lr()}}function Vr(e){const t=t=>{e.exposed=t||{}};return{get attrs(){return function(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get:(t,n)=>(Oe(e,0,"$attrs"),t[n])}))}(e)},slots:e.slots,emit:e.emit,expose:t}}function Zr(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Pt(ht(e.exposed)),{get:(t,n)=>n in t?t[n]:n in uo?uo[n](e):void 0,has:(e,t)=>t in e||t in uo}))}function Xr(e,t=!0){return m(e)?e.displayName||e.name:e.name||t&&e.__name}const Yr=(e,t)=>function(e,t,n=!1){let o,r;const l=m(e);return l?(o=e,r=i):(o=e.get,r=e.set),new mt(o,r,l||!r,n)}(e,0,Hr);function Kr(e,t,n){const o=arguments.length;return 2===o?y(t)&&!h(t)?yr(t)?Cr(e,null,[t]):Cr(e,t):Cr(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):3===o&&yr(n)&&(n=[n]),Cr(e,t,n))}const Gr="3.4.5",Ur="undefined"!=typeof document?document:null,qr=Ur&&Ur.createElement("template"),Jr={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const r="svg"===t?Ur.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?Ur.createElementNS("http://www.w3.org/1998/Math/MathML",e):Ur.createElement(e,n?{is:n}:void 0);return"select"===e&&o&&null!=o.multiple&&r.setAttribute("multiple",o.multiple),r},createText:e=>Ur.createTextNode(e),createComment:e=>Ur.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ur.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,r,i){const l=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==i&&(r=r.nextSibling););else{qr.innerHTML="svg"===o?`${e}`:"mathml"===o?`${e}`:e;const r=qr.content;if("svg"===o||"mathml"===o){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ei="transition",ti="animation",ni=Symbol("_vtc"),oi=(e,{slots:t})=>Kr(Rn,si(e),t);oi.displayName="Transition";const ri={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},ii=oi.props=c({},An,ri),li=(e,t=[])=>{h(e)?e.forEach((e=>e(...t))):e&&e(...t)},ai=e=>!!e&&(h(e)?e.some((e=>e.length>1)):e.length>1);function si(e){const t={};for(const c in e)c in ri||(t[c]=e[c]);if(!1===e.css)return t;const{name:n="v",type:o,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:l=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:s=i,appearActiveClass:u=l,appearToClass:d=a,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:f=`${n}-leave-to`}=e,g=function(e){if(null==e)return null;if(y(e))return[ci(e.enter),ci(e.leave)];{const t=ci(e);return[t,t]}}(r),m=g&&g[0],v=g&&g[1],{onBeforeEnter:b,onEnter:O,onEnterCancelled:w,onLeave:x,onLeaveCancelled:$,onBeforeAppear:S=b,onAppear:C=O,onAppearCancelled:k=w}=t,P=(e,t,n)=>{di(e,t?d:a),di(e,t?u:l),n&&n()},T=(e,t)=>{e._isLeaving=!1,di(e,p),di(e,f),di(e,h),t&&t()},M=e=>(t,n)=>{const r=e?C:O,l=()=>P(t,e,n);li(r,[t,l]),pi((()=>{di(t,e?s:i),ui(t,e?d:a),ai(r)||fi(t,o,m,l)}))};return c(t,{onBeforeEnter(e){li(b,[e]),ui(e,i),ui(e,l)},onBeforeAppear(e){li(S,[e]),ui(e,s),ui(e,u)},onEnter:M(!1),onAppear:M(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>T(e,t);ui(e,p),bi(),ui(e,h),pi((()=>{e._isLeaving&&(di(e,p),ui(e,f),ai(x)||fi(e,o,v,n))})),li(x,[e,n])},onEnterCancelled(e){P(e,!1),li(w,[e])},onAppearCancelled(e){P(e,!0),li(k,[e])},onLeaveCancelled(e){T(e),li($,[e])}})}function ci(e){const t=(e=>{const t=v(e)?Number(e):NaN;return isNaN(t)?e:t})(e);return t}function ui(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e[ni]||(e[ni]=new Set)).add(t)}function di(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const n=e[ni];n&&(n.delete(t),n.size||(e[ni]=void 0))}function pi(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let hi=0;function fi(e,t,n,o){const r=e._endId=++hi,i=()=>{r===e._endId&&o()};if(n)return setTimeout(i,n);const{type:l,timeout:a,propCount:s}=gi(e,t);if(!l)return o();const c=l+"end";let u=0;const d=()=>{e.removeEventListener(c,p),i()},p=t=>{t.target===e&&++u>=s&&d()};setTimeout((()=>{u(n[e]||"").split(", "),r=o(`${ei}Delay`),i=o(`${ei}Duration`),l=mi(r,i),a=o(`${ti}Delay`),s=o(`${ti}Duration`),c=mi(a,s);let u=null,d=0,p=0;return t===ei?l>0&&(u=ei,d=l,p=i.length):t===ti?c>0&&(u=ti,d=c,p=s.length):(d=Math.max(l,c),u=d>0?l>c?ei:ti:null,p=u?u===ei?i.length:s.length:0),{type:u,timeout:d,propCount:p,hasTransform:u===ei&&/\b(transform|all)(,|$)/.test(o(`${ei}Property`).toString())}}function mi(e,t){for(;e.lengthvi(t)+vi(e[n]))))}function vi(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function bi(){return document.body.offsetHeight}const yi=Symbol("_vod"),Oi={beforeMount(e,{value:t},{transition:n}){e[yi]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):wi(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),wi(e,!0),o.enter(e)):o.leave(e,(()=>{wi(e,!1)})):wi(e,t))},beforeUnmount(e,{value:t}){wi(e,t)}};function wi(e,t){e.style.display=t?e[yi]:"none"}const xi=Symbol(""),$i=/\s*!important$/;function Si(e,t,n){if(h(n))n.forEach((n=>Si(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=ki[t];if(n)return n;let o=T(t);if("filter"!==o&&o in e)return ki[t]=o;o=E(o);for(let r=0;r{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();Dt(function(e,t){if(h(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Ei||(Ai.then((()=>Ei=0)),Ei=Date.now()),n}(o,r);!function(e,t,n,o){e.addEventListener(t,n,o)}(e,n,l,a)}else l&&(function(e,t,n,o){e.removeEventListener(t,n,o)}(e,n,l,a),i[t]=void 0)}}const Ii=/(?:Once|Passive|Capture)$/;let Ei=0;const Ai=Promise.resolve(),Ri=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Di=new WeakMap,ji=new WeakMap,Bi=Symbol("_moveCb"),Ni=Symbol("_enterCb"),zi={name:"TransitionGroup",props:c({},ii,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Br(),o=In();let r,i;return qn((()=>{if(!r.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){const o=e.cloneNode(),r=e[ni];r&&r.forEach((e=>{e.split(/\s+/).forEach((e=>e&&o.classList.remove(e)))})),n.split(/\s+/).forEach((e=>e&&o.classList.add(e))),o.style.display="none";const i=1===t.nodeType?t:t.parentNode;i.appendChild(o);const{hasTransform:l}=gi(o);return i.removeChild(o),l}(r[0].el,n.vnode.el,t))return;r.forEach(Li),r.forEach(Qi);const o=r.filter(Hi);bi(),o.forEach((e=>{const n=e.el,o=n.style;ui(n,t),o.transform=o.webkitTransform=o.transitionDuration="";const r=n[Bi]=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",r),n[Bi]=null,di(n,t))};n.addEventListener("transitionend",r)}))})),()=>{const l=pt(e),a=si(l);let s=l.tag||ar;r=i,i=t.default?_n(t.default()):[];for(let e=0;ee.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Fi.some((n=>e[`${n}Key`]&&!t.includes(n)))},Vi=(e,t)=>{const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(n,...o)=>{for(let e=0;e{const d="svg"===r;"class"===t?function(e,t,n){const o=e[ni];o&&(t=(t?[t,...o]:[...o]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,o,d):"style"===t?function(e,t,n){const o=e.style,r=v(n);if(n&&!r){if(t&&!v(t))for(const e in t)null==n[e]&&Si(o,e,"");for(const e in n)Si(o,e,n[e])}else{const i=o.display;if(r){if(t!==n){const e=o[xi];e&&(n+=";"+e),o.cssText=n}}else t&&e.removeAttribute("style");yi in e&&(o.display=i)}}(e,n,o):a(t)?s(t)||Mi(e,t,0,o,l):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,o){if(o)return"innerHTML"===t||"textContent"===t||!!(t in e&&Ri(t)&&m(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return(!Ri(t)||!v(n))&&t in e}(e,t,o,d))?function(e,t,n,o,r,i,l){if("innerHTML"===t||"textContent"===t)return o&&l(o,r,i),void(e[t]=null==n?"":n);const a=e.tagName;if("value"===t&&"PROGRESS"!==a&&!a.includes("-")){e._value=n;const o=null==n?"":n;return("OPTION"===a?e.getAttribute("value"):e.value)!==o&&(e.value=o),void(null==n&&e.removeAttribute(t))}let s=!1;if(""===n||null==n){const o=typeof e[t];"boolean"===o?n=Z(n):null==n&&"string"===o?(n="",s=!0):"number"===o&&(n=0,s=!0)}try{e[t]=n}catch(c){}s&&e.removeAttribute(t)}(e,t,o,i,l,c,u):("true-value"===t?e._trueValue=o:"false-value"===t&&(e._falseValue=o),function(e,t,n,o,r){if(o&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(Pi,t.slice(6,t.length)):e.setAttributeNS(Pi,t,n);else{const o=V(t);null==n||o&&!Z(n)?e.removeAttribute(t):e.setAttribute(t,o?"":n)}}(e,t,o,d))}},Jr);let Xi;function Yi(){return Xi||(Xi=Ko(Zi))}const Ki=(...e)=>{Yi().render(...e)},Gi=(...e)=>{const t=Yi().createApp(...e),{mount:n}=t;return t.mount=e=>{const o=function(e){return v(e)?document.querySelector(e):e}(e);if(!o)return;const r=t._component;m(r)||r.render||r.template||(r.template=o.innerHTML),o.innerHTML="";const i=n(o,!1,function(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t}; /*! * pinia v2.1.7 @@ -18,4 +18,4 @@ var UJ,qJ;!function(e){class t{static encodeText(n,o){const r=e.QrSegment.makeSe * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ -function n1(e){return"[object Object]"===Object.prototype.toString.call(e)}function o1(){return o1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(r[n]=e[n]);return r}const i1={silent:!1,logLevel:"warn"},l1=["validator"],a1=Object.prototype,s1=a1.toString,c1=a1.hasOwnProperty,u1=/^\s*function (\w+)/;function d1(e){var t;const n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){const e=n.toString().match(u1);return e?e[1]:""}return""}const p1=function(e){var t,n;return!1!==n1(e)&&(void 0===(t=e.constructor)||!1!==n1(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))};let h1=e=>e;const f1=(e,t)=>c1.call(e,t),g1=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},m1=Array.isArray||function(e){return"[object Array]"===s1.call(e)},v1=e=>"[object Function]"===s1.call(e),b1=(e,t)=>p1(e)&&f1(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t),y1=e=>p1(e)&&(f1(e,"type")||["_vueTypes_name","validator","default","required"].some((t=>f1(e,t))));function O1(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function w1(e,t,n=!1){let o,r=!0,i="";o=p1(e)?e:{type:e};const l=b1(o)?o._vueTypes_name+" - ":"";if(y1(o)&&null!==o.type){if(void 0===o.type||!0===o.type)return r;if(!o.required&&null==t)return r;m1(o.type)?(r=o.type.some((e=>!0===w1(e,t,!0))),i=o.type.map((e=>d1(e))).join(" or ")):(i=d1(o),r="Array"===i?m1(t):"Object"===i?p1(t):"String"===i||"Number"===i||"Boolean"===i||"Function"===i?function(e){if(null==e)return"";const t=e.constructor.toString().match(u1);return t?t[1].replace(/^Async/,""):""}(t)===i:t instanceof o.type)}if(!r){const e=`${l}value "${t}" should be of type "${i}"`;return!1===n?(h1(e),!1):e}if(f1(o,"validator")&&v1(o.validator)){const e=h1,i=[];if(h1=e=>{i.push(e)},r=o.validator(t),h1=e,!r){const e=(i.length>1?"* ":"")+i.join("\n* ");return i.length=0,!1===n?(h1(e),r):e}}return r}function x1(e,t){const n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(f1(this,"default")&&delete this.default,this):v1(e)||!0===w1(this,e,!0)?(this.default=m1(e)?()=>[...e]:p1(e)?()=>Object.assign({},e):e,this):(h1(`${this._vueTypes_name} - invalid default value: "${e}"`),this)}}}),{validator:o}=n;return v1(o)&&(n.validator=O1(o,n)),n}function $1(e,t){const n=x1(e,t);return Object.defineProperty(n,"validate",{value(e){return v1(this.validator)&&h1(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=O1(e,this),this}})}function S1(e,t,n){const o=function(e){const t={};return Object.getOwnPropertyNames(e).forEach((n=>{t[n]=Object.getOwnPropertyDescriptor(e,n)})),Object.defineProperties({},t)}(t);if(o._vueTypes_name=e,!p1(n))return o;const{validator:r}=n,i=r1(n,l1);if(v1(r)){let{validator:e}=o;e&&(e=null!==(a=(l=e).__original)&&void 0!==a?a:l),o.validator=O1(e?function(t){return e.call(this,t)&&r.call(this,t)}:r,o)}var l,a;return Object.assign(o,i)}function C1(e){return e.replace(/^(?!\s*$)/gm," ")}const k1=()=>$1("any",{}),P1=()=>$1("boolean",{type:Boolean}),T1=()=>$1("string",{type:String}),M1=()=>$1("number",{type:Number}),I1=()=>$1("array",{type:Array}),E1=()=>$1("object",{type:Object});function A1(e,t="custom validation failed"){if("function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return x1(e.name||"<>",{type:null,validator(n){const o=e(n);return o||h1(`${this._vueTypes_name} - ${t}`),o}})}function R1(e){if(!m1(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.map((e=>"symbol"==typeof e?e.toString():e)).join('", "')}".`,n={validator(n){const o=-1!==e.indexOf(n);return o||h1(t),o}};if(-1===e.indexOf(null)){const t=e.reduce(((e,t)=>{if(null!=t){const n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e}),[]);t.length>0&&(n.type=t)}return x1("oneOf",n)}function D1(e){if(!m1(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,n=!1,o=[];for(let i=0;io.indexOf(e)===t));const r=!1===n&&o.length>0?o:null;return x1("oneOfType",t?{type:r,validator(t){const n=[],o=e.some((e=>{const o=w1(e,t,!0);return"string"==typeof o&&n.push(o),!0===o}));return o||h1(`oneOfType - provided value does not match any of the ${n.length} passed-in validators:\n${C1(n.join("\n"))}`),o}}:{type:r})}function j1(e){return x1("arrayOf",{type:Array,validator(t){let n="";const o=t.every((t=>(n=w1(e,t,!0),!0===n)));return o||h1(`arrayOf - value validation error:\n${C1(n)}`),o}})}function B1(e){return x1("instanceOf",{type:e})}function N1(e){return x1("objectOf",{type:Object,validator(t){let n="";const o=Object.keys(t).every((o=>(n=w1(e,t[o],!0),!0===n)));return o||h1(`objectOf - value validation error:\n${C1(n)}`),o}})}function z1(e){const t=Object.keys(e),n=t.filter((t=>{var n;return!(null===(n=e[t])||void 0===n||!n.required)})),o=x1("shape",{type:Object,validator(o){if(!p1(o))return!1;const r=Object.keys(o);if(n.length>0&&n.some((e=>-1===r.indexOf(e)))){const e=n.filter((e=>-1===r.indexOf(e)));return h1(1===e.length?`shape - required property "${e[0]}" is not defined.`:`shape - required properties "${e.join('", "')}" are not defined.`),!1}return r.every((n=>{if(-1===t.indexOf(n))return!0===this._vueTypes_isLoose||(h1(`shape - shape definition does not include a "${n}" property. Allowed keys: "${t.join('", "')}".`),!1);const r=w1(e[n],o[n],!0);return"string"==typeof r&&h1(`shape - "${n}" property validation error:\n ${C1(r)}`),!0===r}))}});return Object.defineProperty(o,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(o,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),o}const _1=["name","validate","getter"],L1=(()=>{var e;return(e=class{static get any(){return k1()}static get func(){return $1("function",{type:Function}).def(this.defaults.func)}static get bool(){return void 0===this.defaults.bool?P1():P1().def(this.defaults.bool)}static get string(){return T1().def(this.defaults.string)}static get number(){return M1().def(this.defaults.number)}static get array(){return I1().def(this.defaults.array)}static get object(){return E1().def(this.defaults.object)}static get integer(){return x1("integer",{type:Number,validator(e){const t=g1(e);return!1===t&&h1(`integer - "${e}" is not an integer`),t}}).def(this.defaults.integer)}static get symbol(){return x1("symbol",{validator(e){const t="symbol"==typeof e;return!1===t&&h1(`symbol - invalid value "${e}"`),t}})}static get nullable(){return Object.defineProperty({type:null,validator(e){const t=null===e;return!1===t&&h1("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"})}static extend(e){if(h1("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),m1(e))return e.forEach((e=>this.extend(e))),this;const{name:t,validate:n=!1,getter:o=!1}=e,r=r1(e,_1);if(f1(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:i}=r;if(b1(i))return delete r.type,Object.defineProperty(this,t,o?{get:()=>S1(t,i,r)}:{value(...e){const n=S1(t,i,r);return n.validator&&(n.validator=n.validator.bind(n,...e)),n}});let l;return l=o?{get(){const e=Object.assign({},r);return n?$1(t,e):x1(t,e)},enumerable:!0}:{value(...e){const o=Object.assign({},r);let i;return i=n?$1(t,o):x1(t,o),o.validator&&(i.validator=o.validator.bind(i,...e)),i},enumerable:!0},Object.defineProperty(this,t,l)}}).defaults={},e.sensibleDefaults=void 0,e.config=i1,e.custom=A1,e.oneOf=R1,e.instanceOf=B1,e.oneOfType=D1,e.arrayOf=j1,e.objectOf=N1,e.shape=z1,e.utils={validate:(e,t)=>!0===w1(t,e,!0),toType:(e,t,n=!1)=>n?$1(e,t):x1(e,t)},e})();!function(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){(class extends L1{static get sensibleDefaults(){return o1({},this.defaults)}static set sensibleDefaults(t){this.defaults=!1!==t?o1({},!0!==t?t:e):{}}}).defaults=o1({},e)}();const Q1=Ln({__name:"AntdIcon",props:{modelValue:k1(),size:T1(),color:T1()},setup(e){const t=Ln({props:{value:k1(),size:T1(),color:T1()},setup:e=>()=>{const{value:t}=e;return t?Kr(t,{style:{fontSize:e.size,color:e.color}},{}):null}});return(n,o)=>(hr(),br(Ct(t),{value:e.modelValue,size:e.size,color:e.color},null,8,["value","size","color"]))}});var H1=(e=>(e[e.SpEl=1]="SpEl",e[e.Aviator=2]="Aviator",e[e.QL=3]="QL",e))(H1||{}),F1=(e=>(e[e["CRON表达式"]=1]="CRON表达式",e[e["固定时间"]=2]="固定时间",e))(F1||{}),W1=(e=>(e[e["丢弃"]=1]="丢弃",e[e["覆盖"]=2]="覆盖",e[e["并行"]=3]="并行",e))(W1||{}),V1=(e=>(e[e["跳过"]=1]="跳过",e[e["阻塞"]=2]="阻塞",e))(V1||{}),Z1=(e=>(e[e["关闭"]=0]="关闭",e[e["开启"]=1]="开启",e))(Z1||{}),X1=(e=>(e[e.and=1]="and",e[e.or=2]="or",e))(X1||{}),Y1=(e=>(e[e["application/json"]=1]="application/json",e[e["application/x-www-form-urlencoded"]=2]="application/x-www-form-urlencoded",e))(Y1||{});const K1={1:{title:"待处理",name:"waiting",color:"#64a6ea",icon:KJ},2:{title:"运行中",name:"running",color:"#1b7ee5",icon:yN},3:{title:"成功",name:"success",color:"#087da1",icon:l$},4:{title:"失败",name:"fail",color:"#f52d80",icon:w$},5:{title:"停止",name:"stop",color:"#ac2df5",icon:DJ},6:{title:"取消",name:"cancel",color:"#f5732d",icon:cJ},99:{title:"跳过",name:"skip",color:"#00000036",icon:fJ}},G1={1:{name:"Java",color:"#d06892"}},U1={0:{name:"无",color:"#f5f5f5"},1:{name:"执行超时",color:"#64a6ea"},2:{name:"无客户端节点",color:"#1b7ee5"},3:{name:"任务已关闭",color:"#087da1"},4:{name:"任务丢弃",color:"#3a2f81"},5:{name:"任务被覆盖",color:"#c2238a"},6:{name:"无可执行任务项",color:"#23c28a"},7:{name:"任务执行期间发生非预期异常",color:"#bdc223"},8:{name:"手动停止",color:"#23c28a"},9:{name:"条件节点执行异常",color:"#23c28a"},10:{name:"任务中断",color:"#bdc223"},11:{name:"回调节点执行异常",color:"#bdc223"},12:{name:"无需处理",color:"#23c28a"},13:{name:"节点处理失败并跳过",color:"#3a2f81"}},q1={2:{name:"运行中",color:"#1b7ee5"},3:{name:"成功",color:"#087da1"},4:{name:"失败",color:"#f52d80"},5:{name:"停止",color:"#ac2df5"}},J1={DEBUG:{name:"DEBUG",color:"#2647cc"},INFO:{name:"INFO",color:"#5c962c"},WARN:{name:"WARN",color:"#da9816"},ERROR:{name:"ERROR",color:"#dc3f41"}},e2={0:{name:"关闭",color:"#dc3f41"},1:{name:"开启",color:"#1b7ee5"}},t2=(e=>{const t={};return Object.keys(e).forEach((n=>{const o=e[parseInt(n,10)];t[parseInt(n,10)]={name:o.title,color:o.color}})),t})(K1),n2=e=>(ln("data-v-ab46a2e9"),e=e(),an(),e),o2={class:"log"},r2={class:"scroller"},i2={class:"gutters"},l2=n2((()=>Sr("div",{style:{"margin-top":"4px"}},null,-1))),a2={class:"gutter-element"},s2=n2((()=>Sr("div",{style:{height:"25px"}},null,-1))),c2={class:"content"},u2={class:"text",style:{color:"#2db7f5"}},d2={class:"text",style:{color:"#00a3a3"}},p2={class:"text",style:{color:"#a771bf","font-weight":"500"}},h2=n2((()=>Sr("div",{class:"text"},":",-1))),f2={class:"text",style:{"font-size":"18px"}},g2=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},m2=g2(Ln({__name:"LogModal",props:{open:P1().def(!1),record:E1().def({}),modalValue:I1().def([])},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1),i=Ot([]);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),wn((()=>o.modalValue),(e=>{i.value=e}),{immediate:!0,deep:!0});let l=0;Gn((()=>{d(),l=setInterval((()=>{d()}),1e3)}));const a=()=>{clearInterval(l),n("update:open",!1)};let s=!1,c=0,u=0;const d=()=>{s?clearInterval(l):t1(`/job/log/list?taskBatchId=${o.record.taskBatchId}&jobId=${o.record.jobId}&taskId=${o.record.id}&startId=${c}&fromIndex=${u}&size=50`).then((e=>{s=e.finished,c=e.nextStartId,u=e.fromIndex,e.message&&i.value.push(...e.message)}))},p=e=>{const t=new Date(Number.parseInt(e.toString()));return`${t.getFullYear()}-${1===(t.getMonth()+1).toString().length?"0"+(t.getMonth()+1):(t.getMonth()+1).toString()}-${t.getDate()} ${t.getHours()}:${1===t.getMinutes().toString().length?"0"+t.getMinutes():t.getMinutes().toString()}:${1===t.getSeconds().toString().length?"0"+t.getSeconds():t.getSeconds().toString()}`};return(t,n)=>{const o=fn("a-flex"),l=fn("a-modal");return hr(),br(l,{open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),centered:"",width:"80%",footer:null,title:"日志详情",onCancel:a},{default:sn((()=>[Sr("div",o2,[Sr("div",r2,[Sr("div",i2,[l2,(hr(!0),vr(ar,null,io(i.value,((e,t)=>(hr(),vr("div",{key:e.time_stamp},[Sr("div",a2,X(t+1),1),s2])))),128))]),Sr("div",c2,[(hr(!0),vr(ar,null,io(e.modalValue,(e=>(hr(),vr("div",{class:"line",key:e.time_stamp},[Cr(o,{gap:"small"},{default:sn((()=>[Sr("div",u2,X(p(e.time_stamp)),1),Sr("div",{class:"text",style:_({color:Ct(J1)[e.level].color})},X(4===e.level.length?e.level+"\t":e.level),5),Sr("div",d2,"["+X(e.thread)+"]",1),Sr("div",p2,X(e.location),1),h2])),_:2},1024),Sr("div",f2,X(e.message),1)])))),128))])])])])),_:1},8,["open"])}}}),[["__scopeId","data-v-ab46a2e9"]]),v2={key:0},b2={style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},y2=(e=>(ln("data-v-11227e3a"),e=e(),an(),e))((()=>Sr("span",{style:{"padding-left":"18px"}},"任务项列表",-1))),O2={style:{"padding-left":"6px"}},w2=["onClick"],x2={key:0},$2=g2(Ln({__name:"DetailCard",props:{id:T1(),ids:I1().def([]),open:P1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=fo().slots,i=Od.PRESENTED_IMAGE_SIMPLE,l=e1(),a=Ot(!1),s=Ot(!1),c=Ot(!1),u=Ot(!1),d=Ot(1),p=Ot({}),h=Ot([]),f=Ot({current:1,defaultPageSize:10,pageSize:10,total:0,showSizeChanger:!1,showQuickJumper:!1,showTotal:e=>`共 ${e} 条`});wn((()=>o.open),(e=>{a.value=e}),{immediate:!0});const g=Ot([]);Gn((()=>{o.ids.length>1&&(document.querySelector(".ant-pagination-prev").title="上一个",document.querySelector(".ant-pagination-next").title="下一个"),g.value=o.ids,o.ids.length>0?(y(o.ids[0]),O(o.ids[0])):o.id&&(g.value=[o.id],b(o.id),O(o.id))}));const m=()=>{n("update:open",!1)},b=e=>{c.value=!0,t1(`/job/${e}`).then((e=>{p.value=e,c.value=!1}))},y=e=>{c.value=!0,t1(`/job/batch/${e}`).then((e=>{p.value=e,c.value=!1}))},O=(e,t=1)=>{u.value=!0,t1(`/job/task/list?groupName=${l.GROUP_NAME}&taskBatchId=${e}&page=${t}`).then((e=>{f.value.total=e.total,h.value=e.data,u.value=!1}))},w=Ot({}),x=Ot([{title:"日志",dataIndex:"log",width:"5%"},{title:"ID",dataIndex:"id",width:"10%"},{title:"组名称",dataIndex:"groupName"},{title:"地址",dataIndex:"clientInfo"},{title:"参数",dataIndex:"argsStr",ellipsis:!0},{title:"结果",dataIndex:"resultMessage",ellipsis:!0},{title:"状态",dataIndex:"taskStatus"},{title:"重试次数",dataIndex:"retryCount"},{title:"开始执行时间",dataIndex:"createDt",sorter:!0,width:"12%"}]);return(t,n)=>{const o=fn("a-descriptions-item"),l=fn("a-tag"),b=fn("a-descriptions"),y=fn("a-spin"),$=fn("a-button"),S=fn("a-table"),C=fn("a-tab-pane"),k=fn("a-tabs"),P=fn("a-empty"),T=fn("a-pagination"),M=fn("a-drawer");return hr(),vr(ar,null,[Cr(M,{title:"任务批次详情",placement:"right",width:800,open:a.value,"onUpdate:open":n[2]||(n[2]=e=>a.value=e),"destroy-on-close":"",onClose:m},lo({default:sn((()=>[g.value&&g.value.length>0?(hr(),vr("div",v2,[Cr(k,{activeKey:d.value,"onUpdate:activeKey":n[0]||(n[0]=e=>d.value=e),animated:""},{renderTabBar:sn((()=>[])),default:sn((()=>[(hr(!0),vr(ar,null,io(g.value,((e,n)=>(hr(),br(C,{key:n+1,tab:e},{default:sn((()=>[Cr(y,{spinning:c.value},{default:sn((()=>[Cr(b,{bordered:"",column:2},{default:sn((()=>[Cr(o,{label:"组名称"},{default:sn((()=>[Pr(X(p.value.groupName),1)])),_:1}),Cr(o,{label:"任务名称"},{default:sn((()=>[Pr(X(p.value.jobName),1)])),_:1}),Cr(o,{label:"状态"},{default:sn((()=>[null!=p.value.taskBatchStatus?(hr(),br(l,{key:0,color:Ct(t2)[p.value.taskBatchStatus].color},{default:sn((()=>[Pr(X(Ct(t2)[p.value.taskBatchStatus].name),1)])),_:1},8,["color"])):Tr("",!0),null!=p.value.jobStatus?(hr(),br(l,{key:1,color:Ct(e2)[p.value.jobStatus].color},{default:sn((()=>[Pr(X(Ct(e2)[p.value.jobStatus].name),1)])),_:1},8,["color"])):Tr("",!0)])),_:1}),Ct(r).default?Tr("",!0):(hr(),br(o,{key:0,label:"执行器类型"},{default:sn((()=>[p.value.executorType?(hr(),br(l,{key:0,color:Ct(G1)[p.value.executorType].color},{default:sn((()=>[Pr(X(Ct(G1)[p.value.executorType].name),1)])),_:1},8,["color"])):Tr("",!0)])),_:1})),Cr(o,{label:"操作原因"},{default:sn((()=>[void 0!==p.value.operationReason?(hr(),br(l,{key:0,color:Ct(U1)[p.value.operationReason].color,style:_(0===p.value.operationReason?{color:"#1e1e1e"}:{})},{default:sn((()=>[Pr(X(Ct(U1)[p.value.operationReason].name),1)])),_:1},8,["color","style"])):Tr("",!0)])),_:1}),Cr(o,{label:"开始执行时间",span:Ct(r).default?2:1},{default:sn((()=>[Pr(X(p.value.executionAt),1)])),_:1},8,["span"]),Ct(r).default?Tr("",!0):(hr(),br(o,{key:1,label:"执行器名称",span:2},{default:sn((()=>[Pr(X(p.value.executorInfo),1)])),_:1})),Cr(o,{label:"创建时间",span:2},{default:sn((()=>[Pr(X(p.value.createDt),1)])),_:1})])),_:1})])),_:1},8,["spinning"]),ao(t.$slots,"default",{},void 0,!0),Sr("div",b2,[y2,Sr("span",O2,[Cr($,{type:"text",icon:Kr(Ct(_J)),onClick:t=>O(e)},null,8,["icon","onClick"])])]),Cr(S,{dataSource:h.value,columns:x.value,loading:u.value,scroll:{x:1200},"row-key":"id",onChange:t=>{return n=e,o=t,f.value=o,void O(n,o.current);var n,o},pagination:f.value},{bodyCell:sn((({column:e,record:t,text:n})=>["log"===e.dataIndex?(hr(),vr("a",{key:0,onClick:e=>{return n=t,w.value=n,void(s.value=!0);var n}},"点击查看",8,w2)):Tr("",!0),"taskStatus"===e.dataIndex?(hr(),vr(ar,{key:1},[n?(hr(),br(l,{key:0,color:Ct(q1)[n].color},{default:sn((()=>[Pr(X(Ct(q1)[n].name),1)])),_:2},1032,["color"])):Tr("",!0)],64)):Tr("",!0),"clientInfo"===e.dataIndex?(hr(),vr(ar,{key:2},[Pr(X(""!==n?n.split("@")[1]:""),1)],64)):Tr("",!0)])),_:2},1032,["dataSource","columns","loading","onChange","pagination"])])),_:2},1032,["tab"])))),128))])),_:3},8,["activeKey"])])):(hr(),br(P,{key:1,class:"empty",image:Ct(i),description:"暂无数据"},null,8,["image"]))])),_:2},[e.ids&&e.ids.length>0?{name:"footer",fn:sn((()=>[Cr(T,{style:{"text-align":"center"},current:d.value,"onUpdate:current":n[1]||(n[1]=e=>d.value=e),total:e.ids.length,pageSize:1,hideOnSinglePage:""},{itemRender:sn((({page:e,type:t,originalElement:n})=>{return["page"===t?(hr(),vr("a",x2,X(e),1)):(hr(),br((o=n,v(o)?mn(hn,o,!1)||o:o||gn),{key:1}))];var o})),_:1},8,["current","total"])])),key:"0"}:void 0]),1032,["open"]),s.value&&w.value?(hr(),br(m2,{key:0,open:s.value,"onUpdate:open":n[3]||(n[3]=e=>s.value=e),record:w.value},null,8,["open","record"])):Tr("",!0)],64)}}}),[["__scopeId","data-v-11227e3a"]]),S2=e=>(ln("data-v-74f467a1"),e=e(),an(),e),C2={class:"add-node-btn-box"},k2={class:"add-node-btn"},P2={class:"add-node-popover-body"},T2={class:"icon"},M2=S2((()=>Sr("p",null,"任务节点",-1))),I2=S2((()=>Sr("p",null,"决策节点",-1))),E2=S2((()=>Sr("p",null,"回调通知",-1))),A2=g2(Ln({__name:"AddNode",props:{modelValue:E1(),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=e=>{let t={};1===e?t={nodeName:"任务节点",nodeType:1,conditionNodes:[{nodeName:"任务1",failStrategy:1,priorityLevel:1,workflowNodeStatus:1,jobTask:{jobId:void 0}}],childNode:o.modelValue}:2===e?t={nodeName:"决策节点",nodeType:2,conditionNodes:[{nodeName:"条件1",priorityLevel:1,decision:{expressionType:1,nodeExpression:void 0,logicalCondition:1,defaultDecision:0}},{nodeName:"其他情况",priorityLevel:2,decision:{expressionType:1,nodeExpression:"#true",logicalCondition:1,defaultDecision:1}}],childNode:o.modelValue}:3===e&&(t={nodeName:"回调通知",nodeType:3,conditionNodes:[{nodeName:"回调通知",workflowNodeStatus:1,callback:{webhook:void 0,contentType:void 0,secret:void 0}}],childNode:o.modelValue}),n("update:modelValue",t)};return(t,n)=>{const o=fn("a-button"),i=fn("a-popover");return hr(),vr("div",C2,[Sr("div",k2,[e.disabled?Tr("",!0):(hr(),br(i,{key:0,placement:"rightTop",trigger:"click","overlay-style":{width:"296px"}},{content:sn((()=>[Sr("div",P2,[Sr("ul",T2,[Sr("li",null,[Cr(o,{shape:"circle",size:"large",onClick:n[0]||(n[0]=e=>r(1))},{default:sn((()=>[Cr(Ct(WJ),{style:{color:"#3296fa"}})])),_:1}),M2]),Sr("li",null,[Cr(o,{shape:"circle",size:"large",onClick:n[1]||(n[1]=e=>r(2))},{default:sn((()=>[Cr(Ct(MJ),{style:{color:"#15bc83"}})])),_:1}),I2]),Sr("li",null,[Cr(o,{shape:"circle",size:"large",onClick:n[2]||(n[2]=e=>r(3))},{default:sn((()=>[Cr(Ct(yL),{style:{color:"#935af6"}})])),_:1}),E2])])])])),default:sn((()=>[Cr(o,{type:"primary",icon:Kr(Ct(TI)),shape:"circle"},null,8,["icon"])])),_:1}))])])}}}),[["__scopeId","data-v-74f467a1"]]),R2=e=>{const t=[];for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=e[n];"number"==typeof o&&t.push({name:n,value:o})}return t},D2=Ln({__name:"TaskDrawer",props:{open:P1().def(!1),len:M1().def(0),modelValue:E1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=e1(),i=Ot(!1),l=Ot({}),a=Ot([]);Gn((()=>{a.value=r.JOB_LIST})),wn((()=>o.open),(e=>{i.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{l.value=e}),{immediate:!0,deep:!0});const s=()=>{n("update:modelValue",l.value)},c=Ot(),u=()=>{var e;null==(e=c.value)||e.validate().then((()=>{d(),n("save",l.value)})).catch((()=>{xB.warning("请检查表单信息")}))},d=()=>{n("update:open",!1),i.value=!1},p={failStrategy:[{required:!0,message:"请选择失败策略",trigger:"change"}],workflowNodeStatus:[{required:!0,message:"请选择工作流状态",trigger:"change"}]};return(t,n)=>{const o=fn("a-typography-paragraph"),r=fn("a-select-option"),h=fn("a-select"),f=fn("a-form-item"),g=fn("a-radio"),m=fn("a-radio-group"),v=fn("a-form"),b=fn("a-button"),y=fn("a-drawer");return hr(),br(y,{open:i.value,"onUpdate:open":n[5]||(n[5]=e=>i.value=e),"destroy-on-close":"",width:500,onClose:d},{title:sn((()=>[Cr(o,{style:{margin:"0",width:"412px"},ellipsis:"",content:l.value.nodeName,"onUpdate:content":n[0]||(n[0]=e=>l.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:s},null,8,["content"])])),extra:sn((()=>[Cr(h,{value:l.value.priorityLevel,"onUpdate:value":n[1]||(n[1]=e=>l.value.priorityLevel=e),style:{width:"110px"}},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.len,(e=>(hr(),br(r,{key:e,value:e},{default:sn((()=>[Pr("优先级 "+X(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),footer:sn((()=>[Cr(b,{type:"primary",onClick:u},{default:sn((()=>[Pr("保存")])),_:1}),Cr(b,{style:{"margin-left":"12px"},onClick:d},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(v,{ref_key:"formRef",ref:c,rules:p,layout:"vertical",model:l.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(f,{name:["jobTask","jobId"],label:"所属任务",placeholder:"请选择任务",rules:[{required:!0,message:"请选择任务",trigger:"change"}]},{default:sn((()=>[Cr(h,{value:l.value.jobTask.jobId,"onUpdate:value":n[2]||(n[2]=e=>l.value.jobTask.jobId=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(a.value,(e=>(hr(),br(r,{key:e.id,value:e.id},{default:sn((()=>[Pr(X(e.jobName),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(f,{name:"failStrategy",label:"失败策略"},{default:sn((()=>[Cr(m,{value:l.value.failStrategy,"onUpdate:value":n[3]||(n[3]=e=>l.value.failStrategy=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(V1)),(e=>(hr(),br(g,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(f,{name:"workflowNodeStatus",label:"节点状态"},{default:sn((()=>[Cr(m,{value:l.value.workflowNodeStatus,"onUpdate:value":n[4]||(n[4]=e=>l.value.workflowNodeStatus=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(Z1)),(e=>(hr(),br(g,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),j2=Ln({__name:"TaskDetail",props:{modelValue:E1().def({}),open:P1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=e1(),i=Ot(!1);wn((()=>o.open),(e=>{i.value=e}),{immediate:!0});const l=()=>{n("update:open",!1)},a=e=>{var t;return null==(t=r.JOB_LIST.find((t=>t.id===e)))?void 0:t.jobName};return(t,n)=>{const o=fn("a-descriptions-item"),r=fn("a-descriptions"),s=fn("a-drawer");return hr(),br(s,{title:"任务详情",placement:"right",width:500,open:i.value,"onUpdate:open":n[0]||(n[0]=e=>i.value=e),"destroy-on-close":"",onClose:l},{default:sn((()=>[Cr(r,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(o,{label:"节点名称"},{default:sn((()=>[Pr(X(e.modelValue.nodeName),1)])),_:1}),Cr(o,{label:"任务 ID"},{default:sn((()=>{var t;return[Pr(X(null==(t=e.modelValue.jobTask)?void 0:t.jobId),1)]})),_:1}),Cr(o,{label:"任务名称"},{default:sn((()=>{var t;return[Pr(X(a(null==(t=e.modelValue.jobTask)?void 0:t.jobId)),1)]})),_:1}),Cr(o,{label:"失败策略"},{default:sn((()=>[Pr(X(Ct(V1)[e.modelValue.failStrategy]),1)])),_:1}),Cr(o,{label:"工作流状态"},{default:sn((()=>[Pr(X(Ct(Z1)[e.modelValue.workflowNodeStatus]),1)])),_:1})])),_:1})])),_:1},8,["open"])}}}),B2=e=>(ln("data-v-c53370c6"),e=e(),an(),e),N2={class:"node-wrap"},z2={class:"branch-box"},_2={class:"condition-node"},L2={class:"condition-node-box"},Q2={class:"popover"},H2=B2((()=>Sr("span",null,"重试",-1))),F2=B2((()=>Sr("span",null,"忽略",-1))),W2=["onClick"],V2=["onClick"],Z2={class:"title"},X2={class:"text",style:{color:"#3296fa"}},Y2={class:"priority-title"},K2={class:"content",style:{"min-height":"81px"}},G2={key:0,class:"placeholder"},U2=B2((()=>Sr("span",{class:"content_label"},"任务ID: ",-1))),q2=B2((()=>Sr("span",{class:"content_label"},"失败策略: ",-1))),J2=B2((()=>Sr("div",null,".........",-1))),e3=["onClick"],t3={key:1,class:"top-left-cover-line"},n3={key:2,class:"bottom-left-cover-line"},o3={key:3,class:"top-right-cover-line"},r3={key:4,class:"bottom-right-cover-line"},i3=g2(Ln({__name:"TaskNode",props:{modelValue:E1().def({}),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=e1(),i=Ot({}),l=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{var e;const t=i.value.conditionNodes.length+1;null==(e=i.value.conditionNodes)||e.push({nodeName:"任务"+t,priorityLevel:t,failStrategy:1,workflowNodeStatus:1,jobTask:{jobId:void 0}}),n("update:modelValue",i.value)},s=(e,t)=>{e.childNode?s(e.childNode,t):e.childNode=t},c=(e,t=1)=>{var o;i.value.conditionNodes[e]=i.value.conditionNodes.splice(e+t,1,i.value.conditionNodes[e])[0],null==(o=i.value.conditionNodes)||o.map(((e,t)=>{e.priorityLevel=t+1})),n("update:modelValue",i.value)},u=Ot(0),d=Ot(!1),p=Ot({}),h=e=>{const t=i.value.conditionNodes[u.value].priorityLevel,o=e.priorityLevel;i.value.conditionNodes[u.value]=e,t!==o&&c(u.value,o-t),n("update:modelValue",i.value)},f=e=>o.disabled?2===r.TYPE?`node-error node-error-${e.taskBatchStatus&&K1[e.taskBatchStatus]?K1[e.taskBatchStatus].name:"default"}`:"node-error":"auto-judge-def auto-judge-hover",g=Ot(),m=Ot(),v=Ot(!1),b=Ot([]),y=(e,t)=>{var n,l,a,s;m.value=[],2===r.TYPE?(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=m.value)||t.push(e.id):e.jobId&&(g.value=e.jobId.toString())})),(null==(l=e.jobTask)?void 0:l.jobId)&&(g.value=null==(a=e.jobTask)?void 0:a.jobId.toString()),v.value=!0):1===r.TYPE?b.value[t]=!0:(s=t,o.disabled||(u.value=s,p.value=JSON.parse(JSON.stringify(i.value.conditionNodes[s])),d.value=!0))};return(t,o)=>{const u=fn("a-button"),O=fn("a-divider"),w=fn("a-badge"),x=fn("a-tooltip"),$=fn("a-popover");return hr(),vr("div",N2,[Sr("div",z2,[e.disabled?Tr("",!0):(hr(),br(u,{key:0,class:"add-branch",primary:"",onClick:a},{default:sn((()=>[Pr("添加任务")])),_:1})),(hr(!0),vr(ar,null,io(i.value.conditionNodes,((o,a)=>(hr(),vr("div",{class:"col-box",key:a},[Sr("div",_2,[Sr("div",L2,[Cr($,{open:l.value[a]&&2===Ct(r).TYPE,getPopupContainer:e=>e.parentNode,onOpenChange:e=>l.value[a]=e},{content:sn((()=>[Sr("div",Q2,[Cr(O,{type:"vertical"}),Cr(u,{type:"text",class:"popover-item"},{default:sn((()=>[Cr(Ct(yJ)),H2])),_:1}),Cr(O,{type:"vertical"}),Cr(u,{type:"text",class:"popover-item"},{default:sn((()=>[Cr(Ct(rJ)),F2])),_:1})])])),default:sn((()=>{var t,l,u;return[Sr("div",{class:W(["auto-judge",f(o)]),style:{cursor:"pointer"},onClick:e=>y(o,a)},[0!=a?(hr(),vr("div",{key:0,class:"sort-left",onClick:Vi((e=>c(a,-1)),["stop"])},[Cr(Ct(BR))],8,V2)):Tr("",!0),Sr("div",Z2,[Sr("span",X2,[Cr(w,{status:"processing",color:1===o.workflowNodeStatus?"#52c41a":"#ff4d4f"},null,8,["color"]),Pr(" "+X(o.nodeName),1)]),Sr("span",Y2,"优先级"+X(o.priorityLevel),1),e.disabled?Tr("",!0):(hr(),br(Ct(Jb),{key:0,class:"close",onClick:Vi((e=>(e=>{var t;1===i.value.conditionNodes.length?(i.value.childNode&&(i.value.conditionNodes[0].childNode?s(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Vt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))):null==(t=i.value.conditionNodes)||t.splice(e,1)})(a)),["stop"])},null,8,["onClick"]))]),Sr("div",K2,[(null==(t=o.jobTask)?void 0:t.jobId)?Tr("",!0):(hr(),vr("div",G2,"请选择任务")),(null==(l=o.jobTask)?void 0:l.jobId)?(hr(),vr(ar,{key:1},[Sr("div",null,[U2,Pr(" "+X(null==(u=o.jobTask)?void 0:u.jobId),1)]),Sr("div",null,[q2,Pr(X(Ct(V1)[o.failStrategy]),1)]),J2],64)):Tr("",!0)]),a!=i.value.conditionNodes.length-1?(hr(),vr("div",{key:1,class:"sort-right",onClick:Vi((e=>c(a)),["stop"])},[Cr(Ct(ok))],8,e3)):Tr("",!0),2===Ct(r).TYPE&&o.taskBatchStatus?(hr(),br(x,{key:2},{title:sn((()=>[Pr(X(Ct(K1)[o.taskBatchStatus].title),1)])),default:sn((()=>[Cr(Ct(Q1),{class:"error-tip",color:Ct(K1)[o.taskBatchStatus].color,size:"24px",onClick:Vi((()=>{}),["stop"]),"model-value":Ct(K1)[o.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):Tr("",!0)],10,W2)]})),_:2},1032,["open","getPopupContainer","onOpenChange"]),Cr(A2,{disabled:e.disabled,modelValue:o.childNode,"onUpdate:modelValue":e=>o.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),o.childNode?ao(t.$slots,"default",{key:0,node:o},void 0,!0):Tr("",!0),0==a?(hr(),vr("div",t3)):Tr("",!0),0==a?(hr(),vr("div",n3)):Tr("",!0),a==i.value.conditionNodes.length-1?(hr(),vr("div",o3)):Tr("",!0),a==i.value.conditionNodes.length-1?(hr(),vr("div",r3)):Tr("",!0),0!==Ct(r).type&&b.value[a]?(hr(),br(j2,{key:5,open:b.value[a],"onUpdate:open":e=>b.value[a]=e,modelValue:i.value.conditionNodes[a],"onUpdate:modelValue":e=>i.value.conditionNodes[a]=e},null,8,["open","onUpdate:open","modelValue","onUpdate:modelValue"])):Tr("",!0)])))),128))]),i.value.conditionNodes.length>1?(hr(),br(A2,{key:0,disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":o[0]||(o[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])):Tr("",!0),0===Ct(r).TYPE&&d.value?(hr(),br(D2,{key:1,open:d.value,"onUpdate:open":o[1]||(o[1]=e=>d.value=e),modelValue:p.value,"onUpdate:modelValue":o[2]||(o[2]=e=>p.value=e),len:i.value.conditionNodes.length,"onUpdate:len":o[3]||(o[3]=e=>i.value.conditionNodes.length=e),onSave:h},null,8,["open","modelValue","len"])):Tr("",!0),0!==Ct(r).TYPE&&v.value?(hr(),br(Ct($2),{key:2,open:v.value,"onUpdate:open":o[4]||(o[4]=e=>v.value=e),id:g.value,ids:m.value},null,8,["open","id","ids"])):Tr("",!0)])}}}),[["__scopeId","data-v-c53370c6"]]);class l3{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=g3(this,e,t);let o=[];return this.decompose(0,e,o,2),n.length&&n.decompose(0,n.length,o,3),this.decompose(t,this.length,o,1),s3.from(o,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=g3(this,e,t);let n=[];return this.decompose(e,t,n,0),s3.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),o=new d3(this),r=new d3(e);for(let i=t,l=t;;){if(o.next(i),r.next(i),i=0,o.lineBreak!=r.lineBreak||o.done!=r.done||o.value!=r.value)return!1;if(l+=o.value.length,o.done||l>=n)return!0}}iter(e=1){return new d3(this,e)}iterRange(e,t=this.length){return new p3(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let o=this.line(e).from;n=this.iterRange(o,Math.max(o,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new h3(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new a3(e):s3.from(a3.split(e,[])):l3.empty}}class a3 extends l3{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,o){for(let r=0;;r++){let i=this.text[r],l=o+i.length;if((t?n:l)>=e)return new f3(o,l,n,i);o=l+1,n++}}decompose(e,t,n,o){let r=e<=0&&t>=this.length?this:new a3(u3(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&o){let e=n.pop(),t=c3(r.text,e.text.slice(),0,r.length);if(t.length<=32)n.push(new a3(t,e.length+r.length));else{let e=t.length>>1;n.push(new a3(t.slice(0,e)),new a3(t.slice(e)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof a3))return super.replace(e,t,n);[e,t]=g3(this,e,t);let o=c3(this.text,c3(n.text,u3(this.text,0,e)),t),r=this.length+n.length-(t-e);return o.length<=32?new a3(o,r):s3.from(a3.split(o,[]),r)}sliceString(e,t=this.length,n="\n"){[e,t]=g3(this,e,t);let o="";for(let r=0,i=0;r<=t&&ie&&i&&(o+=n),er&&(o+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return o}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],o=-1;for(let r of e)n.push(r),o+=r.length+1,32==n.length&&(t.push(new a3(n,o)),n=[],o=-1);return o>-1&&t.push(new a3(n,o)),t}}class s3 extends l3{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,o){for(let r=0;;r++){let i=this.children[r],l=o+i.length,a=n+i.lines-1;if((t?a:l)>=e)return i.lineInner(e,t,n,o);o=l+1,n=a+1}}decompose(e,t,n,o){for(let r=0,i=0;i<=t&&r=i){let r=o&((i<=e?1:0)|(a>=t?2:0));i>=e&&a<=t&&!r?n.push(l):l.decompose(e-i,t-i,n,r)}i=a+1}}replace(e,t,n){if([e,t]=g3(this,e,t),n.lines=r&&t<=l){let a=i.replace(e-r,t-r,n),s=this.lines-i.lines+a.lines;if(a.lines>4&&a.lines>s>>6){let r=this.children.slice();return r[o]=a,new s3(r,this.length-(t-e)+n.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=g3(this,e,t);let o="";for(let r=0,i=0;re&&r&&(o+=n),ei&&(o+=l.sliceString(e-i,t-i,n)),i=a+1}return o}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof s3))return 0;let n=0,[o,r,i,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;o+=t,r+=t){if(o==i||r==l)return n;let a=this.children[o],s=e.children[r];if(a!=s)return n+a.scanIdentical(s,t);n+=a.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let n=0;for(let p of e)n+=p.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new a3(n,t)}let o=Math.max(32,n>>5),r=o<<1,i=o>>1,l=[],a=0,s=-1,c=[];function u(e){let t;if(e.lines>r&&e instanceof s3)for(let n of e.children)u(n);else e.lines>i&&(a>i||!a)?(d(),l.push(e)):e instanceof a3&&a&&(t=c[c.length-1])instanceof a3&&e.lines+t.lines<=32?(a+=e.lines,s+=e.length+1,c[c.length-1]=new a3(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>o&&d(),a+=e.lines,s+=e.length+1,c.push(e))}function d(){0!=a&&(l.push(1==c.length?c[0]:s3.from(c,s)),s=-1,a=c.length=0)}for(let p of e)u(p);return d(),1==l.length?l[0]:new s3(l,t)}}function c3(e,t,n=0,o=1e9){for(let r=0,i=0,l=!0;i=n&&(s>o&&(a=a.slice(0,o-r)),r0?1:(e instanceof a3?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,o=this.nodes[n],r=this.offsets[n],i=r>>1,l=o instanceof a3?o.text.length:o.children.length;if(i==(t>0?l:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(o instanceof a3){let r=o.text[i+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=o.children[i+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof a3?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class p3{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new d3(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:o}=this.cursor.next(e);return this.pos+=(o.length+e)*t,this.value=o.length<=n?o:t<0?o.slice(o.length-n):o.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class h3{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:o}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=o,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(l3.prototype[Symbol.iterator]=function(){return this.iter()},d3.prototype[Symbol.iterator]=p3.prototype[Symbol.iterator]=h3.prototype[Symbol.iterator]=function(){return this});class f3{constructor(e,t,n,o){this.from=e,this.to=t,this.number=n,this.text=o}get length(){return this.to-this.from}}function g3(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}let m3="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e=>e?parseInt(e,36):1));for(let jpe=1;jpee)return m3[t-1]<=e;return!1}function b3(e){return e>=127462&&e<=127487}function y3(e,t,n=!0,o=!0){return(n?O3:w3)(e,t,o)}function O3(e,t,n){if(t==e.length)return t;t&&x3(e.charCodeAt(t))&&$3(e.charCodeAt(t-1))&&t--;let o=S3(e,t);for(t+=k3(o);t=0&&b3(S3(e,o));)n++,o-=2;if(n%2==0)break;t+=2}}}return t}function w3(e,t,n){for(;t>0;){let o=O3(e,t-2,n);if(o=56320&&e<57344}function $3(e){return e>=55296&&e<56320}function S3(e,t){let n=e.charCodeAt(t);if(!$3(n)||t+1==e.length)return n;let o=e.charCodeAt(t+1);return x3(o)?o-56320+(n-55296<<10)+65536:n}function C3(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function k3(e){return e<65536?1:2}const P3=/\r\n?|\n/;var T3=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(T3||(T3={}));class M3{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-o);r+=l}else{if(n!=T3.Simple&&s>=e&&(n==T3.TrackDel&&oe||n==T3.TrackBefore&&oe))return null;if(s>e||s==e&&t<0&&!l)return e==o||t<0?r:r+a;r+=a}o=s}if(e>o)throw new RangeError(`Position ${e} is out of range for changeset of length ${o}`);return r}touchesRange(e,t=e){for(let n=0,o=0;n=0&&o<=t&&r>=e)return!(ot)||"cover";o=r}return!1}toString(){let e="";for(let t=0;t=0?":"+o:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new M3(e)}static create(e){return new M3(e)}}class I3 extends M3{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return R3(this,((t,n,o,r,i)=>e=e.replace(o,o+(n-t),i)),!1),e}mapDesc(e,t=!1){return D3(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let o=0,r=0;o=0){t[o]=l,t[o+1]=i;let a=o>>1;for(;n.length0&&A3(n,t,r.text),r.forward(e),l+=e}let s=e[i++];for(;l>1].toJSON()))}return e}static of(e,t,n){let o=[],r=[],i=0,l=null;function a(e=!1){if(!e&&!o.length)return;il||e<0||l>t)throw new RangeError(`Invalid change range ${e} to ${l} (in doc of length ${t})`);let u=c?"string"==typeof c?l3.of(c.split(n||P3)):c:l3.empty,d=u.length;if(e==l&&0==d)return;ei&&E3(o,e-i,-1),E3(o,l-e,d),A3(r,o,u),i=l}}(e),a(!l),l}static empty(e){return new I3(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let o=0;ot&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)t.push(r[0],0);else{for(;n.length=0&&n<=0&&n==e[r+1]?e[r]+=t:0==t&&0==e[r]?e[r+1]+=n:o?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function A3(e,t,n){if(0==n.length)return;let o=t.length-2>>1;if(o>1])),!(n||l==e.sections.length||e.sections[l+1]<0);)a=e.sections[l++],s=e.sections[l++];t(r,c,i,u,d),r=c,i=u}}}function D3(e,t,n,o=!1){let r=[],i=o?[]:null,l=new B3(e),a=new B3(t);for(let s=-1;;)if(-1==l.ins&&-1==a.ins){let e=Math.min(l.len,a.len);E3(r,e,-1),l.forward(e),a.forward(e)}else if(a.ins>=0&&(l.ins<0||s==l.i||0==l.off&&(a.len=0&&s=0)){if(l.done&&a.done)return i?I3.createSet(r,i):M3.create(r);throw new Error("Mismatched change set lengths")}{let e=0,t=l.len;for(;t;)if(-1==a.ins){let n=Math.min(t,a.len);e+=n,t-=n,a.forward(n)}else{if(!(0==a.ins&&a.lene||l.ins>=0&&l.len>e)&&(a||o.length>t),i.forward2(e),l.forward(e)}}else E3(o,0,l.ins,a),r&&A3(r,o,l.text),l.next()}}class B3{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?l3.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?l3.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class N3{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let n,o;return this.empty?n=o=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),o=e.mapPos(this.to,-1)),n==this.from&&o==this.to?this:new N3(n,o,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return z3.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return z3.range(this.anchor,n)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return z3.range(e.anchor,e.head)}static create(e,t,n){return new N3(e,t,n)}}class z3{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:z3.create(this.ranges.map((n=>n.map(e,t))),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON())),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new z3(e.ranges.map((e=>N3.fromJSON(e))),e.main)}static single(e,t=e){return new z3([z3.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,o=0;oe?8:0)|r)}static normalized(e,t=0){let n=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(n);for(let o=1;on.head?z3.range(l,i):z3.range(i,l))}}return new z3(e,t)}}function _3(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let L3=0;class Q3{constructor(e,t,n,o,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=o,this.id=L3++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new Q3(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:H3),!!e.static,e.enables)}of(e){return new F3([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new F3(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new F3(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(n=>t(n.field(e))))}}function H3(e,t){return e==t||e.length==t.length&&e.every(((e,n)=>e===t[n]))}class F3{constructor(e,t,n,o){this.dependencies=e,this.facet=t,this.type=n,this.value=o,this.id=L3++}dynamicSlot(e){var t;let n=this.value,o=this.facet.compareInput,r=this.id,i=e[r]>>1,l=2==this.type,a=!1,s=!1,c=[];for(let u of this.dependencies)"doc"==u?a=!0:"selection"==u?s=!0:0==(1&(null!==(t=e[u.id])&&void 0!==t?t:1))&&c.push(e[u.id]);return{create:e=>(e.values[i]=n(e),1),update(e,t){if(a&&t.docChanged||s&&(t.docChanged||t.selection)||V3(e,c)){let t=n(e);if(l?!W3(t,e.values[i],o):!o(t,e.values[i]))return e.values[i]=t,1}return 0},reconfigure:(e,t)=>{let a,s=t.config.address[r];if(null!=s){let r=l4(t,s);if(this.dependencies.every((n=>n instanceof Q3?t.facet(n)===e.facet(n):!(n instanceof Y3)||t.field(n,!1)==e.field(n,!1)))||(l?W3(a=n(e),r,o):o(a=n(e),r)))return e.values[i]=r,0}else a=n(e);return e.values[i]=a,1}}}}function W3(e,t,n){if(e.length!=t.length)return!1;for(let o=0;oe[t.id])),r=n.map((e=>e.type)),i=o.filter((e=>!(1&e))),l=e[t.id]>>1;function a(e){let n=[];for(let t=0;te===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(X3).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let o=e.values[t],r=this.updateF(o,n);return this.compareF(o,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,X3.of({field:this,create:e})]}get extension(){return this}}const K3=4,G3=3,U3=2,q3=1;function J3(e){return t=>new t4(t,e)}const e4={highest:J3(0),high:J3(q3),default:J3(U3),low:J3(G3),lowest:J3(K3)};class t4{constructor(e,t){this.inner=e,this.prec=t}}class n4{of(e){return new o4(this,e)}reconfigure(e){return n4.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class o4{constructor(e,t){this.compartment=e,this.inner=t}}class r4{constructor(e,t,n,o,r,i){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=o,this.staticValues=r,this.facets=i,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let o=[],r=Object.create(null),i=new Map;for(let d of function(e,t,n){let o=[[],[],[],[],[]],r=new Map;function i(e,l){let a=r.get(e);if(null!=a){if(a<=l)return;let t=o[a].indexOf(e);t>-1&&o[a].splice(t,1),e instanceof o4&&n.delete(e.compartment)}if(r.set(e,l),Array.isArray(e))for(let t of e)i(t,l);else if(e instanceof o4){if(n.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");let o=t.get(e.compartment)||e.inner;n.set(e.compartment,o),i(o,l)}else if(e instanceof t4)i(e.inner,e.prec);else if(e instanceof Y3)o[l].push(e),e.provides&&i(e.provides,l);else if(e instanceof F3)o[l].push(e),e.facet.extensions&&i(e.facet.extensions,U3);else{let t=e.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(t,l)}}return i(e,U3),o.reduce(((e,t)=>e.concat(t)))}(e,t,i))d instanceof Y3?o.push(d):(r[d.facet.id]||(r[d.facet.id]=[])).push(d);let l=Object.create(null),a=[],s=[];for(let d of o)l[d.id]=s.length<<1,s.push((e=>d.slot(e)));let c=null==n?void 0:n.config.facets;for(let d in r){let e=r[d],t=e[0].facet,o=c&&c[d]||[];if(e.every((e=>0==e.type)))if(l[t.id]=a.length<<1|1,H3(o,e))a.push(n.facet(t));else{let o=t.combine(e.map((e=>e.value)));a.push(n&&t.compare(o,n.facet(t))?n.facet(t):o)}else{for(let t of e)0==t.type?(l[t.id]=a.length<<1|1,a.push(t.value)):(l[t.id]=s.length<<1,s.push((e=>t.dynamicSlot(e))));l[t.id]=s.length<<1,s.push((n=>Z3(n,t,e)))}}let u=s.map((e=>e(l)));return new r4(e,i,u,l,a,r)}}function i4(e,t){if(1&t)return 2;let n=t>>1,o=e.status[n];if(4==o)throw new Error("Cyclic dependency between fields and/or facets");if(2&o)return o;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function l4(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const a4=Q3.define(),s4=Q3.define({combine:e=>e.some((e=>e)),static:!0}),c4=Q3.define({combine:e=>e.length?e[0]:void 0,static:!0}),u4=Q3.define(),d4=Q3.define(),p4=Q3.define(),h4=Q3.define({combine:e=>!!e.length&&e[0]});class f4{constructor(e,t){this.type=e,this.value=t}static define(){return new g4}}class g4{of(e){return new f4(this,e)}}class m4{constructor(e){this.map=e}of(e){return new v4(this,e)}}class v4{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new v4(this.type,t)}is(e){return this.type==e}static define(e={}){return new m4(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let o of e){let e=o.map(t);e&&n.push(e)}return n}}v4.reconfigure=v4.define(),v4.appendConfig=v4.define();class b4{constructor(e,t,n,o,r,i){this.startState=e,this.changes=t,this.selection=n,this.effects=o,this.annotations=r,this.scrollIntoView=i,this._doc=null,this._state=null,n&&_3(n,t.newLength),r.some((e=>e.type==b4.time))||(this.annotations=r.concat(b4.time.of(Date.now())))}static create(e,t,n,o,r,i){return new b4(e,t,n,o,r,i)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(b4.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function y4(e,t){let n=[];for(let o=0,r=0;;){let i,l;if(o=e[o]))i=e[o++],l=e[o++];else{if(!(r=0;r--){let i=n[r](e);i&&Object.keys(i).length&&(o=O4(o,w4(t,i,e.changes.newLength),!0))}return o==e?e:b4.create(t,e.changes,e.selection,o.effects,o.annotations,o.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let r of t.facet(u4)){let t=r(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:y4(n,t))}if(!0!==n){let o,r;if(!1===n)r=e.changes.invertedDesc,o=I3.empty(t.doc.length);else{let t=e.changes.filter(n);o=t.changes,r=t.filtered.mapDesc(t.changes).invertedDesc}e=b4.create(t,o,e.selection&&e.selection.map(r),v4.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let o=t.facet(d4);for(let r=o.length-1;r>=0;r--){let n=o[r](e);e=n instanceof b4?n:Array.isArray(n)&&1==n.length&&n[0]instanceof b4?n[0]:x4(t,S4(n),!1)}return e}(r):r)}b4.time=f4.define(),b4.userEvent=f4.define(),b4.addToHistory=f4.define(),b4.remote=f4.define();const $4=[];function S4(e){return null==e?$4:Array.isArray(e)?e:[e]}var C4=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(C4||(C4={}));const k4=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let P4;try{P4=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(Dpe){}function T4(e){return t=>{if(!/\S/.test(t))return C4.Space;if(function(e){if(P4)return P4.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||k4.test(n)))return!0}return!1}(t))return C4.Word;for(let n=0;n-1)return C4.Word;return C4.Other}}class M4{constructor(e,t,n,o,r,i){this.config=e,this.doc=t,this.selection=n,this.values=o,this.status=e.statusTemplate.slice(),this.computeSlot=r,i&&(i._state=this);for(let l=0;lr.set(t,e))),n=null),r.set(l.value.compartment,l.value.extension)):l.is(v4.reconfigure)?(n=null,o=l.value):l.is(v4.appendConfig)&&(n=null,o=S4(o).concat(l.value));n?t=e.startState.values.slice():(n=r4.resolve(o,r,this),t=new M4(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values);let i=e.startState.facet(s4)?e.newSelection:e.newSelection.asSingle();new M4(n,e.newDoc,i,t,((t,n)=>n.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:z3.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),o=this.changes(n.changes),r=[n.range],i=S4(n.effects);for(let l=1;lt.spec.fromJSON(i,e))))}return M4.create({doc:e.doc,selection:z3.fromJSON(e.selection),extensions:t.extensions?o.concat([t.extensions]):o})}static create(e={}){let t=r4.resolve(e.extensions||[],new Map),n=e.doc instanceof l3?e.doc:l3.of((e.doc||"").split(t.staticFacet(M4.lineSeparator)||P3)),o=e.selection?e.selection instanceof z3?e.selection:z3.single(e.selection.anchor,e.selection.head):z3.single(0);return _3(o,n.length),t.staticFacet(s4)||(o=o.asSingle()),new M4(t,n,o,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(M4.tabSize)}get lineBreak(){return this.facet(M4.lineSeparator)||"\n"}get readOnly(){return this.facet(h4)}phrase(e,...t){for(let n of this.facet(M4.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,((e,n)=>{if("$"==n)return"$";let o=+(n||1);return!o||o>t.length?e:t[o-1]}))),e}languageDataAt(e,t,n=-1){let o=[];for(let r of this.facet(a4))for(let i of r(this,t,n))Object.prototype.hasOwnProperty.call(i,e)&&o.push(i[e]);return o}charCategorizer(e){return T4(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:o}=this.doc.lineAt(e),r=this.charCategorizer(e),i=e-n,l=e-n;for(;i>0;){let e=y3(t,i,!1);if(r(t.slice(e,i))!=C4.Word)break;i=e}for(;le.length?e[0]:4}),M4.lineSeparator=c4,M4.readOnly=h4,M4.phrases=Q3.define({compare(e,t){let n=Object.keys(e),o=Object.keys(t);return n.length==o.length&&n.every((n=>e[n]==t[n]))}}),M4.languageData=a4,M4.changeFilter=u4,M4.transactionFilter=d4,M4.transactionExtender=p4,n4.reconfigure=v4.define();class E4{eq(e){return this==e}range(e,t=e){return A4.create(e,t,this)}}E4.prototype.startSide=E4.prototype.endSide=0,E4.prototype.point=!1,E4.prototype.mapMode=T3.TrackDel;let A4=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,o){return new e(t,n,o)}};function R4(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class D4{constructor(e,t,n,o){this.from=e,this.to=t,this.value=n,this.maxPoint=o}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,o=0){let r=n?this.to:this.from;for(let i=o,l=r.length;;){if(i==l)return i;let o=i+l>>1,a=r[o]-e||(n?this.value[o].endSide:this.value[o].startSide)-t;if(o==i)return a>=0?i:l;a>=0?l=o:i=o+1}}between(e,t,n,o){for(let r=this.findIndex(t,-1e9,!0),i=this.findIndex(n,1e9,!1,r);rc||s==c&&u.startSide>0&&u.endSide<=0)continue;(c-s||u.endSide-u.startSide)<0||(i<0&&(i=s),u.point&&(l=Math.max(l,c-s)),n.push(u),o.push(s-i),r.push(c-i))}return{mapped:n.length?new D4(o,r,n,l):null,pos:i}}}class j4{constructor(e,t,n,o){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=o}static create(e,t,n,o){return new j4(e,t,n,o)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:o=0,filterTo:r=this.length}=e,i=e.filter;if(0==t.length&&!i)return this;if(n&&(t=t.slice().sort(R4)),this.isEmpty)return t.length?j4.of(t):this;let l=new z4(this,null,-1).goto(0),a=0,s=[],c=new B4;for(;l.value||a=0){let e=t[a++];c.addInner(e.from,e.to,e.value)||s.push(e)}else 1==l.rangeIndex&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+i.length&&!1===i.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return _4.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return _4.from(e).goto(t)}static compare(e,t,n,o,r=-1){let i=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),l=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),a=N4(i,l,n),s=new Q4(i,a,r),c=new Q4(l,a,r);n.iterGaps(((e,t,n)=>H4(s,e,c,t,n,o))),n.empty&&0==n.length&&H4(s,0,c,0,0,o)}static eq(e,t,n=0,o){null==o&&(o=999999999);let r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),i=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(r.length!=i.length)return!1;if(!r.length)return!0;let l=N4(r,i),a=new Q4(r,l,0).goto(n),s=new Q4(i,l,0).goto(n);for(;;){if(a.to!=s.to||!F4(a.active,s.active)||a.point&&(!s.point||!a.point.eq(s.point)))return!1;if(a.to>o)return!0;a.next(),s.next()}}static spans(e,t,n,o,r=-1){let i=new Q4(e,null,r).goto(t),l=t,a=i.openStart;for(;;){let e=Math.min(i.to,n);if(i.point){let n=i.activeForPoint(i.to),r=i.pointFroml&&(o.span(l,e,i.active,a),a=i.openEnd(e));if(i.to>n)return a+(i.point&&i.to>n?1:0);l=i.to,i.next()}}static of(e,t=!1){let n=new B4;for(let o of e instanceof A4?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(R4);t=o}return e}(e):e)n.add(o.from,o.to,o.value);return n.finish()}static join(e){if(!e.length)return j4.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let o=e[n];o!=j4.empty;o=o.nextLayer)t=new j4(o.chunkPos,o.chunk,t,Math.max(o.maxPoint,t.maxPoint));return t}}j4.empty=new j4([],[],null,-1),j4.empty.nextLayer=j4.empty;class B4{finishChunk(e){this.chunks.push(new D4(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new B4)).add(e,t,n)}addInner(e,t,n){let o=e-this.lastTo||n.startSide-this.last.endSide;if(o<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(o<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(j4.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=j4.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function N4(e,t,n){let o=new Map;for(let i of e)for(let e=0;e=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&o.push(new z4(i,t,n,r));return 1==o.length?o[0]:new _4(o)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)L4(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)L4(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),L4(this.heap,0)}}}function L4(e,t){for(let n=e[t];;){let o=1+(t<<1);if(o>=e.length)break;let r=e[o];if(o+1=0&&(r=e[o+1],o++),n.compare(r)<0)break;e[o]=n,e[t]=r,t=o}}class Q4{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=_4.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){W4(this.active,e),W4(this.activeTo,e),W4(this.activeRank,e),this.minActive=Z4(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:o,rank:r}=this.cursor;for(;t0;)t++;V4(this.active,t,n),V4(this.activeTo,t,o),V4(this.activeRank,t,r),e&&V4(e,t,this.cursor.from),this.minActive=Z4(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let o=this.minActive;if(o>-1&&(this.activeTo[o]-this.cursor.from||this.active[o].endSide-this.cursor.startSide)<0){if(this.activeTo[o]>e){this.to=this.activeTo[o],this.endSide=this.active[o].endSide;break}this.removeActive(o),n&&W4(n,o)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[t]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function H4(e,t,n,o,r,i){e.goto(t),n.goto(o);let l=o+r,a=o,s=o-t;for(;;){let t=e.to+s-n.to||e.endSide-n.endSide,o=t<0?e.to+s:n.to,r=Math.min(o,l);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&F4(e.activeForPoint(e.to),n.activeForPoint(n.to))||i.comparePoint(a,r,e.point,n.point):r>a&&!F4(e.active,n.active)&&i.compareRange(a,r,e.active,n.active),o>l)break;a=o,t<=0&&e.next(),t>=0&&n.next()}}function F4(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;o--)e[o+1]=e[o];e[t]=n}function Z4(e,t){let n=-1,o=1e9;for(let r=0;r=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=y3(e,r)}return!0===o?-1:e.length}const K4="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),G4="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),U4="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class q4{constructor(e,t){this.rules=[];let{finish:n}=t||{};function o(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function r(e,t,i,l){let a=[],s=/^@(\w+)\b/.exec(e[0]),c=s&&"keyframes"==s[1];if(s&&null==t)return i.push(e[0]+";");for(let n in t){let l=t[n];if(/&/.test(n))r(n.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),l,i);else if(l&&"object"==typeof l){if(!s)throw new RangeError("The value of a property ("+n+") should be a primitive value.");r(o(n),l,a,c)}else null!=l&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+l+";")}(a.length||c)&&i.push((!n||s||l?e:e.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let i in e)r(o(i),e[i],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=U4[K4]||1;return U4[K4]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let o=e[G4],r=n&&n.nonce;o?r&&o.setNonce(r):o=new e5(e,r),o.mount(Array.isArray(t)?t:[t])}}let J4=new Map;class e5{constructor(e,t){let n=e.ownerDocument||e,o=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&o.CSSStyleSheet){let t=J4.get(n);if(t)return e.adoptedStyleSheets=[t.sheet,...e.adoptedStyleSheets],e[G4]=t;this.sheet=new o.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],J4.set(n,this)}else{this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let o=e.head||e;o.insertBefore(this.styleTag,o.firstChild)}this.modules=[],e[G4]=this}mount(e){let t=this.sheet,n=0,o=0;for(let r=0;r-1&&(this.modules.splice(l,1),o--,l=-1),-1==l){if(this.modules.splice(o++,0,i),t)for(let e=0;e",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},o5="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),r5="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),i5=0;i5<10;i5++)t5[48+i5]=t5[96+i5]=String(i5);for(i5=1;i5<=24;i5++)t5[i5+111]="F"+i5;for(i5=65;i5<=90;i5++)t5[i5]=String.fromCharCode(i5+32),n5[i5]=String.fromCharCode(i5);for(var l5 in t5)n5.hasOwnProperty(l5)||(n5[l5]=t5[l5]);function a5(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function s5(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function c5(e,t){if(!t.anchorNode)return!1;try{return s5(e,t.anchorNode)}catch(Dpe){return!1}}function u5(e){return 3==e.nodeType?x5(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function d5(e,t,n,o){return!!n&&(h5(e,t,n,o,-1)||h5(e,t,n,o,1))}function p5(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function h5(e,t,n,o,r){for(;;){if(e==n&&t==o)return!0;if(t==(r<0?0:f5(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=p5(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?f5(e):0}}}function f5(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function g5(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function m5(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function v5(e,t){let n=t.width/e.offsetWidth,o=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(o>.995&&o<1.005||!isFinite(o)||Math.abs(t.height-e.offsetHeight)<1)&&(o=1),{scaleX:n,scaleY:o}}class b5{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?f5(t):0),n,Math.min(e.focusOffset,n?f5(n):0))}set(e,t,n,o){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=o}}let y5,O5=null;function w5(e){if(e.setActive)return e.setActive();if(O5)return e.focus(O5);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==O5?{get preventScroll(){return O5={preventScroll:!0},!0}}:void 0),!O5){O5=!1;for(let e=0;eMath.max(1,e.scrollHeight-e.clientHeight-4)}class k5{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new k5(e.parentNode,p5(e),t)}static after(e,t){return new k5(e.parentNode,p5(e)+1,t)}}const P5=[];class T5{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(2&this.flags){let n,o=this.dom,r=null;for(let i of this.children){if(7&i.flags){if(!i.dom&&(n=r?r.nextSibling:o.firstChild)){let e=T5.get(n);(!e||!e.parent&&e.canReuseDOM(i))&&i.reuseDOM(n)}i.sync(e,t),i.flags&=-8}if(n=r?r.nextSibling:o.firstChild,t&&!t.written&&t.node==o&&n!=i.dom&&(t.written=!0),i.dom.parentNode==o)for(;n&&n!=i.dom;)n=M5(n);else o.insertBefore(i.dom,n);r=i.dom}for(n=r?r.nextSibling:o.firstChild,n&&t&&t.node==o&&(t.written=!0);n;)n=M5(n)}else if(1&this.flags)for(let n of this.children)7&n.flags&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let o=0==f5(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==this.dom)break;0==o&&t.firstChild!=t.lastChild&&(o=e==t.firstChild?-1:1),e=t}n=o<0?e:e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!T5.get(n);)n=n.nextSibling;if(!n)return this.length;for(let o=0,r=0;;o++){let e=this.children[o];if(e.dom==n)return r;r+=e.length+e.breakAfter}}domBoundsAround(e,t,n=0){let o=-1,r=-1,i=-1,l=-1;for(let a=0,s=n,c=n;at)return n.domBoundsAround(e,t,s);if(u>=e&&-1==o&&(o=a,r=s),s>t&&n.dom.parentNode==this.dom){i=a,l=c;break}c=u,s=u+n.breakAfter}return{from:r,to:l<0?n+this.length:l,startDOM:(o?this.children[o-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:i=0?this.children[i].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=P5){this.markDirty();for(let o=e;othis.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function E5(e,t,n,o,r,i,l,a,s){let{children:c}=e,u=c.length?c[t]:null,d=i.length?i[i.length-1]:null,p=d?d.breakAfter:l;if(!(t==o&&u&&!l&&!p&&i.length<2&&u.merge(n,r,i.length?d:null,0==n,a,s))){if(o0&&(!l&&i.length&&u.merge(n,u.length,i[0],!1,a,0)?u.breakAfter=i.shift().breakAfter:(n2);var W5={mac:F5||/Mac/.test(R5.platform),windows:/Win/.test(R5.platform),linux:/Linux|X11/.test(R5.platform),ie:z5,ie_version:B5?D5.documentMode||6:N5?+N5[1]:j5?+j5[1]:0,gecko:_5,gecko_version:_5?+(/Firefox\/(\d+)/.exec(R5.userAgent)||[0,0])[1]:0,chrome:!!L5,chrome_version:L5?+L5[1]:0,ios:F5,android:/Android\b/.test(R5.userAgent),webkit:Q5,safari:H5,webkit_version:Q5?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=D5.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class V5 extends T5{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,n){return!(8&this.flags||n&&(!(n instanceof V5)||this.length-(t-e)+n.length>256||8&n.flags)||(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),0))}split(e){let t=new V5(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new k5(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,n){let o=e.nodeValue.length;t>o&&(t=o);let r=t,i=t,l=0;0==t&&n<0||t==o&&n>=0?W5.chrome||W5.gecko||(t?(r--,l=1):i=0)?0:a.length-1];return W5.safari&&!l&&0==s.width&&(s=Array.prototype.find.call(a,(e=>e.width))||s),l?g5(s,l<0):s||null}(this.dom,e,t)}}class Z5 extends T5{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let o of t)o.setParent(this)}setAttrs(e){if(S5(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!(8&(this.flags|e.flags))}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof Z5&&n.mark.eq(this.mark))||e&&r<=0||te&&t.push(n=e&&(o=r),n=i,r++}let i=this.length-e;return this.length=e,o>-1&&(this.children.length=o,this.markDirty()),new Z5(this.mark,t,i)}domAtPos(e){return K5(this,e)}coordsAt(e,t){return U5(this,e,t)}}class X5 extends T5{static create(e,t,n){return new X5(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=X5.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof X5&&this.widget.compare(n.widget))||e>0&&r<=0||t0)?k5.before(this.dom):k5.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let o=this.dom.getClientRects(),r=null;if(!o.length)return null;let i=this.side?this.side<0:e>0;for(let l=i?o.length-1:0;r=o[l],!(e>0?0==l:l==o.length-1||r.top0?k5.before(this.dom):k5.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return l3.empty}get isHidden(){return!0}}function K5(e,t){let n=e.dom,{children:o}=e,r=0;for(let i=0;ri&&t0;i--){let e=o[i-1];if(e.dom.parentNode==n)return e.domAtPos(e.length)}for(let i=r;i0&&t instanceof Z5&&r.length&&(o=r[r.length-1])instanceof Z5&&o.mark.eq(t.mark)?G5(o,t.children[0],n-1):(r.push(t),t.setParent(e)),e.length+=t.length}function U5(e,t,n){let o=null,r=-1,i=null,l=-1;!function e(t,a){for(let s=0,c=0;s=a&&(u.children.length?e(u,a-c):(!i||i.isHidden&&n>0)&&(d>a||c==d&&u.getSide()>0)?(i=u,l=a-c):(c-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let i of o)if(i!=n&&(-1==r.indexOf(i)||e[i]!==t[i]))return!1;return!0}function t8(e,t,n){let o=!1;if(t)for(let r in t)n&&r in n||(o=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(o=!0,"style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return o}function n8(e){let t=Object.create(null);for(let n=0;n0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){e8(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){G5(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=q5(t,this.attrs||{})),n&&(this.attrs=q5({class:n},this.attrs||{}))}domAtPos(e){return K5(this,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?4&this.flags&&(S5(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(t8(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let o=this.dom.lastChild;for(;o&&T5.get(o)instanceof Z5;)o=o.lastChild;if(!(o&&this.length&&("BR"==o.nodeName||0!=(null===(n=T5.get(o))||void 0===n?void 0:n.isEditable)||W5.ios&&this.children.some((e=>e instanceof V5))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e,t=0;for(let n of this.children){if(!(n instanceof V5)||/[^ -~]/.test(n.text))return null;let o=u5(n.dom);if(1!=o.length)return null;t+=o[0].width,e=o[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(e,t){let n=U5(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:e}=this.parent.view.viewState,t=n.bottom-n.top;if(Math.abs(t-e.lineHeight)<2&&e.textHeight=t){if(r instanceof o8)return r;if(i>t)break}o=i+r.breakAfter}return null}}class r8 extends T5{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof r8&&this.widget.compare(n.widget))||e>0&&r<=0||t0)}}class i8{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var l8=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(l8||(l8={}));class a8 extends E4{constructor(e,t,n,o){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=o}get heightRelevant(){return!1}static mark(e){return new s8(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new u8(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,o=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:r,end:i}=d8(e,o);t=(r?o?-3e8:-1:5e8)-1,n=1+(i?o?2e8:1:-6e8)}return new u8(e,t,n,o,e.widget||null,!0)}static line(e){return new c8(e)}static set(e,t=!1){return j4.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}a8.none=j4.empty;class s8 extends a8{constructor(e){let{start:t,end:n}=d8(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof s8&&this.tagName==e.tagName&&(this.class||(null===(t=this.attrs)||void 0===t?void 0:t.class))==(e.class||(null===(n=e.attrs)||void 0===n?void 0:n.class))&&e8(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}s8.prototype.point=!1;class c8 extends a8{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof c8&&this.spec.class==e.spec.class&&e8(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}c8.prototype.mapMode=T3.TrackBefore,c8.prototype.point=!0;class u8 extends a8{constructor(e,t,n,o,r,i){super(t,n,r,e),this.block=o,this.isReplace=i,this.mapMode=o?t<=0?T3.TrackBefore:T3.TrackAfter:T3.TrackDel}get type(){return this.startSide!=this.endSide?l8.WidgetRange:this.startSide<=0?l8.WidgetBefore:l8.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof u8&&(t=this.widget,n=e.widget,t==n||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,n}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function d8(e,t=!1){let{inclusiveStart:n,inclusiveEnd:o}=e;return null==n&&(n=e.inclusive),null==o&&(o=e.inclusive),{start:null!=n?n:t,end:null!=o?o:t}}function p8(e,t,n,o=0){let r=n.length-1;r>=0&&n[r]+o>=e?n[r]=Math.max(n[r],t):n.push(e,t)}u8.prototype.point=!0;class h8{constructor(e,t,n,o){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=o,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof r8&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new o8),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(f8(new Y5(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||e&&this.content.length&&this.content[this.content.length-1]instanceof r8||this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:o}=this.cursor.next(this.skip);if(this.skip=0,o)throw new Error("Ran out of text content when drawing inline views");if(n){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}this.text=t,this.textOff=0}let o=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(f8(new V5(this.text.slice(this.textOff,this.textOff+o)),t),n),this.atCursorPos=!0,this.textOff+=o,e-=o,n=0}}span(e,t,n,o){this.buildText(t-e,n,o),this.pos=t,this.openStart<0&&(this.openStart=o)}point(e,t,n,o,r,i){if(this.disallowBlockEffectsFor[i]&&n instanceof u8){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(n instanceof u8)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new r8(n.widget||new g8("div"),l,n));else{let i=X5.create(n.widget||new g8("span"),l,l?0:n.startSide),a=this.atCursorPos&&!i.isEditable&&r<=o.length&&(e0),s=!i.isEditable&&(eo.length||n.startSide<=0),c=this.getLine();2!=this.pendingBuffer||a||i.isEditable||(this.pendingBuffer=0),this.flushBuffer(o),a&&(c.append(f8(new Y5(1),o),r),r=o.length+Math.max(0,r-o.length)),c.append(f8(i,o),r),this.atCursorPos=s,this.pendingBuffer=s?eo.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=o.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,o,r){let i=new h8(e,t,n,r);return i.openEnd=j4.spans(o,t,n,i),i.openStart<0&&(i.openStart=i.openEnd),i.finish(i.openEnd),i}}function f8(e,t){for(let n of t)e=new Z5(n,[e],e.length);return e}class g8 extends i8{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}var m8=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(m8||(m8={}));const v8=m8.LTR,b8=m8.RTL;function y8(e){let t=[];for(let n=0;n=t){if(l.level==n)return i;(r<0||(0!=o?o<0?l.fromt:e[r].level>l.level))&&(r=i)}}if(r<0)throw new RangeError("Index out of range");return r}}function P8(e,t){if(e.length!=t.length)return!1;for(let n=0;ns&&l.push(new k8(s,f.from,p)),I8(e,f.direction==v8!=!(p%2)?o+1:o,r,f.inner,f.from,f.to,l),s=f.to),h=f.to}else{if(h==n||(t?T8[h]!=a:T8[h]==a))break;h++}d?M8(e,s,h,o+1,r,d,l):st;){let n=!0,u=!1;if(!c||s>i[c-1].to){let e=T8[s-1];e!=a&&(n=!1,u=16==e)}let d=n||1!=a?null:[],p=n?o:o+1,h=s;e:for(;;)if(c&&h==i[c-1].to){if(u)break e;let f=i[--c];if(!n)for(let e=f.from,n=c;;){if(e==t)break e;if(!n||i[n-1].to!=e){if(T8[e-1]==a)break e;break}e=i[--n].from}d?d.push(f):(f.to=0;e-=3)if($8[e+1]==-n){let t=$8[e+2],n=2&t?r:4&t?1&t?i:r:0;n&&(T8[l]=T8[$8[e]]=n),a=e;break}}else{if(189==$8.length)break;$8[a++]=l,$8[a++]=t,$8[a++]=s}else if(2==(o=T8[l])||1==o){let e=o==r;s=e?0:1;for(let t=a-3;t>=0;t-=3){let n=$8[t+2];if(2&n)break;if(e)$8[t+2]|=2;else{if(4&n)break;$8[t+2]|=4}}}}}(e,r,i,o,a),function(e,t,n,o){for(let r=0,i=o;r<=n.length;r++){let l=r?n[r-1].to:e,a=rs;)t==i&&(t=n[--o].from,i=o?n[o-1].to:e),T8[--t]=u;s=l}else i=l,s++}}}(r,i,o,a),M8(e,r,i,t,n,o,l)}function E8(e){return[new k8(0,e,0)]}let A8="";function R8(e,t,n,o,r){var i;let l=o.head-e.from,a=k8.find(t,l,null!==(i=o.bidiLevel)&&void 0!==i?i:-1,o.assoc),s=t[a],c=s.side(r,n);if(l==c){let e=a+=r?1:-1;if(e<0||e>=t.length)return null;s=t[a=e],l=s.side(!r,n),c=s.side(r,n)}let u=y3(e.text,l,s.forward(r,n));(us.to)&&(u=c),A8=e.text.slice(Math.min(l,u),Math.max(l,u));let d=a==(r?t.length-1:0)?null:t[a+(r?1:-1)];return d&&u==c&&d.level+(r?0:1)e.some((e=>e))}),F8=Q3.define({combine:e=>e.some((e=>e))});class W8{constructor(e,t="nearest",n="nearest",o=5,r=5,i=!1){this.range=e,this.y=t,this.x=n,this.yMargin=o,this.xMargin=r,this.isSnapshot=i}map(e){return e.empty?this:new W8(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new W8(z3.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const V8=v4.define({map:(e,t)=>e.map(t)});function Z8(e,t,n){let o=e.facet(z8);o.length?o[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)}const X8=Q3.define({combine:e=>!e.length||e[0]});let Y8=0;const K8=Q3.define();class G8{constructor(e,t,n,o,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=o,this.extension=r(this)}static define(e,t){const{eventHandlers:n,eventObservers:o,provide:r,decorations:i}=t||{};return new G8(Y8++,e,n,o,(e=>{let t=[K8.of(e)];return i&&t.push(e6.of((t=>{let n=t.plugin(e);return n?i(n):a8.none}))),r&&t.push(r(e)),t}))}static fromClass(e,t){return G8.define((t=>new e(t)),t)}}class U8{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(Rpe){if(Z8(e.state,Rpe,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(Dpe){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(Rpe){Z8(e.state,Rpe,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(Rpe){Z8(e.state,Rpe,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const q8=Q3.define(),J8=Q3.define(),e6=Q3.define(),t6=Q3.define(),n6=Q3.define(),o6=Q3.define();function r6(e,t){let n=e.state.facet(o6);if(!n.length)return n;let o=n.map((t=>t instanceof Function?t(e):t)),r=[];return j4.spans(o,t.from,t.to,{point(){},span(e,n,o,i){let l=e-t.from,a=n-t.from,s=r;for(let r=o.length-1;r>=0;r--,i--){let e,n=o[r].spec.bidiIsolate;if(null==n&&(n=D8(t.text,l,a)),i>0&&s.length&&(e=s[s.length-1]).to==l&&e.direction==n)e.to=a,s=e.inner;else{let e={from:l,to:a,direction:n,inner:[]};s.push(e),s=e.inner}}}}),r}const i6=Q3.define();function l6(e){let t=0,n=0,o=0,r=0;for(let i of e.state.facet(i6)){let l=i(e);l&&(null!=l.left&&(t=Math.max(t,l.left)),null!=l.right&&(n=Math.max(n,l.right)),null!=l.top&&(o=Math.max(o,l.top)),null!=l.bottom&&(r=Math.max(r,l.bottom)))}return{left:t,right:n,top:o,bottom:r}}const a6=Q3.define();class s6{constructor(e,t,n,o){this.fromA=e,this.toA=t,this.fromB=n,this.toB=o}join(e){return new s6(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let o=e[t-1];if(!(o.fromA>n.toA)){if(o.toAc)break;r+=2}if(!a)return n;new s6(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),i=a.toA,l=a.toB}}}class c6{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=I3.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let o=[];this.changes.iterChangedRanges(((e,t,n,r)=>o.push(new s6(e,t,n,r)))),this.changedRanges=o}static create(e,t,n){return new c6(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class u6 extends T5{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new o8],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new s6(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every((({fromA:e,toA:t})=>tthis.minWidthTo))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let o=-1;this.view.inputState.composing>=0&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?o=this.domChanged.newSel.head:function(e,t){let n=!1;return t&&e.iterChangedRanges(((e,o)=>{et.from&&(n=!0)})),n}(e.changes,this.hasComposition)||e.selectionSet||(o=e.state.selection.main.head));let r=o>-1?function(e,t,n){let o=p6(e,n);if(!o)return null;let{node:r,from:i,to:l}=o,a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(o.from,o.to)!=a)return null;let s=t.invertedDesc,c=new s6(s.mapPos(i),s.mapPos(l),i,l),u=[];for(let d=r.parentNode;;d=d.parentNode){let t=T5.get(d);if(t instanceof Z5)u.push({node:d,deco:t.mark});else{if(t instanceof o8||"DIV"==d.nodeName&&d.parentNode==e.contentDOM)return{range:c,text:r,marks:u,line:d};if(d==e.contentDOM)return null;u.push({node:d,deco:new s8({inclusive:!0,attributes:n8(d),tagName:d.tagName.toLowerCase()})})}}}(this.view,e.changes,o):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:t,to:o}=this.hasComposition;n=new s6(t,o,e.changes.mapPos(t,-1),e.changes.mapPos(o,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(W5.ie||W5.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=function(e,t,n){let o=new f6;return j4.compare(e,t,n,o),o.changes}(this.decorations,this.updateDeco(),e.changes);return n=s6.extendWithRanges(n,i),!!(7&this.flags||0!=n.length)&&(this.updateInner(n,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:o}=this.view;o.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=W5.chrome||W5.ios?{node:o.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||o.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((e=>e.flags&=-9));let r=[];if(this.view.viewport.from||this.view.viewport.to=0?o[i]:null;if(!e)break;let t,l,a,s,{fromA:c,toA:u,fromB:d,toB:p}=e;if(n&&n.range.fromBd){let e=h8.build(this.view.state.doc,d,n.range.fromB,this.decorations,this.dynamicDecorationMap),o=h8.build(this.view.state.doc,n.range.toB,p,this.decorations,this.dynamicDecorationMap);l=e.breakAtStart,a=e.openStart,s=o.openEnd;let r=this.compositionView(n);o.breakAtStart?r.breakAfter=1:o.content.length&&r.merge(r.length,r.length,o.content[0],!1,o.openStart,0)&&(r.breakAfter=o.content[0].breakAfter,o.content.shift()),e.content.length&&r.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),t=e.content.concat(r).concat(o.content)}else({content:t,breakAtStart:l,openStart:a,openEnd:s}=h8.build(this.view.state.doc,d,p,this.decorations,this.dynamicDecorationMap));let{i:h,off:f}=r.findPos(u,1),{i:g,off:m}=r.findPos(c,-1);E5(this,g,m,h,f,t,l,a,s)}n&&this.fixCompositionDOM(n)}compositionView(e){let t=new V5(e.text.nodeValue);t.flags|=8;for(let{deco:o}of e.marks)t=new Z5(o,[t],t.length);let n=new o8;return n.append(t,0),n}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|(t.children.some((e=>7&e.flags))?1:0),this.markedForComposition.add(t);let n=T5.get(e);n&&n!=t&&(n.dom=null),t.setDOM(e)},n=this.childPos(e.range.fromB,1),o=this.children[n.i];t(e.line,o);for(let r=e.marks.length-1;r>=-1;r--)n=o.childPos(n.off,1),o=o.children[n.i],t(r>=0?e.marks[r].node:e.text,o)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let n=this.view.root.activeElement,o=n==this.dom,r=!o&&c5(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(o||t||r))return;let i=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),s=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(W5.gecko&&l.empty&&!this.hasComposition&&1==(c=a).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null))),a=s=new k5(e,0),i=!0}var c;let u=this.view.observer.selectionRange;!i&&u.focusNode&&(d5(a.node,a.offset,u.anchorNode,u.anchorOffset)&&d5(s.node,s.offset,u.focusNode,u.focusOffset)||this.suppressWidgetCursorChange(u,l))||(this.view.observer.ignore((()=>{W5.android&&W5.chrome&&this.dom.contains(u.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=a5(this.view.root);if(e)if(l.empty){if(W5.gecko){let e=(t=a.node,o=a.offset,1!=t.nodeType?0:(o&&"false"==t.childNodes[o-1].contentEditable?1:0)|(ol.head&&([a,s]=[s,a]),t.setEnd(s.node,s.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}var t,o;r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())})),this.view.observer.setSelectionRange(a,s)),this.impreciseAnchor=a.precise?null:new k5(u.anchorNode,u.anchorOffset),this.impreciseHead=s.precise?null:new k5(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&d5(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=a5(e.root),{anchorNode:o,anchorOffset:r}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let i=o8.find(this,t.head);if(!i)return;let l=i.posAtStart;if(t.head==l||t.head==l+i.length)return;let a=this.coordsAt(t.head,-1),s=this.coordsAt(t.head,1);if(!a||!s||a.bottom>s.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(o,r)}moveToLine(e){let t,n=this.dom;if(e.node!=n)return e;for(let o=e.offset;!t&&o=0;o--){let e=T5.get(n.childNodes[o]);e instanceof o8&&(t=e.domAtPos(e.length))}return t?new k5(t.node,t.offset,!0):e}nearest(e){for(let t=e;t;){let e=T5.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;i--){let l=this.children[i],a=r-l.breakAfter,s=a-l.length;if(ae||l.covers(1))&&(!n||l instanceof o8&&!(n instanceof o8&&t>=0))&&(n=l,o=s),r=s}return n?n.coordsAt(e-o,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),o=this.children[t];if(!(o instanceof o8))return null;for(;o.children.length;){let{i:e,off:t}=o.childPos(n,1);for(;;e++){if(e==o.children.length)return null;if((o=o.children[e]).length)break}n=t}if(!(o instanceof V5))return null;let r=y3(o.text,n);if(r==n)return null;let i=x5(o.dom,n,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==m8.LTR;for(let s=0,c=0;co)break;if(s>=n){let n=e.dom.getBoundingClientRect();if(t.push(n.height),i){let t=e.dom.lastChild,o=t?u5(t):[];if(o.length){let e=o[o.length-1],t=a?e.right-n.left:n.right-e.left;t>l&&(l=t,this.minWidth=r,this.minWidthFrom=s,this.minWidthTo=u)}}}s=u+e.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?m8.RTL:m8.LTR}measureTextSize(){for(let r of this.children)if(r instanceof o8){let e=r.measureTextSize();if(e)return e}let e,t,n,o=document.createElement("div");return o.className="cm-line",o.style.width="99999px",o.style.position="absolute",o.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(o);let r=u5(o.firstChild)[0];e=o.getBoundingClientRect().height,t=r?r.width/27:7,n=r?r.height:e,o.remove()})),{lineHeight:e,charWidth:t,textHeight:n}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new I5(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,o=0;;o++){let r=o==t.viewports.length?null:t.viewports[o],i=r?r.from-1:this.length;if(i>n){let o=(t.lineBlockAt(i).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(a8.replace({widget:new d6(o),block:!0,inclusive:!0,isBlockGap:!0}).range(n,i))}if(!r)break;n=r.to+1}return a8.set(e)}updateDeco(){let e=this.view.state.facet(e6).map(((e,t)=>(this.dynamicDecorationMap[t]="function"==typeof e)?e(this.view):e)),t=!1,n=this.view.state.facet(t6).map(((e,n)=>{let o="function"==typeof e;return o&&(t=!0),o?e(this.view):e}));n.length&&(this.dynamicDecorationMap[e.length]=t,e.push(j4.join(n)));for(let o=e.length;on.anchor?-1:1);if(!o)return;!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(o={left:Math.min(o.left,t.left),top:Math.min(o.top,t.top),right:Math.max(o.right,t.right),bottom:Math.max(o.bottom,t.bottom)});let r=l6(this.view),i={left:o.left-r.left,top:o.top-r.top,right:o.right+r.right,bottom:o.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;!function(e,t,n,o,r,i,l,a){let s=e.ownerDocument,c=s.defaultView||window;for(let u=e,d=!1;u&&!d;)if(1==u.nodeType){let e,p=u==s.body,h=1,f=1;if(p)e=m5(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:h,scaleY:f}=v5(u,t)),e={left:t.left,right:t.left+u.clientWidth*h,top:t.top,bottom:t.top+u.clientHeight*f}}let g=0,m=0;if("nearest"==r)t.top0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+m+l)):t.bottom>e.bottom&&(m=t.bottom-e.bottom+l,n<0&&t.top-m0&&t.right>e.right+g&&(g=t.right-e.right+g+i)):t.right>e.right&&(g=t.right-e.right+i,n<0&&t.left0))break;o=o.childNodes[r-1],r=f5(o)}if(n>=0)for(let o=e,r=t;;){if(3==o.nodeType)return{node:o,offset:r};if(!(1==o.nodeType&&r=0))break;o=o.childNodes[r],r=0}return null}let f6=class{constructor(){this.changes=[]}compareRange(e,t){p8(e,t,this.changes)}comparePoint(e,t){p8(e,t,this.changes)}};function g6(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function m6(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function v6(e,t){return e.topt.top+1}function b6(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function O6(e,t,n){let o,r,i,l,a,s,c,u,d=!1;for(let h=e.firstChild;h;h=h.nextSibling){let e=u5(h);for(let p=0;pm||l==m&&i>g){o=h,r=f,i=g,l=m;let a=m?n0?p0)}0==g?n>f.bottom&&(!c||c.bottomf.top)&&(s=h,u=f):c&&v6(c,f)?c=y6(c,f.bottom):u&&v6(u,f)&&(u=b6(u,f.top))}}if(c&&c.bottom>=n?(o=a,r=c):u&&u.top<=n&&(o=s,r=u),!o)return{node:e,offset:0};let p=Math.max(r.left,Math.min(r.right,t));return 3==o.nodeType?w6(o,p,n):d&&"false"!=o.contentEditable?O6(o,p,n):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,o)+(t>=(r.left+r.right)/2?1:0)}}function w6(e,t,n){let o=e.nodeValue.length,r=-1,i=1e9,l=0;for(let a=0;an?c.top-n:n-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&u=(c.left+c.right)/2,o=n;if((W5.chrome||W5.gecko)&&x5(e,a).getBoundingClientRect().left==c.right&&(o=!n),u<=0)return{node:e,offset:a+(o?1:0)};r=a+(o?1:0),i=u}}}return{node:e,offset:r>-1?r:l>0?e.nodeValue.length:0}}function x6(e,t,n,o=-1){var r,i;let l,a=e.contentDOM.getBoundingClientRect(),s=a.top+e.viewState.paddingTop,{docHeight:c}=e.viewState,{x:u,y:d}=t,p=d-s;if(p<0)return 0;if(p>c)return e.state.doc.length;for(let O=e.viewState.heightOracle.textHeight/2,w=!1;l=e.elementAtHeight(p),l.type!=l8.Text;)for(;p=o>0?l.bottom+O:l.top-O,!(p>=0&&p<=c);){if(w)return n?null:0;w=!0,o=-o}d=s+p;let h=l.from;if(he.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:$6(e,a,l,u,d);let f=e.dom.ownerDocument,g=e.root.elementFromPoint?e.root:f,m=g.elementFromPoint(u,d);m&&!e.contentDOM.contains(m)&&(m=null),m||(u=Math.max(a.left+1,Math.min(a.right-1,u)),m=g.elementFromPoint(u,d),m&&!e.contentDOM.contains(m)&&(m=null));let v,b=-1;if(m&&0!=(null===(r=e.docView.nearest(m))||void 0===r?void 0:r.isEditable))if(f.caretPositionFromPoint){let e=f.caretPositionFromPoint(u,d);e&&({offsetNode:v,offset:b}=e)}else if(f.caretRangeFromPoint){let t=f.caretRangeFromPoint(u,d);t&&(({startContainer:v,startOffset:b}=t),(!e.contentDOM.contains(v)||W5.safari&&function(e,t,n){let o;if(3!=e.nodeType||t!=(o=e.nodeValue.length))return!1;for(let r=e.nextSibling;r;r=r.nextSibling)if(1!=r.nodeType||"BR"!=r.nodeName)return!1;return x5(e,o-1,o).getBoundingClientRect().left>n}(v,b,u)||W5.chrome&&function(e,t,n){if(0!=t)return!1;for(let r=e;;){let e=r.parentNode;if(!e||1!=e.nodeType||e.firstChild!=r)return!1;if(e.classList.contains("cm-line"))break;r=e}let o=1==e.nodeType?e.getBoundingClientRect():x5(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect();return n-o.left>5}(v,b,u))&&(v=void 0))}if(!v||!e.docView.dom.contains(v)){let t=o8.find(e.docView,h);if(!t)return p>l.top+l.height/2?l.to:l.from;({node:v,offset:b}=O6(t.dom,u,d))}let y=e.docView.nearest(v);if(!y)return null;if(y.isWidget&&1==(null===(i=y.dom)||void 0===i?void 0:i.nodeType)){let e=y.dom.getBoundingClientRect();return t.y1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;i+=Math.floor((r-n.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let l=e.state.sliceDoc(n.from,n.to);return n.from+Y4(l,i,e.state.tabSize)}function S6(e,t){let n=e.lineBlockAt(t);if(Array.isArray(n.type))for(let o of n.type)if(o.to>t||o.to==t&&(o.to==n.to||o.type==l8.Text))return o;return n}function C6(e,t,n,o){let r=e.state.doc.lineAt(t.head),i=e.bidiSpans(r),l=e.textDirectionAt(r.from);for(let a=t,s=null;;){let t=R8(r,i,l,a,n),c=A8;if(!t){if(r.number==(n?e.state.doc.lines:1))return a;c="\n",r=e.state.doc.line(r.number+(n?1:-1)),i=e.bidiSpans(r),t=e.visualLineSide(r,!n)}if(s){if(!s(c))return a}else{if(!o)return t;s=o(c)}a=t}}function k6(e,t,n){for(;;){let o=0;for(let r of e)r.between(t-1,t+1,((e,r,i)=>{if(t>e&&tt(e))),n.from,t.head>n.from?-1:1);return o==n.from?n:z3.cursor(o,onull)),W5.gecko&&(t=e.contentDOM.ownerDocument,e7.has(t)||(e7.add(t),t.addEventListener("copy",(()=>{})),t.addEventListener("cut",(()=>{}))))}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,o=t.target;o!=e.contentDOM;o=o.parentNode)if(!o||11==o.nodeType||(n=T5.get(o))&&n.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let o of e){let e=o.spec;if(e&&e.domEventHandlers)for(let t in e.domEventHandlers){let r=e.domEventHandlers[t];r&&n(t).handlers.push(M6(o.value,r))}if(e&&e.domEventObservers)for(let t in e.domEventObservers){let r=e.domEventObservers[t];r&&n(t).observers.push(M6(o.value,r))}}for(let o in j6)n(o).handlers.push(j6[o]);for(let o in B6)n(o).observers.push(B6[o]);return t}(e),n=this.handlers,o=this.view.contentDOM;for(let r in t)if("scroll"!=r){let e=!t[r].handlers.length,i=n[r];i&&e!=!i.handlers.length&&(o.removeEventListener(r,this.handleEvent),i=null),i||o.addEventListener(r,this.handleEvent,{passive:e})}for(let r in n)"scroll"==r||t[r]||o.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&Date.now()t.keyCode==e.keyCode)))&&!e.ctrlKey||E6.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(){let e=this.pendingIOSKey;return!!e&&(this.pendingIOSKey=void 0,$5(this.view.contentDOM,e.key,e.keyCode))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(W5.safari&&!W5.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function M6(e,t){return(n,o)=>{try{return t.call(e,o,n)}catch(Rpe){Z8(n.state,Rpe)}}}const I6=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],E6="dthko",A6=[16,17,18,20,91,92,224,225];function R6(e){return.7*Math.max(0,e)+8}class D6{constructor(e,t,n,o){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=o,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=function(e){let t=e.ownerDocument;for(let n=e.parentNode;n&&n!=t.body;)if(1==n.nodeType){if(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else{if(11!=n.nodeType)break;n=n.host}return null}(e.contentDOM),this.atoms=e.state.facet(n6).map((t=>t(e)));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(M4.allowMultipleSelections)&&function(e,t){let n=e.state.facet(j8);return n.length?n[0](t):W5.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let o=a5(e.root);if(!o||0==o.rangeCount)return!0;let r=o.getRangeAt(0).getClientRects();for(let i=0;i=t.clientX&&e.top<=t.clientY&&e.bottom>=t.clientY)return!0}return!1}(e,t)||1!=Y6(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t,n,o;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(n=this.startEvent,o=e,Math.max(Math.abs(n.clientX-o.clientX),Math.abs(n.clientY-o.clientY))<10))return;this.select(this.lastEvent=e);let r=0,i=0,l=(null===(t=this.scrollParent)||void 0===t?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},a=l6(this.view);e.clientX-a.left<=l.left+6?r=-R6(l.left-e.clientX):e.clientX+a.right>=l.right-6&&(r=R6(e.clientX-l.right)),e.clientY-a.top<=l.top+6?i=-R6(l.top-e.clientY):e.clientY+a.bottom>=l.bottom-6&&(i=R6(e.clientY-l.bottom)),this.setScrollSpeed(r,i)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nthis.select(this.lastEvent)),20)}}const j6=Object.create(null),B6=Object.create(null),N6=W5.ie&&W5.ie_version<15||W5.ios&&W5.webkit_version<604;function z6(e,t){let n,{state:o}=e,r=1,i=o.toText(t),l=i.lines==o.selection.ranges.length;if(null!=G6&&o.selection.ranges.every((e=>e.empty))&&G6==i.toString()){let e=-1;n=o.changeByRange((n=>{let a=o.doc.lineAt(n.from);if(a.from==e)return{range:n};e=a.from;let s=o.toText((l?i.line(r++).text:t)+o.lineBreak);return{changes:{from:a.from,insert:s},range:z3.cursor(n.from+s.length)}}))}else n=l?o.changeByRange((e=>{let t=i.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:z3.cursor(e.from+t.length)}})):o.replaceSelection(i);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function _6(e,t,n,o){if(1==o)return z3.cursor(t,n);if(2==o)return function(e,t,n=1){let o=e.charCategorizer(t),r=e.doc.lineAt(t),i=t-r.from;if(0==r.length)return z3.cursor(t);0==i?n=1:i==r.length&&(n=-1);let l=i,a=i;n<0?l=y3(r.text,i,!1):a=y3(r.text,i);let s=o(r.text.slice(l,a));for(;l>0;){let e=y3(r.text,l,!1);if(o(r.text.slice(e,l))!=s)break;l=e}for(;a{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},j6.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&(e.inputState.lastEscPress=Date.now()),!1),B6.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},B6.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},j6.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let o of e.state.facet(N8))if(n=o(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=F6(e,t),o=Y6(t),r=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),r=r.map(e.changes))},get(t,i,l){let a,s=F6(e,t),c=_6(e,s.pos,s.bias,o);if(n.pos!=s.pos&&!i){let t=_6(e,n.pos,n.bias,o),r=Math.min(t.from,c.from),i=Math.max(t.to,c.to);c=r1&&(a=function(e,t){for(let n=0;n=t)return z3.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(r,s.pos))?a:l?r.addRange(c):z3.create([c])}}}(e,t)),n){let o=!e.hasFocus;e.inputState.startMouseSelection(new D6(e,t,n,o)),o&&e.observer.ignore((()=>w5(e.contentDOM)));let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}return!1};let L6=(e,t)=>e>=t.top&&e<=t.bottom,Q6=(e,t,n)=>L6(t,n)&&e>=n.left&&e<=n.right;function H6(e,t,n,o){let r=o8.find(e.docView,t);if(!r)return 1;let i=t-r.posAtStart;if(0==i)return 1;if(i==r.length)return-1;let l=r.coordsAt(i,-1);if(l&&Q6(n,o,l))return-1;let a=r.coordsAt(i,1);return a&&Q6(n,o,a)?1:l&&L6(o,l)?-1:1}function F6(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:H6(e,n,t.clientX,t.clientY)}}const W6=W5.ie&&W5.ie_version<=11;let V6=null,Z6=0,X6=0;function Y6(e){if(!W6)return e.detail;let t=V6,n=X6;return V6=e,X6=Date.now(),Z6=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Z6+1)%3:1}function K6(e,t,n,o){if(!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:i}=e.inputState,l=o&&i&&function(e,t){let n=e.state.facet(B8);return n.length?n[0](t):W5.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:i.from,to:i.to}:null,a={from:r,insert:n},s=e.state.changes(l?[l,a]:a);e.focus(),e.dispatch({changes:s,selection:{anchor:s.mapPos(r,-1),head:s.mapPos(r,1)},userEvent:l?"move.drop":"input.drop"}),e.inputState.draggedContent=null}j6.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let o=e.docView.nearest(t.target);if(o&&o.isWidget){let e=o.posAtStart,t=e+o.length;(e>=n.to||t<=n.from)&&(n=z3.range(e,t))}}let{inputState:o}=e;return o.mouseSelection&&(o.mouseSelection.dragging=!0),o.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove"),!1},j6.dragend=e=>(e.inputState.draggedContent=null,!1),j6.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let o=Array(n.length),r=0,i=()=>{++r==n.length&&K6(e,t,o.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(o[e]=t.result),i()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return K6(e,t,n,!0),!0}return!1},j6.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=N6?null:t.clipboardData;return n?(z6(e,n.getData("text/plain")||n.getData("text/uri-text")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((()=>{e.focus(),n.remove(),z6(e,n.value)}),50)}(e),!1)};let G6=null;j6.copy=j6.cut=(e,t)=>{let{text:n,ranges:o,linewise:r}=function(e){let t=[],n=[],o=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:o}of e.selection.ranges){let i=e.doc.lineAt(o);i.number>r&&(t.push(i.text),n.push({from:i.from,to:Math.min(e.doc.length,i.to+1)})),r=i.number}o=!0}return{text:t.join(e.lineBreak),ranges:n,linewise:o}}(e.state);if(!n&&!r)return!1;G6=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:o,scrollIntoView:!0,userEvent:"delete.cut"});let i=N6?null:t.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(function(e,t){let n=e.dom.parentNode;if(!n)return;let o=n.appendChild(document.createElement("textarea"));o.style.cssText="position: fixed; left: -10000px; top: 10px",o.value=t,o.focus(),o.selectionEnd=t.length,o.selectionStart=0,setTimeout((()=>{o.remove(),e.focus()}),50)}(e,n),!1)};const U6=f4.define();function q6(e,t){let n=[];for(let o of e.facet(Q8)){let r=o(e,t);r&&n.push(r)}return n?e.update({effects:n,annotations:U6.of(!0)}):null}function J6(e){setTimeout((()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=q6(e.state,t);n?e.dispatch(n):e.update([])}}),10)}B6.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),J6(e)},B6.blur=e=>{e.observer.clearSelectionRange(),J6(e)},B6.compositionstart=B6.compositionupdate=e=>{null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0)},B6.compositionend=e=>{e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,W5.chrome&&W5.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then((()=>e.observer.flush())):setTimeout((()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])}),50)},B6.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},j6.beforeinput=(e,t)=>{var n;let o;if(W5.chrome&&W5.android&&(o=I6.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(o.key,o.keyCode),"Backspace"==o.key||"Delete"==o.key)){let t=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}return!1};const e7=new Set,t7=["pre-wrap","normal","pre-line","break-spaces"];class n7{constructor(e){this.lineWrapping=e,this.doc=l3.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return t7.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=o,this.lineLength=r,a){this.heightSamples={};for(let e=0;e0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>l7&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return a7.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,o){let r=this,i=n.doc;for(let l=o.length-1;l>=0;l--){let{fromA:a,toA:s,fromB:c,toB:u}=o[l],d=r.lineAt(a,i7.ByPosNoHeight,n.setDoc(t),0,0),p=d.to>=s?d:r.lineAt(s,i7.ByPosNoHeight,n,0,0);for(u+=p.to-s,s=p.to;l>0&&d.from<=o[l-1].toA;)a=o[l-1].fromA,c=o[l-1].fromB,l--,a2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,o-=r.size}else{if(!(r>2*o))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,r-=t.size}}else if(o=r&&i(this.blockAt(0,n,o,r))}updateHeight(e,t=0,n=!1,o){return o&&o.from<=t&&o.more&&this.setHeight(e,o.heights[o.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class c7 extends s7{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,o){return new r7(o,this.length,n,this.height,this.breaks)}replace(e,t,n){let o=n[0];return 1==n.length&&(o instanceof c7||o instanceof u7&&4&o.flags)&&Math.abs(this.length-o.length)<10?(o instanceof u7?o=new c7(o.length,this.height):o.height=this.height,this.outdated||(o.outdated=!1),o):a7.of(n)}updateHeight(e,t=0,n=!1,o){return o&&o.from<=t&&o.more?this.setHeight(e,o.heights[o.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class u7 extends a7{constructor(e){super(e,0)}heightMetrics(e,t){let n,o=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-o+1,l=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);n=t/i,this.length>i+1&&(l=(this.height-t)/(this.length-i-1))}else n=this.height/i;return{firstLine:o,lastLine:r,perLine:n,perChar:l}}blockAt(e,t,n,o){let{firstLine:r,lastLine:i,perLine:l,perChar:a}=this.heightMetrics(t,o);if(t.lineWrapping){let r=o+Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length),i=t.doc.lineAt(r),s=l+i.length*a,c=Math.max(n,e-s/2);return new r7(i.from,i.length,c,s,0)}{let o=Math.max(0,Math.min(i-r,Math.floor((e-n)/l))),{from:a,length:s}=t.doc.line(r+o);return new r7(a,s,n+l*o,l,0)}}lineAt(e,t,n,o,r){if(t==i7.ByHeight)return this.blockAt(e,n,o,r);if(t==i7.ByPosNoHeight){let{from:t,to:o}=n.doc.lineAt(e);return new r7(t,o-t,0,0,0)}let{firstLine:i,perLine:l,perChar:a}=this.heightMetrics(n,r),s=n.doc.lineAt(e),c=l+s.length*a,u=s.number-i,d=o+l*u+a*(s.from-r-u);return new r7(s.from,s.length,Math.max(o,Math.min(d,o+this.height-c)),c,0)}forEachLine(e,t,n,o,r,i){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:s}=this.heightMetrics(n,r);for(let c=e,u=o;c<=t;){let t=n.doc.lineAt(c);if(c==e){let n=t.number-l;u+=a*n+s*(e-r-n)}let o=a+s*t.length;i(new r7(t.from,t.length,u,o,0)),u+=o,c=t.to+1}}replace(e,t,n){let o=this.length-t;if(o>0){let e=n[n.length-1];e instanceof u7?n[n.length-1]=new u7(e.length+o):n.push(null,new u7(o-1))}if(e>0){let t=n[0];t instanceof u7?n[0]=new u7(e+t.length):n.unshift(new u7(e-1),null)}return a7.of(n)}decomposeLeft(e,t){t.push(new u7(e-1),null)}decomposeRight(e,t){t.push(null,new u7(this.length-e-1))}updateHeight(e,t=0,n=!1,o){let r=t+this.length;if(o&&o.from<=t+this.length&&o.more){let n=[],i=Math.max(t,o.from),l=-1;for(o.from>t&&n.push(new u7(o.from-t-1).updateHeight(e,t));i<=r&&o.more;){let t=e.doc.lineAt(i).length;n.length&&n.push(null);let r=o.heights[o.index++];-1==l?l=r:Math.abs(r-l)>=l7&&(l=-2);let a=new c7(t,r);a.outdated=!1,n.push(a),i+=t+1}i<=r&&n.push(null,new u7(r-i).updateHeight(e,i));let a=a7.of(n);return(l<0||Math.abs(a.height-this.height)>=l7||Math.abs(l-this.heightMetrics(e,t).perLine)>=l7)&&(e.heightChanged=!0),a}return(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class d7 extends a7{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,o){let r=n+this.left.height;return el))return s;let c=t==i7.ByPosNoHeight?i7.ByPosNoHeight:i7.ByPos;return a?s.join(this.right.lineAt(l,c,n,i,l)):this.left.lineAt(l,c,n,o,r).join(s)}forEachLine(e,t,n,o,r,i){let l=o+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,l,a,i);else{let s=this.lineAt(a,i7.ByPos,n,o,r);e=e&&s.from<=t&&i(s),t>s.to&&this.right.forEachLine(s.to+1,t,n,l,a,i)}}replace(e,t,n){let o=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-o,t-o,n));let r=[];e>0&&this.decomposeLeft(e,r);let i=r.length;for(let l of n)r.push(l);if(e>0&&p7(r,i-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,o=n+this.break;if(e>=o)return this.right.decomposeRight(e-o,t);e2*t.size||t.size>2*e.size?a7.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,o){let{left:r,right:i}=this,l=t+r.length+this.break,a=null;return o&&o.from<=t+r.length&&o.more?a=r=r.updateHeight(e,t,n,o):r.updateHeight(e,t,n),o&&o.from<=l+i.length&&o.more?a=i=i.updateHeight(e,l,n,o):i.updateHeight(e,l,n),a?this.balanced(r,i):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function p7(e,t){let n,o;null==e[t]&&(n=e[t-1])instanceof u7&&(o=e[t+1])instanceof u7&&e.splice(t-1,3,new u7(n.length+1+o.length))}class h7{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof c7?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new c7(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=5)&&this.addLineDeco(o,r,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new c7(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new u7(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof c7)return e;let t=new c7(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let o=this.ensureLine();o.length+=n,o.collapsed+=n,o.widgetHeight=Math.max(o.widgetHeight,e),o.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof c7||this.isCovered?(this.writtenTot.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=n.overflow){let n=t.getBoundingClientRect();i=Math.max(i,n.left),l=Math.min(l,n.right),a=Math.max(a,n.top),s=c==e.parentNode?n.bottom:Math.min(s,n.bottom)}c="absolute"==n.position||"fixed"==n.position?t.offsetParent:t.parentNode}else{if(11!=c.nodeType)break;c=c.host}return{left:i-n.left,right:Math.max(i,l)-n.left,top:a-(n.top+t),bottom:Math.max(a,s)-(n.top+t)}}function m7(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class v7{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n"function"!=typeof e&&"cm-lineWrapping"==e.class));this.heightOracle=new n7(t),this.stateDeco=e.facet(e6).filter((e=>"function"!=typeof e)),this.heightMap=a7.empty().applyChanges(this.stateDeco,l3.empty,this.heightOracle.setDoc(e.doc),[new s6(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=a8.set(this.lineGaps.map((e=>e.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let o=n?t.head:t.anchor;if(!e.some((({from:e,to:t})=>o>=e&&o<=t))){let{from:t,to:n}=this.lineBlockAt(o);e.push(new O7(t,n))}}this.viewports=e.sort(((e,t)=>e.from-t.from)),this.scaler=this.heightMap.height<=7e6?S7:new C7(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(e=>{this.viewportLines.push(1==this.scaler.scale?e:k7(e,this.scaler))}))}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(e6).filter((e=>"function"!=typeof e));let o=e.changedRanges,r=s6.extendWithRanges(o,function(e,t,n){let o=new f7;return j4.compare(e,t,n,o,0),o.changes}(n,this.stateDeco,e?e.changes:I3.empty(this.state.doc.length))),i=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=i&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let s=!e.changes.empty||2&e.flags||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),s&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(F8)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),o=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?m8.RTL:m8.LTR;let i=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=i||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let s=0,c=0;if(l.width&&l.height){let{scaleX:e,scaleY:n}=v5(t,l);this.scaleX==e&&this.scaleY==n||(this.scaleX=e,this.scaleY=n,s|=8,i=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==d||(this.paddingTop=u,this.paddingBottom=d,s|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(o.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,s|=8);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=C5(e.scrollDOM);let h=(this.printing?m7:g7)(t,this.paddingTop),f=h.top-this.pixelViewport.top,g=h.bottom-this.pixelViewport.bottom;this.pixelViewport=h;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let v=l.width;if(this.contentDOMWidth==v&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,s|=8),a){let t=e.docView.measureVisibleLineHeights(this.viewport);if(o.mustRefreshForHeights(t)&&(i=!0),i||o.lineWrapping&&Math.abs(v-this.contentDOMWidth)>o.charWidth){let{lineHeight:n,charWidth:l,textHeight:a}=e.docView.measureTextSize();i=n>0&&o.refresh(r,n,l,a,v/l,t),i&&(e.docView.minWidth=0,s|=8)}f>0&&g>0?c=Math.max(f,g):f<0&&g<0&&(c=Math.min(f,g)),o.heightChanged=!1;for(let n of this.viewports){let r=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(i?a7.empty().applyChanges(this.stateDeco,l3.empty,this.heightOracle,[new s6(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(o,0,i,new o7(n.from,r))}o.heightChanged&&(s|=2)}let b=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(2&s||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(i?[]:this.lineGaps,e)),s|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),s}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),o=this.heightMap,r=this.heightOracle,{visibleTop:i,visibleBottom:l}=this,a=new O7(o.lineAt(i-1e3*n,i7.ByHeight,r,0,0).from,o.lineAt(l+1e3*(1-n),i7.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(ea.to){let n,i=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),l=o.lineAt(e,i7.ByPos,r,0,0);n="center"==t.y?(l.top+l.bottom)/2-i/2:"start"==t.y||"nearest"==t.y&&e=l+Math.max(10,Math.min(n,250)))&&o>i-2e3&&r>1,i=o<<1;if(this.defaultTextDirection!=m8.LTR&&!n)return[];let l=[],a=(o,i,s,c)=>{if(i-oo&&ee.from>=s.from&&e.to<=s.to&&Math.abs(e.from-o)e.fromt))));if(!p){if(ie.from<=i&&e.to>=i))){let e=t.moveToLineBoundary(z3.cursor(i),!1,!0).head;e>o&&(i=e)}p=new v7(o,i,this.gapSize(s,o,i,c))}l.push(p)};for(let s of this.viewportLines){if(s.lengths.from&&a(s.from,t,s,e),re.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];j4.spans(e,this.viewport.from,this.viewport.to,{span(e,n){t.push({from:e,to:n})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some(((e,n)=>e.from!=t[n].from||e.to!=t[n].to));return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||k7(this.heightMap.lineAt(e,i7.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return k7(this.heightMap.lineAt(this.scaler.fromDOM(e),i7.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return k7(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class O7{constructor(e,t){this.from=e,this.to=t}}function w7(e,t,n){let o=[],r=e,i=0;return j4.spans(n,e,t,{span(){},point(e,t){e>r&&(o.push({from:r,to:e}),i+=e-r),r=t}},20),r=1)return t[t.length-1].to;let o=Math.floor(e*n);for(let r=0;;r++){let{from:e,to:n}=t[r],i=n-e;if(o<=i)return e+o;o-=i}}function $7(e,t){let n=0;for(let{from:o,to:r}of e.ranges){if(t<=r){n+=t-o;break}n+=r-o}return n/e.total}const S7={toDOM:e=>e,fromDOM:e=>e,scale:1};class C7{constructor(e,t,n){let o=0,r=0,i=0;this.viewports=n.map((({from:n,to:r})=>{let i=t.lineAt(n,i7.ByPos,e,0,0).top,l=t.lineAt(r,i7.ByPos,e,0,0).bottom;return o+=l-i,{from:n,to:r,top:i,bottom:l,domTop:0,domBottom:0}})),this.scale=(7e6-o)/(t.height-o);for(let l of this.viewports)l.domTop=i+(l.top-r)*this.scale,i=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,n=0,o=0;;t++){let r=tk7(e,t))):e._content)}const P7=Q3.define({combine:e=>e.join(" ")}),T7=Q3.define({combine:e=>e.indexOf(!0)>-1}),M7=q4.newName(),I7=q4.newName(),E7=q4.newName(),A7={"&light":"."+I7,"&dark":"."+E7};function R7(e,t,n){return new q4(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]})):e+" "+t})}const D7=R7("."+M7,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},A7),j7="￿";class B7{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(M4.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=j7}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let o=e;;){this.findPointBefore(n,o);let e=this.text.length;this.readNode(o);let r=o.nextSibling;if(r==t)break;let i=T5.get(o),l=T5.get(r);(i&&l?i.breakAfter:(i?i.breakAfter:z7(o))||z7(r)&&("BR"!=o.nodeName||o.cmIgnore)&&this.text.length>e)&&this.lineBreak(),o=r}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,o=this.lineSeparator?null:/\r\n?|\n/g;;){let r,i=-1,l=1;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),l=this.lineSeparator.length):(r=o.exec(t))&&(i=r.index,l=r[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),l>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=l-1);n=i+l}}readNode(e){if(e.cmIgnore)return;let t=T5.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(N7(e,n.node,n.offset)?t:0))}}function N7(e,t,n){for(;;){if(!t||n-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let t=r||i?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}=e.observer.selectionRange;return n&&(t.push(new _7(n,o)),r==n&&i==o||t.push(new _7(r,i))),t}(e),n=new B7(t,e.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,o=2==e.length?e[1].pos:n;return n>-1&&o>-1?z3.single(n+t,o+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!s5(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),o=i&&i.node==t.anchorNode&&i.offset==t.anchorOffset||!s5(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),l=e.viewport;if(W5.ios&&e.state.selection.main.empty&&n!=o&&(l.from>0||l.toDate.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=r.from,s=null;(8===i||W5.android&&t.text.length0&&a>0&&e.charCodeAt(l-1)==t.charCodeAt(a-1);)l--,a--;return"end"==o&&(n-=l+Math.max(0,i-Math.min(l,a))-i),l=l?i-n:0,a=i+(a-l),l=i):a=a?i-n:0,l=i+(l-a),a=i),{from:i,toA:l,toB:a}}(e.state.doc.sliceString(o,l,j7),t.text,a-o,s);c&&(W5.chrome&&13==i&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==j7+j7&&c.toB--,n={from:o+c.from,to:o+c.toA,insert:l3.of(t.text.slice(c.from,c.toB).split(j7))})}else o&&(!e.hasFocus&&e.state.facet(X8)||o.main.eq(r))&&(o=null);if(!n&&!o)return!1;if(!n&&t.typeOver&&!r.empty&&o&&o.main.empty?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,r.to)}:n&&n.from>=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,r.to))}:(W5.mac||W5.android)&&n&&n.from==n.to&&n.from==r.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(o&&2==n.insert.length&&(o=z3.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:l3.of([" "])}):W5.chrome&&n&&n.from==n.to&&n.from==r.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(o&&(o=z3.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:l3.of([" "])}),n){if(W5.ios&&e.inputState.flushIOSKey())return!0;if(W5.android&&(n.from==r.from&&n.to==r.to&&1==n.insert.length&&2==n.insert.lines&&$5(e.contentDOM,"Enter",13)||(n.from==r.from-1&&n.to==r.to&&0==n.insert.length||8==i&&n.insert.lengthr.head)&&$5(e.contentDOM,"Backspace",8)||n.from==r.from&&n.to==r.to+1&&0==n.insert.length&&$5(e.contentDOM,"Delete",46)))return!0;let t,l=n.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>t||(t=function(e,t,n){let o,r=e.state,i=r.selection.main;if(t.from>=i.from&&t.to<=i.to&&t.to-t.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=i.fromt.to?r.sliceDoc(t.to,i.to):"";o=r.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+l))}else{let l=r.changes(t),a=n&&n.main.to<=l.newLength?n.main:void 0;if(r.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=i.to&&t.to>=i.to-10){let s,c=e.state.sliceDoc(t.from,t.to),u=n&&p6(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);s={from:u.from,to:u.to-e}}else s=e.state.doc.lineAt(i.head);let d=i.to-t.to,p=i.to-i.from;o=r.changeByRange((n=>{if(n.from==i.from&&n.to==i.to)return{changes:l,range:a||n.map(l)};let o=n.to-d,u=o-c.length;if(n.to-n.from!=p||e.state.sliceDoc(u,o)!=c||n.to>=s.from&&n.from<=s.to)return{range:n};let h=r.changes({from:u,to:o,insert:t.insert}),f=n.to-i.to;return{changes:h,range:a?z3.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):n.map(h)}}))}else o={changes:l,selection:a&&r.selection.replaceRange(a)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(o,{userEvent:l,scrollIntoView:!0})}(e,n,o));return e.state.facet(L8).some((t=>t(e,n.from,n.to,l,a)))||e.dispatch(a()),!0}if(o&&!o.main.eq(r)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:o,scrollIntoView:t,userEvent:n}),!0}return!1}const H7={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},F7=W5.ie&&W5.ie_version<=11;class W7{constructor(e){this.view=e,this.active=!1,this.selectionRange=new b5,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((t=>{for(let e of t)this.queue.push(e);(W5.ie&&W5.ie_version<=11||W5.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),F7&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some(((t,n)=>t!=e[n])))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,o=this.selectionRange;if(n.state.facet(X8)?n.root.activeElement!=this.dom:!c5(n.dom,o))return;let r=o.anchorNode&&n.docView.nearest(o.anchorNode);r&&r.ignoreEvent(e)?t||(this.selectionChanged=!1):(W5.ie&&W5.ie_version<=11||W5.android&&W5.chrome)&&!n.state.selection.main.empty&&o.focusNode&&d5(o.focusNode,o.focusOffset,o.anchorNode,o.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=W5.safari&&11==e.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e){let t=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",n,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),!t)return null;let o=t.startContainer,r=t.startOffset,i=t.endContainer,l=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor);return d5(a.node,a.offset,i,l)&&([o,r,i,l]=[i,l,o,r]),{anchorNode:o,anchorOffset:r,focusNode:i,focusOffset:l}}(this.view)||a5(e.root);if(!t||this.selectionRange.eq(t))return!1;let n=c5(this.dom,t);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&$5(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,o=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(o=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:o}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),o=this.selectionChanged&&c5(this.dom,this.selectionRange);if(e<0&&!o)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new L7(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,o=Q7(this.view,t);return this.view.state==n&&this.view.update([]),o}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){let n=V7(t,e.previousSibling||e.target.previousSibling,-1),o=V7(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:o?t.posBefore(o):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let o of this.scrollTargets)o.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function V7(e,t,n){for(;t;){let o=T5.get(t);if(o&&o.parent==e)return o;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}class Z7{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach((e=>t(e,this))))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new y7(e.state||M4.create(e)),e.scrollTo&&e.scrollTo.is(V8)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(K8).map((e=>new U8(e)));for(let n of this.plugins)n.update(this);this.observer=new W7(this),this.inputState=new T6(this),this.inputState.ensureHandlers(this.plugins),this.docView=new u6(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=1==e.length&&e[0]instanceof b4?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,o=!1,r=this.state;for(let d of e){if(d.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=d.state}if(this.destroyed)return void(this.viewState.state=r);let i=this.hasFocus,l=0,a=null;e.some((e=>e.annotation(U6)))?(this.inputState.notifiedFocused=i,l=1):i!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=i,a=q6(r,i),a||(l=1));let s=this.observer.delayedAndroidKey,c=null;if(s?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(M4.phrases)!=this.state.facet(M4.phrases))return this.setState(r);t=c6.create(this,r,e),t.flags|=l;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;u=new W8(e.empty?e:z3.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(V8)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=K7.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(a6)!=this.styleModules&&this.mountStyles(),o=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(P7)!=t.state.facet(P7)&&(this.viewState.mustMeasureContent=!0),(n||o||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!t.empty)for(let d of this.state.facet(_8))try{d(t)}catch(Rpe){Z8(this.state,Rpe,"update listener")}(a||c)&&Promise.resolve().then((()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Q7(this,c)&&s.force&&$5(this.contentDOM,s.key,s.keyCode)}))}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new y7(e),this.plugins=e.facet(K8).map((e=>new U8(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new u6(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(K8),n=e.state.facet(K8);if(t!=n){let o=[];for(let r of n){let n=t.indexOf(r);if(n<0)o.push(new U8(r));else{let t=this.plugins[n];t.mustUpdate=e,o.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=o,this.pluginMap.clear()}else for(let o of this.plugins)o.mustUpdate=e;for(let o=0;o-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,o=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:i}=this.viewState;Math.abs(o-this.viewState.scrollTop)>1&&(i=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(i<0)if(C5(n))r=-1,i=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(o);r=e.from,i=e.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5)break;let a=[];4&l||([this.measureRequests,a]=[a,this.measureRequests]);let s=a.map((e=>{try{return e.read(this)}catch(Rpe){return Z8(this.state,Rpe),Y7}})),c=c6.create(this,this.state,[]),u=!1;c.flags|=l,t?t.flags|=l:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c));for(let e=0;e1||e<-1){o+=e,n.scrollTop=o/this.scaleY,i=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(_8))l(t)}get themeClasses(){return M7+" "+(this.state.facet(T7)?E7:I7)+" "+this.state.facet(P7)}updateAttrs(){let e=G7(this,q8,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(X8)?"true":"false",class:"cm-content",style:`${W5.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),G7(this,J8,t);let n=this.observer.ignore((()=>{let n=t8(this.contentDOM,this.contentAttrs,t),o=t8(this.dom,this.editorAttrs,e);return n||o}));return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(Z7.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(a6);let e=this.state.facet(Z7.cspNonce);q4.mount(this.root,this.styleModules.concat(D7).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(let t=0;tt.spec==e))||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return P6(this,e,C6(this,e,t,n))}moveByGroup(e,t){return P6(this,e,C6(this,e,t,(t=>function(e,t,n){let o=e.state.charCategorizer(t),r=o(n);return e=>{let t=o(e);return r==C4.Space&&(r=t),r==t}}(this,e.head,t))))}visualLineSide(e,t){let n=this.bidiSpans(e),o=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return z3.cursor(r.side(t,o)+e.from,r.forward(!t,o)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,o){let r=S6(e,t.head),i=o&&r.type==l8.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(i){let t=e.dom.getBoundingClientRect(),o=e.textDirectionAt(r.from),l=e.posAtCoords({x:n==(o==m8.LTR)?t.right-1:t.left+1,y:(i.top+i.bottom)/2});if(null!=l)return z3.cursor(l,n?-1:1)}return z3.cursor(n?r.to:r.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return P6(this,e,function(e,t,n,o){let r=t.head,i=n?1:-1;if(r==(n?e.state.doc.length:0))return z3.cursor(r,t.assoc);let l,a=t.goalColumn,s=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(r,t.assoc||-1),u=e.documentTop;if(c)null==a&&(a=c.left-s.left),l=i<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(r);null==a&&(a=Math.min(s.right-s.left,e.defaultCharacterWidth*(r-t.from))),l=(i<0?t.top:t.bottom)+u}let d=s.left+a,p=null!=o?o:e.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let t=l+(p+h)*i,n=x6(e,{x:d,y:t},!1,i);if(ts.bottom||(i<0?nr)){let o=e.docView.coordsForChar(n),r=!o||t0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(H8)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>X7)return E8(e.length);let t,n=this.textDirectionAt(e.from);for(let r of this.bidiCache)if(r.from==e.from&&r.dir==n&&(r.fresh||P8(r.isolates,t=r6(this,e))))return r.order;t||(t=r6(this,e));let o=function(e,t,n){if(!e)return[new k8(0,0,t==b8?1:0)];if(t==v8&&!n.length&&!C8.test(e))return E8(e.length);if(n.length)for(;e.length>T8.length;)T8[T8.length]=256;let o=[],r=t==v8?0:1;return I8(e,r,r,n,0,e.length,o),o}(e.text,n,t);return this.bidiCache.push(new K7(e.from,e.to,n,t,!0,o)),o}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||W5.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{w5(this.contentDOM),this.docView.updateSelection()}))}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return V8.of(new W8("number"==typeof e?z3.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return V8.of(new W8(z3.cursor(n.from),"start","start",n.top-e,t,!0))}static domEventHandlers(e){return G8.define((()=>({})),{eventHandlers:e})}static domEventObservers(e){return G8.define((()=>({})),{eventObservers:e})}static theme(e,t){let n=q4.newName(),o=[P7.of(n),a6.of(R7(`.${n}`,e))];return t&&t.dark&&o.push(T7.of(!0)),o}static baseTheme(e){return e4.lowest(a6.of(R7("."+M7,e,A7)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),o=n&&T5.get(n)||T5.get(e);return(null===(t=null==o?void 0:o.rootView)||void 0===t?void 0:t.view)||null}}Z7.styleModule=a6,Z7.inputHandler=L8,Z7.focusChangeEffect=Q8,Z7.perLineTextDirection=H8,Z7.exceptionSink=z8,Z7.updateListener=_8,Z7.editable=X8,Z7.mouseSelectionStyle=N8,Z7.dragMovesSelection=B8,Z7.clickAddsSelectionRange=j8,Z7.decorations=e6,Z7.outerDecorations=t6,Z7.atomicRanges=n6,Z7.bidiIsolatedRanges=o6,Z7.scrollMargins=i6,Z7.darkTheme=T7,Z7.cspNonce=Q3.define({combine:e=>e.length?e[0]:""}),Z7.contentAttributes=J8,Z7.editorAttributes=q8,Z7.lineWrapping=Z7.contentAttributes.of({class:"cm-lineWrapping"}),Z7.announce=v4.define();const X7=4096,Y7={};class K7{constructor(e,t,n,o,r,i){this.from=e,this.to=t,this.dir=n,this.isolates=o,this.fresh=r,this.order=i}static update(e,t){if(t.empty&&!e.some((e=>e.fresh)))return e;let n=[],o=e.length?e[e.length-1].dir:m8.LTR;for(let r=Math.max(0,e.length-10);r=0;r--){let t=o[r],i="function"==typeof t?t(e):t;i&&q5(i,n)}return n}const U7=W5.mac?"mac":W5.windows?"win":W5.linux?"linux":"key";function q7(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const J7=e4.default(Z7.domEventHandlers({keydown:(e,t)=>r9(n9(t.state),e,t,"editor")})),e9=Q3.define({enables:J7}),t9=new WeakMap;function n9(e){let t=e.facet(e9),n=t9.get(t);return n||t9.set(t,n=function(e,t=U7){let n=Object.create(null),o=Object.create(null),r=(e,t)=>{let n=o[e];if(null==n)o[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},i=(e,o,i,l,a)=>{var s,c;let u=n[e]||(n[e]=Object.create(null)),d=o.split(/ (?!$)/).map((e=>function(e,t){const n=e.split(/-(?!$)/);let o,r,i,l,a=n[n.length-1];"Space"==a&&(a=" ");for(let s=0;s{let o=o9={view:t,prefix:n,scope:e};return setTimeout((()=>{o9==o&&(o9=null)}),4e3),!0}]})}let p=d.join(" ");r(p,!1);let h=u[p]||(u[p]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(s=u._any)||void 0===s?void 0:s.run)||void 0===c?void 0:c.slice())||[]});i&&h.run.push(i),l&&(h.preventDefault=!0),a&&(h.stopPropagation=!0)};for(let l of e){let e=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let t in e)e[t].run.push(l.any)}let o=l[t]||l.key;if(o)for(let t of e)i(t,o,l.run,l.preventDefault,l.stopPropagation),l.shift&&i(t,"Shift-"+o,l.shift,l.preventDefault,l.stopPropagation)}return n}(t.reduce(((e,t)=>e.concat(t)),[]))),n}let o9=null;function r9(e,t,n,o){let r=function(e){var t=!(o5&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||r5&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?n5:t5)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),i=k3(S3(r,0))==r.length&&" "!=r,l="",a=!1,s=!1,c=!1;o9&&o9.view==n&&o9.scope==o&&(l=o9.prefix+" ",A6.indexOf(t.keyCode)<0&&(s=!0,o9=null));let u,d,p=new Set,h=e=>{if(e){for(let o of e.run)if(!p.has(o)&&(p.add(o),o(n,t)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),s=!0)}return!1},f=e[o];return f&&(h(f[l+q7(r,t,!i)])?a=!0:i&&(t.altKey||t.metaKey||t.ctrlKey)&&!(W5.windows&&t.ctrlKey&&t.altKey)&&(u=t5[t.keyCode])&&u!=r?(h(f[l+q7(u,t,!0)])||t.shiftKey&&(d=n5[t.keyCode])!=r&&d!=u&&h(f[l+q7(d,t,!1)]))&&(a=!0):i&&t.shiftKey&&h(f[l+q7(r,t,!0)])&&(a=!0),!a&&h(f._any)&&(a=!0)),s&&(a=!0),a&&c&&t.stopPropagation(),a}class i9{constructor(e,t,n,o,r){this.className=e,this.left=t,this.top=n,this.width=o,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let o=e.coordsAtPos(n.head,n.assoc||1);if(!o)return[];let r=l9(e);return[new i9(t,o.left-r.left,o.top-r.top,null,o.bottom-o.top)]}return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let o=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),i=e.textDirection==m8.LTR,l=e.contentDOM,a=l.getBoundingClientRect(),s=l9(e),c=l.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),d=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),p=a.right-(u?parseInt(u.paddingRight):0),h=S6(e,o),f=S6(e,r),g=h.type==l8.Text?h:null,m=f.type==l8.Text?f:null;if(g&&(e.lineWrapping||h.widgetLineBreaks)&&(g=a9(e,o,g)),m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=a9(e,r,m)),g&&m&&g.from==m.from)return b(y(n.from,n.to,g));{let t=g?y(n.from,null,g):O(h,!1),o=m?y(null,n.to,m):O(f,!0),r=[];return(g||h).to<(m||f).from-(g&&m?1:0)||h.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2c&&i.from=r)break;a>o&&s(Math.max(e,o),null==t&&e<=c,Math.min(a,r),null==n&&a>=u,l.dir)}if(o=i.to+1,o>=r)break}return 0==a.length&&s(c,null==t,u,null==n,e.textDirection),{top:r,bottom:l,horizontal:a}}function O(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n)}}function l9(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==m8.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function a9(e,t,n){let o=z3.cursor(t);return{from:Math.max(n.from,e.moveToLineBoundary(o,!1,!0).from),to:Math.min(n.to,e.moveToLineBoundary(o,!0,!0).from),type:l8.Text}}class s9{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(c9)!=e.state.facet(c9)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,n=e.facet(c9);for(;t{return n=e,o=this.drawn[t],!(n.constructor==o.constructor&&n.eq(o));var n,o}))){let t=this.dom.firstChild,n=0;for(let o of e)o.update&&t&&o.constructor&&this.drawn[n].constructor&&o.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(o.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const c9=Q3.define();function u9(e){return[G8.define((t=>new s9(t,e))),c9.of(e)]}const d9=!W5.ios,p9=Q3.define({combine:e=>I4(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function h9(e={}){return[p9.of(e),g9,v9,y9,F8.of(!0)]}function f9(e){return e.startState.facet(p9)!=e.state.facet(p9)}const g9=u9({above:!0,markers(e){let{state:t}=e,n=t.facet(p9),o=[];for(let r of t.selection.ranges){let i=r==t.selection.main;if(r.empty?!i||d9:n.drawRangeCursor){let t=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=r.empty?r:z3.cursor(r.head,r.head>r.anchor?-1:1);for(let r of i9.forRange(e,t,n))o.push(r)}}return o},update(e,t){e.transactions.some((e=>e.selection))&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=f9(e);return n&&m9(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){m9(t.state,e)},class:"cm-cursorLayer"});function m9(e,t){t.style.animationDuration=e.facet(p9).cursorBlinkRate+"ms"}const v9=u9({above:!1,markers:e=>e.state.selection.ranges.map((t=>t.empty?[]:i9.forRange(e,"cm-selectionBackground",t))).reduce(((e,t)=>e.concat(t))),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||f9(e),class:"cm-selectionLayer"}),b9={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};d9&&(b9[".cm-line"].caretColor="transparent !important",b9[".cm-content"]={caretColor:"transparent !important"});const y9=e4.highest(Z7.theme(b9)),O9=v4.define({map:(e,t)=>null==e?null:t.mapPos(e)}),w9=Y3.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce(((e,t)=>t.is(O9)?t.value:e),e))}),x9=G8.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(w9);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(w9)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(w9),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let o=e.scrollDOM.getBoundingClientRect();return{left:n.left-o.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-o.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(w9)!=e&&this.view.dispatch({effects:O9.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function $9(e,t,n,o,r){t.lastIndex=0;for(let i,l=e.iterRange(n,o),a=n;!l.next().done;a+=l.value.length)if(!l.lineBreak)for(;i=t.exec(l.value);)r(a+i.index,i)}class S9{constructor(e){const{regexp:t,decoration:n,decorate:o,boundary:r,maxLength:i=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,o)this.addMatch=(e,t,n,r)=>o(r,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,o,r)=>{let i=n(e,t,o);i&&r(o,o+e[0].length,i)};else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(e,t,o,r)=>r(o,o+e[0].length,n)}this.boundary=r,this.maxLength=i}createDeco(e){let t=new B4,n=t.add.bind(t);for(let{from:o,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let o=[];for(let{from:r,to:i}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),i=Math.min(e.state.doc.lineAt(i).to,i+t),o.length&&o[o.length-1].to>=r?o[o.length-1].to=i:o.push({from:r,to:i});return o}(e,this.maxLength))$9(e.state.doc,this.regexp,o,r,((t,o)=>this.addMatch(o,e,t,n)));return t.finish()}updateDeco(e,t){let n=1e9,o=-1;return e.docChanged&&e.changes.iterChanges(((t,r,i,l)=>{l>e.view.viewport.from&&i1e3?this.createDeco(e.view):o>-1?this.updateRange(e.view,t.map(e.changes),n,o):t}updateRange(e,t,n,o){for(let r of e.visibleRanges){let i=Math.max(r.from,n),l=Math.min(r.to,o);if(l>i){let n=e.state.doc.lineAt(i),o=n.ton.from;i--)if(this.boundary.test(n.text[i-1-n.from])){a=i;break}for(;lu.push(n.range(e,t));if(n==o)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.indexthis.addMatch(n,e,t,d)));t=t.update({filterFrom:a,filterTo:s,filter:(e,t)=>es,add:u})}}return t}}const C9=null!=/x/.unicode?"gu":"g",k9=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",C9),P9={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let T9=null;const M9=Q3.define({combine(e){let t=I4(e,{render:null,specialChars:k9,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==T9&&"undefined"!=typeof document&&document.body){let t=document.body.style;T9=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return T9||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,C9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,C9)),t}});function I9(e={}){return[M9.of(e),E9||(E9=G8.fromClass(class{constructor(e){this.view=e,this.decorations=a8.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(M9)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new S9({regexp:e.specialChars,decoration:(t,n,o)=>{let{doc:r}=n.state,i=S3(t[0],0);if(9==i){let e=r.lineAt(o),t=n.state.tabSize,i=X4(e.text,t,o-e.from);return a8.replace({widget:new R9((t-i%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=a8.replace({widget:new A9(e,i)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(M9);e.startState.facet(M9)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}let E9=null;class A9 extends i8{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=(n=this.code)>=32?"•":10==n?"␤":String.fromCharCode(9216+n);var n;let o=e.state.phrase("Control character")+" "+(P9[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,o,t);if(r)return r;let i=document.createElement("span");return i.textContent=t,i.title=o,i.setAttribute("aria-label",o),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class R9 extends i8{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const D9=a8.line({class:"cm-activeLine"}),j9=G8.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let o of e.state.selection.ranges){let r=e.lineBlockAt(o.head);r.from>t&&(n.push(D9.range(r.from)),t=r.from)}return a8.set(n)}},{decorations:e=>e.decorations});class B9 extends i8{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?u5(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),o=g5(t[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return o.bottom-o.top>1.5*r?{left:o.left,right:o.right,top:o.top,bottom:o.top+r}:o}ignoreEvent(){return!1}}const N9=2e3;function z9(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(n),r=n-o.from,i=r>N9?-1:r==o.length?function(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):X4(o.text,e.state.tabSize,n-o.from);return{line:o.number,col:i,off:r}}function _9(e,t){let n=z9(e,t),o=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),r=e.state.doc.lineAt(t);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},o=o.map(e.changes)}},get(t,r,i){let l=z9(e,t);if(!l)return o;let a=function(e,t,n){let o=Math.min(t.line,n.line),r=Math.max(t.line,n.line),i=[];if(t.off>N9||n.off>N9||t.col<0||n.col<0){let l=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let t=o;t<=r;t++){let n=e.doc.line(t);n.length<=a&&i.push(z3.range(n.from+l,n.to+a))}}else{let l=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let t=o;t<=r;t++){let n=e.doc.line(t),o=Y4(n.text,l,e.tabSize,!0);if(o<0)i.push(z3.cursor(n.to));else{let t=Y4(n.text,a,e.tabSize);i.push(z3.range(n.from+o,n.from+t))}}}return i}(e.state,n,l);return a.length?i?z3.create(a.concat(o.ranges)):z3.create(a):o}}:null}function L9(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return Z7.mouseSelectionStyle.of(((e,n)=>t(n)?_9(e,n):null))}const Q9={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},H9={style:"cursor: crosshair"};function F9(e={}){let[t,n]=Q9[e.key||"Alt"],o=G8.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[o,Z7.contentAttributes.of((e=>{var t;return(null===(t=e.plugin(o))||void 0===t?void 0:t.isDown)?H9:null}))]}const W9="-10000px";class V9{constructor(e,t,n){this.facet=t,this.createTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e)),this.tooltipViews=this.tooltips.map(n)}update(e,t){var n;let o=e.state.facet(this.facet),r=o.filter((e=>e));if(o===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let i=[],l=t?[]:null;for(let a=0;at[n]=e)),t.length=l.length),this.input=o,this.tooltips=r,this.tooltipViews=i,!0}}function Z9(e){let{win:t}=e;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const X9=Q3.define({combine:e=>{var t,n,o;return{position:W5.ios?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find((e=>e.parent)))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(o=e.find((e=>e.tooltipSpace)))||void 0===o?void 0:o.tooltipSpace)||Z9}}}),Y9=new WeakMap,K9=G8.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(X9);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new V9(e,q9,(e=>this.createTooltip(e))),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,o=e.state.facet(X9);if(o.position!=this.position&&!this.madeAbsolute){this.position=o.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(o.parent!=this.parent){this.parent&&this.container.remove(),this.parent=o.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e){let t=e.create(this.view);if(t.dom.classList.add("cm-tooltip"),e.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",t.dom.appendChild(e)}return t.dom.style.position=this.position,t.dom.style.top=W9,t.dom.style.left="0px",this.container.appendChild(t.dom),t.mount&&t.mount(this.view),t}destroy(){var e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),null===(e=n.destroy)||void 0===e||e.call(n);this.parent&&this.container.remove(),null===(t=this.intersectionObserver)||void 0===t||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect(),t=1,n=1,o=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(W5.gecko)o=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==W9&&"0px"==e.style.left){let t=e.getBoundingClientRect();o=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(o||"absolute"==this.position)if(this.parent){let e=this.parent.getBoundingClientRect();e.width&&e.height&&(t=e.width/this.parent.offsetWidth,n=e.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:n}=this.view.viewState);return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map(((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(X9).tooltipSpace(this.view),scaleX:t,scaleY:n,makeAbsolute:o}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{editor:n,space:o,scaleX:r,scaleY:i}=e,l=[];for(let a=0;a=Math.min(n.bottom,o.bottom)||d.rightMath.min(n.right,o.right)+.1){u.style.top=W9;continue}let h=s.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,f=h?7:0,g=p.right-p.left,m=null!==(t=Y9.get(c))&&void 0!==t?t:p.bottom-p.top,v=c.offset||U9,b=this.view.textDirection==m8.LTR,y=p.width>o.right-o.left?b?o.left:o.right-p.width:b?Math.min(d.left-(h?14:0)+v.x,o.right-g):Math.max(o.left,d.left-g+(h?14:0)-v.x),O=this.above[a];!s.strictSide&&(O?d.top-(p.bottom-p.top)-v.yo.bottom)&&O==o.bottom-d.bottom>d.top-o.top&&(O=this.above[a]=!O);let w=(O?d.top-o.top:o.bottom-d.bottom)-f;if(wy&&e.topx&&(x=O?e.top-m-2-f:e.bottom+f+2);if("absolute"==this.position?(u.style.top=(x-e.parent.top)/i+"px",u.style.left=(y-e.parent.left)/r+"px"):(u.style.top=x/i+"px",u.style.left=y/r+"px"),h){let e=d.left+(b?v.x:-v.x)-(y+14-7);h.style.left=e/r+"px"}!0!==c.overlap&&l.push({left:y,top:x,right:$,bottom:x+m}),u.classList.toggle("cm-tooltip-above",O),u.classList.toggle("cm-tooltip-below",!O),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=W9}},{eventObservers:{scroll(){this.maybeMeasure()}}}),G9=Z7.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),U9={x:0,y:0},q9=Q3.define({enables:[K9,G9]}),J9=Q3.define();class eee{static create(e){return new eee(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new V9(e,J9,(e=>this.createHostedView(e)))}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let o=n[e];if(void 0!==o)if(void 0===t)t=o;else if(t!==o)return}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const tee=q9.compute([J9],(e=>{let t=e.facet(J9).filter((e=>e));return 0===t.length?null:{pos:Math.min(...t.map((e=>e.pos))),end:Math.max(...t.map((e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos}))),create:eee.create,above:t[0].above,arrow:t.some((e=>e.arrow))}}));class nee{constructor(e,t,n,o,r){this.view=e,this.source=t,this.field=n,this.setHover=o,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((()=>this.startHover()),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;en.bottom||t.xn.right+e.defaultCharacterWidth)return;let i=e.bidiSpans(e.state.doc.lineAt(o)).find((e=>e.from<=o&&e.to>=o)),l=i&&i.dir==m8.RTL?-1:1;r=t.x{this.pending==t&&(this.pending=null,n&&e.dispatch({effects:this.setHover.of(n)}))}),(t=>Z8(e.state,t,"hover tooltip")))}else i&&e.dispatch({effects:this.setHover.of(i)})}get tooltip(){let e=this.view.plugin(K9),t=e?e.manager.tooltips.findIndex((e=>e.create==eee.create)):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:n,tooltip:o}=this;if(n&&o&&!function(e,t){let n=e.getBoundingClientRect();return t.clientX>=n.left-4&&t.clientX<=n.right+4&&t.clientY>=n.top-4&&t.clientY<=n.bottom+4}(o.dom,e)||this.pending){let{pos:o}=n||this.pending,r=null!==(t=null==n?void 0:n.end)&&void 0!==t?t:o;(o==r?this.view.posAtCoords(this.lastMove)==o:function(e,t,n,o,r,i){let l=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(l.left>o||l.rightr||Math.min(l.bottom,a)=t&&s<=n}(this.view,o,r,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of(null)})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function oee(e,t={}){let n=v4.define(),o=Y3.define({create:()=>null,update(e,o){if(e&&(t.hideOnChange&&(o.docChanged||o.selection)||t.hideOn&&t.hideOn(o,e)))return null;if(e&&o.docChanged){let t=o.changes.mapPos(e.pos,-1,T3.TrackDel);if(null==t)return null;let n=Object.assign(Object.create(null),e);n.pos=t,null!=e.end&&(n.end=o.changes.mapPos(e.end)),e=n}for(let t of o.effects)t.is(n)&&(e=t.value),t.is(iee)&&(e=null);return e},provide:e=>J9.from(e)});return[o,G8.define((r=>new nee(r,e,o,n,t.hoverTime||300))),tee]}function ree(e,t){let n=e.plugin(K9);if(!n)return null;let o=n.manager.tooltips.indexOf(t);return o<0?null:n.manager.tooltipViews[o]}const iee=v4.define(),lee=Q3.define({combine(e){let t,n;for(let o of e)t=t||o.topContainer,n=n||o.bottomContainer;return{topContainer:t,bottomContainer:n}}});function aee(e,t){let n=e.plugin(see),o=n?n.specs.indexOf(t):-1;return o>-1?n.panels[o]:null}const see=G8.fromClass(class{constructor(e){this.input=e.state.facet(dee),this.specs=this.input.filter((e=>e)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(lee);this.top=new cee(e,!0,t.topContainer),this.bottom=new cee(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(lee);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new cee(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new cee(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(dee);if(n!=this.input){let t=n.filter((e=>e)),o=[],r=[],i=[],l=[];for(let n of t){let t,a=this.specs.indexOf(n);a<0?(t=n(e.view),l.push(t)):(t=this.panels[a],t.update&&t.update(e)),o.push(t),(t.top?r:i).push(t)}this.specs=t,this.panels=o,this.top.sync(r),this.bottom.sync(i);for(let e of l)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let o of this.panels)o.update&&o.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Z7.scrollMargins.of((t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}}))});class cee{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=uee(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=uee(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function uee(e){let t=e.nextSibling;return e.remove(),t}const dee=Q3.define({enables:see});class pee extends E4{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}pee.prototype.elementClass="",pee.prototype.toDOM=void 0,pee.prototype.mapMode=T3.TrackBefore,pee.prototype.startSide=pee.prototype.endSide=-1,pee.prototype.point=!0;const hee=Q3.define(),fee={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>j4.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},gee=Q3.define();function mee(e){return[bee(),gee.of(Object.assign(Object.assign({},fee),e))]}const vee=Q3.define({combine:e=>e.some((e=>e))});function bee(e){let t=[yee];return e&&!1===e.fixed&&t.push(vee.of(!0)),t}const yee=G8.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(gee).map((t=>new $ee(e,t)));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!e.state.facet(vee),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,o=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(o<.8*(n.to-n.from))}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(vee)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let n=j4.iter(this.view.state.facet(hee),this.view.viewport.from),o=[],r=this.gutters.map((e=>new xee(e,this.view.viewport,-this.view.documentPadding.top)));for(let i of this.view.viewportLineBlocks)if(o.length&&(o=[]),Array.isArray(i.type)){let e=!0;for(let t of i.type)if(t.type==l8.Text&&e){wee(n,o,t.from);for(let e of r)e.line(this.view,t,o);e=!1}else if(t.widget)for(let e of r)e.widget(this.view,t)}else if(i.type==l8.Text){wee(n,o,i.from);for(let e of r)e.line(this.view,i,o)}else if(i.widget)for(let e of r)e.widget(this.view,i);for(let i of r)i.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(gee),n=e.state.facet(gee),o=e.docChanged||e.heightChanged||e.viewportChanged||!j4.eq(e.startState.facet(hee),e.state.facet(hee),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(o=!0);else{o=!0;let r=[];for(let o of n){let n=t.indexOf(o);n<0?r.push(new $ee(this.view,o)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),r.indexOf(e)<0&&e.destroy();for(let e of r)this.dom.appendChild(e.dom);this.gutters=r}return o}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>Z7.scrollMargins.of((t=>{let n=t.plugin(e);return n&&0!=n.gutters.length&&n.fixed?t.textDirection==m8.LTR?{left:n.dom.offsetWidth*t.scaleX}:{right:n.dom.offsetWidth*t.scaleX}:null}))});function Oee(e){return Array.isArray(e)?e:[e]}function wee(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class xee{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=j4.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:o}=this,r=(t.top-this.height)/e.scaleY,i=t.height/e.scaleY;if(this.i==o.elements.length){let t=new See(e,i,r,n);o.elements.push(t),o.dom.appendChild(t.dom)}else o.elements[this.i].update(e,i,r,n);this.height=t.bottom,this.i++}line(e,t,n){let o=[];wee(this.cursor,o,t.from),n.length&&(o=o.concat(n));let r=this.gutter.config.lineMarker(e,t,o);r&&o.unshift(r);let i=this.gutter;(0!=o.length||i.config.renderEmptyElements)&&this.addElement(e,t,o)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class $ee{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,(o=>{let r,i=o.target;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();r=(e.top+e.bottom)/2}else r=o.clientY;let l=e.lineBlockAtHeight(r-e.documentTop);t.domEventHandlers[n](e,l,o)&&o.preventDefault()}));this.markers=Oee(t.markers(e)),t.initialSpacer&&(this.spacer=new See(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Oee(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!j4.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class See{constructor(e,t,n,o){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,o)}update(e,t,n,o){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;nI4(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let o in t){let e=n[o],r=t[o];n[o]=e?(t,n,o)=>e(t,n,o)||r(t,n,o):r}return n}})});class Pee extends pee{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Tee(e,t){return e.state.facet(kee).formatNumber(t,e.state)}const Mee=gee.compute([kee],(e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(Cee),lineMarker:(e,t,n)=>n.some((e=>e.toDOM))?null:new Pee(Tee(e,e.state.doc.lineAt(t.from).number)),widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(kee)!=e.state.facet(kee),initialSpacer:e=>new Pee(Tee(e,Eee(e.state.doc.lines))),updateSpacer(e,t){let n=Tee(t.view,Eee(t.view.state.doc.lines));return n==e.number?e:new Pee(n)},domEventHandlers:e.facet(kee).domEventHandlers})));function Iee(e={}){return[kee.of(e),bee(),Mee]}function Eee(e){let t=9;for(;t{let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.head).from;r>n&&(n=r,t.push(Aee.range(r)))}return j4.of(t)})),Dee=1024;let jee=0,Bee=class{constructor(e,t){this.from=e,this.to=t}};class Nee{constructor(e={}){this.id=jee++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=Lee.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}Nee.closedBy=new Nee({deserialize:e=>e.split(" ")}),Nee.openedBy=new Nee({deserialize:e=>e.split(" ")}),Nee.group=new Nee({deserialize:e=>e.split(" ")}),Nee.isolate=new Nee({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),Nee.contextHash=new Nee({perNode:!0}),Nee.lookAhead=new Nee({perNode:!0}),Nee.mounted=new Nee({perNode:!0});class zee{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Nee.mounted.id]}}const _ee=Object.create(null);class Lee{constructor(e,t,n,o=0){this.name=e,this.props=t,this.id=n,this.flags=o}static define(e){let t=e.props&&e.props.length?Object.create(null):_ee,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),o=new Lee(e.name||"",t,e.id,n);if(e.props)for(let r of e.props)if(Array.isArray(r)||(r=r(o)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}return o}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(Nee.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let o of n.split(" "))t[o]=e[n];return e=>{for(let n=e.prop(Nee.group),o=-1;o<(n?n.length:0);o++){let r=t[o<0?e.name:n[o]];if(r)return r}}}}Lee.none=new Lee("",Object.create(null),0,8);class Qee{constructor(e){this.types=e;for(let t=0;t=t){let l=new qee(e.tree,e.overlay[0].from+i.from,-1,i);(r||(r=[o])).push(Gee(l,t,n,!1))}}return r?ote(r):o}(this,e,t)}iterate(e){let{enter:t,leave:n,from:o=0,to:r=this.length}=e,i=e.mode||0,l=(i&Wee.IncludeAnonymous)>0;for(let a=this.cursor(i|Wee.IncludeAnonymous);;){let e=!1;if(a.from<=r&&a.to>=o&&(!l&&a.type.isAnonymous||!1!==t(a))){if(a.firstChild())continue;e=!0}for(;e&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;e=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:cte(Lee.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,n)=>new Zee(this.type,e,t,n,this.propValues)),e.makeTree||((e,t,n)=>new Zee(Lee.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:o,maxBufferLength:r=Dee,reused:i=[],minRepeatType:l=o.types.length}=e,a=Array.isArray(n)?new Xee(n,n.length):n,s=o.types,c=0,u=0;function d(e,t,n,b,y,O){let{id:w,start:x,end:$,size:S}=a,C=u;for(;S<0;){if(a.next(),-1==S){let t=i[w];return n.push(t),void b.push(x-e)}if(-3==S)return void(c=w);if(-4==S)return void(u=w);throw new RangeError(`Unrecognized record size: ${S}`)}let k,P,T=s[w],M=x-e;if($-x<=r&&(P=m(a.pos-t,y))){let t=new Uint16Array(P.size-P.skip),n=a.pos-P.size,r=t.length;for(;a.pos>n;)r=v(P.start,t,r);k=new Yee(t,$-P.start,o),M=P.start-e}else{let e=a.pos-S;a.next();let t=[],n=[],o=w>=l?w:-1,i=0,s=$;for(;a.pos>e;)o>=0&&a.id==o&&a.size>=0?(a.end<=s-r&&(f(t,n,x,i,a.end,s,o,C),i=t.length,s=a.end),a.next()):O>2500?p(x,e,t,n):d(x,e,t,n,o,O+1);if(o>=0&&i>0&&i-1&&i>0){let e=h(T);k=cte(T,t,n,0,t.length,0,$-x,e,e)}else k=g(T,t,n,$-x,C-$)}n.push(k),b.push(M)}function p(e,t,n,i){let l=[],s=0,c=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:o}=a;if(o>4)a.next();else{if(c>-1&&t=0;e-=3)t[n++]=l[e],t[n++]=l[e+1]-r,t[n++]=l[e+2]-r,t[n++]=n;n.push(new Yee(t,l[2]-r,o)),i.push(r-e)}}function h(e){return(t,n,o)=>{let r,i,l=0,a=t.length-1;if(a>=0&&(r=t[a])instanceof Zee){if(!a&&r.type==e&&r.length==o)return r;(i=r.prop(Nee.lookAhead))&&(l=n[a]+r.length+i)}return g(e,t,n,o,l)}}function f(e,t,n,r,i,l,a,s){let c=[],u=[];for(;e.length>r;)c.push(e.pop()),u.push(t.pop()+n-i);e.push(g(o.types[a],c,u,l-i,s-l)),t.push(i-n)}function g(e,t,n,o,r=0,i){if(c){let e=[Nee.contextHash,c];i=i?[e].concat(i):[e]}if(r>25){let e=[Nee.lookAhead,r];i=i?[e].concat(i):[e]}return new Zee(e,t,n,o,i)}function m(e,t){let n=a.fork(),o=0,i=0,s=0,c=n.end-r,u={size:0,start:0,skip:0};e:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=o,u.start=i,u.skip=s,s+=4,o+=4,n.next();continue}let a=n.pos-e;if(e<0||a=l?4:0,p=n.start;for(n.next();n.pos>a;){if(n.size<0){if(-3!=n.size)break e;d+=4}else n.id>=l&&(d+=4);n.next()}i=p,o+=e,s+=d}return(t<0||o==e)&&(u.size=o,u.start=i,u.skip=s),u.size>4?u:void 0}function v(e,t,n){let{id:o,start:r,end:i,size:s}=a;if(a.next(),s>=0&&o4){let o=a.pos-(s-4);for(;a.pos>o;)n=v(e,t,n)}t[--n]=l,t[--n]=i-e,t[--n]=r-e,t[--n]=o}else-3==s?c=o:-4==s&&(u=o);return n}let b=[],y=[];for(;a.pos>0;)d(e.start||0,e.bufferStart||0,b,y,-1,0);let O=null!==(t=e.length)&&void 0!==t?t:b.length?y[0]+b[0].length:0;return new Zee(s[e.topID],b.reverse(),y.reverse(),O)}(e)}}Zee.empty=new Zee(Lee.none,[],[],0);class Xee{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Xee(this.buffer,this.index)}}class Yee{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Lee.none}toString(){let e=[];for(let t=0;t0));a=i[a+3]);return l}slice(e,t,n){let o=this.buffer,r=new Uint16Array(t-e),i=0;for(let l=e,a=0;l=t&&nt;case 1:return n<=t&&o>t;case 2:return o>t;case 4:return!0}}function Gee(e,t,n,o){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;e!=s;e+=t){let s=l[e],c=a[e]+i.from;if(Kee(o,n,c,c+s.length))if(s instanceof Yee){if(r&Wee.ExcludeBuffers)continue;let l=s.findChild(0,s.buffer.length,t,n-c,o);if(l>-1)return new nte(new tte(i,s,e,c),null,l)}else if(r&Wee.IncludeAnonymous||!s.type.isAnonymous||lte(s)){let l;if(!(r&Wee.IgnoreMounts)&&(l=zee.get(s))&&!l.overlay)return new qee(l.tree,c,e,i);let a=new qee(s,c,e,i);return r&Wee.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?s.children.length-1:0,t,n,o)}}if(r&Wee.IncludeAnonymous||!i.type.isAnonymous)return null;if(e=i.index>=0?i.index+t:t<0?-1:i._parent._tree.children.length,i=i._parent,!i)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let o;if(!(n&Wee.IgnoreOverlays)&&(o=zee.get(this._tree))&&o.overlay){let n=e-this.from;for(let{from:e,to:r}of o.overlay)if((t>0?e<=n:e=n:r>n))return new qee(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Jee(e,t,n,o){let r=e.cursor(),i=[];if(!r.firstChild())return i;if(null!=n)for(;!r.type.is(n);)if(!r.nextSibling())return i;for(;;){if(null!=o&&r.type.is(o))return i;if(r.type.is(t)&&i.push(r.node),!r.nextSibling())return null==o?i:[]}}function ete(e,t,n=t.length-1){for(let o=e.parent;n>=0;o=o.parent){if(!o)return!1;if(!o.type.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}class tte{constructor(e,t,n,o){this.parent=e,this.buffer=t,this.index=n,this.start=o}}class nte extends Uee{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:o}=this.context,r=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new nte(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&Wee.ExcludeBuffers)return null;let{buffer:o}=this.context,r=o.findChild(this.index+4,o.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new nte(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new nte(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new nte(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,o=this.index+4,r=n.buffer[this.index+3];if(r>o){let i=n.buffer[this.index+1];e.push(n.slice(o,r,i)),t.push(0)}return new Zee(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ote(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;in.from||o.to0){if(this.index-1)for(let o=t+e,r=e<0?-1:n._tree.children.length;o!=r;o+=e){let e=n._tree.children[o];if(this.mode&Wee.IncludeAnonymous||e instanceof Yee||!e.type.isAnonymous||lte(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let i=e;i;i=i._parent)if(i.index==o){if(o==this.index)return i;t=i,n=r+1;break e}o=this.stack[--r]}for(let o=n;o=0;r--){if(r<0)return ete(this.node,e,o);let i=n[t.buffer[this.stack[r]]];if(!i.isAnonymous){if(e[o]&&e[o]!=i.name)return!1;o--}}return!0}}function lte(e){return e.children.some((e=>e instanceof Yee||!e.type.isAnonymous||lte(e)))}const ate=new WeakMap;function ste(e,t){if(!e.isAnonymous||t instanceof Yee||t.type!=e)return 1;let n=ate.get(t);if(null==n){n=1;for(let o of t.children){if(o.type!=e||!(o instanceof Zee)){n=1;break}n+=ste(e,o)}ate.set(t,n)}return n}function cte(e,t,n,o,r,i,l,a,s){let c=0;for(let h=o;h=u)break;f+=t}if(c==r+1){if(f>u){let e=n[r];t(e.children,e.positions,0,e.children.length,o[r]+a);continue}d.push(n[r])}else{let t=o[c-1]+n[c-1].length-h;d.push(cte(e,n,o,r,c,h,t,null,s))}p.push(h+a-i)}}(t,n,o,r,0),(a||s)(d,p,l)}class ute{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let o=this.map.get(e);o||this.map.set(e,o=new Map),o.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof nte?this.setBuffer(e.context.buffer,e.index,t):e instanceof qee&&this.map.set(e.tree,t)}get(e){return e instanceof nte?this.getBuffer(e.context.buffer,e.index):e instanceof qee?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class dte{constructor(e,t,n,o,r=!1,i=!1){this.from=e,this.to=t,this.tree=n,this.offset=o,this.open=(r?1:0)|(i?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let o=[new dte(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&o.push(r);return o}static applyChanges(e,t,n=128){if(!t.length)return e;let o=[],r=1,i=e.length?e[0]:null;for(let l=0,a=0,s=0;;l++){let c=l=n)for(;i&&i.from=t.from||u<=t.to||s){let e=Math.max(t.from,a)-s,n=Math.min(t.to,u)-s;t=e>=n?null:new dte(e,n,t.tree,t.offset+s,l>0,!!c)}if(t&&o.push(t),i.to>u)break;i=rnew Bee(e.from,e.to))):[new Bee(0,0)]:[new Bee(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let o=this.startParse(e,t,n);for(;;){let e=o.advance();if(e)return e}}}class hte{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new Nee({perNode:!0});let fte=0;class gte{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=fte++}static define(e){if(null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let t=new gte([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new vte;return t=>t.modified.indexOf(e)>-1?t:vte.get(t.base||t,t.modified.concat(e).sort(((e,t)=>e.id-t.id)))}}let mte=0;class vte{constructor(){this.instances=[],this.id=mte++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find((n=>{return n.base==e&&(o=t,r=n.modified,o.length==r.length&&o.every(((e,t)=>e==r[t])));var o,r}));if(n)return n;let o=[],r=new gte(o,e,t);for(let l of t)l.instances.push(r);let i=function(e){let t=[[]];for(let n=0;nt.length-e.length))}(t);for(let l of e.set)if(!l.modified.length)for(let e of i)o.push(vte.get(l,e));return r}}function bte(e){let t=Object.create(null);for(let n in e){let o=e[n];Array.isArray(o)||(o=[o]);for(let e of n.split(" "))if(e){let n=[],r=2,i=e;for(let t=0;;){if("..."==i&&t>0&&t+3==e.length){r=1;break}let o=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(i);if(!o)throw new RangeError("Invalid path: "+e);if(n.push("*"==o[0]?"":'"'==o[0][0]?JSON.parse(o[0]):o[0]),t+=o[0].length,t==e.length)break;let l=e[t++];if(t==e.length&&"!"==l){r=0;break}if("/"!=l)throw new RangeError("Invalid path: "+e);i=e.slice(t)}let l=n.length-1,a=n[l];if(!a)throw new RangeError("Invalid path: "+e);let s=new Ote(o,r,l>0?n.slice(0,l):null);t[a]=s.sort(t[a])}}return yte.add(t)}const yte=new Nee;class Ote{constructor(e,t,n,o){this.tags=e,this.mode=t,this.context=n,this.next=o}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth{let t=r;for(let o of e)for(let e of o.set){let o=n[e.id];if(o){t=t?t+" "+o:o;break}}return t},scope:o}}function xte(e,t,n,o=0,r=e.length){let i=new $te(o,Array.isArray(t)?t:[t],n);i.highlightRange(e.cursor(),o,r,"",i.highlighters),i.flush(r)}Ote.empty=new Ote([],2,null);class $te{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,o,r){let{type:i,from:l,to:a}=e;if(l>=n||a<=t)return;i.isTop&&(r=this.highlighters.filter((e=>!e.scope||e.scope(i))));let s=o,c=function(e){let t=e.type.prop(yte);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||Ote.empty,u=function(e,t){let n=null;for(let o of e){let e=o.style(t);e&&(n=n?n+" "+e:e)}return n}(r,c.tags);if(u&&(s&&(s+=" "),s+=u,1==c.mode&&(o+=(o?" ":"")+u)),this.startSpan(Math.max(t,l),s),c.opaque)return;let d=e.tree&&e.tree.prop(Nee.mounted);if(d&&d.overlay){let i=e.node.enter(d.overlay[0].from+l,1),c=this.highlighters.filter((e=>!e.scope||e.scope(d.tree.type))),u=e.firstChild();for(let p=0,h=l;;p++){let f=p=g)&&e.nextSibling()););if(!f||g>n)break;h=f.to+l,h>t&&(this.highlightRange(i.cursor(),Math.max(t,f.from+l),Math.min(n,h),"",c),this.startSpan(Math.min(n,h),s))}u&&e.parent()}else if(e.firstChild()){d&&(o="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,o,r),this.startSpan(Math.min(n,e.to),s)}}while(e.nextSibling());e.parent()}}}const Ste=gte.define,Cte=Ste(),kte=Ste(),Pte=Ste(kte),Tte=Ste(kte),Mte=Ste(),Ite=Ste(Mte),Ete=Ste(Mte),Ate=Ste(),Rte=Ste(Ate),Dte=Ste(),jte=Ste(),Bte=Ste(),Nte=Ste(Bte),zte=Ste(),_te={comment:Cte,lineComment:Ste(Cte),blockComment:Ste(Cte),docComment:Ste(Cte),name:kte,variableName:Ste(kte),typeName:Pte,tagName:Ste(Pte),propertyName:Tte,attributeName:Ste(Tte),className:Ste(kte),labelName:Ste(kte),namespace:Ste(kte),macroName:Ste(kte),literal:Mte,string:Ite,docString:Ste(Ite),character:Ste(Ite),attributeValue:Ste(Ite),number:Ete,integer:Ste(Ete),float:Ste(Ete),bool:Ste(Mte),regexp:Ste(Mte),escape:Ste(Mte),color:Ste(Mte),url:Ste(Mte),keyword:Dte,self:Ste(Dte),null:Ste(Dte),atom:Ste(Dte),unit:Ste(Dte),modifier:Ste(Dte),operatorKeyword:Ste(Dte),controlKeyword:Ste(Dte),definitionKeyword:Ste(Dte),moduleKeyword:Ste(Dte),operator:jte,derefOperator:Ste(jte),arithmeticOperator:Ste(jte),logicOperator:Ste(jte),bitwiseOperator:Ste(jte),compareOperator:Ste(jte),updateOperator:Ste(jte),definitionOperator:Ste(jte),typeOperator:Ste(jte),controlOperator:Ste(jte),punctuation:Bte,separator:Ste(Bte),bracket:Nte,angleBracket:Ste(Nte),squareBracket:Ste(Nte),paren:Ste(Nte),brace:Ste(Nte),content:Ate,heading:Rte,heading1:Ste(Rte),heading2:Ste(Rte),heading3:Ste(Rte),heading4:Ste(Rte),heading5:Ste(Rte),heading6:Ste(Rte),contentSeparator:Ste(Ate),list:Ste(Ate),quote:Ste(Ate),emphasis:Ste(Ate),strong:Ste(Ate),link:Ste(Ate),monospace:Ste(Ate),strikethrough:Ste(Ate),inserted:Ste(),deleted:Ste(),changed:Ste(),invalid:Ste(),meta:zte,documentMeta:Ste(zte),annotation:Ste(zte),processingInstruction:Ste(zte),definition:gte.defineModifier(),constant:gte.defineModifier(),function:gte.defineModifier(),standard:gte.defineModifier(),local:gte.defineModifier(),special:gte.defineModifier()};var Lte;wte([{tag:_te.link,class:"tok-link"},{tag:_te.heading,class:"tok-heading"},{tag:_te.emphasis,class:"tok-emphasis"},{tag:_te.strong,class:"tok-strong"},{tag:_te.keyword,class:"tok-keyword"},{tag:_te.atom,class:"tok-atom"},{tag:_te.bool,class:"tok-bool"},{tag:_te.url,class:"tok-url"},{tag:_te.labelName,class:"tok-labelName"},{tag:_te.inserted,class:"tok-inserted"},{tag:_te.deleted,class:"tok-deleted"},{tag:_te.literal,class:"tok-literal"},{tag:_te.string,class:"tok-string"},{tag:_te.number,class:"tok-number"},{tag:[_te.regexp,_te.escape,_te.special(_te.string)],class:"tok-string2"},{tag:_te.variableName,class:"tok-variableName"},{tag:_te.local(_te.variableName),class:"tok-variableName tok-local"},{tag:_te.definition(_te.variableName),class:"tok-variableName tok-definition"},{tag:_te.special(_te.variableName),class:"tok-variableName2"},{tag:_te.definition(_te.propertyName),class:"tok-propertyName tok-definition"},{tag:_te.typeName,class:"tok-typeName"},{tag:_te.namespace,class:"tok-namespace"},{tag:_te.className,class:"tok-className"},{tag:_te.macroName,class:"tok-macroName"},{tag:_te.propertyName,class:"tok-propertyName"},{tag:_te.operator,class:"tok-operator"},{tag:_te.comment,class:"tok-comment"},{tag:_te.meta,class:"tok-meta"},{tag:_te.invalid,class:"tok-invalid"},{tag:_te.punctuation,class:"tok-punctuation"}]);const Qte=new Nee;function Hte(e){return Q3.define({combine:e?t=>t.concat(e):void 0})}const Fte=new Nee;class Wte{constructor(e,t,n=[],o=""){this.data=e,this.name=o,M4.prototype.hasOwnProperty("tree")||Object.defineProperty(M4.prototype,"tree",{get(){return Xte(this)}}),this.parser=t,this.extension=[nne.of(this),M4.languageData.of(((e,t,n)=>{let o=Vte(e,t,n),r=o.type.prop(Qte);if(!r)return[];let i=e.facet(r),l=o.type.prop(Fte);if(l){let r=o.resolve(t-o.from,n);for(let t of l)if(t.test(r,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(i)}}return i}))].concat(n)}isActiveAt(e,t,n=-1){return Vte(e,t,n).type.prop(Qte)==this.data}findRegions(e){let t=e.facet(nne);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],o=(e,t)=>{if(e.prop(Qte)==this.data)return void n.push({from:t,to:t+e.length});let r=e.prop(Nee.mounted);if(r){if(r.tree.prop(Qte)==this.data){if(r.overlay)for(let e of r.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(r.overlay){let e=n.length;if(o(r.tree,r.overlay[0].from+t),n.length>e)return}}for(let n=0;ne.isTop?t:void 0))]}),e.name)}configure(e,t){return new Zte(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Xte(e){let t=e.field(Wte.state,!1);return t?t.tree:Zee.empty}class Yte{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Kte=null;class Gte{constructor(e,t,n=[],o,r,i,l,a){this.parser=e,this.state=t,this.fragments=n,this.tree=o,this.treeLen=r,this.viewport=i,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new Gte(e,t,[],Zee.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Yte(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=Zee.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((()=>{for(;!(t=this.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(dte.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Kte;Kte=this;try{return e()}finally{Kte=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Ute(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:o,treeLen:r,viewport:i,skipped:l}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,n,o,r)=>t.push({fromA:e,toA:n,fromB:o,toB:r}))),n=dte.applyChanges(n,t),o=Zee.empty,r=0,i={from:e.mapPos(i.from,-1),to:e.mapPos(i.to,1)},this.skipped.length){l=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),o=e.mapPos(t.to,-1);ne.from&&(this.fragments=Ute(this.fragments,t,o),this.skipped.splice(n--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends pte{createParse(t,n,o){let r=o[0].from,i=o[o.length-1].to;return{parsedPos:r,advance(){let t=Kte;if(t){for(let e of o)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=i,new Zee(Lee.none,[],[],i-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return Kte}}function Ute(e,t,n){return dte.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class qte{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new qte(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=Gte.create(e.facet(nne).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new qte(n)}}Wte.state=Y3.define({create:qte.init,update(e,t){for(let n of t.effects)if(n.is(Wte.setState))return n.value;return t.startState.facet(nne)!=t.state.facet(nne)?qte.init(t.state):e.apply(t)}});let Jte=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(Jte=e=>{let t=-1,n=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const ene="undefined"!=typeof navigator&&(null===(Lte=navigator.scheduling)||void 0===Lte?void 0:Lte.isInputPending)?()=>navigator.scheduling.isInputPending():null,tne=G8.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Wte.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Wte.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=Jte(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndo+1e3,a=r.context.work((()=>ene&&ene()||Date.now()>i),o+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Wte.setState.of(new qte(r.context))})),this.chunkBudget>0&&(!a||l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>Z8(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),nne=Q3.define({combine:e=>e.length?e[0]:null,enables:e=>[Wte.state,tne,Z7.contentAttributes.compute([e],(t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}}))]});class one{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const rne=Q3.define(),ine=Q3.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some((e=>e!=t[0])))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function lne(e){let t=e.facet(ine);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function ane(e,t){let n="",o=e.tabSize,r=e.facet(ine)[0];if("\t"==r){for(;t>=o;)n+="\t",t-=o;r=" "}for(let i=0;i=t?function(e,t,n){let o=t.resolveStack(n),r=o.node.enterUnfinishedNodesBefore(n);if(r!=o.node){let e=[];for(let t=r;t!=o.node;t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)o={node:e[t],next:o}}return dne(o,e,n)}(e,n,t):null}class cne{constructor(e,t={}){this.state=e,this.options=t,this.unit=lne(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:o,simulateDoubleBreak:r}=this.options;return null!=o&&o>=n.from&&o<=n.to?r&&o==e?{text:"",from:e}:(t<0?o-1&&(r+=i-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return X4(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:o}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(o);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const une=new Nee;function dne(e,t,n){for(let o=e;o;o=o.next){let e=pne(o.node);if(e)return e(fne.create(t,n,o))}return 0}function pne(e){let t=e.type.prop(une);if(t)return t;let n,o=e.firstChild;if(o&&(n=o.type.prop(Nee.closedBy))){let t=e.lastChild,o=t&&n.indexOf(t.name)>-1;return e=>vne(e,!0,1,void 0,o&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?hne:null}function hne(){return 0}class fne extends cne{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new fne(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(gne(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return dne(this.context.next,this.base,this.pos)}}function gne(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function mne({closing:e,align:t=!0,units:n=1}){return o=>vne(o,t,n,e)}function vne(e,t,n,o,r){let i=e.textAfter,l=i.match(/^\s*/)[0].length,a=o&&i.slice(l,l+o.length)==o||r==e.pos+l,s=t?function(e){let t=e.node,n=t.childAfter(t.from),o=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,i=e.state.doc.lineAt(n.from),l=null==r||r<=i.from?i.to:Math.min(i.to,r);for(let a=n.to;;){let e=t.childAfter(a);if(!e||e==o)return null;if(!e.type.isSkipped)return e.from{let o=e&&e.test(n.textAfter);return n.baseIndent+(o?0:t*n.unit)}}const yne=Q3.define(),One=new Nee;function wne(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function xne(e,t,n){for(let o of e.facet(yne)){let r=o(e,t,n);if(r)return r}return function(e,t,n){let o=Xte(e);if(o.lengthn)continue;if(r&&l.from=t&&o.to>n&&(r=o)}}return r}(e,t,n)}function $ne(e,t){let n=t.mapPos(e.from,1),o=t.mapPos(e.to,-1);return n>=o?void 0:{from:n,to:o}}const Sne=v4.define({map:$ne}),Cne=v4.define({map:$ne});function kne(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some((e=>e.from<=n&&e.to>=n))||t.push(e.lineBlockAt(n));return t}const Pne=Y3.define({create:()=>a8.none,update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(Sne)&&!Mne(e,n.value.from,n.value.to)){let{preparePlaceholder:o}=t.state.facet(Dne),r=o?a8.replace({widget:new zne(o(t.state,n.value))}):Nne;e=e.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(Cne)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:o}=t.selection.main;e.between(o,o,((e,t)=>{eo&&(n=!0)})),n&&(e=e.update({filterFrom:o,filterTo:o,filter:(e,t)=>t<=o||e>=o}))}return e},provide:e=>Z7.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,((e,t)=>{n.push(e,t)})),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{(!r||r.from>e)&&(r={from:e,to:t})})),r}function Mne(e,t,n){let o=!1;return e.between(t,t,((e,r)=>{e==t&&r==n&&(o=!0)})),o}function Ine(e,t){return e.field(Pne,!1)?t:t.concat(v4.appendConfig.of(jne()))}function Ene(e,t,n=!0){let o=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return Z7.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${o} ${e.state.phrase("to")} ${r}.`)}const Ane=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of kne(e)){let n=xne(e.state,t.from,t.to);if(n)return e.dispatch({effects:Ine(e.state,[Sne.of(n),Ene(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(Pne,!1))return!1;let t=[];for(let n of kne(e)){let o=Tne(e.state,n.from,n.to);o&&t.push(Cne.of(o),Ene(e,o,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let o=0;o{let t=e.state.field(Pne,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,((e,t)=>{n.push(Cne.of({from:e,to:t}))})),e.dispatch({effects:n}),!0}}],Rne={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Dne=Q3.define({combine:e=>I4(e,Rne)});function jne(e){let t=[Pne,Hne];return e&&t.push(Dne.of(e)),t}function Bne(e,t){let{state:n}=e,o=n.facet(Dne),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),o=Tne(e.state,n.from,n.to);o&&e.dispatch({effects:Cne.of(o)}),t.preventDefault()};if(o.placeholderDOM)return o.placeholderDOM(e,r,t);let i=document.createElement("span");return i.textContent=o.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=r,i}const Nne=a8.replace({widget:new class extends i8{toDOM(e){return Bne(e,null)}}});class zne extends i8{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Bne(e,this.value)}}const _ne={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Lne extends pee{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function Qne(e={}){let t=Object.assign(Object.assign({},_ne),e),n=new Lne(t,!0),o=new Lne(t,!1),r=G8.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(nne)!=e.state.facet(nne)||e.startState.field(Pne,!1)!=e.state.field(Pne,!1)||Xte(e.startState)!=Xte(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new B4;for(let r of e.viewportLineBlocks){let i=Tne(e.state,r.from,r.to)?o:xne(e.state,r.from,r.to)?n:null;i&&t.add(r.from,r.from,i)}return t.finish()}}),{domEventHandlers:i}=t;return[r,mee({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.markers)||j4.empty},initialSpacer:()=>new Lne(t,!1),domEventHandlers:Object.assign(Object.assign({},i),{click:(e,t,n)=>{if(i.click&&i.click(e,t,n))return!0;let o=Tne(e.state,t.from,t.to);if(o)return e.dispatch({effects:Cne.of(o)}),!0;let r=xne(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:Sne.of(r)}),!0)}})}),jne()]}const Hne=Z7.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Fne{constructor(e,t){let n;function o(e){let t=q4.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const r="string"==typeof t.all?t.all:t.all?o(t.all):void 0,i=t.scope;this.scope=i instanceof Wte?e=>e.prop(Qte)==i.data:i?e=>e==i:void 0,this.style=wte(e.map((e=>({tag:e.tag,class:e.class||o(Object.assign({},e,{tag:null}))}))),{all:r}).style,this.module=n?new q4(n):null,this.themeType=t.themeType}static define(e,t){return new Fne(e,t||{})}}const Wne=Q3.define(),Vne=Q3.define({combine:e=>e.length?[e[0]]:null});function Zne(e){let t=e.facet(Wne);return t.length?t:e.facet(Vne)}function Xne(e,t){let n,o=[Kne];return e instanceof Fne&&(e.module&&o.push(Z7.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?o.push(Vne.of(e)):n?o.push(Wne.computeN([Z7.darkTheme],(t=>t.facet(Z7.darkTheme)==("dark"==n)?[e]:[]))):o.push(Wne.of(e)),o}class Yne{constructor(e){this.markCache=Object.create(null),this.tree=Xte(e.state),this.decorations=this.buildDeco(e,Zne(e.state))}update(e){let t=Xte(e.state),n=Zne(e.state),o=n!=Zne(e.startState);t.length{n.add(e,t,this.markCache[o]||(this.markCache[o]=a8.mark({class:o})))}),o,r);return n.finish()}}const Kne=e4.high(G8.fromClass(Yne,{decorations:e=>e.decorations})),Gne=Fne.define([{tag:_te.meta,color:"#404740"},{tag:_te.link,textDecoration:"underline"},{tag:_te.heading,textDecoration:"underline",fontWeight:"bold"},{tag:_te.emphasis,fontStyle:"italic"},{tag:_te.strong,fontWeight:"bold"},{tag:_te.strikethrough,textDecoration:"line-through"},{tag:_te.keyword,color:"#708"},{tag:[_te.atom,_te.bool,_te.url,_te.contentSeparator,_te.labelName],color:"#219"},{tag:[_te.literal,_te.inserted],color:"#164"},{tag:[_te.string,_te.deleted],color:"#a11"},{tag:[_te.regexp,_te.escape,_te.special(_te.string)],color:"#e40"},{tag:_te.definition(_te.variableName),color:"#00f"},{tag:_te.local(_te.variableName),color:"#30a"},{tag:[_te.typeName,_te.namespace],color:"#085"},{tag:_te.className,color:"#167"},{tag:[_te.special(_te.variableName),_te.macroName],color:"#256"},{tag:_te.definition(_te.propertyName),color:"#00c"},{tag:_te.comment,color:"#940"},{tag:_te.invalid,color:"#f00"}]),Une=Z7.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),qne="()[]{}",Jne=Q3.define({combine:e=>I4(e,{afterCursor:!0,brackets:qne,maxScanDistance:1e4,renderMatch:noe})}),eoe=a8.mark({class:"cm-matchingBracket"}),toe=a8.mark({class:"cm-nonmatchingBracket"});function noe(e){let t=[],n=e.matched?eoe:toe;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const ooe=[Y3.define({create:()=>a8.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],o=t.state.facet(Jne);for(let r of t.state.selection.ranges){if(!r.empty)continue;let e=soe(t.state,r.head,-1,o)||r.head>0&&soe(t.state,r.head-1,1,o)||o.afterCursor&&(soe(t.state,r.head,1,o)||r.headZ7.decorations.from(e)}),Une];function roe(e={}){return[Jne.of(e),ooe]}const ioe=new Nee;function loe(e,t,n){let o=e.prop(t<0?Nee.openedBy:Nee.closedBy);if(o)return o;if(1==e.name.length){let o=n.indexOf(e.name);if(o>-1&&o%2==(t<0?1:0))return[n[o+t]]}return null}function aoe(e){let t=e.type.prop(ioe);return t?t(e.node):e}function soe(e,t,n,o={}){let r=o.maxScanDistance||1e4,i=o.brackets||qne,l=Xte(e),a=l.resolveInner(t,n);for(let s=a;s;s=s.parent){let e=loe(s.type,n,i);if(e&&s.from0?t>=o.from&&to.from&&t<=o.to))return coe(0,0,n,s,o,e,i)}}return function(e,t,n,o,r,i,l){let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),s=l.indexOf(a);if(s<0||s%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let p=0;!u.next().done&&p<=i;){let e=u.value;n<0&&(p+=e.length);let i=t+p*n;for(let t=n>0?0:e.length-1,a=n>0?e.length:-1;t!=a;t+=n){let a=l.indexOf(e[t]);if(!(a<0||o.resolveInner(i+t,1).type!=r))if(a%2==0==n>0)d++;else{if(1==d)return{start:c,end:{from:i+t,to:i+t+1},matched:a>>1==s>>1};d--}}n>0&&(p+=e.length)}return u.done?{start:c,matched:!1}:null}(e,t,n,l,a.type,r,i)}function coe(e,t,n,o,r,i,l){let a=o.parent,s={from:r.from,to:r.to},c=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(o.from):u.childAfter(o.to)))do{if(n<0?u.to<=o.from:u.from>=o.to){if(0==c&&i.indexOf(u.type.name)>-1&&u.from-1||poe.push(e)}function moe(e,t){let n=[];for(let a of t.split(" ")){let t=[];for(let n of a.split(".")){let o=e[n]||_te[n];o?"function"==typeof o?t.length?t=t.map(o):goe(n):t.length?goe(n):t=Array.isArray(o)?o:[o]:goe(n)}for(let e of t)n.push(e)}if(!n.length)return 0;let o=t.replace(/ /g,"_"),r=o+" "+n.map((e=>e.id)),i=hoe[r];if(i)return i.id;let l=hoe[r]=Lee.define({id:doe.length,name:o,props:[bte({[o]:n})]});return doe.push(l),l.id}function voe(e,t){return({state:n,dispatch:o})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(o(n.update(r)),!0)}}m8.RTL,m8.LTR;const boe=voe($oe,0),yoe=voe(xoe,0),Ooe=voe(((e,t)=>xoe(e,t,function(e){let t=[];for(let n of e.selection.ranges){let o=e.doc.lineAt(n.from),r=n.to<=o.to?o:e.doc.lineAt(n.to),i=t.length-1;i>=0&&t[i].to>o.from?t[i].to=r.to:t.push({from:o.from+/^\s*/.exec(o.text)[0].length,to:r.to})}return t}(t))),0);function woe(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function xoe(e,t,n=t.selection.ranges){let o=n.map((e=>woe(t,e.from).block));if(!o.every((e=>e)))return null;let r=n.map(((e,n)=>function(e,{open:t,close:n},o,r){let i,l,a=e.sliceDoc(o-50,o),s=e.sliceDoc(r,r+50),c=/\s*$/.exec(a)[0].length,u=/^\s*/.exec(s)[0].length,d=a.length-c;if(a.slice(d-t.length,d)==t&&s.slice(u,u+n.length)==n)return{open:{pos:o-c,margin:c&&1},close:{pos:r+u,margin:u&&1}};r-o<=100?i=l=e.sliceDoc(o,r):(i=e.sliceDoc(o,o+50),l=e.sliceDoc(r-50,r));let p=/^\s*/.exec(i)[0].length,h=/\s*$/.exec(l)[0].length,f=l.length-h-n.length;return i.slice(p,p+t.length)==t&&l.slice(f,f+n.length)==n?{open:{pos:o+p+t.length,margin:/\s/.test(i.charAt(p+t.length))?1:0},close:{pos:r-h-n.length,margin:/\s/.test(l.charAt(f-1))?1:0}}:null}(t,o[n],e.from,e.to)));if(2!=e&&!r.every((e=>e)))return{changes:t.changes(n.map(((e,t)=>r[t]?[]:[{from:e.from,insert:o[t].open+" "},{from:e.to,insert:" "+o[t].close}])))};if(1!=e&&r.some((e=>e))){let e=[];for(let t,n=0;nr&&(i==l||l>s.from)){r=s.from;let e=/^\s*/.exec(s.text)[0].length,t=e==s.length,i=s.text.slice(e,e+a.length)==a?e:-1;ee.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:r,indent:i,empty:l,single:a}of o)!a&&l||e.push({from:t.from+i,insert:r+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&o.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:n,token:r}of o)if(n>=0){let o=t.from+n,i=o+r.length;" "==t.text[i-t.from]&&i++,e.push({from:o,to:i})}return{changes:e}}return null}const Soe=f4.define(),Coe=f4.define(),koe=Q3.define(),Poe=Q3.define({combine:e=>I4(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,o)=>e(n,o)||t(n,o)})}),Toe=Y3.define({create:()=>Woe.empty,update(e,t){let n=t.state.facet(Poe),o=t.annotation(Soe);if(o){let r=joe.fromTransaction(t,o.selection),i=o.side,l=0==i?e.undone:e.done;return l=r?Boe(l,l.length,n.minDepth,r):_oe(l,t.startState.selection),new Woe(0==i?o.rest:l,0==i?l:o.rest)}let r=t.annotation(Coe);if("full"!=r&&"before"!=r||(e=e.isolate()),!1===t.annotation(b4.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let i=joe.fromTransaction(t),l=t.annotation(b4.time),a=t.annotation(b4.userEvent);return i?e=e.addChanges(i,l,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,a,n.newGroupDelay)),"full"!=r&&"after"!=r||(e=e.isolate()),e},toJSON:e=>({done:e.done.map((e=>e.toJSON())),undone:e.undone.map((e=>e.toJSON()))}),fromJSON:e=>new Woe(e.done.map(joe.fromJSON),e.undone.map(joe.fromJSON))});function Moe(e={}){return[Toe,Poe.of(e),Z7.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?Eoe:"historyRedo"==e.inputType?Aoe:null;return!!n&&(e.preventDefault(),n(t))}})]}function Ioe(e,t){return function({state:n,dispatch:o}){if(!t&&n.readOnly)return!1;let r=n.field(Toe,!1);if(!r)return!1;let i=r.pop(e,n,t);return!!i&&(o(i),!0)}}const Eoe=Ioe(0,!1),Aoe=Ioe(1,!1),Roe=Ioe(0,!0),Doe=Ioe(1,!0);class joe{constructor(e,t,n,o,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=o,this.selectionsAfter=r}setSelAfter(e){return new joe(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((e=>e.toJSON()))}}static fromJSON(e){return new joe(e.changes&&I3.fromJSON(e.changes),[],e.mapped&&M3.fromJSON(e.mapped),e.startSelection&&z3.fromJSON(e.startSelection),e.selectionsAfter.map(z3.fromJSON))}static fromTransaction(e,t){let n=zoe;for(let o of e.startState.facet(koe)){let t=o(e);t.length&&(n=n.concat(t))}return!n.length&&e.changes.empty?null:new joe(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,zoe)}static selection(e){return new joe(void 0,zoe,void 0,void 0,e)}}function Boe(e,t,n,o){let r=t+1>n+20?t-n-1:0,i=e.slice(r,t);return i.push(o),i}function Noe(e,t){return e.length?t.length?e.concat(t):e:t}const zoe=[];function _oe(e,t){if(e.length){let n=e[e.length-1],o=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return o.length&&o[o.length-1].eq(t)?e:(o.push(t),Boe(e,e.length-1,1e9,n.setSelAfter(o)))}return[joe.selection([t])]}function Loe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Qoe(e,t){if(!e.length)return e;let n=e.length,o=zoe;for(;n;){let r=Hoe(e[n-1],t,o);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,o=r.selectionsAfter}return o.length?[joe.selection(o)]:zoe}function Hoe(e,t,n){let o=Noe(e.selectionsAfter.length?e.selectionsAfter.map((e=>e.map(t))):zoe,n);if(!e.changes)return joe.selection(o);let r=e.changes.map(t),i=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(i):i;return new joe(r,v4.mapEffects(e.effects,t),l,e.startSelection.map(i),o)}const Foe=/^(input\.type|delete)($|\.)/;class Woe{constructor(e,t,n=0,o=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=o}isolate(){return this.prevTime?new Woe(this.done,this.undone):this}addChanges(e,t,n,o,r){let i=this.done,l=i[i.length-1];return i=l&&l.changes&&!l.changes.empty&&e.changes&&(!n||Foe.test(n))&&(!l.selectionsAfter.length&&t-this.prevTimen.push(e,t))),t.iterChangedRanges(((e,t,r,i)=>{for(let l=0;l=e&&r<=t&&(o=!0)}})),o}(l.changes,e.changes))||"input.type.compose"==n)?Boe(i,i.length-1,o.minDepth,new joe(e.changes.compose(l.changes),Noe(e.effects,l.effects),l.mapped,l.startSelection,zoe)):Boe(i,i.length,o.minDepth,e),new Woe(i,zoe,t,n)}addSelection(e,t,n,o){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:zoe;return r.length>0&&t-this.prevTimee.empty!=l.ranges[t].empty)).length)?this:new Woe(_oe(this.done,e),this.undone,t,n);var i,l}addMapping(e){return new Woe(Qoe(this.done,e),Qoe(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let o=0==e?this.done:this.undone;if(0==o.length)return null;let r=o[o.length-1],i=r.selectionsAfter[0]||t.selection;if(n&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:Soe.of({side:e,rest:Loe(o),selection:i}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let n=1==o.length?zoe:o.slice(0,o.length-1);return r.mapped&&(n=Qoe(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:Soe.of({side:e,rest:n,selection:i}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}Woe.empty=new Woe(zoe,zoe);const Voe=[{key:"Mod-z",run:Eoe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Aoe,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Aoe,preventDefault:!0},{key:"Mod-u",run:Roe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Doe,preventDefault:!0}];function Zoe(e,t){return z3.create(e.ranges.map(t),e.mainIndex)}function Xoe(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Yoe({state:e,dispatch:t},n){let o=Zoe(e.selection,n);return!o.eq(e.selection,!0)&&(t(Xoe(e,o)),!0)}function Koe(e,t){return z3.cursor(t?e.to:e.from)}function Goe(e,t){return Yoe(e,(n=>n.empty?e.moveByChar(n,t):Koe(n,t)))}function Uoe(e){return e.textDirectionAt(e.state.selection.main.head)==m8.LTR}const qoe=e=>Goe(e,!Uoe(e)),Joe=e=>Goe(e,Uoe(e));function ere(e,t){return Yoe(e,(n=>n.empty?e.moveByGroup(n,t):Koe(n,t)))}function tre(e,t,n){if(t.type.prop(n))return!0;let o=t.to-t.from;return o&&(o>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function nre(e,t,n){let o,r,i=Xte(e).resolveInner(t.head),l=n?Nee.closedBy:Nee.openedBy;for(let a=t.head;;){let t=n?i.childAfter(a):i.childBefore(a);if(!t)break;tre(e,t,l)?i=t:a=n?t.to:t.from}return r=i.type.prop(l)&&(o=n?soe(e,i.from,1):soe(e,i.to,-1))&&o.matched?n?o.end.to:o.end.from:n?i.to:i.from,z3.cursor(r,n?-1:1)}function ore(e,t){return Yoe(e,(n=>{if(!n.empty)return Koe(n,t);let o=e.moveVertically(n,t);return o.head!=n.head?o:e.moveToLineBoundary(n,t)}))}const rre=e=>ore(e,!1),ire=e=>ore(e,!0);function lre(e){let t,n=e.scrollDOM.clientHeightn.empty?e.moveVertically(n,t,o.height):Koe(n,t)));if(i.eq(r.selection))return!1;if(o.selfScroll){let t=e.coordsAtPos(r.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),a=l.top+o.marginTop,s=l.bottom-o.marginBottom;t&&t.top>a&&t.bottomare(e,!1),cre=e=>are(e,!0);function ure(e,t,n){let o=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?o.to:o.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==o.from&&o.length){let n=/^\s*/.exec(e.state.sliceDoc(o.from,Math.min(o.from+100,o.to)))[0].length;n&&t.head!=o.from+n&&(r=z3.cursor(o.from+n))}return r}function dre(e,t){let n=Zoe(e.state.selection,(e=>{let n=t(e);return z3.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)}));return!n.eq(e.state.selection)&&(e.dispatch(Xoe(e.state,n)),!0)}function pre(e,t){return dre(e,(n=>e.moveByChar(n,t)))}const hre=e=>pre(e,!Uoe(e)),fre=e=>pre(e,Uoe(e));function gre(e,t){return dre(e,(n=>e.moveByGroup(n,t)))}function mre(e,t){return dre(e,(n=>e.moveVertically(n,t)))}const vre=e=>mre(e,!1),bre=e=>mre(e,!0);function yre(e,t){return dre(e,(n=>e.moveVertically(n,t,lre(e).height)))}const Ore=e=>yre(e,!1),wre=e=>yre(e,!0),xre=({state:e,dispatch:t})=>(t(Xoe(e,{anchor:0})),!0),$re=({state:e,dispatch:t})=>(t(Xoe(e,{anchor:e.doc.length})),!0),Sre=({state:e,dispatch:t})=>(t(Xoe(e,{anchor:e.selection.main.anchor,head:0})),!0),Cre=({state:e,dispatch:t})=>(t(Xoe(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function kre(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:o}=e,r=o.changeByRange((o=>{let{from:r,to:i}=o;if(r==i){let l=t(o);lr&&(n="delete.forward",l=Pre(e,l,!0)),r=Math.min(r,l),i=Math.max(i,l)}else r=Pre(e,r,!1),i=Pre(e,i,!0);return r==i?{range:o}:{changes:{from:r,to:i},range:z3.cursor(r,rt(e))))o.between(t,t,((e,o)=>{et&&(t=n?o:e)}));return t}const Tre=(e,t)=>kre(e,(n=>{let o,r,i=n.from,{state:l}=e,a=l.doc.lineAt(i);if(!t&&i>a.from&&iTre(e,!1),Ire=e=>Tre(e,!0),Ere=(e,t)=>kre(e,(n=>{let o=n.head,{state:r}=e,i=r.doc.lineAt(o),l=r.charCategorizer(o);for(let e=null;;){if(o==(t?i.to:i.from)){o==n.head&&i.number!=(t?r.doc.lines:1)&&(o+=t?1:-1);break}let a=y3(i.text,o-i.from,t)+i.from,s=i.text.slice(Math.min(o,a)-i.from,Math.max(o,a)-i.from),c=l(s);if(null!=e&&c!=e)break;" "==s&&o==n.head||(e=c),o=a}return o})),Are=e=>Ere(e,!1);function Rre(e){let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.from),i=e.doc.lineAt(o.to);if(o.empty||o.to!=i.from||(i=e.doc.lineAt(o.to-1)),n>=r.number){let e=t[t.length-1];e.to=i.to,e.ranges.push(o)}else t.push({from:r.from,to:i.to,ranges:[o]});n=i.number+1}return t}function Dre(e,t,n){if(e.readOnly)return!1;let o=[],r=[];for(let i of Rre(e)){if(n?i.to==e.doc.length:0==i.from)continue;let t=e.doc.lineAt(n?i.to+1:i.from-1),l=t.length+1;if(n){o.push({from:i.to,to:t.to},{from:i.from,insert:t.text+e.lineBreak});for(let t of i.ranges)r.push(z3.range(Math.min(e.doc.length,t.anchor+l),Math.min(e.doc.length,t.head+l)))}else{o.push({from:t.from,to:i.from},{from:i.to,insert:e.lineBreak+t.text});for(let e of i.ranges)r.push(z3.range(e.anchor-l,e.head-l))}}return!!o.length&&(t(e.update({changes:o,scrollIntoView:!0,selection:z3.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function jre(e,t,n){if(e.readOnly)return!1;let o=[];for(let r of Rre(e))n?o.push({from:r.from,insert:e.doc.slice(r.from,r.to)+e.lineBreak}):o.push({from:r.to,insert:e.lineBreak+e.doc.slice(r.from,r.to)});return t(e.update({changes:o,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Bre=Nre(!1);function Nre(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let o=t.changeByRange((n=>{let{from:o,to:r}=n,i=t.doc.lineAt(o),l=!e&&o==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,o=Xte(e).resolveInner(t),r=o.childBefore(t),i=o.childAfter(t);return r&&i&&r.to<=t&&i.from>=t&&(n=r.type.prop(Nee.closedBy))&&n.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,o);e&&(o=r=(r<=i.to?i:t.doc.lineAt(r)).to);let a=new cne(t,{simulateBreak:o,simulateDoubleBreak:!!l}),s=sne(a,o);for(null==s&&(s=X4(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));ri.from&&o{let r=[];for(let l=o.from;l<=o.to;){let i=e.doc.lineAt(l);i.number>n&&(o.empty||o.to>i.from)&&(t(i,r,o),n=i.number),l=i.to+1}let i=e.changes(r);return{changes:r,range:z3.range(i.mapPos(o.anchor,1),i.mapPos(o.head,1))}}))}const _re=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(zre(e,((t,n)=>{n.push({from:t.from,insert:e.facet(ine)})})),{userEvent:"input.indent"})),!0),Lre=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(zre(e,((t,n)=>{let o=/^\s*/.exec(t.text)[0];if(!o)return;let r=X4(o,e.tabSize),i=0,l=ane(e,Math.max(0,r-lne(e)));for(;iYoe(e,(t=>nre(e.state,t,!Uoe(e)))),shift:e=>dre(e,(t=>nre(e.state,t,!Uoe(e))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>Yoe(e,(t=>nre(e.state,t,Uoe(e)))),shift:e=>dre(e,(t=>nre(e.state,t,Uoe(e))))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>Dre(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>jre(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>Dre(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>jre(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,o=null;return n.ranges.length>1?o=z3.create([n.main]):n.main.empty||(o=z3.create([z3.cursor(n.main.head)])),!!o&&(t(Xoe(e,o)),!0)}},{key:"Mod-Enter",run:Nre(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=Rre(e).map((({from:t,to:n})=>z3.range(t,Math.min(n+1,e.doc.length))));return t(e.update({selection:z3.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=Zoe(e.selection,(t=>{var n;for(let o=Xte(e).resolveStack(t.from,1);o;o=o.next){let{node:e}=o;if((e.from=t.to||e.to>t.to&&e.from<=t.from)&&(null===(n=e.parent)||void 0===n?void 0:n.parent))return z3.range(e.to,e.from)}return t}));return t(Xoe(e,n)),!0},preventDefault:!0},{key:"Mod-[",run:Lre},{key:"Mod-]",run:_re},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),o=new cne(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=zre(e,((t,r,i)=>{let l=sne(o,t.from);if(null==l)return;/\S/.test(t.text)||(l=0);let a=/^\s*/.exec(t.text)[0],s=ane(e,l);(a!=s||i.from{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Rre(t).map((({from:e,to:n})=>(e>0?e--:ne.moveVertically(t,!0))).map(n);return e.dispatch({changes:n,selection:o,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,n){let o=!1,r=Zoe(e.selection,(t=>{let r=soe(e,t.head,-1)||soe(e,t.head,1)||t.head>0&&soe(e,t.head-1,1)||t.head{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),o=woe(e.state,n.from);return o.line?boe(e):!!o.block&&Ooe(e)}},{key:"Alt-A",run:yoe}].concat([{key:"ArrowLeft",run:qoe,shift:hre,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>ere(e,!Uoe(e)),shift:e=>gre(e,!Uoe(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>Yoe(e,(t=>ure(e,t,!Uoe(e)))),shift:e=>dre(e,(t=>ure(e,t,!Uoe(e)))),preventDefault:!0},{key:"ArrowRight",run:Joe,shift:fre,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>ere(e,Uoe(e)),shift:e=>gre(e,Uoe(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>Yoe(e,(t=>ure(e,t,Uoe(e)))),shift:e=>dre(e,(t=>ure(e,t,Uoe(e)))),preventDefault:!0},{key:"ArrowUp",run:rre,shift:vre,preventDefault:!0},{mac:"Cmd-ArrowUp",run:xre,shift:Sre},{mac:"Ctrl-ArrowUp",run:sre,shift:Ore},{key:"ArrowDown",run:ire,shift:bre,preventDefault:!0},{mac:"Cmd-ArrowDown",run:$re,shift:Cre},{mac:"Ctrl-ArrowDown",run:cre,shift:wre},{key:"PageUp",run:sre,shift:Ore},{key:"PageDown",run:cre,shift:wre},{key:"Home",run:e=>Yoe(e,(t=>ure(e,t,!1))),shift:e=>dre(e,(t=>ure(e,t,!1))),preventDefault:!0},{key:"Mod-Home",run:xre,shift:Sre},{key:"End",run:e=>Yoe(e,(t=>ure(e,t,!0))),shift:e=>dre(e,(t=>ure(e,t,!0))),preventDefault:!0},{key:"Mod-End",run:$re,shift:Cre},{key:"Enter",run:Bre},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Mre,shift:Mre},{key:"Delete",run:Ire},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Are},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>Ere(e,!0)},{mac:"Mod-Backspace",run:e=>kre(e,(t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}))},{mac:"Mod-Delete",run:e=>kre(e,(t=>{let n=e.moveToLineBoundary(t,!0).head;return t.headYoe(e,(t=>z3.cursor(e.lineBlockAt(t.head).from,1))),shift:e=>dre(e,(t=>z3.cursor(e.lineBlockAt(t.head).from)))},{key:"Ctrl-e",run:e=>Yoe(e,(t=>z3.cursor(e.lineBlockAt(t.head).to,-1))),shift:e=>dre(e,(t=>z3.cursor(e.lineBlockAt(t.head).to)))},{key:"Ctrl-d",run:Ire},{key:"Ctrl-h",run:Mre},{key:"Ctrl-k",run:e=>kre(e,(t=>{let n=e.lineBlockAt(t.head).to;return t.head{if(e.readOnly)return!1;let n=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:l3.of(["",""])},range:z3.cursor(e.from)})));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,o=e.doc.lineAt(n),r=n==o.from?n-1:y3(o.text,n-o.from,!1)+o.from,i=n==o.to?n+1:y3(o.text,n-o.from,!0)+o.from;return{changes:{from:r,to:i,insert:e.doc.slice(n,i).append(e.doc.slice(r,n))},range:z3.cursor(i)}}));return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:cre}].map((e=>({mac:e.key,run:e.run,shift:e.shift}))))),Hre={key:"Tab",run:_re,shift:Lre};function Fre(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)){var r=n[o];"string"==typeof r?e.setAttribute(o,r):null!=r&&(e[o]=r)}t++}for(;te.normalize("NFKD"):e=>e;class Zre{constructor(e,t,n=0,o=e.length,r,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,o),this.bufferStart=n,this.normalize=r?e=>r(Vre(e)):Vre,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return S3(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=C3(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=k3(e);let o=this.normalize(t);for(let r=0,i=n;;r++){let e=o.charCodeAt(r),l=this.match(e,i);if(r==o.length-1){if(l)return this.value=l,this;break}i==n&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,o=n+t[0].length;if(this.matchPos=Jre(this.text,o+(n==o?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,o,t)))return this.value={from:n,to:o,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=n||o.to<=t){let o=new Ure(t,e.sliceString(t,n));return Gre.set(e,o),o}if(o.from==t&&o.to==n)return o;let{text:r,from:i}=o;return i>t&&(r=e.sliceString(t,i)+r,i=t),o.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=Jre(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ure.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Jre(e,t){if(t>=e.length)return t;let n,o=e.lineAt(t);for(;t=56320&&n<57344;)t++;return t}function eie(e){let t=Fre("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:o}=e,r=o.doc.lineAt(o.selection.main.head),[,i,l,a,s]=n,c=a?+a.slice(1):0,u=l?+l:r.number;if(l&&s){let e=u/100;i&&(e=e*("-"==i?-1:1)+r.number/o.doc.lines),u=Math.round(o.doc.lines*e)}else l&&i&&(u=u*("-"==i?-1:1)+r.number);let d=o.doc.line(Math.max(1,Math.min(o.doc.lines,u))),p=z3.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[tie.of(!1),Z7.scrollIntoView(p.from,{y:"center"})],selection:p}),e.focus()}return{dom:Fre("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:tie.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},Fre("label",e.state.phrase("Go to line"),": ",t)," ",Fre("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(Kre.prototype[Symbol.iterator]=qre.prototype[Symbol.iterator]=function(){return this});const tie=v4.define(),nie=Y3.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(tie)&&(e=n.value);return e},provide:e=>dee.from(e,(e=>e?eie:null))}),oie=Z7.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),rie={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},iie=Q3.define({combine:e=>I4(e,rie,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})});function lie(e){let t=[die,uie];return e&&t.push(iie.of(e)),t}const aie=a8.mark({class:"cm-selectionMatch"}),sie=a8.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function cie(e,t,n,o){return!(0!=n&&e(t.sliceDoc(n-1,n))==C4.Word||o!=t.doc.length&&e(t.sliceDoc(o,o+1))==C4.Word)}const uie=G8.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(iie),{state:n}=e,o=n.selection;if(o.ranges.length>1)return a8.none;let r,i=o.main,l=null;if(i.empty){if(!t.highlightWordAroundCursor)return a8.none;let e=n.wordAt(i.head);if(!e)return a8.none;l=n.charCategorizer(i.head),r=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e200)return a8.none;if(t.wholeWords){if(r=n.sliceDoc(i.from,i.to),l=n.charCategorizer(i.head),!cie(l,n,i.from,i.to)||!function(e,t,n,o){return e(t.sliceDoc(n,n+1))==C4.Word&&e(t.sliceDoc(o-1,o))==C4.Word}(l,n,i.from,i.to))return a8.none}else if(r=n.sliceDoc(i.from,i.to).trim(),!r)return a8.none}let a=[];for(let s of e.visibleRanges){let e=new Zre(n.doc,r,s.from,s.to);for(;!e.next().done;){let{from:o,to:r}=e.value;if((!l||cie(l,n,o,r))&&(i.empty&&o<=i.from&&r>=i.to?a.push(sie.range(o,r)):(o>=i.to||r<=i.from)&&a.push(aie.range(o,r)),a.length>t.maxMatches))return a8.none}}return a8.set(a)}},{decorations:e=>e.decorations}),die=Z7.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),pie=Q3.define({combine:e=>I4(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Qie(e),scrollToMatch:e=>Z7.scrollIntoView(e)})});class hie{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,Yre),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"))}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Oie(this):new mie(this)}getCursor(e,t=0,n){let o=e.doc?e:M4.create({doc:e});return null==n&&(n=o.doc.length),this.regexp?vie(this,o,t,n):gie(this,o,t,n)}}class fie{constructor(e){this.spec=e}}function gie(e,t,n,o){return new Zre(t.doc,e.unquoted,n,o,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(r=t.doc,i=t.charCategorizer(t.selection.main.head),(e,t,n,o)=>((o>e||o+n.length=t)return null;o.push(n.value)}return o}highlight(e,t,n,o){let r=gie(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)o(r.value.from,r.value.to)}}function vie(e,t,n,o){return new Kre(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(r=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(r(bie(n.input,n.index))!=C4.Word||r(yie(n.input,n.index))!=C4.Word)&&(r(yie(n.input,n.index+n[0].length))!=C4.Word||r(bie(n.input,n.index+n[0].length))!=C4.Word)):void 0},n,o);var r}function bie(e,t){return e.slice(y3(e,t,!1),t)}function yie(e,t){return e.slice(t,y3(e,t))}class Oie extends fie{nextMatch(e,t,n){let o=vie(this.spec,e,n,e.doc.length).next();return o.done&&(o=vie(this.spec,e,0,t).next()),o.done?null:o.value}prevMatchInRange(e,t,n){for(let o=1;;o++){let r=Math.max(t,n-1e4*o),i=vie(this.spec,e,r,n),l=null;for(;!i.next().done;)l=i.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,((t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n=t)return null;o.push(n.value)}return o}highlight(e,t,n,o){let r=vie(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)o(r.value.from,r.value.to)}}const wie=v4.define(),xie=v4.define(),$ie=Y3.define({create:e=>new Sie(jie(e).create(),null),update(e,t){for(let n of t.effects)n.is(wie)?e=new Sie(n.value.create(),e.panel):n.is(xie)&&(e=new Sie(e.query,n.value?Die:null));return e},provide:e=>dee.from(e,(e=>e.panel))});class Sie{constructor(e,t){this.query=e,this.panel=t}}const Cie=a8.mark({class:"cm-searchMatch"}),kie=a8.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Pie=G8.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field($ie))}update(e){let t=e.state.field($ie);(t!=e.startState.field($ie)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return a8.none;let{view:n}=this,o=new B4;for(let r=0,i=n.visibleRanges,l=i.length;ri[r+1].from-500;)a=i[++r].to;e.highlight(n.state,t,a,((e,t)=>{let r=n.state.selection.ranges.some((n=>n.from==e&&n.to==t));o.add(e,t,r?kie:Cie)}))}return o.finish()}},{decorations:e=>e.decorations});function Tie(e){return t=>{let n=t.state.field($ie,!1);return n&&n.query.spec.valid?e(t,n):zie(t)}}const Mie=Tie(((e,{query:t})=>{let{to:n}=e.state.selection.main,o=t.nextMatch(e.state,n,n);if(!o)return!1;let r=z3.single(o.from,o.to),i=e.state.facet(pie);return e.dispatch({selection:r,effects:[Wie(e,o),i.scrollToMatch(r.main,e)],userEvent:"select.search"}),Nie(e),!0})),Iie=Tie(((e,{query:t})=>{let{state:n}=e,{from:o}=n.selection.main,r=t.prevMatch(n,o,o);if(!r)return!1;let i=z3.single(r.from,r.to),l=e.state.facet(pie);return e.dispatch({selection:i,effects:[Wie(e,r),l.scrollToMatch(i.main,e)],userEvent:"select.search"}),Nie(e),!0})),Eie=Tie(((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:z3.create(n.map((e=>z3.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),Aie=Tie(((e,{query:t})=>{let{state:n}=e,{from:o,to:r}=n.selection.main;if(n.readOnly)return!1;let i=t.nextMatch(n,o,o);if(!i)return!1;let l,a,s=[],c=[];if(i.from==o&&i.to==r&&(a=n.toText(t.getReplacement(i)),s.push({from:i.from,to:i.to,insert:a}),i=t.nextMatch(n,i.from,i.to),c.push(Z7.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(o).number)+"."))),i){let t=0==s.length||s[0].from>=i.to?0:i.to-i.from-a.length;l=z3.single(i.from-t,i.to-t),c.push(Wie(e,i)),c.push(n.facet(pie).scrollToMatch(l.main,e))}return e.dispatch({changes:s,selection:l,effects:c,userEvent:"input.replace"}),!0})),Rie=Tie(((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map((e=>{let{from:n,to:o}=e;return{from:n,to:o,insert:t.getReplacement(e)}}));if(!n.length)return!1;let o=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Z7.announce.of(o),userEvent:"input.replace.all"}),!0}));function Die(e){return e.state.facet(pie).createPanel(e)}function jie(e,t){var n,o,r,i,l;let a=e.selection.main,s=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!s)return t;let c=e.facet(pie);return new hie({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?s:s.replace(/\n/g,"\\n"),caseSensitive:null!==(o=null==t?void 0:t.caseSensitive)&&void 0!==o?o:c.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:c.literal,regexp:null!==(i=null==t?void 0:t.regexp)&&void 0!==i?i:c.regexp,wholeWord:null!==(l=null==t?void 0:t.wholeWord)&&void 0!==l?l:c.wholeWord})}function Bie(e){let t=aee(e,Die);return t&&t.dom.querySelector("[main-field]")}function Nie(e){let t=Bie(e);t&&t==e.root.activeElement&&t.select()}const zie=e=>{let t=e.state.field($ie,!1);if(t&&t.panel){let n=Bie(e);if(n&&n!=e.root.activeElement){let o=jie(e.state,t.query.spec);o.valid&&e.dispatch({effects:wie.of(o)}),n.focus(),n.select()}}else e.dispatch({effects:[xie.of(!0),t?wie.of(jie(e.state,t.query.spec)):v4.appendConfig.of(Zie)]});return!0},_ie=e=>{let t=e.state.field($ie,!1);if(!t||!t.panel)return!1;let n=aee(e,Die);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:xie.of(!1)}),!0},Lie=[{key:"Mod-f",run:zie,scope:"editor search-panel"},{key:"F3",run:Mie,shift:Iie,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Mie,shift:Iie,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:_ie,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:o,to:r}=n.main,i=[],l=0;for(let a=new Zre(e.doc,e.sliceDoc(o,r));!a.next().done;){if(i.length>1e3)return!1;a.value.from==o&&(l=i.length),i.push(z3.range(a.value.from,a.value.to))}return t(e.update({selection:z3.create(i,l),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=aee(e,eie);if(!t){let n=[tie.of(!0)];null==e.state.field(nie,!1)&&n.push(v4.appendConfig.of([nie,oie])),e.dispatch({effects:n}),t=aee(e,eie)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some((e=>e.from===e.to)))return(({state:e,dispatch:t})=>{let{selection:n}=e,o=z3.create(n.ranges.map((t=>e.wordAt(t.head)||z3.cursor(t.head))),n.mainIndex);return!o.eq(n)&&(t(e.update({selection:o})),!0)})({state:e,dispatch:t});let o=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some((t=>e.sliceDoc(t.from,t.to)!=o)))return!1;let r=function(e,t){let{main:n,ranges:o}=e.selection,r=e.wordAt(n.head),i=r&&r.from==n.from&&r.to==n.to;for(let l=!1,a=new Zre(e.doc,t,o[o.length-1].to);;){if(a.next(),!a.done){if(l&&o.some((e=>e.from==a.value.from)))continue;if(i){let t=e.wordAt(a.value.from);if(!t||t.from!=a.value.from||t.to!=a.value.to)continue}return a.value}if(l)return null;a=new Zre(e.doc,t,0,Math.max(0,o[o.length-1].from-1)),l=!0}}(e,o);return!!r&&(t(e.update({selection:e.selection.addRange(z3.range(r.from,r.to),!1),effects:Z7.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class Qie{constructor(e){this.view=e;let t=this.query=e.state.field($ie).query.spec;function n(e,t,n){return Fre("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=Fre("input",{value:t.search,placeholder:Hie(e,"Find"),"aria-label":Hie(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Fre("input",{value:t.replace,placeholder:Hie(e,"Replace"),"aria-label":Hie(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Fre("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Fre("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Fre("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=Fre("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",(()=>Mie(e)),[Hie(e,"next")]),n("prev",(()=>Iie(e)),[Hie(e,"previous")]),n("select",(()=>Eie(e)),[Hie(e,"all")]),Fre("label",null,[this.caseField,Hie(e,"match case")]),Fre("label",null,[this.reField,Hie(e,"regexp")]),Fre("label",null,[this.wordField,Hie(e,"by word")]),...e.state.readOnly?[]:[Fre("br"),this.replaceField,n("replace",(()=>Aie(e)),[Hie(e,"replace")]),n("replaceAll",(()=>Rie(e)),[Hie(e,"replace all")])],Fre("button",{name:"close",onclick:()=>_ie(e),"aria-label":Hie(e,"close"),type:"button"},["×"])])}commit(){let e=new hie({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:wie.of(e)}))}keydown(e){var t,n,o;t=this.view,n=e,o="search-panel",r9(n9(t.state),n,t,o)?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Iie:Mie)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),Aie(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(wie)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(pie).top}}function Hie(e,t){return e.state.phrase(t)}const Fie=/[\s\.,:;?!]/;function Wie(e,{from:t,to:n}){let o=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,i=Math.max(o.from,t-30),l=Math.min(r,n+30),a=e.state.sliceDoc(i,l);if(i!=o.from)for(let s=0;s<30;s++)if(!Fie.test(a[s+1])&&Fie.test(a[s])){a=a.slice(s);break}if(l!=r)for(let s=a.length-1;s>a.length-30;s--)if(!Fie.test(a[s-1])&&Fie.test(a[s])){a=a.slice(0,s);break}return Z7.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${o.number}.`)}const Vie=Z7.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Zie=[$ie,e4.low(Pie),Vie];class Xie{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=Xte(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),o=t.text.slice(n-t.from,this.pos-t.from),r=o.search(qie(e,!1));return r<0?null:{from:n+r,to:this.pos,text:o.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function Yie(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function Kie(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[n,o]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e{let r=e.matchBefore(o);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}class Gie{constructor(e,t,n,o){this.completion=e,this.source=t,this.match=n,this.score=o}}function Uie(e){return e.selection.main.from}function qie(e,t){var n;let{source:o}=e,r=t&&"^"!=o[0],i="$"!=o[o.length-1];return r||i?new RegExp(`${r?"^":""}(?:${o})${i?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const Jie=f4.define(),ele=new WeakMap;function tle(e){if(!Array.isArray(e))return e;let t=ele.get(e);return t||ele.set(e,t=Kie(e)),t}const nle=v4.define(),ole=v4.define();class rle{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&o<=57||o>=97&&o<=122?2:o>=65&&o<=90?1:0:(s=C3(o))!=s.toLowerCase()?1:s!=s.toUpperCase()?2:0;(!v||1==b&&g||0==y&&0!=b)&&(t[u]==o||n[u]==o&&(d=!0)?i[u++]=v:i.length&&(m=!1)),y=b,v+=k3(o)}return u==a&&0==i[0]&&m?this.result((d?-200:0)-100,i,e):p==a&&0==h?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):p==a?this.ret(-900-e.length,[h,f]):u==a?this.result((d?-200:0)-100-700+(m?0:-1100),i,e):2!=t.length&&this.result((o[0]?-700:0)-200-1100,o,e)}result(e,t,n){let o=[],r=0;for(let i of t){let e=i+(this.astral?k3(S3(n,i)):1);r&&o[r-1]==i?o[r-1]=e:(o[r++]=i,o[r++]=e)}return this.ret(e-n.length,o)}}const ile=Q3.define({combine:e=>I4(e,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:ale,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>lle(e(n),t(n)),optionClass:(e,t)=>n=>lle(e(n),t(n)),addToOptions:(e,t)=>e.concat(t)})});function lle(e,t){return e?t?e+" "+t:e:t}function ale(e,t,n,o,r,i){let l,a,s=e.textDirection==m8.RTL,c=s,u=!1,d="top",p=t.left-r.left,h=r.right-t.right,f=o.right-o.left,g=o.bottom-o.top;if(c&&p=g||e>t.top?l=n.bottom-t.top:(d="bottom",l=t.bottom-n.top)}return{style:`${d}: ${l/((t.bottom-t.top)/i.offsetHeight)}px; max-width: ${a/((t.right-t.left)/i.offsetWidth)}px`,class:"cm-completionInfo-"+(u?s?"left-narrow":"right-narrow":c?"left":"right")}}function sle(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let o=Math.floor((e-t)/n);return{from:e-(o+1)*n,to:e-o*n}}class cle{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let o=e.state.field(t),{options:r,selected:i}=o.open,l=e.state.facet(ile);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map((e=>"cm-completionIcon-"+e))),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,o){let r=document.createElement("span");r.className="cm-completionLabel";let i=e.displayLabel||e.label,l=0;for(let a=0;al&&r.appendChild(document.createTextNode(i.slice(l,e)));let n=r.appendChild(document.createElement("span"));n.appendChild(document.createTextNode(i.slice(e,t))),n.className="cm-completionMatchedText",l=t}return le.position-t.position)).map((e=>e.render))}(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=sle(r.length,i,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",(n=>{let{options:o}=e.state.field(t).open;for(let t,r=n.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(t=/-(\d+)$/.exec(r.id))&&+t[1]{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(ile).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:ole.of(null)})})),this.showOptions(r,o.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(e){var t;let n=e.state.field(this.stateField),o=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=o){let{options:r,selected:i,disabled:l}=n.open;o.open&&o.open.options==r||(this.range=sle(r.length,i,e.state.facet(ile).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),l!=(null===(t=o.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=sle(t.options.length,t.selected,this.view.state.facet(ile).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:o}=n;if(!o)return;let r="string"==typeof o?document.createTextNode(o):o(n);if(!r)return;"then"in r?r.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)})).catch((e=>Z8(this.view.state,e,"completion info"))):this.addInfoPane(r,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:o}=e;n.appendChild(t),this.infoDestroy=o||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,o=this.range.from;n;n=n.nextSibling,o++)"LI"==n.nodeName&&n.id?o==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected"):o--;return t&&function(e,t){let n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.height/e.offsetHeight;o.topn.bottom&&(e.scrollTop+=(o.bottom-n.bottom)/r)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),o=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:e.innerWidth,bottom:e.innerHeight}}return o.top>Math.min(r.bottom,t.bottom)-10||o.bottomn.from||0==n.from)&&(r=e,"string"!=typeof s&&s.header?o.appendChild(s.header(s)):o.appendChild(document.createElement("completion-section")).textContent=e)}const c=o.appendChild(document.createElement("li"));c.id=t+"-"+i,c.setAttribute("role","option");let u=this.optionClass(l);u&&(c.className=u);for(let e of this.optionContent){let t=e(l,this.view.state,this.view,a);t&&c.appendChild(t)}}return n.from&&o.classList.add("cm-completionListIncompleteTop"),n.tonew cle(n,e,t)}function dle(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class ple{constructor(e,t,n,o,r,i){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=o,this.selected=r,this.disabled=i}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new ple(this.options,gle(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,o,r){let i=function(e,t){let n=[],o=null,r=e=>{n.push(e);let{section:t}=e.completion;if(t){o||(o=[]);let e="string"==typeof t?t:t.name;o.some((t=>t.name==e))||o.push("string"==typeof t?{name:e}:t)}};for(let s of e)if(s.hasResult()){let e=s.result.getMatch;if(!1===s.result.filter)for(let t of s.result.options)r(new Gie(t,s.source,e?e(t):[],1e9-n.length));else{let n=new rle(t.sliceDoc(s.from,s.to));for(let t of s.result.options)if(n.match(t.label)){let o=t.displayLabel?e?e(t,n.matched):[]:n.matched;r(new Gie(t,s.source,o,n.score+(t.boost||0)))}}}if(o){let e=Object.create(null),t=0,r=(e,t)=>{var n,o;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(o=t.rank)&&void 0!==o?o:1e9)||(e.namet.score-e.score||a(e.completion,t.completion)))){let e=s.completion;!l||l.label!=e.label||l.detail!=e.detail||null!=l.type&&null!=e.type&&l.type!=e.type||l.apply!=e.apply||l.boost!=e.boost?i.push(s):dle(s.completion)>dle(l)&&(i[i.length-1]=s),l=s.completion}return i}(e,t);if(!i.length)return o&&e.some((e=>1==e.state))?new ple(o.options,o.attrs,o.tooltip,o.timestamp,o.selected,!0):null;let l=t.facet(ile).selectOnOpen?0:-1;if(o&&o.selected!=l&&-1!=o.selected){let e=o.options[o.selected].completion;for(let t=0;tt.hasResult()?Math.min(e,t.from):e),1e8),create:Sle,above:r.aboveCursor},o?o.timestamp:Date.now(),l,!1)}map(e){return new ple(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class hle{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new hle(mle,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(ile),o=(n.override||t.languageDataAt("autocomplete",Uie(t)).map(tle)).map((t=>(this.active.find((e=>e.source==t))||new ble(t,this.active.some((e=>0!=e.state))?1:0)).update(e,n)));o.length==this.active.length&&o.every(((e,t)=>e==this.active[t]))&&(o=this.active);let r=this.open;r&&e.docChanged&&(r=r.map(e.changes)),e.selection||o.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let n=0,o=0;;){for(;n1==e.state))&&(r=null),!r&&o.every((e=>1!=e.state))&&o.some((e=>e.hasResult()))&&(o=o.map((e=>e.hasResult()?new ble(e.source,0):e)));for(let i of e.effects)i.is(wle)&&(r=r&&r.setSelected(i.value,this.id));return o==this.active&&r==this.open?this:new hle(o,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:fle}}const fle={"aria-autocomplete":"list"};function gle(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const mle=[];function vle(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class ble{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=vle(e),o=this;n?o=o.handleUserEvent(e,n,t):e.docChanged?o=o.handleChange(e):e.selection&&0!=o.state&&(o=new ble(o.source,0));for(let r of e.effects)if(r.is(nle))o=new ble(o.source,1,r.value?Uie(e.state):-1);else if(r.is(ole))o=new ble(o.source,0);else if(r.is(Ole))for(let e of r.value)e.source==o.source&&(o=e);return o}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new ble(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(Uie(e.startState))?new ble(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new ble(this.source,this.state,e.mapPos(this.explicitPos))}}class yle extends ble{constructor(e,t,n,o,r){super(e,2,t),this.result=n,this.from=o,this.to=r}hasResult(){return!0}handleUserEvent(e,t,n){var o;let r=e.changes.mapPos(this.from),i=e.changes.mapPos(this.to,1),l=Uie(e.state);if((this.explicitPos<0?l<=r:li||"delete"==t&&Uie(e.startState)==this.from)return new ble(this.source,"input"==t&&n.activateOnTyping?1:0);let a,s=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,n,o){if(!e)return!1;let r=t.sliceDoc(n,o);return"function"==typeof e?e(r,n,o,t):qie(e,!0).test(r)}(this.result.validFor,e.state,r,i)?new yle(this.source,s,this.result,r,i):this.result.update&&(a=this.result.update(this.result,r,i,new Xie(e.state,l,s>=0)))?new yle(this.source,s,a,a.from,null!==(o=a.to)&&void 0!==o?o:Uie(e.state)):new ble(this.source,1,s)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new ble(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new yle(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}const Ole=v4.define({map:(e,t)=>e.map((e=>e.map(t)))}),wle=v4.define(),xle=Y3.define({create:()=>hle.start(),update:(e,t)=>e.update(t),provide:e=>[q9.from(e,(e=>e.tooltip)),Z7.contentAttributes.from(e,(e=>e.attrs))]});function $le(e,t){const n=t.completion.apply||t.completion.label;let o=e.state.field(xle).active.find((e=>e.source==t.source));return o instanceof yle&&("string"==typeof n?e.dispatch(Object.assign(Object.assign({},function(e,t,n,o){let{main:r}=e.selection,i=n-r.from,l=o-r.from;return Object.assign(Object.assign({},e.changeByRange((a=>a!=r&&n!=o&&e.sliceDoc(a.from+i,a.from+l)!=e.sliceDoc(n,o)?{range:a}:{changes:{from:a.from+i,to:o==r.from?a.to:a.from+l,insert:t},range:z3.cursor(a.from+i+t.length)}))),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,n,o.from,o.to)),{annotations:Jie.of(t.completion)})):n(e,t.completion,o.from,o.to),!0)}const Sle=ule(xle,$le);function Cle(e,t="option"){return n=>{let o=n.state.field(xle,!1);if(!o||!o.open||o.open.disabled||Date.now()-o.open.timestamp-1?o.open.selected+i*(e?1:-1):e?0:l-1;return a<0?a="page"==t?0:l-1:a>=l&&(a="page"==t?l-1:0),n.dispatch({effects:wle.of(a)}),!0}}class kle{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Ple=G8.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let t of e.state.field(xle).active)1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(xle);if(!e.selectionSet&&!e.docChanged&&e.startState.field(xle)==t)return;let n=e.transactions.some((e=>(e.selection||e.docChanged)&&!vle(e)));for(let o=0;o50&&Date.now()-t.time>1e3){for(let e of t.context.abortListeners)try{e()}catch(Rpe){Z8(this.view.state,Rpe)}t.context.abortListeners=null,this.running.splice(o--,1)}else t.updates.push(...e.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=t.active.some((e=>1==e.state&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),50):-1,0!=this.composing)for(let o of e.transactions)"input"==vle(o)?this.composing=2:2==this.composing&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:e}=this.view,t=e.field(xle);for(let n of t.active)1!=n.state||this.running.some((e=>e.active.source==n.source))||this.startQuery(n)}startQuery(e){let{state:t}=this.view,n=Uie(t),o=new Xie(t,n,e.explicitPos==n),r=new kle(e,o);this.running.push(r),Promise.resolve(e.source(o)).then((e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())}),(e=>{this.view.dispatch({effects:ole.of(null)}),Z8(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(ile).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(ile);for(let o=0;oe.source==r.active.source));if(i&&1==i.state)if(null==r.done){let e=new ble(r.active.source,0);for(let t of r.updates)e=e.update(t,n);1!=e.state&&t.push(e)}else this.startQuery(i)}t.length&&this.view.dispatch({effects:Ole.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(xle,!1);if(t&&t.tooltip&&this.view.state.facet(ile).closeOnBlur){let n=t.open&&ree(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||this.view.dispatch({effects:ole.of(null)})}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:nle.of(!1)})),20),this.composing=0}}}),Tle=Z7.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Mle{constructor(e,t,n,o){this.field=e,this.line=t,this.from=n,this.to=o}}class Ile{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,T3.TrackDel),n=e.mapPos(this.to,1,T3.TrackDel);return null==t||null==n?null:new Ile(this.field,t,n)}}class Ele{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],o=[t],r=e.doc.lineAt(t),i=/^\s*/.exec(r.text)[0];for(let l of this.lines){if(n.length){let n=i,r=/^\t*/.exec(l)[0].length;for(let t=0;tnew Ile(e.field,o[e.line]+e.from,o[e.line]+e.to)))}}static parse(e){let t,n=[],o=[],r=[];for(let i of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(i);){let e=t[1]?+t[1]:null,l=t[2]||t[3]||"",a=-1;for(let t=0;t=a&&e.field++}r.push(new Mle(a,o.length,t.index,t.index+l.length)),i=i.slice(0,t.index)+l+i.slice(t.index+t[0].length)}for(let e;e=/\\([{}])/.exec(i);){i=i.slice(0,e.index)+e[1]+i.slice(e.index+e[0].length);for(let t of r)t.line==o.length&&t.from>e.index&&(t.from--,t.to--)}o.push(i)}return new Ele(o,r)}}let Ale=a8.widget({widget:new class extends i8{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),Rle=a8.mark({class:"cm-snippetField"});class Dle{constructor(e,t){this.ranges=e,this.active=t,this.deco=a8.set(e.map((e=>(e.from==e.to?Ale:Rle).range(e.from,e.to))))}map(e){let t=[];for(let n of this.ranges){let o=n.map(e);if(!o)return null;t.push(o)}return new Dle(t,this.active)}selectionInsideField(e){return e.ranges.every((e=>this.ranges.some((t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))))}}const jle=v4.define({map:(e,t)=>e&&e.map(t)}),Ble=v4.define(),Nle=Y3.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(jle))return n.value;if(n.is(Ble)&&e)return new Dle(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Z7.decorations.from(e,(e=>e?e.deco:a8.none))});function zle(e,t){return z3.create(e.filter((e=>e.field==t)).map((e=>z3.range(e.from,e.to))))}function _le(e){let t=Ele.parse(e);return(e,n,o,r)=>{let{text:i,ranges:l}=t.instantiate(e.state,o),a={changes:{from:o,to:r,insert:l3.of(i)},scrollIntoView:!0,annotations:n?Jie.of(n):void 0};if(l.length&&(a.selection=zle(l,0)),l.length>1){let t=new Dle(l,0),n=a.effects=[jle.of(t)];void 0===e.state.field(Nle,!1)&&n.push(v4.appendConfig.of([Nle,Fle,Vle,Tle]))}e.dispatch(e.state.update(a))}}function Lle(e){return({state:t,dispatch:n})=>{let o=t.field(Nle,!1);if(!o||e<0&&0==o.active)return!1;let r=o.active+e,i=e>0&&!o.ranges.some((t=>t.field==r+e));return n(t.update({selection:zle(o.ranges,r),effects:jle.of(i?null:new Dle(o.ranges,r)),scrollIntoView:!0})),!0}}const Qle=[{key:"Tab",run:Lle(1),shift:Lle(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(Nle,!1)&&(t(e.update({effects:jle.of(null)})),!0)}],Hle=Q3.define({combine:e=>e.length?e[0]:Qle}),Fle=e4.highest(e9.compute([Hle],(e=>e.facet(Hle))));function Wle(e,t){return Object.assign(Object.assign({},t),{apply:_le(e)})}const Vle=Z7.domEventHandlers({mousedown(e,t){let n,o=t.state.field(Nle,!1);if(!o||null==(n=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let r=o.ranges.find((e=>e.from<=n&&e.to>=n));return!(!r||r.field==o.active||(t.dispatch({selection:zle(o.ranges,r.field),effects:jle.of(o.ranges.some((e=>e.field>r.field))?new Dle(o.ranges,r.field):null),scrollIntoView:!0}),0))}}),Zle={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Xle=v4.define({map(e,t){let n=t.mapPos(e,-1,T3.TrackAfter);return null==n?void 0:n}}),Yle=new class extends E4{};Yle.startSide=1,Yle.endSide=-1;const Kle=Y3.define({create:()=>j4.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(Xle)&&(e=e.update({add:[Yle.range(n.value,n.value+1)]}));return e}}),Gle="()[]{}<>";function Ule(e){for(let t=0;t<8;t+=2)if(Gle.charCodeAt(t)==e)return Gle.charAt(t+1);return C3(e<128?e:e+1)}function qle(e,t){return e.languageDataAt("closeBrackets",t)[0]||Zle}const Jle="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),eae=Z7.inputHandler.of(((e,t,n,o)=>{if((Jle?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(o.length>2||2==o.length&&1==k3(S3(o,0))||t!=r.from||n!=r.to)return!1;let i=function(e,t){let n=qle(e,e.selection.main.head),o=n.brackets||Zle.brackets;for(let r of o){let i=Ule(S3(r,0));if(t==r)return i==r?lae(e,r,o.indexOf(r+r+r)>-1,n):rae(e,r,i,n.before||Zle.before);if(t==i&&nae(e,e.selection.main.from))return iae(e,0,i)}return null}(e.state,o);return!!i&&(e.dispatch(i),!0)})),tae=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=qle(e,e.selection.main.head).brackets||Zle.brackets,o=null,r=e.changeByRange((t=>{if(t.empty){let o=function(e,t){let n=e.sliceString(t-2,t);return k3(S3(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let r of n)if(r==o&&oae(e.doc,t.head)==Ule(S3(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:z3.cursor(t.head-r.length)}}return{range:o=t}}));return o||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!o}}];function nae(e,t){let n=!1;return e.field(Kle).between(0,e.doc.length,(e=>{e==t&&(n=!0)})),n}function oae(e,t){let n=e.sliceString(t,t+2);return n.slice(0,k3(S3(n,0)))}function rae(e,t,n,o){let r=null,i=e.changeByRange((i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:n,from:i.to}],effects:Xle.of(i.to+t.length),range:z3.range(i.anchor+t.length,i.head+t.length)};let l=oae(e.doc,i.head);return!l||/\s/.test(l)||o.indexOf(l)>-1?{changes:{insert:t+n,from:i.head},effects:Xle.of(i.head+t.length),range:z3.cursor(i.head+t.length)}:{range:r=i}}));return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function iae(e,t,n){let o=null,r=e.changeByRange((t=>t.empty&&oae(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:z3.cursor(t.head+n.length)}:o={range:t}));return o?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function lae(e,t,n,o){let r=o.stringPrefixes||Zle.stringPrefixes,i=null,l=e.changeByRange((o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:t,from:o.to}],effects:Xle.of(o.to+t.length),range:z3.range(o.anchor+t.length,o.head+t.length)};let l,a=o.head,s=oae(e.doc,a);if(s==t){if(aae(e,a))return{changes:{insert:t+t,from:a},effects:Xle.of(a+t.length),range:z3.cursor(a+t.length)};if(nae(e,a)){let o=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+o.length,insert:o},range:z3.cursor(a+o.length)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(l=sae(e,a-2*t.length,r))>-1&&aae(e,l))return{changes:{insert:t+t+t+t,from:a},effects:Xle.of(a+t.length),range:z3.cursor(a+t.length)};if(e.charCategorizer(a)(s)!=C4.Word&&sae(e,a,r)>-1&&!function(e,t,n,o){let r=Xte(e).resolveInner(t,-1),i=o.reduce(((e,t)=>Math.max(e,t.length)),0);for(let l=0;l<5;l++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+i)),a=l.indexOf(n);if(!a||a>-1&&o.indexOf(l.slice(0,a))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let s=r.to==t&&r.parent;if(!s)break;r=s}return!1}(e,a,t,r))return{changes:{insert:t+t,from:a},effects:Xle.of(a+t.length),range:z3.cursor(a+t.length)}}return{range:i=o}}));return i?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function aae(e,t){let n=Xte(e).resolveInner(t+1);return n.parent&&n.from==t}function sae(e,t,n){let o=e.charCategorizer(t);if(o(e.sliceDoc(t-1,t))!=C4.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&o(e.sliceDoc(n-1,n))!=C4.Word)return n}return-1}function cae(e={}){return[xle,ile.of(e),Ple,dae,Tle]}const uae=[{key:"Ctrl-Space",run:e=>!!e.state.field(xle,!1)&&(e.dispatch({effects:nle.of(!0)}),!0)},{key:"Escape",run:e=>{let t=e.state.field(xle,!1);return!(!t||!t.active.some((e=>0!=e.state))||(e.dispatch({effects:ole.of(null)}),0))}},{key:"ArrowDown",run:Cle(!0)},{key:"ArrowUp",run:Cle(!1)},{key:"PageDown",run:Cle(!0,"page")},{key:"PageUp",run:Cle(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(xle,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.facet(ile).defaultKeymap?[uae]:[])));class pae{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class hae{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let o=e,r=n.facet(Pae).markerFilter;r&&(o=r(o));let i=a8.set(o.map((e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?a8.widget({widget:new Aae(e),diagnostic:e}).range(e.from):a8.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity+(e.markClass?" "+e.markClass:"")},diagnostic:e}).range(e.from,e.to))),!0);return new hae(i,t,fae(i))}}function fae(e,t=null,n=0){let o=null;return e.between(n,1e9,((e,n,{spec:r})=>{if(!t||r.diagnostic==t)return o=new pae(e,n,r.diagnostic),!1})),o}function gae(e,t){let n=e.startState.doc.lineAt(t.pos);return!(!e.effects.some((e=>e.is(vae)))&&!e.changes.touchesRange(n.from,n.to))}function mae(e,t){return e.field(Oae,!1)?t:t.concat(v4.appendConfig.of(Zae))}const vae=v4.define(),bae=v4.define(),yae=v4.define(),Oae=Y3.define({create:()=>new hae(a8.none,null,null),update(e,t){if(t.docChanged){let n=e.diagnostics.map(t.changes),o=null;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);o=fae(n,e.selected.diagnostic,r)||fae(n,null,r)}e=new hae(n,e.panel,o)}for(let n of t.effects)n.is(vae)?e=hae.init(n.value,e.panel,t.state):n.is(bae)?e=new hae(e.diagnostics,n.value?Dae.open:null,e.selected):n.is(yae)&&(e=new hae(e.diagnostics,e.panel,n.value));return e},provide:e=>[dee.from(e,(e=>e.panel)),Z7.decorations.from(e,(e=>e.diagnostics))]}),wae=a8.mark({class:"cm-lintRange cm-lintRange-active"});function xae(e,t,n){let{diagnostics:o}=e.state.field(Oae),r=[],i=2e8,l=0;o.between(t-(n<0?1:0),t+(n>0?1:0),((e,o,{spec:a})=>{t>=e&&t<=o&&(e==o||(t>e||n>0)&&(t({dom:$ae(e,r)})}:null}function $ae(e,t){return Fre("ul",{class:"cm-tooltip-lint"},t.map((t=>Eae(e,t,!1))))}const Sae=e=>{let t=e.state.field(Oae,!1);return!(!t||!t.panel||(e.dispatch({effects:bae.of(!1)}),0))},Cae=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(Oae,!1);t&&t.panel||e.dispatch({effects:mae(e.state,[bae.of(!0)])});let n=aee(e,Dae.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(Oae,!1);if(!t)return!1;let n=e.state.selection.main,o=t.diagnostics.iter(n.to+1);return!(!o.value&&(o=t.diagnostics.iter(0),!o.value||o.from==n.from&&o.to==n.to)||(e.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0}),0))}}],kae=G8.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(Pae);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){let e=Date.now();if(ePromise.resolve(e(this.view))))).then((t=>{let n=t.reduce(((e,t)=>e.concat(t)));this.view.state.doc==e.doc&&this.view.dispatch(function(e,t){return{effects:mae(e,[vae.of(t)])}}(this.view.state,n))}),(e=>{Z8(this.view.state,e)}))}}update(e){let t=e.state.facet(Pae);(e.docChanged||t!=e.startState.facet(Pae)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Pae=Q3.define({combine:e=>Object.assign({sources:e.map((e=>e.source))},I4(e.map((e=>e.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function Tae(e,t={}){return[Pae.of({source:e,config:t}),kae,Zae]}function Mae(e){let t=e.plugin(kae);t&&t.force()}function Iae(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;ee.toLowerCase()==o.toLowerCase()))){t.push(o);continue e}}t.push("")}return t}function Eae(e,t,n){var o;let r=n?Iae(t.actions):[];return Fre("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Fre("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage():t.message),null===(o=t.actions)||void 0===o?void 0:o.map(((n,o)=>{let i=!1,l=o=>{if(o.preventDefault(),i)return;i=!0;let r=fae(e.state.field(Oae).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:a}=n,s=r[o]?a.indexOf(r[o]):-1,c=s<0?a:[a.slice(0,s),Fre("u",a.slice(s,s+1)),a.slice(s+1)];return Fre("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${a}${s<0?"":` (access key "${r[o]})"`}.`},c)})),t.source&&Fre("div",{class:"cm-diagnosticSource"},t.source))}class Aae extends i8{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Fre("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Rae{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=Eae(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Dae{constructor(e){this.view=e,this.items=[],this.list=Fre("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)Sae(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],o=Iae(n.actions);for(let r=0;r{for(let t=0;tSae(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Oae).selected;if(!e)return-1;for(let t=0;t{let a,s=-1;for(let t=n;tn&&(this.items.splice(n,s-n),o=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),r=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}));n({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.topt.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=fae(this.view.state.field(Oae).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:yae.of(t)})}static open(e){return new Dae(e)}}function jae(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function Bae(e){return jae(``,'width="6" height="3"')}const Nae=Z7.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Bae("#d11")},".cm-lintRange-warning":{backgroundImage:Bae("orange")},".cm-lintRange-info":{backgroundImage:Bae("#999")},".cm-lintRange-hint":{backgroundImage:Bae("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function zae(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}class _ae extends pee{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce(((e,t)=>zae(e)function(e,t,n){function o(){let o=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(o.from)&&e.dispatch({effects:Fae.of({pos:o.from,above:!1,create:()=>({dom:$ae(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,function(e,t){let n=o=>{let r=t.getBoundingClientRect();if(!(o.clientX>r.left-10&&o.clientXr.top-10&&o.clientY{clearTimeout(i),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(i),i=setTimeout(o,r)}}(e,t,n)),t}}function Lae(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let o=[];for(let r in n)o.push(new _ae(n[r]).range(+r));return j4.of(o,!0)}const Qae=mee({class:"cm-gutter-lint",markers:e=>e.state.field(Hae)}),Hae=Y3.define({create:()=>j4.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(Xae).markerFilter;for(let o of t.effects)if(o.is(vae)){let r=o.value;n&&(r=n(r||[])),e=Lae(t.state.doc,r.slice(0))}return e}}),Fae=v4.define(),Wae=Y3.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=gae(t,e)?null:Object.assign(Object.assign({},e),{pos:t.changes.mapPos(e.pos)})),t.effects.reduce(((e,t)=>t.is(Fae)?t.value:e),e)),provide:e=>q9.from(e)}),Vae=Z7.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:jae('')},".cm-lint-marker-warning":{content:jae('')},".cm-lint-marker-error":{content:jae('')}}),Zae=[Oae,Z7.decorations.compute([Oae],(e=>{let{selected:t,panel:n}=e.field(Oae);return t&&n&&t.from!=t.to?a8.set([wae.range(t.from,t.to)]):a8.none})),oee(xae,{hideOn:gae}),Nae],Xae=Q3.define({combine:e=>I4(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});function Yae(e={}){return[Xae.of(e),Hae,Qae,Vae,Wae]}const Kae=(()=>[Iee(),Ree,I9(),Moe(),Qne(),h9(),[w9,x9],M4.allowMultipleSelections.of(!0),M4.transactionFilter.of((e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:o}=e.newSelection.main,r=n.lineAt(o);if(o>r.from+200)return e;let i=n.sliceString(r.from,o);if(!t.some((e=>e.test(i))))return e;let{state:l}=e,a=-1,s=[];for(let{head:c}of l.selection.ranges){let e=l.doc.lineAt(c);if(e.from==a)continue;a=e.from;let t=sne(l,e.from);if(null==t)continue;let n=/^\s*/.exec(e.text)[0],o=ane(l,t);n!=o&&s.push({from:e.from,to:e.from+n.length,insert:o})}return s.length?[e,{changes:s,sequential:!0}]:e})),Xne(Gne,{fallback:!0}),roe(),[eae,Kle],cae(),L9(),F9(),j9,lie(),e9.of([...tae,...Qre,...Lie,...Voe,...Ane,...uae,...Cae])])(),Gae=(()=>[I9(),Moe(),h9(),Xne(Gne,{fallback:!0}),e9.of([...Qre,...Voe])])();function Uae(e,t={},n){const{props:o,domProps:r,on:i,...l}=t,a=i?(e=>e?Object.entries(e).reduce(((e,[t,n])=>({...e,[t=`on${t=t.charAt(0).toUpperCase()+t.slice(1)}`]:n})),{}):{})(i):{};return Kr(e,{...l,...o,...r,...a},n)}var qae=Ln({name:"CodeMirror",model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,default:""},theme:{type:Object,default:()=>{}},dark:{type:Boolean,default:!1},basic:{type:Boolean,default:!1},minimal:{type:Boolean,default:!1},placeholder:{type:String,default:void 0},wrap:{type:Boolean,default:!1},tab:{type:Boolean,default:!1},allowMultipleSelections:{type:Boolean,default:!1},tabSize:{type:Number,default:void 0},lineSeparator:{type:String,default:void 0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},extensions:{type:Array,default:()=>[]},phrases:{type:Object,default:()=>{}},lang:{type:Object,default:()=>{}},linter:{type:Function,default:void 0},linterConfig:{type:Object,default:()=>({})},forceLinting:{type:Boolean,default:!1},gutter:{type:Boolean,defalt:!1},gutterConfig:{type:Object,default:()=>{}},tag:{type:String,default:"div"}},emits:{"update:modelValue":e=>!0,update:e=>!0,ready:e=>!0,focus:e=>!0,change:e=>!0,destroy:()=>!0},setup(e,t){const n=Ot(),o=Ot(e.modelValue),r=wt(new Z7),i=Yr({get:()=>r.value.hasFocus,set:e=>{e&&r.value.focus()}}),l=Yr({get:()=>r.value.state.selection,set:e=>r.value.dispatch({selection:e})}),a=Yr({get:()=>r.value.state.selection.main.head,set:e=>r.value.dispatch({selection:{anchor:e}})}),s=Yr({get:()=>r.value.state.toJSON(),set:e=>r.value.setState(M4.fromJSON(e))}),c=Ot(0),u=Ot(0),d=Yr((()=>{const n=new n4,o=new n4;return[e.basic?Kae:void 0,e.minimal&&!e.basic?Gae:void 0,Z7.updateListener.of((n=>{t.emit("focus",r.value.hasFocus),c.value=r.value.state.doc.length,!n.changes.empty&&n.docChanged&&(e.linter&&(e.forceLinting&&Mae(r.value),u.value=e.linter(r.value).length),t.emit("update",n))})),Z7.theme(e.theme,{dark:e.dark}),e.wrap?Z7.lineWrapping:void 0,e.tab?e9.of([Hre]):void 0,M4.allowMultipleSelections.of(e.allowMultipleSelections),e.tabSize?o.of(M4.tabSize.of(e.tabSize)):void 0,e.phrases?M4.phrases.of(e.phrases):void 0,M4.readOnly.of(e.readonly),Z7.editable.of(!e.disabled),e.lineSeparator?M4.lineSeparator.of(e.lineSeparator):void 0,e.lang?n.of(e.lang):void 0,e.linter?Tae(e.linter,e.linterConfig):void 0,e.linter&&e.gutter?Yae(e.gutterConfig):void 0,e.placeholder?(i=e.placeholder,G8.fromClass(class{constructor(e){this.view=e,this.placeholder=i?a8.set([a8.widget({widget:new B9(i),side:1}).range(0)]):a8.none}get decorations(){return this.view.state.doc.length?a8.none:this.placeholder}},{decorations:e=>e.decorations})):void 0,...e.extensions].filter((e=>!!e));var i}));wn(d,(e=>{var t;null==(t=r.value)||t.dispatch({effects:v4.reconfigure.of(e)})}),{immediate:!0}),wn((()=>e.modelValue),(async t=>{r.value.composing||r.value.state.doc.toJSON().join(e.lineSeparator??"\n")===t||r.value.dispatch({changes:{from:0,to:r.value.state.doc.length,insert:t},selection:r.value.state.selection,scrollIntoView:!0})}),{immediate:!0}),Gn((async()=>{let e=o.value;n.value&&(n.value.childNodes[0]&&(o.value,e=n.value.childNodes[0].innerText.trim()),r.value=new Z7({parent:n.value,state:M4.create({doc:e,extensions:d.value}),dispatch:e=>{r.value.update([e]),!e.changes.empty&&e.docChanged&&(t.emit("update:modelValue",e.state.doc.toString()),t.emit("change",e.state))}}),await Vt(),t.emit("ready",{view:r.value,state:r.value.state,container:n.value}))})),eo((()=>{r.value.destroy(),t.emit("destroy")}));const p={editor:n,view:r,cursor:a,selection:l,focus:i,length:c,json:s,diagnosticCount:u,dom:r.value.contentDOM,lint:()=>{!e.linter||!r.value||(e.forceLinting&&Mae(r.value),u.value=function(e){let t=e.field(Oae,!1);return t?t.diagnostics.size:0}(r.value.state))},forceReconfigure:()=>{var e,t;null==(e=r.value)||e.dispatch({effects:v4.reconfigure.of([])}),null==(t=r.value)||t.dispatch({effects:v4.appendConfig.of(d.value)})},getRange:(e,t)=>r.value.state.sliceDoc(e,t),getLine:e=>r.value.state.doc.line(e+1).text,lineCount:()=>r.value.state.doc.lines,getCursor:()=>r.value.state.selection.main.head,listSelections:()=>{let e;return null!==(e=r.value.state.selection.ranges)&&void 0!==e?e:[]},getSelection:()=>{let e;return null!==(e=r.value.state.sliceDoc(r.value.state.selection.main.from,r.value.state.selection.main.to))&&void 0!==e?e:""},getSelections:()=>{const e=r.value.state;return e?e.selection.ranges.map((t=>e.sliceDoc(t.from,t.to))):[]},somethingSelected:()=>r.value.state.selection.ranges.some((e=>!e.empty)),replaceRange:(e,t,n)=>r.value.dispatch({changes:{from:t,to:n,insert:e}}),replaceSelection:e=>r.value.dispatch(r.value.state.replaceSelection(e)),setCursor:e=>r.value.dispatch({selection:{anchor:e}}),setSelection:(e,t)=>r.value.dispatch({selection:{anchor:e,head:t}}),setSelections:(e,t)=>r.value.dispatch({selection:z3.create(e,t)}),extendSelectionsBy:e=>r.value.dispatch({selection:z3.create(l.value.ranges.map((t=>t.extend(e(t)))))})};return t.expose(p),p},render(){return Uae(this.$props.tag,{ref:"editor",class:"vue-codemirror"},this.$slots.default?Uae("aside",{style:"display: none;","aria-hidden":"true"},"function"==typeof(e=this.$slots.default)?e():e):void 0);var e}});const Jae="#e06c75",ese="#abb2bf",tse="#7d8799",nse="#d19a66",ose="#2c313a",rse="#282c34",ise="#353a42",lse="#528bff",ase=[Z7.theme({"&":{color:ese,backgroundColor:rse},".cm-content":{caretColor:lse},".cm-cursor, .cm-dropCursor":{borderLeftColor:lse},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:ese},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:rse,color:tse,border:"none"},".cm-activeLineGutter":{backgroundColor:ose},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ise},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ise,borderBottomColor:ise},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:ose,color:ese}}},{dark:!0}),Xne(Fne.define([{tag:_te.keyword,color:"#c678dd"},{tag:[_te.name,_te.deleted,_te.character,_te.propertyName,_te.macroName],color:Jae},{tag:[_te.function(_te.variableName),_te.labelName],color:"#61afef"},{tag:[_te.color,_te.constant(_te.name),_te.standard(_te.name)],color:nse},{tag:[_te.definition(_te.name),_te.separator],color:ese},{tag:[_te.typeName,_te.className,_te.number,_te.changed,_te.annotation,_te.modifier,_te.self,_te.namespace],color:"#e5c07b"},{tag:[_te.operator,_te.operatorKeyword,_te.url,_te.escape,_te.regexp,_te.link,_te.special(_te.string)],color:"#56b6c2"},{tag:[_te.meta,_te.comment],color:tse},{tag:_te.strong,fontWeight:"bold"},{tag:_te.emphasis,fontStyle:"italic"},{tag:_te.strikethrough,textDecoration:"line-through"},{tag:_te.link,color:tse,textDecoration:"underline"},{tag:_te.heading,fontWeight:"bold",color:Jae},{tag:[_te.atom,_te.bool,_te.special(_te.variableName)],color:nse},{tag:[_te.processingInstruction,_te.string,_te.inserted],color:"#98c379"},{tag:_te.invalid,color:"#ffffff"}]))];var sse={};class cse{constructor(e,t,n,o,r,i,l,a,s,c=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=o,this.pos=r,this.score=i,this.buffer=l,this.bufferBase=a,this.curContext=s,this.lookAhead=c,this.parent=u}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let o=e.parser.context;return new cse(e,[],t,n,n,0,[],0,o?new use(o,o.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,o=65535&e,{parser:r}=this.p,i=r.dynamicPrecedence(o);if(i&&(this.score+=i),0==n)return this.pushState(r.getGoto(this.state,o,!0),this.reducePos),o=2e3&&!(null===(t=this.p.parser.nodeSet.types[o])||void 0===t?void 0:t.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=s):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(o,a)}storeNode(e,t,n,o=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[o-4]&&e.buffer[o-1]>-1){if(t==n)return;if(e.buffer[o-2]>=t)return void(e.buffer[o-2]=n)}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,o>4&&(o-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=n,this.buffer[r+3]=o}else this.buffer.push(e,t,n,o)}shift(e,t,n,o){if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:i}=this.p;(o>this.pos||t<=i.maxNode)&&(this.pos=o,i.stateFlag(r,1)||(this.reducePos=o)),this.pushState(r,n),this.shiftContext(t,n),t<=i.maxNode&&this.buffer.push(t,n,o,4)}else this.pos=o,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,o,4)}apply(e,t,n,o){65536&e?this.reduce(e):this.shift(e,t,n,o)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let o=this.pos;this.reducePos=this.pos=o+e.length,this.pushState(t,o),this.buffer.push(n,o,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),o=e.bufferBase+t;for(;e&&o==e.bufferBase;)e=e.parent;return new cse(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,o,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new dse(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if(0==(65536&n))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let o,r=0;r1&t&&e==o))||n.push(t[e],o)}t=n}let n=[];for(let o=0;o>19,o=65535&t,r=this.stack.length-3*n;if(r<0||e.getGoto(this.stack[r],o,!1)<0){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(o,r)=>{if(!t.includes(o))return t.push(o),e.allActions(o,(t=>{if(393216&t);else if(65536&t){let n=(t>>19)-r;if(n>1){let o=65535&t,r=this.stack.length-3*n;if(r>=0&&e.getGoto(this.stack[r],o,!1)>=0)return n<<19|65536|o}}else{let e=n(t,r+1);if(null!=e)return e}}))};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class use{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class dse{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let o=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=o}}class pse{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new pse(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new pse(this.stack,this.pos,this.index)}}function hse(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let o=0,r=0;o=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,n=!0),i+=r,n)break;i*=46}n?n[r++]=i:n=new t(i)}return n}class fse{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const gse=new fse;class mse{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=gse,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,o=this.rangeIndex,r=this.pos+e;for(;rn.to:r>=n.to;){if(o==this.ranges.length-1)return null;let e=this.ranges[++o];r+=e.from-n.to,n=e}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t,n,o=this.chunkOff+e;if(o>=0&&o=this.chunk2Pos&&to.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=gse,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let o of this.ranges){if(o.from>=t)break;o.to>e&&(n+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}return n}}class vse{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Ose(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}vse.prototype.contextual=vse.prototype.fallback=vse.prototype.extend=!1;class bse{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?hse(e):e}token(e,t){let n=e.pos,o=0;for(;;){let n=e.next<0,r=e.resolveOffset(1,1);if(Ose(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(n||o++,null==r)break;e.reset(r,e.token)}o&&(e.reset(n,e.token),e.acceptToken(this.elseToken,o))}}bse.prototype.contextual=vse.prototype.fallback=vse.prototype.extend=!1;class yse{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ose(e,t,n,o,r,i){let l=0,a=1<0){let n=e[d];if(s.allows(n)&&(-1==t.token.value||t.token.value==n||xse(n,t.token.value,r,i))){t.acceptToken(n);break}}let o=t.next,c=0,u=e[l+2];if(!(t.next<0&&u>c&&65535==e[n+3*u-3])){for(;c>1,i=n+r+(r<<1),a=e[i],s=e[i+1]||65536;if(o=s)){l=e[i+2],t.advance();continue e}c=r+1}}break}l=e[n+3*u-1]}}function wse(e,t,n){for(let o,r=t;65535!=(o=e[r]);r++)if(o==n)return r-t;return-1}function xse(e,t,n,o){let r=wse(n,o,t);return r<0||wse(n,o,e)t)&&!o.type.isError)return n<0?Math.max(0,Math.min(o.to-1,t-25)):Math.min(e.length,Math.max(o.from+1,t+25));if(n<0?o.prevSibling():o.nextSibling())break;if(!o.parent())return n<0?0:e.length}}class kse{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Cse(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Cse(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=i,null;if(r instanceof Zee){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+r.length}}}class Pse{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new fse))}getActions(e){let t=0,n=null,{parser:o}=e.p,{tokenizers:r}=o,i=o.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let s=0;sc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let r=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!o.extend&&(n=c,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||(n=new fse,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new fse,{pos:n,p:o}=e;return t.start=n,t.end=Math.min(n+1,o.stream.end),t.value=n==o.stream.end?o.parser.eofTerm:0,t}updateCachedToken(e,t,n){let o=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(o,e),n),e.value>-1){let{parser:t}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(o+1)}putAction(e,t,n,o){for(let r=0;r4*e.bufferLength?new kse(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,o=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;io)r.push(l);else{if(this.advanceStack(l,r,n))continue;{e||(e=[],t=[]),e.push(l);let n=this.tokens.getMainToken(l);t.push(n.value,n.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(n)return this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>o))&&this.recovering--}else if(r.length>1){e:for(let e=0;e500&&o.buffer.length>500){if(!((t.score-o.score||t.buffer.length-o.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(n--,1)}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let i=1;ithis.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let i=this.fragments.nodeAt(o);i;){let o=this.parser.nodeSet.types[i.type.id]==i.type?r.getGoto(e.state,i.type.id):-1;if(o>-1&&i.length&&(!t||(i.prop(Nee.contextHash)||0)==n))return e.useNode(i,o),!0;if(!(i instanceof Zee)||0==i.children.length||i.positions[0]>0)break;let l=i.children[0];if(!(l instanceof Zee&&0==i.positions[0]))break;i=l}}let i=r.stateSlot(e.state,4);if(i>0)return e.reduce(i),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let a=0;ao?t.push(u):n.push(u)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Mse(e,t),!0}}runRecovery(e,t,n){let o=null,r=!1;for(let i=0;i ":"";if(l.deadEnd){if(r)continue;if(r=!0,l.restart(),this.advanceFully(l,n))continue}let u=l.split(),d=c;for(let e=0;u.forceReduce()&&e<10&&!this.advanceFully(u,n);e++)$se&&(d=this.stackID(u)+" -> ");for(let e of l.recoverByInsert(a))this.advanceFully(e,n);this.stream.end>l.pos?(s==l.pos&&(s++,a=0),l.recoverByDelete(a,s),Mse(l,n)):(!o||o.scoree;class Ase extends pte{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[t][1])),o=[];for(let l=0;l=0)r(n,e,l[t++]);else{let o=l[t+-n];for(let i=-n;i>0;i--)r(l[t++],e,o);t++}}}this.nodeSet=new Qee(t.map(((t,r)=>Lee.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:o[r],top:n.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Dee;let i=hse(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l"number"==typeof e?new vse(i,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let o=new Tse(this,e,t,n);for(let r of this.wrappers)o=r(o,e,t,n);return o}getGoto(e,t,n=!1){let o=this.goto;if(t>=o[0])return-1;for(let r=o[t+1];;){let t=o[r++],i=1&t,l=o[r++];if(i&&n)return l;for(let n=r+(t>>1);r0}validAction(e,t){return!!this.allActions(e,(e=>e==t||null))}allActions(e,t){let n=this.stateSlot(e,4),o=n?t(n):void 0;for(let r=this.stateSlot(e,1);null==o;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=Rse(this.data,r+2)}o=t(Rse(this.data,r+1))}return o}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=Rse(this.data,n+2)}if(0==(1&this.data[n+2])){let e=this.data[n+1];t.some(((t,n)=>1&n&&t==e))||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(Ase.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map((t=>{let n=e.tokenizers.find((e=>e.from==t));return n?n.to:t}))),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map(((n,o)=>{let r=e.specializers.find((e=>e.from==n.external));if(!r)return n;let i=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[o]=Dse(i),i}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map((()=>!1));if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let o=null;for(let r=0;re.external(n,o)<<1|t}return e.get}const jse=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Bse=new class{constructor(e){this.start=e.start,this.shift=e.shift||Ese,this.reduce=e.reduce||Ese,this.reuse=e.reuse||Ese,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}({start:!1,shift:(e,t)=>4==t||5==t||312==t?e:313==t,strict:!1}),Nse=new yse(((e,t)=>{let{next:n}=e;(125==n||-1==n||t.context)&&e.acceptToken(310)}),{contextual:!0,fallback:!0}),zse=new yse(((e,t)=>{let n,{next:o}=e;jse.indexOf(o)>-1||(47!=o||47!=(n=e.peek(1))&&42!=n)&&(125==o||59==o||-1==o||t.context||e.acceptToken(309))}),{contextual:!0}),_se=new yse(((e,t)=>{let{next:n}=e;if((43==n||45==n)&&(e.advance(),n==e.next)){e.advance();let n=!t.context&&t.canShift(1);e.acceptToken(n?1:2)}}),{contextual:!0});function Lse(e,t){return e>=65&&e<=90||e>=97&&e<=122||95==e||e>=192||!t&&e>=48&&e<=57}const Qse=new yse(((e,t)=>{if(60!=e.next||!t.dialectEnabled(0))return;if(e.advance(),47==e.next)return;let n=0;for(;jse.indexOf(e.next)>-1;)e.advance(),n++;if(Lse(e.next,!0)){for(e.advance(),n++;Lse(e.next,!1);)e.advance(),n++;for(;jse.indexOf(e.next)>-1;)e.advance(),n++;if(44==e.next)return;for(let t=0;;t++){if(7==t){if(!Lse(e.next,!0))return;break}if(e.next!="extends".charCodeAt(t))break;e.advance(),n++}}e.acceptToken(3,-n)})),Hse=bte({"get set async static":_te.modifier,"for while do if else switch try catch finally return throw break continue default case":_te.controlKeyword,"in of await yield void typeof delete instanceof":_te.operatorKeyword,"let var const using function class extends":_te.definitionKeyword,"import export from":_te.moduleKeyword,"with debugger as new":_te.keyword,TemplateString:_te.special(_te.string),super:_te.atom,BooleanLiteral:_te.bool,this:_te.self,null:_te.null,Star:_te.modifier,VariableName:_te.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":_te.function(_te.variableName),VariableDefinition:_te.definition(_te.variableName),Label:_te.labelName,PropertyName:_te.propertyName,PrivatePropertyName:_te.special(_te.propertyName),"CallExpression/MemberExpression/PropertyName":_te.function(_te.propertyName),"FunctionDeclaration/VariableDefinition":_te.function(_te.definition(_te.variableName)),"ClassDeclaration/VariableDefinition":_te.definition(_te.className),PropertyDefinition:_te.definition(_te.propertyName),PrivatePropertyDefinition:_te.definition(_te.special(_te.propertyName)),UpdateOp:_te.updateOperator,"LineComment Hashbang":_te.lineComment,BlockComment:_te.blockComment,Number:_te.number,String:_te.string,Escape:_te.escape,ArithOp:_te.arithmeticOperator,LogicOp:_te.logicOperator,BitOp:_te.bitwiseOperator,CompareOp:_te.compareOperator,RegExp:_te.regexp,Equals:_te.definitionOperator,Arrow:_te.function(_te.punctuation),": Spread":_te.punctuation,"( )":_te.paren,"[ ]":_te.squareBracket,"{ }":_te.brace,"InterpolationStart InterpolationEnd":_te.special(_te.brace),".":_te.derefOperator,", ;":_te.separator,"@":_te.meta,TypeName:_te.typeName,TypeDefinition:_te.definition(_te.typeName),"type enum interface implements namespace module declare":_te.definitionKeyword,"abstract global Privacy readonly override":_te.modifier,"is keyof unique infer":_te.operatorKeyword,JSXAttributeValue:_te.attributeValue,JSXText:_te.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":_te.angleBracket,"JSXIdentifier JSXNameSpacedName":_te.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":_te.attributeName,"JSXBuiltin/JSXIdentifier":_te.standard(_te.tagName)}),Fse={__proto__:null,export:18,as:23,from:31,default:34,async:39,function:40,extends:52,this:56,true:64,false:64,null:76,void:80,typeof:84,super:102,new:136,delete:152,yield:161,await:165,class:170,public:227,private:227,protected:227,readonly:229,instanceof:248,satisfies:251,in:252,const:254,import:286,keyof:339,unique:343,infer:349,is:385,abstract:405,implements:407,type:409,let:412,var:414,using:417,interface:423,enum:427,namespace:433,module:435,declare:439,global:443,for:462,of:471,while:474,with:478,do:482,if:486,else:488,switch:492,case:498,try:504,catch:508,finally:512,return:516,throw:520,break:524,continue:528,debugger:532},Wse={__proto__:null,async:123,get:125,set:127,declare:187,public:189,private:189,protected:189,static:191,abstract:193,override:195,readonly:201,accessor:203,new:389},Vse={__proto__:null,"<":143},Zse=Ase.deserialize({version:14,states:"$RQWO'#CdO>cQWO'#H[O>kQWO'#HbO>kQWO'#HdO`Q^O'#HfO>kQWO'#HhO>kQWO'#HkO>pQWO'#HqO>uQ07iO'#HwO%[Q^O'#HyO?QQ07iO'#H{O?]Q07iO'#H}O9kQ07hO'#IPO?hQ08SO'#ChO@jQ`O'#DiQOQWOOO%[Q^O'#EPOAQQWO'#ESO:RQ7[O'#EjOA]QWO'#EjOAhQpO'#FbOOQU'#Cf'#CfOOQ07`'#Dn'#DnOOQ07`'#Jm'#JmO%[Q^O'#JmOOQO'#Jq'#JqOOQO'#Ib'#IbOBhQ`O'#EcOOQ07`'#Eb'#EbOCdQ07pO'#EcOCnQ`O'#EVOOQO'#Jp'#JpODSQ`O'#JqOEaQ`O'#EVOCnQ`O'#EcPEnO!0LbO'#CaPOOO)CDu)CDuOOOO'#IX'#IXOEyO!bO,59TOOQ07b,59T,59TOOOO'#IY'#IYOFXO#tO,59TO%[Q^O'#D`OOOO'#I['#I[OFgO?MpO,59xOOQ07b,59x,59xOFuQ^O'#I]OGYQWO'#JkOI[QrO'#JkO+}Q^O'#JkOIcQWO,5:OOIyQWO'#ElOJWQWO'#JyOJcQWO'#JxOJcQWO'#JxOJkQWO,5;YOJpQWO'#JwOOQ07f,5:Z,5:ZOJwQ^O,5:ZOLxQ08SO,5:eOMiQWO,5:mONSQ07hO'#JvONZQWO'#JuO9ZQWO'#JuONoQWO'#JuONwQWO,5;XON|QWO'#JuO!#UQrO'#JjOOQ07b'#Ch'#ChO%[Q^O'#ERO!#tQpO,5:rOOQO'#Jr'#JrOOQO-EmOOQU'#J`'#J`OOQU,5>n,5>nOOQU-EpQWO'#HQO9aQWO'#HSO!CgQWO'#HSO:RQ7[O'#HUO!ClQWO'#HUOOQU,5=j,5=jO!CqQWO'#HVO!DSQWO'#CnO!DXQWO,59OO!DcQWO,59OO!FhQ^O,59OOOQU,59O,59OO!FxQ07hO,59OO%[Q^O,59OO!ITQ^O'#H^OOQU'#H_'#H_OOQU'#H`'#H`O`Q^O,5=vO!IkQWO,5=vO`Q^O,5=|O`Q^O,5>OO!IpQWO,5>QO`Q^O,5>SO!IuQWO,5>VO!IzQ^O,5>]OOQU,5>c,5>cO%[Q^O,5>cO9kQ07hO,5>eOOQU,5>g,5>gO!NUQWO,5>gOOQU,5>i,5>iO!NUQWO,5>iOOQU,5>k,5>kO!NZQ`O'#D[O%[Q^O'#JmO!NxQ`O'#JmO# gQ`O'#DjO# xQ`O'#DjO#$ZQ^O'#DjO#$bQWO'#JlO#$jQWO,5:TO#$oQWO'#EpO#$}QWO'#JzO#%VQWO,5;ZO#%[Q`O'#DjO#%iQ`O'#EUOOQ07b,5:n,5:nO%[Q^O,5:nO#%pQWO,5:nO>pQWO,5;UO!@}Q`O,5;UO!AVQ7[O,5;UO:RQ7[O,5;UO#%xQWO,5@XO#%}Q$ISO,5:rOOQO-E<`-E<`O#'TQ07pO,5:}OCnQ`O,5:qO#'_Q`O,5:qOCnQ`O,5:}O!@rQ07hO,5:qOOQ07`'#Ef'#EfOOQO,5:},5:}O%[Q^O,5:}O#'lQ07hO,5:}O#'wQ07hO,5:}O!@}Q`O,5:qOOQO,5;T,5;TO#(VQ07hO,5:}POOO'#IV'#IVP#(kO!0LbO,58{POOO,58{,58{OOOO-EwO+}Q^O,5>wOOQO,5>},5>}O#)VQ^O'#I]OOQO-EpQ08SO1G0{O#>wQ08SO1G0{O#@oQ08SO1G0{O#CoQ(CYO'#ChO#EmQ(CYO1G1^O#EtQ(CYO'#JjO!,lQWO1G1dO#FUQ08SO,5?TOOQ07`-EkQWO1G3lO$2^Q^O1G3nO$6bQ^O'#HmOOQU1G3q1G3qO$6oQWO'#HsO>pQWO'#HuOOQU1G3w1G3wO$6wQ^O1G3wO9kQ07hO1G3}OOQU1G4P1G4POOQ07`'#GY'#GYO9kQ07hO1G4RO9kQ07hO1G4TO$;OQWO,5@XO!*fQ^O,5;[O9ZQWO,5;[O>pQWO,5:UO!*fQ^O,5:UO!@}Q`O,5:UO$;TQ(CYO,5:UOOQO,5;[,5;[O$;_Q`O'#I^O$;uQWO,5@WOOQ07b1G/o1G/oO$;}Q`O'#IdO$pQWO1G0pO!@}Q`O1G0pO!AVQ7[O1G0pOOQ07`1G5s1G5sO!@rQ07hO1G0]OOQO1G0i1G0iO%[Q^O1G0iO$wO$>TQWO1G5qO$>]QWO1G6OO$>eQrO1G6PO9ZQWO,5>}O$>oQ08SO1G5|O%[Q^O1G5|O$?PQ07hO1G5|O$?bQWO1G5{O$?bQWO1G5{O9ZQWO1G5{O$?jQWO,5?QO9ZQWO,5?QOOQO,5?Q,5?QO$@OQWO,5?QO$'TQWO,5?QOOQO-EXOOQU,5>X,5>XO%[Q^O'#HnO%7^QWO'#HpOOQU,5>_,5>_O9ZQWO,5>_OOQU,5>a,5>aOOQU7+)c7+)cOOQU7+)i7+)iOOQU7+)m7+)mOOQU7+)o7+)oO%7cQ`O1G5sO%7wQ(CYO1G0vO%8RQWO1G0vOOQO1G/p1G/pO%8^Q(CYO1G/pO>pQWO1G/pO!*fQ^O'#DjOOQO,5>x,5>xOOQO-E<[-E<[OOQO,5?O,5?OOOQO-EpQWO7+&[O!@}Q`O7+&[OOQO7+%w7+%wO$=gQ08SO7+&TOOQO7+&T7+&TO%[Q^O7+&TO%8hQ07hO7+&TO!@rQ07hO7+%wO!@}Q`O7+%wO%8sQ07hO7+&TO%9RQ08SO7++hO%[Q^O7++hO%9cQWO7++gO%9cQWO7++gOOQO1G4l1G4lO9ZQWO1G4lO%9kQWO1G4lOOQO7+%|7+%|O#%sQWO<tQ08SO1G2ZO%AVQ08SO1G2mO%CbQ08SO1G2oO%EmQ7[O,5>yOOQO-E<]-E<]O%EwQrO,5>zO%[Q^O,5>zOOQO-E<^-E<^O%FRQWO1G5uOOQ07b<YOOQU,5>[,5>[O&5cQWO1G3yO9ZQWO7+&bO!*fQ^O7+&bOOQO7+%[7+%[O&5hQ(CYO1G6PO>pQWO7+%[OOQ07b<pQWO<pQWO7+)eO'&gQWO<}AN>}O%[Q^OAN?ZOOQO<eQ(CYOG26}O!*fQ^O'#DyO1PQWO'#EWO'@ZQrO'#JiO!*fQ^O'#DqO'@bQ^O'#D}O'@iQrO'#ChO'CPQrO'#ChO!*fQ^O'#EPO'CaQ^O,5;VO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O'#IiO'EdQWO,5a#@O#@^#@d#Ax#BW#Cr#DQ#DW#D^#Dd#Dn#Dt#Dz#EU#Eh#EnPPPPPPPPPP#EtPPPPPPP#Fi#Ip#KP#KW#K`PPPP$!d$%Z$+r$+u$+x$,q$,t$,w$-O$-WPP$-^$-b$.Y$/X$/]$/qPP$/u$/{$0PP$0S$0W$0Z$1P$1h$2P$2T$2W$2Z$2a$2d$2h$2lR!{RoqOXst!Z#c%j&m&o&p&r,h,m1w1zY!uQ'Z-Y1[5]Q%pvQ%xyQ&P|Q&e!VS'R!e-QQ'a!iS'g!r!xS*c$|*hQ+f%yQ+s&RQ,X&_Q-W'YQ-b'bQ-j'hQ/|*jQ1f,YR;Y:g%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%j%p%}&f&i&m&o&p&r&v'O']'m'}(P(V(^(r(v(z)y+O+S,e,h,m-^-f-t-z.l.s0[0a0q1_1o1p1r1t1w1z1|2m2s3Z5Y5d5t5u5x6]7w7|8]8gS#p]:d!r)[$[$m'S)n,y,|.{2]3p5W6S9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]Q*u%ZQ+k%{Q,Z&bQ,b&jQ.c;QQ0h+^Q0l+`Q0w+lQ1n,`Q2{.[Q4v0rQ5k1gQ6i3PQ6u;RQ7h4wR8m6j&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%j%p%}&f&i&j&m&o&p&r&v'O'S']'m'}(P(V(^(r(v(z)n)y+O+S+^,e,h,m,y,|-^-f-t-z.[.l.s.{0[0a0q1_1o1p1r1t1w1z1|2]2m2s3P3Z3p5W5Y5d5t5u5x6S6]6j7w7|8]8g9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]t!nQ!r!u!x!y'R'Y'Z'g'h'i-Q-W-Y-j1[5]5_$v$si#u#w$c$d$x${%O%Q%[%]%a)u){)}*P*R*Y*`*p*q+]+`+w+z.Z.i/Z/j/k/m0Q0S0^1R1U1^3O3x4S4[4f4n4p5c6g7T7^7y8j8w9[9n:O:W:y:z:|:};O;P;S;T;U;V;W;X;_;`;a;b;c;d;g;h;i;j;k;l;m;n;q;r < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:371,context:Bse,nodeProps:[["isolate",-8,4,5,13,33,35,48,50,52,""],["group",-26,8,16,18,65,201,205,209,210,212,215,218,228,230,236,238,240,242,245,251,257,259,261,263,265,267,268,"Statement",-32,12,13,28,31,32,38,48,51,52,54,59,67,75,79,81,83,84,106,107,116,117,134,137,139,140,141,142,144,145,164,165,167,"Expression",-23,27,29,33,37,39,41,168,170,172,173,175,176,177,179,180,181,183,184,185,195,197,199,200,"Type",-3,87,99,105,"ClassItem"],["openedBy",22,"<",34,"InterpolationStart",53,"[",57,"{",72,"(",157,"JSXStartCloseTag"],["closedBy",23,">",36,"InterpolationEnd",47,"]",58,"}",73,")",162,"JSXEndTag"]],propSources:[Hse],skippedNodes:[0,4,5,271],repeatNodeCount:37,tokenData:"$Fj(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Ns!`!a$#_!a!b$(l!b!c$,k!c!}Er!}#O$-u#O#P$/P#P#Q$4h#Q#R$5r#R#SEr#S#T$7P#T#o$8Z#o#p$q#r#s$?}#s$f%Z$f$g+g$g#BYEr#BY#BZ$AX#BZ$ISEr$IS$I_$AX$I_$I|Er$I|$I}$Dd$I}$JO$Dd$JO$JTEr$JT$JU$AX$JU$KVEr$KV$KW$AX$KW&FUEr&FU&FV$AX&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AX?HUOEr(n%d_$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$f&j(OpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(OpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Op(R!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$f&j(Op(R!b't(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST(P#S$f&j'u(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$f&j(Op(R!b'u(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$f&j!o$Ip(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/|3l_'}$(n$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$f&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$a`$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$a``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$a`$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(R!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$a`(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k#%|:hh$f&j(Op(R!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXVS$f&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSVSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWVS(R!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]VS$f&j(OpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWVS(OpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYVS(Op(R!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$f&j!USOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$f&j!USO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!USOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!US#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$f&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$f&j(R!b!USOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ(R!b!USOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb(R!b!USOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX(R!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$f&j(R!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#Fse[e]||-1},{term:334,get:e=>Wse[e]||-1},{term:70,get:e=>Vse[e]||-1}],tokenPrec:14626}),Xse=[Wle("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),Wle("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),Wle("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Wle("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Wle("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),Wle("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),Wle("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),Wle("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),Wle("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),Wle('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Wle('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Yse=Xse.concat([Wle("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Wle("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Wle("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Kse=new ute,Gse=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Use(e){return(t,n)=>{let o=t.node.getChild("VariableDefinition");return o&&n(o,e),!0}}const qse=["FunctionDeclaration"],Jse={FunctionDeclaration:Use("function"),ClassDeclaration:Use("class"),ClassExpression:()=>!0,EnumDeclaration:Use("constant"),TypeAliasDeclaration:Use("type"),NamespaceDeclaration:Use("namespace"),VariableDefinition(e,t){e.matchContext(qse)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function ece(e,t){let n=Kse.get(t);if(n)return n;let o=[],r=!0;function i(t,n){let r=e.sliceString(t.from,t.to);o.push({label:r,type:n})}return t.cursor(Wee.IncludeAnonymous).iterate((t=>{if(r)r=!1;else if(t.name){let e=Jse[t.name];if(e&&e(t,i)||Gse.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of ece(e,t.node))o.push(n);return!1}})),Kse.set(t,o),o}const tce=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,nce=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function oce(e){let t=Xte(e.state).resolveInner(e.pos,-1);if(nce.indexOf(t.name)>-1)return null;let n="VariableName"==t.name||t.to-t.from<20&&tce.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let o=[];for(let r=t;r;r=r.parent)Gse.has(r.name)&&(o=o.concat(ece(e.state.doc,r)));return{options:o,from:n?t.from:e.pos,validFor:tce}}const rce=Zte.define({name:"javascript",parser:Zse.configure({props:[une.add({IfStatement:bne({except:/^\s*({|else\b)/}),TryStatement:bne({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:e=>e.baseIndent,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),o=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:o?1:2)*e.unit},Block:mne({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":bne({except:/^{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag":e=>e.column(e.node.from)+e.unit}),One.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to({from:e.from+2,to:e.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),ice={test:e=>/^JSX/.test(e.name),facet:Hte({commentTokens:{block:{open:"{/*",close:"*/}"}}})},lce=rce.configure({dialect:"ts"},"typescript"),ace=rce.configure({dialect:"jsx",props:[Fte.add((e=>e.isTop?[ice]:void 0))]}),sce=rce.configure({dialect:"jsx ts",props:[Fte.add((e=>e.isTop?[ice]:void 0))]},"typescript");let cce=e=>({label:e,type:"keyword"});const uce="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(cce),dce=uce.concat(["declare","implements","private","protected","public"].map(cce));function pce(e={}){let t=e.jsx?e.typescript?sce:ace:e.typescript?lce:rce,n=e.typescript?Yse.concat(dce):Xse.concat(uce);return new one(t,[rce.data.of({autocomplete:(o=nce,r=Kie(n),e=>{for(let t=Xte(e.state).resolveInner(e.pos,-1);t;t=t.parent){if(o.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return r(e)})}),rce.data.of({autocomplete:oce}),e.jsx?gce:[]]);var o,r}function hce(e,t,n=e.length){for(let o=null==t?void 0:t.firstChild;o;o=o.nextSibling)if("JSXIdentifier"==o.name||"JSXBuiltin"==o.name||"JSXNamespacedName"==o.name||"JSXMemberExpression"==o.name)return e.sliceString(o.from,Math.min(o.to,n));return""}const fce="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),gce=Z7.inputHandler.of(((e,t,n,o,r)=>{if((fce?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||">"!=o&&"/"!=o||!rce.isActiveAt(e.state,t,-1))return!1;let i=r(),{state:l}=i,a=l.changeByRange((e=>{var t;let n,{head:r}=e,i=Xte(l).resolveInner(r-1,-1);if("JSXStartTag"==i.name&&(i=i.parent),l.doc.sliceString(r-1,r)!=o||"JSXAttributeValue"==i.name&&i.to>r);else{if(">"==o&&"JSXFragmentTag"==i.name)return{range:e,changes:{from:r,insert:""}};if("/"==o&&"JSXStartCloseTag"==i.name){let e=i.parent,o=e.parent;if(o&&e.from==r-2&&((n=hce(l.doc,o.firstChild,r))||"JSXFragmentTag"==(null===(t=o.firstChild)||void 0===t?void 0:t.name))){let e=`${n}>`;return{range:z3.cursor(r+e.length,-1),changes:{from:r,insert:e}}}}else if(">"==o){let t=function(e){for(;;){if("JSXOpenTag"==e.name||"JSXSelfClosingTag"==e.name||"JSXFragmentTag"==e.name)return e;if("JSXEscape"==e.name||!e.parent)return null;e=e.parent}}(i);if(t&&!/^\/?>|^<\//.test(l.doc.sliceString(r,r+2))&&(n=hce(l.doc,t,r)))return{range:e,changes:{from:r,insert:``}}}}return{range:e}}));return!a.changes.empty&&(e.dispatch([i,l.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),mce=g2(Ln({__name:"BranchDrawer",props:{open:P1().def(!1),len:M1().def(0),modelValue:E1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1),i=Ot({}),l=Ot({".cm-line":{fontSize:"18px"},".cm-scroller":{height:"500px",overflowY:"auto",overflowX:"hidden"}});wn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{n("update:modelValue",i.value)},s=Ot(),c=()=>{var e;null==(e=s.value)||e.validate().then((()=>{u(),n("save",i.value)})).catch((()=>{xB.warning("请检查表单信息")}))},u=()=>{n("update:open",!1),r.value=!1};return(t,n)=>{const o=fn("a-typography-paragraph"),d=fn("a-select-option"),p=fn("a-select"),h=fn("a-radio"),f=fn("a-radio-group"),g=fn("a-form-item"),m=fn("a-form"),v=fn("a-button"),b=fn("a-drawer");return hr(),br(b,{open:r.value,"onUpdate:open":n[5]||(n[5]=e=>r.value=e),"destroy-on-close":"",width:500,onClose:u},{title:sn((()=>[Cr(o,{style:{margin:"0",width:"412px"},ellipsis:"",content:i.value.nodeName,"onUpdate:content":n[0]||(n[0]=e=>i.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:a},{editableEnterIcon:sn((()=>[Pr(X(null))])),_:1},8,["content"])])),extra:sn((()=>[Cr(p,{value:i.value.priorityLevel,"onUpdate:value":n[1]||(n[1]=e=>i.value.priorityLevel=e),style:{width:"110px"}},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.len-1,(e=>(hr(),br(d,{key:e,value:e},{default:sn((()=>[Pr("优先级 "+X(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),footer:sn((()=>[Cr(v,{type:"primary",onClick:c},{default:sn((()=>[Pr("保存")])),_:1}),Cr(v,{style:{"margin-left":"12px"},onClick:u},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(m,{layout:"vertical",ref_key:"formRef",ref:s,model:i.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(g,{name:["decision","logicalCondition"],label:"判定逻辑",rules:[{required:!0,message:"请选择判定逻辑",trigger:"change"}]},{default:sn((()=>[Cr(f,{value:i.value.decision.logicalCondition,"onUpdate:value":n[2]||(n[2]=e=>i.value.decision.logicalCondition=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(X1)),(e=>(hr(),br(h,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(g,{name:["decision","expressionType"],label:"表达式类型",rules:[{required:!0,message:"请选择表达式类型",trigger:"change"}]},{default:sn((()=>[Cr(f,{value:i.value.decision.expressionType,"onUpdate:value":n[3]||(n[3]=e=>i.value.decision.expressionType=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(H1)),(e=>(hr(),br(h,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(g,{name:["decision","nodeExpression"],label:"条件表达式",rules:[{required:!0,message:"请填写条件表达式",trigger:"change"}]},{default:sn((()=>[Cr(Ct(qae),{modelValue:i.value.decision.nodeExpression,"onUpdate:modelValue":n[4]||(n[4]=e=>i.value.decision.nodeExpression=e),theme:l.value,basic:"",lang:Ct(pce)(),extensions:[Ct(ase)]},null,8,["modelValue","theme","lang","extensions"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),[["__scopeId","data-v-5d000a58"]]),vce=g2(Ln({__name:"BranchDesc",props:{modelValue:E1().def({})},setup(e){const t=e,n=Ot("");Gn((()=>{var e;Vt((()=>{r()})),(null==(e=t.modelValue.decision)?void 0:e.nodeExpression)&&(n.value=t.modelValue.decision.nodeExpression)}));const o=Ot({".cm-line":{fontSize:"18px"},".cm-scroller":{height:"520px",overflowY:"auto",overflowX:"hidden"}}),r=()=>{const e=document.getElementById("branch-desc"),t=null==e?void 0:e.querySelector(".ant-descriptions-view"),n=null==t?void 0:t.querySelector("tbody"),o=document.createElement("tr");o.className="ant-descriptions-row";const r=document.createElement("th");r.className="ant-descriptions-item-label",r.innerHTML="条件表达式",r.setAttribute("colspan","4"),o.appendChild(r),null==n||n.insertBefore(o,null==n?void 0:n.childNodes[3]);const i=(null==n?void 0:n.getElementsByClassName("ant-descriptions-row"))[3];i.childNodes[2].remove();const l=i.querySelector(".ant-descriptions-item-content");l.setAttribute("style","padding: 0"),null==l||l.setAttribute("colspan","4")};return(t,r)=>{const i=fn("a-descriptions-item"),l=fn("a-descriptions");return hr(),br(l,{id:"branch-desc",column:2,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(i,{label:"节点名称",span:2},{default:sn((()=>[Pr(X(e.modelValue.nodeName),1)])),_:1}),Cr(i,{label:"判定逻辑"},{default:sn((()=>{var t;return[Pr(X(Ct(X1)[null==(t=e.modelValue.decision)?void 0:t.logicalCondition]),1)]})),_:1}),Cr(i,{label:"表达式类型"},{default:sn((()=>{var t;return[Pr(X(Ct(H1)[null==(t=e.modelValue.decision)?void 0:t.expressionType]),1)]})),_:1}),Cr(i,{label:"条件表达式",span:2},{default:sn((()=>[Cr(Ct(qae),{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=e=>n.value=e),readonly:"",disabled:"",theme:o.value,basic:"",lang:Ct(pce)(),extensions:[Ct(ase)]},null,8,["modelValue","theme","lang","extensions"])])),_:1})])),_:1})}}}),[["__scopeId","data-v-dc9046db"]]),bce=Ln({__name:"BranchDetail",props:{modelValue:E1().def({}),open:P1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=fn("a-drawer");return hr(),br(o,{title:"决策详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:sn((()=>[Cr(vce,{"model-value":e.modelValue},null,8,["model-value"])])),_:1},8,["open"])}}}),yce={class:"branch-wrap"},Oce={class:"branch-box-wrap"},wce={class:"branch-box"},xce={class:"condition-node"},$ce={class:"condition-node-box"},Sce=["onClick"],Cce=["onClick"],kce={class:"title"},Pce={class:"node-title"},Tce={class:"priority-title"},Mce={class:"content"},Ice=["innerHTML"],Ece={key:1,class:"placeholder"},Ace=["onClick"],Rce={key:1,class:"top-left-cover-line"},Dce={key:2,class:"bottom-left-cover-line"},jce={key:3,class:"top-right-cover-line"},Bce={key:4,class:"bottom-right-cover-line"},Nce=(e=>(ln("data-v-affb0f89"),e=e(),an(),e))((()=>Sr("div",{style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[Sr("span",{style:{"padding-left":"18px"}},"决策节点详情")],-1))),zce=g2(Ln({__name:"BranchNode",props:{modelValue:E1().def({}),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=e1(),i=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{const e=i.value.conditionNodes.length;i.value.conditionNodes.splice(-1,0,{nodeName:"条件"+e,priorityLevel:e,decision:{expressionType:1,nodeExpression:void 0,logicalCondition:1}}),i.value.conditionNodes[e].priorityLevel=e+1},a=(e,t)=>{e.childNode?a(e.childNode,t):e.childNode=t},s=(e,t=1)=>{var o;i.value.conditionNodes[e]=i.value.conditionNodes.splice(e+t,1,i.value.conditionNodes[e])[0],null==(o=i.value.conditionNodes)||o.map(((e,t)=>{e.priorityLevel=t+1})),n("update:modelValue",i.value)},c=(e,t)=>{const{nodeName:n,decision:o}=e.conditionNodes[t],{logicalCondition:r,expressionType:i,nodeExpression:l}=o;return l?"其他情况"!==n?`${X1[r]}\n${H1[i]}\n${l}`:"如存在未满足其他分支条件的情况,则进入此分支":"其他情况"===n?"如存在未满足其他分支条件的情况,则进入此分支":void 0},u=Ot(0),d=Ot(!1),p=Ot([]),h=Ot({}),f=e=>{const t=i.value.conditionNodes[u.value].priorityLevel,o=e.priorityLevel;i.value.conditionNodes[u.value]=e,t!==o&&s(u.value,o-t),n("update:modelValue",i.value)},g=Ot([]),m=Ot(""),v=Ot([]),b=(e,t)=>{var n,l;if(v.value=[],"其他情况"!==e.nodeName)if(2===r.TYPE){if(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=v.value)||t.push(e.id):e.jobId&&(m.value=e.jobId.toString())})),0===v.value.length)return void(p.value[t]=!0);g.value[t]=!0}else 1===r.TYPE?p.value[t]=!0:(l=t,o.disabled||l===i.value.conditionNodes.length-1?0!==r.TYPE&&(p.value[l]=!0):(u.value=l,h.value=JSON.parse(JSON.stringify(i.value.conditionNodes[l])),d.value=!0))},y=e=>o.disabled?2===r.TYPE?"其他情况"===e.nodeName?`node-disabled node-error node-error-${e.taskBatchStatus?K1[e.taskBatchStatus].name:"default"}`:`node-error node-error-${e.taskBatchStatus?K1[e.taskBatchStatus].name:"default"}`:"其他情况"===e.nodeName?"node-disabled":"node-error":"其他情况"===e.nodeName?"node-disabled":"auto-judge-def auto-judge-hover";return(t,o)=>{const u=fn("a-button"),O=fn("a-badge"),w=fn("a-tooltip");return hr(),vr("div",yce,[Sr("div",Oce,[Sr("div",wce,[e.disabled?Tr("",!0):(hr(),br(u,{key:0,class:"add-branch",primary:"",onClick:l},{default:sn((()=>[Pr("添加条件")])),_:1})),(hr(!0),vr(ar,null,io(i.value.conditionNodes,((o,l)=>(hr(),vr("div",{class:"col-box",key:l},[Sr("div",xce,[Sr("div",$ce,[Sr("div",{class:W(["auto-judge",y(o)]),onClick:e=>b(o,l)},[0!==l?(hr(),vr("div",{key:0,class:"sort-left",onClick:Vi((e=>s(l,-1)),["stop"])},[Cr(Ct(BR))],8,Cce)):Tr("",!0),Sr("div",kce,[Sr("span",Pce,[Cr(O,{status:"processing",color:"#52c41a"}),Pr(" "+X(o.nodeName)+" ",1),"其他情况"===o.nodeName?(hr(),br(w,{key:0},{title:sn((()=>[Pr(" 该分支为系统默认创建,与其他分支互斥。只有当其他分支都无法运行时,才会运行该分支。 ")])),default:sn((()=>[Cr(Ct(m$),{style:{"margin-left":"3px"}})])),_:1})):Tr("",!0)]),Sr("span",Tce,"优先级"+X(o.priorityLevel),1),e.disabled?Tr("",!0):(hr(),br(Ct(Jb),{key:0,class:"close",onClick:Vi((e=>{return t=l,null==(o=i.value.conditionNodes)||o.splice(t,1),void(1===i.value.conditionNodes.length&&(i.value.childNode&&(i.value.conditionNodes[0].childNode?a(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Vt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))));var t,o}),["stop"])},null,8,["onClick"]))]),Sr("div",Mce,[c(i.value,l)?(hr(),vr("span",{key:0,innerHTML:c(i.value,l)},null,8,Ice)):(hr(),vr("span",Ece," 请设置条件 "))]),l!==i.value.conditionNodes.length-2?(hr(),vr("div",{key:1,class:"sort-right",onClick:Vi((e=>s(l)),["stop"])},[Cr(Ct(ok))],8,Ace)):Tr("",!0),2===Ct(r).TYPE&&o.taskBatchStatus?(hr(),br(w,{key:2},{title:sn((()=>[Pr(X(Ct(K1)[o.taskBatchStatus].title),1)])),default:sn((()=>[Cr(Ct(Q1),{class:"error-tip",color:Ct(K1)[o.taskBatchStatus].color,size:"24px",onClick:Vi((()=>{}),["stop"]),"model-value":Ct(K1)[o.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):Tr("",!0)],10,Sce),Cr(A2,{disabled:e.disabled,modelValue:o.childNode,"onUpdate:modelValue":e=>o.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),o.childNode?ao(t.$slots,"default",{key:0,node:o},void 0,!0):Tr("",!0),0==l?(hr(),vr("div",Rce)):Tr("",!0),0==l?(hr(),vr("div",Dce)):Tr("",!0),l==i.value.conditionNodes.length-1?(hr(),vr("div",jce)):Tr("",!0),l==i.value.conditionNodes.length-1?(hr(),vr("div",Bce)):Tr("",!0),0!==Ct(r).type&&p.value[l]?(hr(),br(bce,{key:5,open:p.value[l],"onUpdate:open":e=>p.value[l]=e,modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["open","onUpdate:open","modelValue","onUpdate:modelValue"])):Tr("",!0),0!==Ct(r).TYPE&&g.value[l]?(hr(),br(Ct($2),{key:6,open:g.value[l],"onUpdate:open":e=>g.value[l]=e,id:m.value,ids:v.value},{default:sn((()=>[Nce,Cr(vce,{modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["open","onUpdate:open","id","ids"])):Tr("",!0)])))),128))]),Cr(A2,{disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":o[0]||(o[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])]),Cr(mce,{open:d.value,"onUpdate:open":o[1]||(o[1]=e=>d.value=e),modelValue:h.value,"onUpdate:modelValue":o[2]||(o[2]=e=>h.value=e),len:i.value.conditionNodes.length,"onUpdate:len":o[3]||(o[3]=e=>i.value.conditionNodes.length=e),onSave:f},null,8,["open","modelValue","len"])])}}}),[["__scopeId","data-v-affb0f89"]]),_ce=Ln({__name:"CallbackDrawer",props:{open:P1().def(!1),len:M1().def(0),modelValue:E1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1),i=Ot({});wn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{n("update:modelValue",i.value)},a=Ot(),s=()=>{var e;null==(e=a.value)||e.validate().then((()=>{c(),n("save",i.value)})).catch((()=>{xB.warning("请检查表单信息")}))},c=()=>{n("update:open",!1),r.value=!1};return(e,t)=>{const n=fn("a-typography-paragraph"),o=fn("a-input"),u=fn("a-form-item"),d=fn("a-select-option"),p=fn("a-select"),h=fn("a-radio"),f=fn("a-radio-group"),g=fn("a-form"),m=fn("a-button"),v=fn("a-drawer");return hr(),br(v,{open:r.value,"onUpdate:open":t[5]||(t[5]=e=>r.value=e),"destroy-on-close":"",width:500,onClose:c},{title:sn((()=>[Cr(n,{style:{margin:"0",width:"412px"},ellipsis:"",content:i.value.nodeName,"onUpdate:content":t[0]||(t[0]=e=>i.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:l},null,8,["content"])])),footer:sn((()=>[Cr(m,{type:"primary",onClick:s},{default:sn((()=>[Pr("保存")])),_:1}),Cr(m,{style:{"margin-left":"12px"},onClick:c},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(g,{ref_key:"formRef",ref:a,layout:"vertical",model:i.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(u,{name:["callback","webhook"],label:"webhook",rules:[{required:!0,message:"请输入 webhook",trigger:"change"}]},{default:sn((()=>[Cr(o,{value:i.value.callback.webhook,"onUpdate:value":t[1]||(t[1]=e=>i.value.callback.webhook=e),placeholder:"请输入 webhook"},null,8,["value"])])),_:1}),Cr(u,{name:["callback","contentType"],label:"请求类型",rules:[{required:!0,message:"请选择请求类型",trigger:"change"}]},{default:sn((()=>[Cr(p,{value:i.value.callback.contentType,"onUpdate:value":t[2]||(t[2]=e=>i.value.callback.contentType=e),placeholder:"请选择请求类型"},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(Y1)),(e=>(hr(),br(d,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(u,{name:["callback","secret"],label:"秘钥",rules:[{required:!0,message:"请输入秘钥",trigger:"change"}]},{default:sn((()=>[Cr(o,{value:i.value.callback.secret,"onUpdate:value":t[3]||(t[3]=e=>i.value.callback.secret=e),placeholder:"请输入秘钥"},null,8,["value"])])),_:1}),Cr(u,{name:"workflowNodeStatus",label:"工作流状态",rules:[{required:!0,message:"请选择工作流状态",trigger:"change"}]},{default:sn((()=>[Cr(f,{value:i.value.workflowNodeStatus,"onUpdate:value":t[4]||(t[4]=e=>i.value.workflowNodeStatus=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(Z1)),(e=>(hr(),br(h,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),Lce=Ln({__name:"CallbackDetail",props:{modelValue:E1().def({}),open:P1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=fn("a-descriptions-item"),l=fn("a-descriptions"),a=fn("a-drawer");return hr(),br(a,{title:"决策详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:sn((()=>[Cr(l,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(o,{label:"节点名称"},{default:sn((()=>[Pr(X(e.modelValue.nodeName),1)])),_:1}),Cr(o,{label:"webhook"},{default:sn((()=>{var t;return[Pr(X(null==(t=e.modelValue.callback)?void 0:t.webhook),1)]})),_:1}),Cr(o,{label:"请求类型"},{default:sn((()=>{var t;return[Pr(X(Ct(Y1)[null==(t=e.modelValue.callback)?void 0:t.contentType]),1)]})),_:1}),Cr(o,{label:"密钥"},{default:sn((()=>{var t;return[Pr(X(null==(t=e.modelValue.callback)?void 0:t.secret),1)]})),_:1})])),_:1})])),_:1},8,["open"])}}}),Qce=e=>(ln("data-v-714c9e92"),e=e(),an(),e),Hce={class:"node-wrap"},Fce={class:"branch-box"},Wce={class:"condition-node",style:{"min-height":"230px"}},Vce={class:"condition-node-box",style:{"padding-top":"0"}},Zce={class:"popover"},Xce=Qce((()=>Sr("span",null,"重试",-1))),Yce=Qce((()=>Sr("span",null,"忽略",-1))),Kce=["onClick"],Gce={class:"title"},Uce={class:"text",style:{color:"#935af6"}},qce={class:"content",style:{"min-height":"81px"}},Jce={key:0,class:"placeholder"},eue={style:{display:"flex","justify-content":"space-between"}},tue=Qce((()=>Sr("span",{class:"content_label"},"Webhook:",-1))),nue=Qce((()=>Sr("span",{class:"content_label"},"请求类型: ",-1))),oue=Qce((()=>Sr("div",null,".........",-1))),rue={key:1,class:"top-left-cover-line"},iue={key:2,class:"bottom-left-cover-line"},lue={key:3,class:"top-right-cover-line"},aue={key:4,class:"bottom-right-cover-line"},sue=Qce((()=>Sr("div",{style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[Sr("span",{style:{"padding-left":"18px"}},"回调节点详情")],-1))),cue=g2(Ln({__name:"CallbackNode",props:{modelValue:E1().def({}),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=e1(),i=Ot({}),l=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{i.value.childNode&&(i.value.conditionNodes[0].childNode?s(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Vt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))},s=(e,t)=>{e.childNode?s(e.childNode,t):e.childNode=t},c=Ot(0),u=Ot(!1),d=Ot(!1),p=Ot({}),h=e=>{i.value.conditionNodes[c.value]=e,n("update:modelValue",i.value)},f=Ot(!1),g=Ot(""),m=Ot([]),v=(e,t)=>{var n,o;if(m.value=[],2===r.TYPE){if(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=m.value)||t.push(e.id):e.jobId&&(g.value=e.jobId.toString())})),0===m.value.length)return void(d.value=!0);f.value=!0}else 1===r.TYPE?d.value=!0:(o=t,0===r.TYPE?(c.value=o,p.value=JSON.parse(JSON.stringify(i.value.conditionNodes[o])),u.value=!0):d.value=!0)},b=e=>o.disabled?2===r.TYPE?`node-error node-error-${e.taskBatchStatus?K1[e.taskBatchStatus].name:"default"}`:"node-error":"auto-judge-def auto-judge-hover";return(t,n)=>{const o=fn("a-divider"),s=fn("a-button"),c=fn("a-badge"),y=fn("a-typography-text"),O=fn("a-tooltip"),w=fn("a-popover"),x=fn("a-descriptions-item"),$=fn("a-descriptions");return hr(),vr("div",Hce,[Sr("div",Fce,[(hr(!0),vr(ar,null,io(i.value.conditionNodes,((n,u)=>(hr(),vr("div",{class:"col-box",key:u},[Sr("div",Wce,[Sr("div",Vce,[Cr(w,{open:l.value[u]&&2===Ct(r).TYPE,getPopupContainer:e=>e.parentNode,onOpenChange:e=>l.value[u]=e},{content:sn((()=>[Sr("div",Zce,[Cr(o,{type:"vertical"}),Cr(s,{type:"text",class:"popover-item"},{default:sn((()=>[Cr(Ct(yJ)),Xce])),_:1}),Cr(o,{type:"vertical"}),Cr(s,{type:"text",class:"popover-item"},{default:sn((()=>[Cr(Ct(rJ)),Yce])),_:1})])])),default:sn((()=>{var t,o;return[Sr("div",{class:W(["auto-judge",b(n)]),onClick:e=>v(n,u)},[Sr("div",Gce,[Sr("span",Uce,[Cr(c,{status:"processing",color:1===n.workflowNodeStatus?"#52c41a":"#ff4d4f"},null,8,["color"]),Pr(" "+X(n.nodeName),1)]),e.disabled?Tr("",!0):(hr(),br(Ct(Jb),{key:0,class:"close",onClick:Vi(a,["stop"])}))]),Sr("div",qce,[(null==(t=n.callback)?void 0:t.webhook)?Tr("",!0):(hr(),vr("div",Jce,"请配置回调通知")),(null==(o=n.callback)?void 0:o.webhook)?(hr(),vr(ar,{key:1},[Sr("div",eue,[tue,Cr(y,{style:{width:"116px"},ellipsis:"",content:n.callback.webhook},null,8,["content"])]),Sr("div",null,[nue,Pr(" "+X(Ct(Y1)[n.callback.contentType]),1)]),oue],64)):Tr("",!0)]),2===Ct(r).TYPE&&n.taskBatchStatus?(hr(),br(O,{key:0},{title:sn((()=>[Pr(X(Ct(K1)[n.taskBatchStatus].title),1)])),default:sn((()=>[Cr(Ct(Q1),{class:"error-tip",color:Ct(K1)[n.taskBatchStatus].color,size:"24px",onClick:Vi((()=>{}),["stop"]),"model-value":Ct(K1)[n.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):Tr("",!0)],10,Kce)]})),_:2},1032,["open","getPopupContainer","onOpenChange"]),Cr(A2,{disabled:e.disabled,modelValue:n.childNode,"onUpdate:modelValue":e=>n.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),n.childNode?ao(t.$slots,"default",{key:0,node:n},void 0,!0):Tr("",!0),0==u?(hr(),vr("div",rue)):Tr("",!0),0==u?(hr(),vr("div",iue)):Tr("",!0),u==i.value.conditionNodes.length-1?(hr(),vr("div",lue)):Tr("",!0),u==i.value.conditionNodes.length-1?(hr(),vr("div",aue)):Tr("",!0)])))),128))]),i.value.conditionNodes.length>1?(hr(),br(A2,{key:0,disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":n[0]||(n[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])):Tr("",!0),0!==Ct(r).type?(hr(),br(Lce,{key:1,open:d.value,"onUpdate:open":n[1]||(n[1]=e=>d.value=e),modelValue:i.value.conditionNodes[0],"onUpdate:modelValue":n[2]||(n[2]=e=>i.value.conditionNodes[0]=e)},null,8,["open","modelValue"])):Tr("",!0),Cr(_ce,{open:u.value,"onUpdate:open":n[3]||(n[3]=e=>u.value=e),modelValue:p.value,"onUpdate:modelValue":n[4]||(n[4]=e=>p.value=e),onSave:h},null,8,["open","modelValue"]),0!==Ct(r).TYPE&&f.value?(hr(),br(Ct($2),{key:2,open:f.value,"onUpdate:open":n[5]||(n[5]=e=>f.value=e),id:g.value,ids:m.value},{default:sn((()=>[sue,Cr($,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(x,{label:"节点名称"},{default:sn((()=>[Pr(X(i.value.conditionNodes[0].nodeName),1)])),_:1}),Cr(x,{label:"webhook"},{default:sn((()=>{var e;return[Pr(X(null==(e=i.value.conditionNodes[0].callback)?void 0:e.webhook),1)]})),_:1}),Cr(x,{label:"请求类型"},{default:sn((()=>{var e;return[Pr(X(Ct(Y1)[null==(e=i.value.conditionNodes[0].callback)?void 0:e.contentType]),1)]})),_:1}),Cr(x,{label:"密钥"},{default:sn((()=>{var e;return[Pr(X(null==(e=i.value.conditionNodes[0].callback)?void 0:e.secret),1)]})),_:1})])),_:1})])),_:1},8,["open","id","ids"])):Tr("",!0)])}}}),[["__scopeId","data-v-714c9e92"]]),uue=Ln({__name:"NodeWrap",props:{modelValue:E1().def({}),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=Ot({});return wn((()=>o.modelValue),(e=>{r.value=e}),{immediate:!0,deep:!0}),wn((()=>r.value),(e=>{n("update:modelValue",e)})),(t,n)=>{const o=fn("node-wrap",!0);return hr(),vr(ar,null,[1==r.value.nodeType?(hr(),br(i3,{key:0,modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),disabled:e.disabled},{default:sn((t=>[t.node?(hr(),br(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):Tr("",!0)])),_:1},8,["modelValue","disabled"])):Tr("",!0),2==r.value.nodeType?(hr(),br(zce,{key:1,modelValue:r.value,"onUpdate:modelValue":n[1]||(n[1]=e=>r.value=e),disabled:e.disabled},{default:sn((t=>[t.node?(hr(),br(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):Tr("",!0)])),_:1},8,["modelValue","disabled"])):Tr("",!0),3==r.value.nodeType?(hr(),br(cue,{key:2,modelValue:r.value,"onUpdate:modelValue":n[2]||(n[2]=e=>r.value=e),disabled:e.disabled},{default:sn((t=>[t.node?(hr(),br(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):Tr("",!0)])),_:1},8,["modelValue","disabled"])):Tr("",!0),r.value.childNode?(hr(),br(o,{key:3,modelValue:r.value.childNode,"onUpdate:modelValue":n[3]||(n[3]=e=>r.value.childNode=e),disabled:e.disabled},null,8,["modelValue","disabled"])):Tr("",!0)],64)}}}),due="*",pue="/",hue="-",fue=",",gue="?",mue="L",vue="W",bue="#",yue="",Oue="LW",wue=(new Date).getFullYear();function xue(e){return"number"==typeof e||/^\d+(\.\d+)?$/.test(e)}const{hasOwnProperty:$ue}=Object.prototype;function Sue(e,t){return Object.keys(t).forEach((n=>{!function(e,t,n){const o=t[n];(function(e){return null!=e})(o)&&($ue.call(e,n)&&function(e){return null!==e&&"object"==typeof e}(o)?e[n]=Sue(Object(e[n]),t[n]):e[n]=o)}(e,t,n)})),e}const Cue={common:{from:"从",fromThe:"从第",start:"开始",every:"每",between:"在",and:"到",end:"之间的",specified:"固定的",symbolTip:"通配符支持",valTip:"值为",nearest:"最近的",current:"本",nth:"第",index:"个",placeholder:"请选择",placeholderMulti:"请选择(支持多选)",help:"帮助",wordNumError:"格式不正确,必须有6或7位",reverse:"反向解析",reset:"重置",tagError:"表达式不正确",numError:"含有非法数字",use:"使用",inputPlaceholder:"Cron表达式"},custom:{unspecified:"不固定",workDay:"工作日",lastTh:"倒数第",lastOne:"最后一个",latestWorkday:"最后一个工作日",empty:"不配置"},second:{title:"秒",val:"0 1 2...59"},minute:{title:"分",val:"0 1 2...59"},hour:{title:"时",val:"0 1 2...23"},dayOfMonth:{timeUnit:"日",title:"日",val:"1 2...31"},month:{title:"月",val:"1 2...12,或12个月的缩写(JAN ... DEC)"},dayOfWeek:{timeUnit:"日",title:"周",val:"1 2...7或星期的缩写(SUN ... SAT)",SUN:"星期天",MON:"星期一",TUE:"星期二",WED:"星期三",THU:"星期四",FRI:"星期五",SAT:"星期六"},year:{title:"年",val:wue+" ... 2099"},period:{startError:"开始格式不符",cycleError:"循环格式不符"},range:{lowerError:"下限格式不符",upperError:"上限格式不符",lowerBiggerThanUpperError:"下限不能比上限大"},weekDay:{weekDayNumError:"周数格式不符",nthError:"天数格式不符"},app:{title:"基于Vue&Element-ui实现的Cron表达式生成器",next10FireTimes:"最近10次执行时刻"},daysOfWeekOptions:[{label:"星期天",value:1},{label:"星期一",value:2},{label:"星期二",value:3},{label:"星期三",value:4},{label:"星期四",value:5},{label:"星期五",value:6},{label:"星期六",value:7}]},kue=Ot("zh-CN"),Pue=it({"zh-CN":Cue}),Tue={messages:()=>Pue[kue.value],use(e,t){kue.value=e,this.add({[e]:t})},add(e={}){Sue(Pue,e)}},Mue=Tue.messages(),Iue={class:"cron-body-row"},Eue={class:"symbol"},Aue=g2(Ln({components:{Radio:EM},props:{timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:due},tag:{type:String,default:due},onChange:{type:Function}},setup:e=>({Message:Mue,change:function(){e.onChange&&e.onChange({tag:due,type:due})},EVERY:due})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",Iue,[Cr(l,{checked:e.type===e.EVERY,onClick:e.change},{default:sn((()=>[Sr("span",Eue,X(e.EVERY),1),Pr(X(e.Message.common.every)+X(e.timeUnit),1)])),_:1},8,["checked","onClick"])])}]]),Rue=Tue.messages(),Due={class:"cron-body-row"},jue={class:"symbol"},Bue=g2(Ln({components:{Radio:EM,InputNumber:pQ},props:{startConfig:{type:Object,default:null},cycleConfig:{type:Object,default:null},timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:pue},tag:{type:String,default:pue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(0);n.value`${n.value}${pue}${o.value}`));function i(t){if(e.type!==pue)return;const r=t.split(pue);2===r.length?(r[0]===due&&(r[0]=0),!xue(r[0])||parseInt(r[0])e.startConfig.max?xB.error(`${Rue.period.startError}:${r[0]}`):!xue(r[1])||parseInt(r[1])e.cycleConfig.max?xB.error(`${Rue.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1]))):xB.error(`${Rue.common.tagError}:${t}`)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Rue,type_:t,start:n,cycle:o,tag_:r,PERIOD:pue,change:function(){e.onChange&&e.onChange({type:pue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("InputNumber"),a=fn("Radio");return hr(),vr("div",Due,[Cr(a,{checked:e.type===e.PERIOD,onChange:e.change},{default:sn((()=>[Sr("span",jue,X(e.tag_),1),Pr(" "+X(e.Message.common.fromThe)+" ",1),Cr(l,{size:"small",value:e.start,"onUpdate:value":t[0]||(t[0]=t=>e.start=t),min:e.startConfig.min,step:e.startConfig.step,max:e.startConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.start)+X(e.Message.common.every)+" ",1),Cr(l,{size:"small",value:e.cycle,"onUpdate:value":t[1]||(t[1]=t=>e.cycle=t),min:e.cycleConfig.min,step:e.cycleConfig.step,max:e.cycleConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),Nue=Tue.messages(),zue={class:"cron-body-row"},_ue={class:"symbol"},Lue=g2(Ln({components:{Radio:EM,InputNumber:pQ},props:{upper:{type:Number,default:1},lowerConfig:{type:Object,default:null},upperConfig:{type:Object,default:null},timeUnit:{type:String,default:null},type:{type:String,default:hue},tag:{type:String,default:hue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(0);o.value`${o.value}${hue}${n.value}`));function l(t){if(e.type!==hue)return;const r=t.split(hue);2===r.length&&(r[0]===hue&&(r[0]=0),!xue(r[0])||parseInt(r[0])e.lowerConfig.max||!xue(r[1])||parseInt(r[1])e.upperConfig.max||(o.value=parseInt(r[0]),n.value=parseInt(r[1])))}return Gn((()=>{l(e.tag)})),wn((()=>e.tag),(e=>{l(e)}),{deep:!0}),wn((()=>e.type),(()=>{l(e.tag)}),{deep:!0}),{Message:Nue,type_:t,lower:o,cycle:r,tag_:i,upper_:n,RANGE:hue,change:function(){e.onChange&&e.onChange({type:hue,tag:i.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("InputNumber"),a=fn("Radio");return hr(),vr("div",zue,[Cr(a,{checked:e.type===e.RANGE,onChange:e.change},{default:sn((()=>[Sr("span",_ue,X(e.tag_),1),Pr(" "+X(e.Message.common.between)+" ",1),Cr(l,{size:"small",value:e.lower,"onUpdate:value":t[0]||(t[0]=t=>e.lower=t),min:e.lowerConfig.min,step:e.lowerConfig.step,max:e.upper_,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.and)+" ",1),Cr(l,{size:"small",value:e.upper_,"onUpdate:value":t[1]||(t[1]=t=>e.upper_=t),min:e.lower,step:e.upperConfig.step,max:e.upperConfig.max,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.Message.common.end)+X(e.Message.common.every)+X(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),Que=Tue.messages(),Hue=Ln({components:{Radio:EM,ASelect:Vx,Tooltip:$S},props:{nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:fue},tag:{type:String,default:fue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Yr((()=>{let e="";if(o.value&&o.value.length){o.value.sort();for(let t=0;t{xue(t)&&parseInt(t)>=parseInt(e.nums[0].value)&&parseInt(t)<=parseInt(e.nums[e.nums.length-1].value)&&o.value.push(parseInt(t))}))}}return Gn((()=>{i()})),wn((()=>e.tag),(()=>i()),{deep:!0}),wn((()=>e.type),(()=>i()),{deep:!0}),{Message:Que,type_:t,tag_:n,open:r,FIXED:fue,change:function(){e.onChange&&e.onChange({type:fue,tag:n.value||fue})},numArray:o,changeTag:i}}}),Fue={class:"cron-body-row"},Wue=Sr("span",{class:"symbol"},",",-1),Vue=g2(Hue,[["render",function(e,t,n,o,r,i){const l=fn("Tooltip"),a=fn("Radio"),s=fn("ASelect");return hr(),vr("div",Fue,[Cr(a,{checked:e.type===e.FIXED,onChange:e.change},{default:sn((()=>[Cr(l,{title:e.tag_},{default:sn((()=>[Wue])),_:1},8,["title"]),Pr(" "+X(e.Message.common.specified),1)])),_:1},8,["checked","onChange"]),Cr(s,{size:"small",mode:"tags",placeholder:e.Message.common.placeholder,style:{width:"300px"},options:e.nums,disabled:e.type!==e.FIXED,value:e.numArray,"onUpdate:value":t[0]||(t[0]=t=>e.numArray=t),onChange:e.change},null,8,["placeholder","options","disabled","value","onChange"])])}]]),Zue={watch:{tag(e){this.resolveTag(e)}},mounted(){this.resolveTag(this.tag)},methods:{resolveTag(e){null==e&&(e=yue);let t=null;(e=this.resolveCustom(e))===yue?t=yue:e===gue?t=gue:e===due?t=due:e===Oue&&(t=Oue),null==t&&(t=e.startsWith("L-")||e.endsWith(mue)?mue:e.endsWith(vue)&&e.length>1?vue:e.indexOf(bue)>0?bue:e.indexOf(pue)>0?pue:e.indexOf(hue)>0?hue:fue),this.type_=t,this.tag_=e},resolveCustom:e=>e}},Xue=Tue.messages(),Yue=g2(Ln({components:{Every:Aue,Period:Bue,Range:Lue,Fixed:Vue},mixins:[Zue],props:{tag:{type:String,default:due},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:59},n={min:1,step:1,max:59},o={min:0,step:1,max:59},r={min:0,step:1,max:59},i=[];for(let s=0;s<60;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(due),a=Ot(e.tag);return{Message:Xue,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.second.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),Kue=Tue.messages(),Gue=g2(Ln({components:{Every:Aue,Period:Bue,Range:Lue,Fixed:Vue},mixins:[Zue],props:{tag:{type:String,default:due},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:59},n={min:1,step:1,max:59},o={min:0,step:1,max:59},r={min:0,step:1,max:59},i=[];for(let s=0;s<60;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(due),a=Ot(e.tag);return{Message:Kue,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.minute.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),Uue=Tue.messages(),que=g2(Ln({components:{Every:Aue,Period:Bue,Range:Lue,Fixed:Vue},mixins:[Zue],props:{tag:{type:String,default:due},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:23},n={min:1,step:1,max:23},o={min:0,step:1,max:23},r={min:0,step:1,max:23},i=[];for(let s=0;s<24;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(due),a=Ot(e.tag);return{Message:Uue,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.hour.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),Jue=Tue.messages(),ede={class:"cron-body-row"},tde={class:"symbol"},nde=g2(Ln({components:{Radio:EM},props:{type:{type:String,default:gue},tag:{type:String,default:gue},onChange:{type:Function}},setup:e=>({Message:Jue,change:function(){e.onChange&&e.onChange({tag:gue,type:gue})},UNFIXED:gue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",ede,[Cr(l,{checked:e.type===e.UNFIXED,onClick:e.change},{default:sn((()=>[Sr("span",tde,X(e.UNFIXED),1),Pr(X(e.Message.custom.unspecified),1)])),_:1},8,["checked","onClick"])])}]]),ode=Tue.messages(),rde={class:"cron-body-row"},ide={class:"symbol"},lde=g2(Ln({components:{Radio:EM,InputNumber:pQ},props:{lastConfig:{type:Object,default:null},targetTimeUnit:{type:String,default:null},timeUnit:{type:String,default:null},type:{type:String,default:mue},tag:{type:String,default:mue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Yr((()=>1===n.value?mue:"L-"+(n.value-1)));function r(t){if(e.type!==mue)return;if(t===mue)return void(n.value=1);const o=t.substring(2);xue(o)&&parseInt(o)>=e.lastConfig.min&&parseInt(o)<=e.lastConfig.max?n.value=parseInt(o)+1:xB.error(ode.common.numError+":"+o)}return Gn((()=>{r(e.tag)})),wn((()=>e.tag),(e=>{r(e)}),{deep:!0}),wn((()=>e.type),(()=>{r(e.tag)}),{deep:!0}),{Message:ode,type_:t,tag_:o,LAST:mue,lastNum:n,change:function(){e.onChange&&e.onChange({type:mue,tag:o.value})},changeTag:r}}}),[["render",function(e,t,n,o,r,i){const l=fn("InputNumber"),a=fn("Radio");return hr(),vr("div",rde,[Cr(a,{checked:e.type===e.LAST,onChange:e.change},{default:sn((()=>[Sr("span",ide,X(e.tag_),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.custom.lastTh)+" ",1),Cr(l,{size:"small",value:e.lastNum,"onUpdate:value":t[0]||(t[0]=t=>e.lastNum=t),min:e.lastConfig.min,step:e.lastConfig.step,max:e.lastConfig.max,disabled:e.type!==e.LAST,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),ade=Tue.messages(),sde={class:"cron-body-row"},cde={class:"symbol"},ude=g2(Ln({components:{Radio:EM,InputNumber:pQ},props:{targetTimeUnit:{type:String,default:null},startDateConfig:{type:Object,default:null},nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:vue},tag:{type:String,default:""},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(1),r=Yr((()=>`${n.value}${vue}`));function i(t){if(e.type!==vue)return;const o=t.substring(0,t.length-1);!xue(o)||parseInt(o)e.startDateConfig.max?xB.error(`${ade.common.numError}:${o}`):n.value=parseInt(o)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:ade,type_:t,startDate:n,weekDayNum:o,tag_:r,WORK_DAY:vue,change:function(){e.onChange&&e.onChange({type:vue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("InputNumber");return hr(),vr("div",sde,[Cr(l,{checked:e.type===e.WORK_DAY,onChange:e.change},{default:sn((()=>[Sr("span",cde,X(e.tag_),1),Pr(" "+X(e.Message.common.every)+X(e.targetTimeUnit),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",value:e.startDate,"onUpdate:value":t[0]||(t[0]=t=>e.startDate=t),min:e.startDateConfig.min,step:e.startDateConfig.step,max:e.startDateConfig.max,disabled:e.type!==e.WORK_DAY,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.nearest)+X(e.Message.custom.workDay),1)])}]]),dde=Tue.messages(),pde={class:"cron-body-row"},hde={class:"symbol"},fde=g2(Ln({components:{Radio:EM},props:{targetTimeUnit:{type:String,default:null},type:{type:String,default:Oue},tag:{type:String,default:Oue},onChange:{type:Function}},setup:e=>({Message:dde,change:function(){e.onChange&&e.onChange({tag:Oue,type:Oue})},LAST_WORK_DAY:Oue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",pde,[Cr(l,{checked:e.type===e.LAST_WORK_DAY,onClick:e.change},{default:sn((()=>[Sr("span",hde,X(e.LAST_WORK_DAY),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.custom.latestWorkday),1)])),_:1},8,["checked","onClick"])])}]]),gde=Tue.messages(),mde=31,vde=g2(Ln({components:{Every:Aue,Period:Bue,Range:Lue,Fixed:Vue,UnFixed:nde,Last:lde,WorkDay:ude,LastWorkDay:fde},mixins:[Zue],props:{tag:{type:String,default:due},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:mde},n={min:1,step:1,max:mde},o={min:1,step:1,max:mde},r={min:1,step:1,max:mde},i={min:1,step:1,max:mde},l=[];for(let c=1;c<32;c++){const e={label:c.toString(),value:c};l.push(e)}const a=Ot(due),s=Ot(e.tag);return{Message:gde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,lastConfig:i,nums:l,type_:a,tag_:s,change:function(t){a.value=t.type,s.value=t.tag,e.onChange&&e.onChange({type:a.value,tag:s.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed"),u=fn("UnFixed"),d=fn("Last"),p=fn("WorkDay"),h=fn("LastWorkDay");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Cr(u,{type:e.type_,nums:e.nums,onChange:e.change},null,8,["type","nums","onChange"]),Cr(d,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"last-config":e.lastConfig,onChange:e.change},null,8,["time-unit","type","tag","target-time-unit","last-config","onChange"]),Cr(p,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"start-date-config":e.startConfig,onChange:e.change},null,8,["time-unit","type","tag","target-time-unit","start-date-config","onChange"]),Cr(h,{type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"start-date-config":e.startConfig,onChange:e.change},null,8,["type","tag","target-time-unit","start-date-config","onChange"])],64)}]]),bde=Tue.messages(),yde=g2(Ln({components:{Every:Aue,Period:Bue,Range:Lue,Fixed:Vue},mixins:[Zue],props:{tag:{type:String,default:due},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:12},n={min:1,step:1,max:12},o={min:1,step:1,max:12},r={min:1,step:1,max:12},i=[];for(let s=1;s<13;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(due),a=Ot(e.tag);return{Message:bde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.month.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),Ode=Tue.messages(),wde={class:"cron-body-row"},xde={class:"symbol"},$de=g2(Ln({components:{Radio:EM},props:{timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:yue},tag:{type:String,default:yue},onChange:{type:Function}},setup:e=>({Message:Ode,change:function(){e.onChange&&e.onChange({tag:yue,type:yue})},EMPTY:yue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",wde,[Cr(l,{checked:e.type===e.EMPTY,onClick:e.change},{default:sn((()=>[Sr("span",xde,X(e.Message.custom.empty),1)])),_:1},8,["checked","onClick"])])}]]),Sde=Tue.messages(),Cde=wue,kde=2099,Pde=g2(Ln({components:{Every:Aue,Period:Bue,Range:Lue,Fixed:Vue,Empty:$de},mixins:[Zue],props:{tag:{type:String,default:yue},onChange:{type:Function}},setup(e){const t={min:Cde,step:1,max:kde},n={min:1,step:1,max:kde},o={min:Cde,step:1,max:kde},r={min:Cde,step:1,max:kde},i=[];for(let s=Cde;s<2100;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(yue),a=Ot(e.tag);return{Message:Sde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed"),u=fn("Empty");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.year.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Cr(u,{type:e.type_,tag:e.tag_,onChange:e.change},null,8,["type","tag","onChange"])],64)}]]),Tde=Tue.messages(),Mde={class:"cron-body-row"},Ide={class:"symbol"},Ede=g2(Ln({components:{Radio:EM,InputNumber:pQ,ASelect:Vx},props:{nums:{type:Array,default:null},startConfig:{type:Object,default:null},cycleConfig:{type:Object,default:null},timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:pue},tag:{type:String,default:pue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(1),r=Yr((()=>`${n.value}${pue}${o.value}`));function i(t){if(e.type!==pue)return;const r=t.split(pue);2===r.length?!xue(r[0])||parseInt(r[0])e.startConfig.max?xB.error(`${Tde.period.startError}:${r[0]}`):!xue(r[1])||parseInt(r[1])e.cycleConfig.max?xB.error(`${Tde.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1])):xB.error(`${Tde.common.tagError}:${t}`)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Tde,type_:t,start:n,cycle:o,tag_:r,PERIOD:pue,change:function(){e.onChange&&e.onChange({type:pue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("ASelect"),s=fn("InputNumber");return hr(),vr("div",Mde,[Cr(l,{checked:e.type===e.PERIOD,onChange:e.change},{default:sn((()=>[Sr("span",Ide,X(e.tag_),1),Pr(" "+X(e.Message.common.from),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",style:{width:"100px"},value:e.start,"onUpdate:value":t[0]||(t[0]=t=>e.start=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"]),Pr(" "+X(e.Message.common.start)+X(e.Message.common.every)+" ",1),Cr(s,{size:"small",value:e.cycle,"onUpdate:value":t[1]||(t[1]=t=>e.cycle=t),min:e.cycleConfig.min,step:e.cycleConfig.step,max:e.cycleConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit),1)])}]]),Ade=Tue.messages(),Rde=Vx.Option,Dde={class:"cron-body-row"},jde={class:"symbol"},Bde=g2(Ln({components:{Radio:EM,ASelect:Vx,AOption:Rde},props:{nums:{type:Array,default:null},upper:{type:Number,default:1},lowerConfig:{type:Object,default:null},upperConfig:{type:Object,default:null},timeUnit:{type:String,default:null},type:{type:String,default:hue},tag:{type:String,default:hue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(0);o.value`${o.value}${hue}${n.value}`));function l(t){if(e.type!==hue)return;const r=t.split(hue);2===r.length&&(r[0]===hue&&(r[0]=0),!xue(r[0])||parseInt(r[0])e.lowerConfig.max||!xue(r[1])||parseInt(r[1])e.upperConfig.max||(o.value=parseInt(r[0]),n.value=parseInt(r[1])))}return Gn((()=>{l(e.tag)})),wn((()=>e.tag),(e=>{l(e)}),{deep:!0}),wn((()=>e.type),(()=>{l(e.tag)}),{deep:!0}),{Message:Ade,type_:t,lower:o,cycle:r,tag_:i,upper_:n,RANGE:hue,change:function(){e.onChange&&e.onChange({type:hue,tag:i.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("AOption"),s=fn("ASelect");return hr(),vr("div",Dde,[Cr(l,{checked:e.type===e.RANGE,onChange:e.change},{default:sn((()=>[Sr("span",jde,X(e.tag_),1),Pr(" "+X(e.Message.common.between),1)])),_:1},8,["checked","onChange"]),Cr(s,{size:"small",style:{width:"100px"},value:e.lower,"onUpdate:value":t[0]||(t[0]=t=>e.lower=t),placeholder:e.Message.common.placeholder,disabled:e.type!==e.RANGE,onChange:e.change},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.nums,(t=>(hr(),br(a,{key:t.value,value:t.value,disabled:Number(t.value)>e.upper_},{default:sn((()=>[Pr(X(t.label),1)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value","placeholder","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.and)+" ",1),Cr(s,{size:"small",style:{width:"100px"},value:e.upper_,"onUpdate:value":t[1]||(t[1]=t=>e.upper_=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"]),Pr(" "+X(e.Message.common.end)+X(e.Message.common.every)+X(e.timeUnit),1)])}]]),Nde=Tue.messages(),zde={class:"cron-body-row"},_de={class:"symbol"},Lde=g2(Ln({components:{Radio:EM,ASelect:Vx},props:{nums:{type:Array,default:null},targetTimeUnit:{type:String,default:null},timeUnit:{type:String,default:null},type:{type:String,default:mue},tag:{type:String,default:mue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Yr((()=>(n.value>=1&&n.value<7?n.value:"")+mue));function r(t){if(e.type!==mue)return;if(t===mue)return void(n.value=7);const o=t.substring(0,t.length-1);xue(o)&&parseInt(o)>=parseInt(e.nums[0].value)&&parseInt(o)<=parseInt(e.nums[e.nums.length-1].value)?n.value=parseInt(o):xB.error(Nde.common.numError+":"+o)}return Gn((()=>{r(e.tag)})),wn((()=>e.tag),(e=>{r(e)}),{deep:!0}),wn((()=>e.type),(()=>{r(e.tag)}),{deep:!0}),{Message:Nde,type_:t,tag_:o,LAST:mue,lastNum:n,change:function(){e.onChange&&e.onChange({type:mue,tag:o.value})},changeTag:r}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("ASelect");return hr(),vr("div",zde,[Cr(l,{checked:e.type===e.LAST,onChange:e.change},{default:sn((()=>[Sr("span",_de,X(e.tag_),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.custom.lastTh),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",style:{width:"100px"},value:e.lastNum,"onUpdate:value":t[0]||(t[0]=t=>e.lastNum=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.LAST,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"])])}]]),Qde=Tue.messages(),Hde={class:"cron-body-row"},Fde={class:"symbol"},Wde=g2(Ln({components:{Radio:EM,InputNumber:pQ,ASelect:Vx},props:{targetTimeUnit:{type:String,default:null},nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:bue},tag:{type:String,default:""},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(1),r=Yr((()=>`${n.value}${bue}${o.value}`));function i(t){if(e.type!==bue)return;const r=t.split(bue);2===r.length?!xue(r[0])||parseInt(r[0])parseInt(e.nums[e.nums.length-1].value)?xB.error(`${Qde.period.startError}:${r[0]}`):!xue(r[1])||parseInt(r[1])<1||parseInt(r[1])>5?xB.error(`${Qde.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1])):xB.error(`${Qde.common.tagError}:${t}`)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Qde,type_:t,nth:n,weekDayNum:o,tag_:r,WEEK_DAY:bue,change:function(){e.onChange&&e.onChange({type:bue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("InputNumber"),s=fn("ASelect");return hr(),vr("div",Hde,[Cr(l,{checked:e.type===e.WEEK_DAY,onChange:e.change},{default:sn((()=>[Sr("span",Fde,X(e.tag_),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.common.nth),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",value:e.nth,"onUpdate:value":t[0]||(t[0]=t=>e.nth=t),min:1,step:1,max:5,disabled:e.type!==e.WEEK_DAY,onChange:e.change},null,8,["value","disabled","onChange"]),Pr(" "+X(e.Message.common.index)+" ",1),Cr(s,{size:"small",style:{width:"100px"},value:e.weekDayNum,"onUpdate:value":t[1]||(t[1]=t=>e.weekDayNum=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.WEEK_DAY,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"])])}]]),Vde=Tue.messages(),Zde=g2(Ln({components:{Every:Aue,Period:Ede,Range:Bde,Fixed:Vue,UnFixed:nde,Last:Lde,WeekDay:Wde},mixins:[Zue],props:{tag:{type:String,default:gue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:7},n={min:1,step:1,max:7},o={min:1,step:1,max:7},r={min:1,step:1,max:7},i={min:1,step:1,max:7},l=Vde.daysOfWeekOptions,a=Ot(due),s=Ot(e.tag);return{Message:Vde,startConfig:t,cycleConfig:o,lowerConfig:r,upperConfig:i,startDateConfig:n,nums:l,type_:a,tag_:s,change:function(t){a.value=t.type,s.value=t.tag,e.onChange&&e.onChange({type:a.value,tag:s.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed"),u=fn("UnFixed"),d=fn("Last"),p=fn("WeekDay");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","nums","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","nums","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.dayOfWeek.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Cr(u,{type:e.type_,nums:e.nums,onChange:e.change},null,8,["type","nums","onChange"]),Cr(d,{"time-unit":e.Message.dayOfWeek.title,"target-time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,"last-config":e.startDateConfig,onChange:e.change},null,8,["time-unit","target-time-unit","type","tag","nums","last-config","onChange"]),Cr(p,{"time-unit":e.Message.dayOfWeek.title,"target-time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","target-time-unit","type","tag","nums","onChange"])],64)}]]),Xde=Tue.messages(),Yde=Ln({name:"VueCron",components:{AInput:Uz,Popover:TS,Card:CE,Seconds:Yue,Minutes:Gue,Hours:que,Days:vde,Months:yde,Years:Pde,WeekDays:Zde,CalendarOutlined:fN},props:{value:{type:String,default:"* * * * * ? *"}},setup(e,{emit:t}){const n=Ot(""),o=Ot([]),r=[{key:"seconds",tab:Xde.second.title},{key:"minutes",tab:Xde.minute.title},{key:"hours",tab:Xde.hour.title},{key:"days",tab:Xde.dayOfMonth.title},{key:"months",tab:Xde.month.title},{key:"weekdays",tab:Xde.dayOfWeek.title},{key:"years",tab:Xde.year.title}],i=it({second:due,minute:due,hour:due,dayOfMonth:due,month:due,dayOfWeek:gue,year:yue}),l=Ot("seconds");function a(e){const o=e.trim().split(" ");if(!e||e.trim().length<11||6!==o.length&&7!==o.length){const e="* * * * * ?";return n.value=e,s(e),xB.error(Xde.common.tagError),t("update:value",e),void t("change",e)}s(e),i.second=o[0],i.minute=o[1],i.hour=o[2],i.dayOfMonth=o[3],i.month=o[4],i.dayOfWeek=o[5],i.year=7===o.length?o[6]:""}function s(e){t1(`/job/cron?cron=${e}`).then((e=>{if(o.value=e,0===o.value.length){const e="* * * * * ?";n.value=e,s(e),t("update:value",e),t("change",e)}}))}return wn((()=>e.value),(e=>{a(e),n.value=e}),{immediate:!0}),{cronStr:n,list:o,tabList:r,activeTabKey:l,tag:i,changeTime:a,timeChange:function(e,n){const o={...i};o[e]=n,"dayOfWeek"===e&&"*"!==n&&"?"!==n?o.dayOfMonth="?":"dayOfMonth"===e&&"*"!==n&&"?"!==n&&(o.dayOfWeek="?");let r=[];r.push(o.second),r.push(o.minute),r.push(o.hour),r.push(o.dayOfMonth),r.push(o.month),r.push(o.dayOfWeek),r.push(o.year),s(r.join(" ").trim()),t("update:value",r.join(" ").trim()),t("change",r.join(" ").trim())}}}}),Kde={key:0},Gde={key:1},Ude={key:2},qde={key:3},Jde={key:4},epe={key:5},tpe={key:6},npe={style:{display:"flex","align-items":"center","justify-content":"space-between"}},ope=Sr("span",{style:{width:"150px","font-weight":"600"}},"CRON 表达式: ",-1),rpe=Sr("div",{style:{margin:"20px 0","border-left":"#1677ff 5px solid","font-size":"medium","font-weight":"bold"}},"    近5次的运行时间: ",-1),ipe=g2(Yde,[["render",function(e,t,n,o,r,i){const l=fn("AInput"),a=fn("CalendarOutlined"),s=fn("Seconds"),c=fn("Minutes"),u=fn("Hours"),d=fn("Days"),p=fn("Months"),h=fn("WeekDays"),f=fn("Years"),g=fn("a-tab-pane"),m=fn("a-tabs"),v=fn("a-divider"),b=fn("a-input"),y=fn("a-button"),O=fn("Card"),w=fn("Popover");return hr(),br(w,{placement:"bottom",trigger:"click"},{content:sn((()=>[Cr(O,{size:"small"},{default:sn((()=>[Cr(m,{activeKey:e.activeTabKey,"onUpdate:activeKey":t[7]||(t[7]=t=>e.activeTabKey=t),type:"card"},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.tabList,(n=>(hr(),br(g,{key:n.key},{tab:sn((()=>[Sr("span",null,[Cr(a),Pr(" "+X(n.tab),1)])])),default:sn((()=>["seconds"===e.activeTabKey?(hr(),vr("div",Kde,[Cr(s,{tag:e.tag.second,onChange:t[0]||(t[0]=t=>e.timeChange("second",t.tag))},null,8,["tag"])])):"minutes"===e.activeTabKey?(hr(),vr("div",Gde,[Cr(c,{tag:e.tag.minute,onChange:t[1]||(t[1]=t=>e.timeChange("minute",t.tag))},null,8,["tag"])])):"hours"===e.activeTabKey?(hr(),vr("div",Ude,[Cr(u,{tag:e.tag.hour,onChange:t[2]||(t[2]=t=>e.timeChange("hour",t.tag))},null,8,["tag"])])):"days"===e.activeTabKey?(hr(),vr("div",qde,[Cr(d,{tag:e.tag.dayOfMonth,onChange:t[3]||(t[3]=t=>e.timeChange("dayOfMonth",t.tag))},null,8,["tag"])])):"months"===e.activeTabKey?(hr(),vr("div",Jde,[Cr(p,{tag:e.tag.month,onChange:t[4]||(t[4]=t=>e.timeChange("month",t.tag))},null,8,["tag"])])):"weekdays"===e.activeTabKey?(hr(),vr("div",epe,[Cr(h,{tag:e.tag.dayOfWeek,onChange:t[5]||(t[5]=t=>e.timeChange("dayOfWeek",t.tag))},null,8,["tag"])])):"years"===e.activeTabKey?(hr(),vr("div",tpe,[Cr(f,{tag:e.tag.year,onChange:t[6]||(t[6]=t=>e.timeChange("year",t.tag))},null,8,["tag"])])):Tr("",!0)])),_:2},1024)))),128))])),_:1},8,["activeKey"]),Cr(v),Sr("div",npe,[ope,Cr(b,{value:e.cronStr,"onUpdate:value":t[8]||(t[8]=t=>e.cronStr=t)},null,8,["value"]),Cr(y,{type:"primary",style:{"margin-left":"16px"},onClick:t[9]||(t[9]=t=>e.changeTime(e.cronStr))},{default:sn((()=>[Pr("保存")])),_:1})]),Cr(v),rpe,(hr(!0),vr(ar,null,io(e.list,((e,t)=>(hr(),vr("div",{key:e,style:{"margin-top":"10px"}},"第"+X(t+1)+"次: "+X(e),1)))),128))])),_:1})])),default:sn((()=>[Cr(l,{readonly:"",value:e.value},null,8,["value"])])),_:1})}]]),lpe=Ln({__name:"StartDrawer",props:{open:P1().def(!1),modelValue:E1().def({})},emits:["update:open","save"],setup(e,{emit:t}){const n=t,o=e;let r="";const i=Ot(!1),l=Ot({}),a=Ot([]);wn((()=>o.open),(e=>{i.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{l.value=e,r=e.workflowName?e.workflowName:e.groupName?e.groupName:"请选择组"}),{immediate:!0,deep:!0});const s=Ot(),c=()=>{var e;null==(e=s.value)||e.validate().then((()=>{u(),n("save",l.value)})).catch((()=>{xB.warning("请检查表单信息")}))},u=()=>{n("update:open",!1),i.value=!1};Gn((()=>{Vt((()=>{d()}))}));const d=()=>{t1("/group/all/group-name/list").then((e=>{a.value=e}))},p=e=>{1===e?l.value.triggerInterval="* * * * * ?":2===e&&(l.value.triggerInterval="60")},h={groupName:[{required:!0,message:"请选择组",trigger:"change"}],triggerType:[{required:!0,message:"请选择触发类型",trigger:"change"}],triggerInterval:[{required:!0,message:"请输入触发间隔",trigger:"change"}],executorTimeout:[{required:!0,message:"请输入执行超时时间",trigger:"change"}],blockStrategy:[{required:!0,message:"请选择阻塞策略",trigger:"change"}],workflowStatus:[{required:!0,message:"请选择工作流状态",trigger:"change"}]};return(e,t)=>{const n=fn("a-input"),o=fn("a-form-item"),d=fn("a-select-option"),f=fn("a-select"),g=fn("a-col"),m=fn("a-input-number"),v=fn("a-form-item-rest"),b=fn("a-row"),y=fn("a-radio"),O=fn("a-radio-group"),w=fn("a-textarea"),x=fn("a-form"),$=fn("a-button"),S=fn("a-drawer");return hr(),br(S,{open:i.value,"onUpdate:open":t[9]||(t[9]=e=>i.value=e),title:Ct(r),"destroy-on-close":"",width:610,onClose:u},{footer:sn((()=>[Cr($,{type:"primary",onClick:c},{default:sn((()=>[Pr("保存")])),_:1}),Cr($,{style:{"margin-left":"12px"},onClick:u},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(x,{ref_key:"formRef",ref:s,layout:"vertical",model:l.value,rules:h,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(o,{name:"workflowName",label:"工作流名称"},{default:sn((()=>[Cr(n,{value:l.value.workflowName,"onUpdate:value":t[0]||(t[0]=e=>l.value.workflowName=e),placeholder:"请输入工作流名称"},null,8,["value"])])),_:1}),Cr(o,{name:"groupName",label:"组名称"},{default:sn((()=>[Cr(f,{ref:"select",value:l.value.groupName,"onUpdate:value":t[1]||(t[1]=e=>l.value.groupName=e),placeholder:"请选择组"},{default:sn((()=>[(hr(!0),vr(ar,null,io(a.value,(e=>(hr(),br(d,{key:e,value:e},{default:sn((()=>[Pr(X(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(b,{gutter:24},{default:sn((()=>[Cr(g,{span:8},{default:sn((()=>[Cr(o,{name:"triggerType",label:"触发类型"},{default:sn((()=>[Cr(f,{ref:"select",value:l.value.triggerType,"onUpdate:value":t[2]||(t[2]=e=>l.value.triggerType=e),placeholder:"请选择触发类型",onChange:p},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(F1)),(e=>(hr(),br(d,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1}),Cr(g,{span:16},{default:sn((()=>[Cr(o,{name:"triggerInterval",label:"触发间隔"},{default:sn((()=>[Cr(v,null,{default:sn((()=>[1===l.value.triggerType?(hr(),br(Ct(ipe),{key:0,value:l.value.triggerInterval,"onUpdate:value":t[3]||(t[3]=e=>l.value.triggerInterval=e)},null,8,["value"])):(hr(),br(m,{key:1,addonAfter:"秒",style:{width:"-webkit-fill-available"},value:l.value.triggerInterval,"onUpdate:value":t[4]||(t[4]=e=>l.value.triggerInterval=e),placeholder:"请输入触发间隔"},null,8,["value"]))])),_:1})])),_:1})])),_:1})])),_:1}),Cr(b,{gutter:24},{default:sn((()=>[Cr(g,{span:8},{default:sn((()=>[Cr(o,{name:"executorTimeout",label:"执行超时时间"},{default:sn((()=>[Cr(m,{addonAfter:"秒",value:l.value.executorTimeout,"onUpdate:value":t[5]||(t[5]=e=>l.value.executorTimeout=e),placeholder:"请输入超时时间"},null,8,["value"])])),_:1})])),_:1}),Cr(g,{span:16},{default:sn((()=>[Cr(o,{name:"blockStrategy",label:"阻塞策略"},{default:sn((()=>[Cr(O,{value:l.value.blockStrategy,"onUpdate:value":t[6]||(t[6]=e=>l.value.blockStrategy=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(W1)),(e=>(hr(),br(y,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1})])),_:1}),Cr(o,{name:"workflowStatus",label:"节点状态"},{default:sn((()=>[Cr(O,{value:l.value.workflowStatus,"onUpdate:value":t[7]||(t[7]=e=>l.value.workflowStatus=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(Z1)),(e=>(hr(),br(y,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(o,{name:"description",label:"描述"},{default:sn((()=>[Cr(w,{value:l.value.description,"onUpdate:value":t[8]||(t[8]=e=>l.value.description=e),"auto-size":{minRows:5},placeholder:"请输入描述"},null,8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open","title"])}}}),ape=Ln({__name:"StartDetail",props:{modelValue:E1().def({}),open:P1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=fn("a-descriptions-item"),l=fn("a-descriptions"),a=fn("a-drawer");return hr(),br(a,{title:"工作流详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:sn((()=>[Cr(l,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(o,{label:"工作流名称"},{default:sn((()=>[Pr(X(e.modelValue.workflowName),1)])),_:1}),Cr(o,{label:"组名称"},{default:sn((()=>[Pr(X(e.modelValue.groupName),1)])),_:1}),Cr(o,{label:"触发类型"},{default:sn((()=>[Pr(X(Ct(F1)[e.modelValue.triggerType]),1)])),_:1}),Cr(o,{label:"触发间隔"},{default:sn((()=>[Pr(X(e.modelValue.triggerInterval)+" "+X(2===e.modelValue.triggerType?"秒":null),1)])),_:1}),Cr(o,{label:"执行超时时间"},{default:sn((()=>[Pr(X(e.modelValue.executorTimeout)+" 秒 ",1)])),_:1}),Cr(o,{label:"阻塞策略"},{default:sn((()=>[Pr(X(Ct(W1)[e.modelValue.blockStrategy]),1)])),_:1}),Cr(o,{label:"工作流状态"},{default:sn((()=>[Pr(X(Ct(Z1)[e.modelValue.workflowStatus]),1)])),_:1})])),_:1})])),_:1},8,["open"])}}}),spe=e=>(ln("data-v-c07f8c3a"),e=e(),an(),e),cpe={class:"node-wrap"},upe={class:"title",style:{background:"#ffffff"}},dpe={class:"text",style:{color:"#ff943e"}},ppe={key:0,class:"content"},hpe=spe((()=>Sr("span",{class:"content_label"},"组名称: ",-1))),fpe=spe((()=>Sr("span",{class:"content_label"},"阻塞策略: ",-1))),gpe=spe((()=>Sr("div",null,".........",-1))),mpe={key:1,class:"content"},vpe=[spe((()=>Sr("span",{class:"placeholder"}," 请配置工作流 ",-1)))],bpe=g2(Ln({__name:"StartNode",props:{modelValue:E1().def({}),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=Ot({}),i=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0}),wn((()=>i.value),(e=>{n("update:modelValue",e)}));const l=e1();wn((()=>i.value.groupName),(e=>{e&&(l.setGroupName(e),t1(`/job/list?groupName=${e}`).then((e=>{l.setJobList(e)})))}),{immediate:!0});const a=Ot(!1),s=Ot(!1),c=e=>{i.value=e},u=()=>{0===l.TYPE?(r.value=JSON.parse(JSON.stringify(i.value)),a.value=!0):s.value=!0};return(t,n)=>{const o=fn("a-badge"),d=fn("a-typography-text"),p=fn("a-tooltip");return hr(),vr("div",cpe,[Sr("div",{class:W([e.disabled?"start-node-disabled":"node-wrap-box-hover","node-wrap-box start-node node-error-success"]),onClick:u},[Sr("div",upe,[Sr("span",dpe,[Cr(o,{status:"processing",color:1===i.value.workflowStatus?"#52c41a":"#ff000d"},null,8,["color"]),Pr(" "+X(i.value.workflowName?i.value.workflowName:"请选择组"),1)])]),i.value.groupName?(hr(),vr("div",ppe,[Sr("div",null,[hpe,Cr(d,{style:{width:"135px"},ellipsis:"",content:i.value.groupName},null,8,["content"])]),Sr("div",null,[fpe,Pr(X(Ct(W1)[i.value.blockStrategy]),1)]),gpe])):(hr(),vr("div",mpe,vpe)),2===Ct(l).TYPE?(hr(),br(p,{key:2},{title:sn((()=>[Pr(X(Ct(K1)[3].title),1)])),default:sn((()=>[Cr(Ct(Q1),{class:"error-tip",color:Ct(K1)[3].color,size:"24px",onClick:Vi((()=>{}),["stop"]),"model-value":Ct(K1)[3].icon},null,8,["color","model-value"])])),_:1})):Tr("",!0)],2),Cr(A2,{disabled:e.disabled,modelValue:i.value.nodeConfig,"onUpdate:modelValue":n[0]||(n[0]=e=>i.value.nodeConfig=e)},null,8,["disabled","modelValue"]),0!==Ct(l).TYPE?(hr(),br(ape,{key:0,open:s.value,"onUpdate:open":n[1]||(n[1]=e=>s.value=e),modelValue:i.value,"onUpdate:modelValue":n[2]||(n[2]=e=>i.value=e)},null,8,["open","modelValue"])):Tr("",!0),Cr(lpe,{open:a.value,"onUpdate:open":n[3]||(n[3]=e=>a.value=e),modelValue:r.value,"onUpdate:modelValue":n[4]||(n[4]=e=>r.value=e),onSave:c},null,8,["open","modelValue"])])}}}),[["__scopeId","data-v-c07f8c3a"]]),ype={class:"workflow-design"},Ope={class:"box-scale"},wpe=Sr("div",{class:"end-node"},[Sr("div",{class:"end-node-circle"}),Sr("div",{class:"end-node-text"},"流程结束")],-1),xpe=Ln({__name:"WorkFlow",props:{modelValue:E1().def({}),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=Ot({});return wn((()=>o.modelValue),(e=>{r.value=e}),{immediate:!0,deep:!0}),wn((()=>r.value),(e=>{n("update:modelValue",e)})),(t,n)=>(hr(),vr("div",ype,[Sr("div",Ope,[Cr(bpe,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),disabled:e.disabled},null,8,["modelValue","disabled"]),r.value.nodeConfig?(hr(),br(uue,{key:0,modelValue:r.value.nodeConfig,"onUpdate:modelValue":n[1]||(n[1]=e=>r.value.nodeConfig=e),disabled:e.disabled},null,8,["modelValue","disabled"])):Tr("",!0),wpe])]))}}),$pe={style:{width:"calc(100vw - 16px)",height:"calc(100vh - 48px)"}},Spe={class:"buttons"},Cpe={style:{overflow:"auto",width:"100vw",height:"calc(100vh - 48px)"}},kpe=g2(Ln({__name:"App",setup(e){const t=e=>{const t={},n=window.location.href.split("?")[1];return n&&n.split("&").forEach((e=>{const n=e.split("=")[1],o=e.split("=")[0];t[o]=n})),t[e]},n=e1(),o=t("id"),r=localStorage.getItem("Access-Token"),i=localStorage.getItem("app_namespace"),l="xkjIc2ZHZ0"===t("x1c2Hdd6"),a="kaxC8Iml"===t("x1c2Hdd6")||l;Gn((()=>{if(n.clear(),!["D7Rzd7Oe","kaxC8Iml","xkjIc2ZHZ0"].includes(t("x1c2Hdd6")))return s.value=!0,void xB.error({content:"未知错误,请联系管理员",duration:0});n.setId(o),n.setToken(r),n.setNameSpaceId(i),n.setType(a?l?2:1:0),c.value=a,o&&"undefined"!==o&&(l?f():h())}));const s=Ot(!1),c=Ot(!1),u=Ot({workflowStatus:1,blockStrategy:1,description:void 0,executorTimeout:60}),d=()=>{"undefined"===o?t1("/workflow","post",u.value).then((()=>{window.parent.postMessage({code:"SV5ucvLBhvFkOftb",data:JSON.stringify(u.value)})})):t1("/workflow","put",u.value).then((()=>{window.parent.postMessage({code:"8Rr3XPtVVAHfduQg",data:JSON.stringify(u.value)})}))},p=()=>{window.parent.postMessage({code:"kb4DO9h6WIiqFhbp"})},h=()=>{s.value=!0,t1(`/workflow/${o}`).then((e=>{u.value=e})).finally((()=>{s.value=!1}))},f=()=>{s.value=!0,t1(`/workflow/batch/${o}`).then((e=>{u.value=e})).finally((()=>{s.value=!1}))};return(e,t)=>{const n=fn("a-button"),o=fn("a-affix"),r=fn("a-spin");return hr(),vr("div",$pe,[c.value?Tr("",!0):(hr(),br(o,{key:0,"offset-top":0},{default:sn((()=>[Sr("div",Spe,[Cr(n,{type:"primary",siz:"large",onClick:d},{default:sn((()=>[Pr("保存")])),_:1}),Cr(n,{siz:"large",style:{"margin-left":"16px"},onClick:p},{default:sn((()=>[Pr("取消")])),_:1})])])),_:1})),Sr("div",Cpe,[Cr(r,{spinning:s.value},{default:sn((()=>[Cr(Ct(xpe),{class:"work-flow",modelValue:u.value,"onUpdate:modelValue":t[0]||(t[0]=e=>u.value=e),disabled:c.value},null,8,["modelValue","disabled"])])),_:1},8,["spinning"])])])}}}),[["__scopeId","data-v-633f102f"]]);function Ppe(e,t){var n;return e="object"==typeof(n=e)&&null!==n?e:Object.create(null),new Proxy(e,{get:(e,n,o)=>"key"===n?Reflect.get(e,n,o):Reflect.get(e,n,o)||Reflect.get(t,n,o)})}function Tpe(e,{storage:t,serializer:n,key:o,debug:r}){try{const r=null==t?void 0:t.getItem(o);r&&e.$patch(null==n?void 0:n.deserialize(r))}catch(Rpe){}}function Mpe(e,{storage:t,serializer:n,key:o,paths:r,debug:i}){try{const i=Array.isArray(r)?function(e,t){return t.reduce(((t,n)=>{const o=n.split(".");return function(e,t,n){return t.slice(0,-1).reduce(((e,t)=>/^(__proto__)$/.test(t)?{}:e[t]=e[t]||{}),e)[t[t.length-1]]=n,e}(t,o,function(e,t){return t.reduce(((e,t)=>null==e?void 0:e[t]),e)}(e,o))}),{})}(e,r):e;t.setItem(o,n.serialize(i))}catch(Rpe){}}var Ipe=function(e={}){return t=>{const{auto:n=!1}=e,{options:{persist:o=n},store:r,pinia:i}=t;if(!o)return;if(!(r.$id in i.state.value)){const e=i._s.get(r.$id.replace("__hot:",""));return void(e&&Promise.resolve().then((()=>e.$persist())))}const l=(Array.isArray(o)?o.map((t=>Ppe(t,e))):[Ppe(o,e)]).map(function(e,t){return n=>{var o;try{const{storage:r=localStorage,beforeRestore:i,afterRestore:l,serializer:a={serialize:JSON.stringify,deserialize:JSON.parse},key:s=t.$id,paths:c=null,debug:u=!1}=n;return{storage:r,beforeRestore:i,afterRestore:l,serializer:a,key:(null!=(o=e.key)?o:e=>e)("string"==typeof s?s:s(t.$id)),paths:c,debug:u}}catch(Rpe){return n.debug,null}}}(e,r)).filter(Boolean);r.$persist=()=>{l.forEach((e=>{Mpe(r.$state,e)}))},r.$hydrate=({runHooks:e=!0}={})=>{l.forEach((n=>{const{beforeRestore:o,afterRestore:i}=n;e&&(null==o||o(t)),Tpe(r,n),e&&(null==i||i(t))}))},l.forEach((e=>{const{beforeRestore:n,afterRestore:o}=e;null==n||n(t),Tpe(r,e),null==o||o(t),r.$subscribe(((t,n)=>{Mpe(n,e)}),{detached:!0})}))}}();const Epe=function(){const e=J(!0),t=e.run((()=>Ot({})));let n=[],o=[];const r=ht({install(e){qi(r),r._a=e,e.provide(Ji,r),e.config.globalProperties.$pinia=r,o.forEach((e=>n.push(e))),o=[]},use(e){return this._a?n.push(e):o.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return r}();Epe.use(Ipe);const Ape=Gi(kpe);Ape.use(J0),Ape.use(Epe),Ape.mount("#app")}},function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports});export default o(); +function n1(e){return"[object Object]"===Object.prototype.toString.call(e)}function o1(){return o1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(r[n]=e[n]);return r}const i1={silent:!1,logLevel:"warn"},l1=["validator"],a1=Object.prototype,s1=a1.toString,c1=a1.hasOwnProperty,u1=/^\s*function (\w+)/;function d1(e){var t;const n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){const e=n.toString().match(u1);return e?e[1]:""}return""}const p1=function(e){var t,n;return!1!==n1(e)&&(void 0===(t=e.constructor)||!1!==n1(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))};let h1=e=>e;const f1=(e,t)=>c1.call(e,t),g1=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},m1=Array.isArray||function(e){return"[object Array]"===s1.call(e)},v1=e=>"[object Function]"===s1.call(e),b1=(e,t)=>p1(e)&&f1(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t),y1=e=>p1(e)&&(f1(e,"type")||["_vueTypes_name","validator","default","required"].some((t=>f1(e,t))));function O1(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function w1(e,t,n=!1){let o,r=!0,i="";o=p1(e)?e:{type:e};const l=b1(o)?o._vueTypes_name+" - ":"";if(y1(o)&&null!==o.type){if(void 0===o.type||!0===o.type)return r;if(!o.required&&null==t)return r;m1(o.type)?(r=o.type.some((e=>!0===w1(e,t,!0))),i=o.type.map((e=>d1(e))).join(" or ")):(i=d1(o),r="Array"===i?m1(t):"Object"===i?p1(t):"String"===i||"Number"===i||"Boolean"===i||"Function"===i?function(e){if(null==e)return"";const t=e.constructor.toString().match(u1);return t?t[1].replace(/^Async/,""):""}(t)===i:t instanceof o.type)}if(!r){const e=`${l}value "${t}" should be of type "${i}"`;return!1===n?(h1(e),!1):e}if(f1(o,"validator")&&v1(o.validator)){const e=h1,i=[];if(h1=e=>{i.push(e)},r=o.validator(t),h1=e,!r){const e=(i.length>1?"* ":"")+i.join("\n* ");return i.length=0,!1===n?(h1(e),r):e}}return r}function x1(e,t){const n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(f1(this,"default")&&delete this.default,this):v1(e)||!0===w1(this,e,!0)?(this.default=m1(e)?()=>[...e]:p1(e)?()=>Object.assign({},e):e,this):(h1(`${this._vueTypes_name} - invalid default value: "${e}"`),this)}}}),{validator:o}=n;return v1(o)&&(n.validator=O1(o,n)),n}function $1(e,t){const n=x1(e,t);return Object.defineProperty(n,"validate",{value(e){return v1(this.validator)&&h1(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=O1(e,this),this}})}function S1(e,t,n){const o=function(e){const t={};return Object.getOwnPropertyNames(e).forEach((n=>{t[n]=Object.getOwnPropertyDescriptor(e,n)})),Object.defineProperties({},t)}(t);if(o._vueTypes_name=e,!p1(n))return o;const{validator:r}=n,i=r1(n,l1);if(v1(r)){let{validator:e}=o;e&&(e=null!==(a=(l=e).__original)&&void 0!==a?a:l),o.validator=O1(e?function(t){return e.call(this,t)&&r.call(this,t)}:r,o)}var l,a;return Object.assign(o,i)}function C1(e){return e.replace(/^(?!\s*$)/gm," ")}const k1=()=>$1("any",{}),P1=()=>$1("boolean",{type:Boolean}),T1=()=>$1("string",{type:String}),M1=()=>$1("number",{type:Number}),I1=()=>$1("array",{type:Array}),E1=()=>$1("object",{type:Object});function A1(e,t="custom validation failed"){if("function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return x1(e.name||"<>",{type:null,validator(n){const o=e(n);return o||h1(`${this._vueTypes_name} - ${t}`),o}})}function R1(e){if(!m1(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.map((e=>"symbol"==typeof e?e.toString():e)).join('", "')}".`,n={validator(n){const o=-1!==e.indexOf(n);return o||h1(t),o}};if(-1===e.indexOf(null)){const t=e.reduce(((e,t)=>{if(null!=t){const n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e}),[]);t.length>0&&(n.type=t)}return x1("oneOf",n)}function D1(e){if(!m1(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,n=!1,o=[];for(let i=0;io.indexOf(e)===t));const r=!1===n&&o.length>0?o:null;return x1("oneOfType",t?{type:r,validator(t){const n=[],o=e.some((e=>{const o=w1(e,t,!0);return"string"==typeof o&&n.push(o),!0===o}));return o||h1(`oneOfType - provided value does not match any of the ${n.length} passed-in validators:\n${C1(n.join("\n"))}`),o}}:{type:r})}function j1(e){return x1("arrayOf",{type:Array,validator(t){let n="";const o=t.every((t=>(n=w1(e,t,!0),!0===n)));return o||h1(`arrayOf - value validation error:\n${C1(n)}`),o}})}function B1(e){return x1("instanceOf",{type:e})}function N1(e){return x1("objectOf",{type:Object,validator(t){let n="";const o=Object.keys(t).every((o=>(n=w1(e,t[o],!0),!0===n)));return o||h1(`objectOf - value validation error:\n${C1(n)}`),o}})}function z1(e){const t=Object.keys(e),n=t.filter((t=>{var n;return!(null===(n=e[t])||void 0===n||!n.required)})),o=x1("shape",{type:Object,validator(o){if(!p1(o))return!1;const r=Object.keys(o);if(n.length>0&&n.some((e=>-1===r.indexOf(e)))){const e=n.filter((e=>-1===r.indexOf(e)));return h1(1===e.length?`shape - required property "${e[0]}" is not defined.`:`shape - required properties "${e.join('", "')}" are not defined.`),!1}return r.every((n=>{if(-1===t.indexOf(n))return!0===this._vueTypes_isLoose||(h1(`shape - shape definition does not include a "${n}" property. Allowed keys: "${t.join('", "')}".`),!1);const r=w1(e[n],o[n],!0);return"string"==typeof r&&h1(`shape - "${n}" property validation error:\n ${C1(r)}`),!0===r}))}});return Object.defineProperty(o,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(o,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),o}const _1=["name","validate","getter"],L1=(()=>{var e;return(e=class{static get any(){return k1()}static get func(){return $1("function",{type:Function}).def(this.defaults.func)}static get bool(){return void 0===this.defaults.bool?P1():P1().def(this.defaults.bool)}static get string(){return T1().def(this.defaults.string)}static get number(){return M1().def(this.defaults.number)}static get array(){return I1().def(this.defaults.array)}static get object(){return E1().def(this.defaults.object)}static get integer(){return x1("integer",{type:Number,validator(e){const t=g1(e);return!1===t&&h1(`integer - "${e}" is not an integer`),t}}).def(this.defaults.integer)}static get symbol(){return x1("symbol",{validator(e){const t="symbol"==typeof e;return!1===t&&h1(`symbol - invalid value "${e}"`),t}})}static get nullable(){return Object.defineProperty({type:null,validator(e){const t=null===e;return!1===t&&h1("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"})}static extend(e){if(h1("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),m1(e))return e.forEach((e=>this.extend(e))),this;const{name:t,validate:n=!1,getter:o=!1}=e,r=r1(e,_1);if(f1(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:i}=r;if(b1(i))return delete r.type,Object.defineProperty(this,t,o?{get:()=>S1(t,i,r)}:{value(...e){const n=S1(t,i,r);return n.validator&&(n.validator=n.validator.bind(n,...e)),n}});let l;return l=o?{get(){const e=Object.assign({},r);return n?$1(t,e):x1(t,e)},enumerable:!0}:{value(...e){const o=Object.assign({},r);let i;return i=n?$1(t,o):x1(t,o),o.validator&&(i.validator=o.validator.bind(i,...e)),i},enumerable:!0},Object.defineProperty(this,t,l)}}).defaults={},e.sensibleDefaults=void 0,e.config=i1,e.custom=A1,e.oneOf=R1,e.instanceOf=B1,e.oneOfType=D1,e.arrayOf=j1,e.objectOf=N1,e.shape=z1,e.utils={validate:(e,t)=>!0===w1(t,e,!0),toType:(e,t,n=!1)=>n?$1(e,t):x1(e,t)},e})();!function(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){(class extends L1{static get sensibleDefaults(){return o1({},this.defaults)}static set sensibleDefaults(t){this.defaults=!1!==t?o1({},!0!==t?t:e):{}}}).defaults=o1({},e)}();const Q1=Ln({__name:"AntdIcon",props:{modelValue:k1(),size:T1(),color:T1()},setup(e){const t=Ln({props:{value:k1(),size:T1(),color:T1()},setup:e=>()=>{const{value:t}=e;return t?Kr(t,{style:{fontSize:e.size,color:e.color}},{}):null}});return(n,o)=>(hr(),br(Ct(t),{value:e.modelValue,size:e.size,color:e.color},null,8,["value","size","color"]))}});var H1=(e=>(e[e.SpEl=1]="SpEl",e[e.Aviator=2]="Aviator",e[e.QL=3]="QL",e))(H1||{}),F1=(e=>(e[e["CRON表达式"]=1]="CRON表达式",e[e["固定时间"]=2]="固定时间",e))(F1||{}),W1=(e=>(e[e["丢弃"]=1]="丢弃",e[e["覆盖"]=2]="覆盖",e[e["并行"]=3]="并行",e))(W1||{}),V1=(e=>(e[e["跳过"]=1]="跳过",e[e["阻塞"]=2]="阻塞",e))(V1||{}),Z1=(e=>(e[e["关闭"]=0]="关闭",e[e["开启"]=1]="开启",e))(Z1||{}),X1=(e=>(e[e.and=1]="and",e[e.or=2]="or",e))(X1||{}),Y1=(e=>(e[e["application/json"]=1]="application/json",e[e["application/x-www-form-urlencoded"]=2]="application/x-www-form-urlencoded",e))(Y1||{});const K1={1:{title:"待处理",name:"waiting",color:"#64a6ea",icon:KJ},2:{title:"运行中",name:"running",color:"#1b7ee5",icon:yN},3:{title:"成功",name:"success",color:"#087da1",icon:l$},4:{title:"失败",name:"fail",color:"#f52d80",icon:w$},5:{title:"停止",name:"stop",color:"#ac2df5",icon:DJ},6:{title:"取消",name:"cancel",color:"#f5732d",icon:cJ},99:{title:"跳过",name:"skip",color:"#00000036",icon:fJ}},G1={1:{name:"Java",color:"#d06892"}},U1={0:{name:"无",color:"#f5f5f5"},1:{name:"执行超时",color:"#64a6ea"},2:{name:"无客户端节点",color:"#1b7ee5"},3:{name:"任务已关闭",color:"#087da1"},4:{name:"任务丢弃",color:"#3a2f81"},5:{name:"任务被覆盖",color:"#c2238a"},6:{name:"无可执行任务项",color:"#23c28a"},7:{name:"任务执行期间发生非预期异常",color:"#bdc223"},8:{name:"手动停止",color:"#23c28a"},9:{name:"条件节点执行异常",color:"#23c28a"},10:{name:"任务中断",color:"#bdc223"},11:{name:"回调节点执行异常",color:"#bdc223"},12:{name:"无需处理",color:"#23c28a"},13:{name:"节点处理失败并跳过",color:"#3a2f81"}},q1={2:{name:"运行中",color:"#1b7ee5"},3:{name:"成功",color:"#087da1"},4:{name:"失败",color:"#f52d80"},5:{name:"停止",color:"#ac2df5"}},J1={DEBUG:{name:"DEBUG",color:"#2647cc"},INFO:{name:"INFO",color:"#5c962c"},WARN:{name:"WARN",color:"#da9816"},ERROR:{name:"ERROR",color:"#dc3f41"}},e2={0:{name:"关闭",color:"#dc3f41"},1:{name:"开启",color:"#1b7ee5"}},t2=(e=>{const t={};return Object.keys(e).forEach((n=>{const o=e[parseInt(n,10)];t[parseInt(n,10)]={name:o.title,color:o.color}})),t})(K1),n2=e=>(ln("data-v-ab46a2e9"),e=e(),an(),e),o2={class:"log"},r2={class:"scroller"},i2={class:"gutters"},l2=n2((()=>Sr("div",{style:{"margin-top":"4px"}},null,-1))),a2={class:"gutter-element"},s2=n2((()=>Sr("div",{style:{height:"25px"}},null,-1))),c2={class:"content"},u2={class:"text",style:{color:"#2db7f5"}},d2={class:"text",style:{color:"#00a3a3"}},p2={class:"text",style:{color:"#a771bf","font-weight":"500"}},h2=n2((()=>Sr("div",{class:"text"},":",-1))),f2={class:"text",style:{"font-size":"18px"}},g2=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},m2=g2(Ln({__name:"LogModal",props:{open:P1().def(!1),record:E1().def({}),modalValue:I1().def([])},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1),i=Ot([]);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),wn((()=>o.modalValue),(e=>{i.value=e}),{immediate:!0,deep:!0});let l=0;Gn((()=>{d(),l=setInterval((()=>{d()}),1e3)}));const a=()=>{clearInterval(l),n("update:open",!1)};let s=!1,c=0,u=0;const d=()=>{s?clearInterval(l):t1(`/job/log/list?taskBatchId=${o.record.taskBatchId}&jobId=${o.record.jobId}&taskId=${o.record.id}&startId=${c}&fromIndex=${u}&size=50`).then((e=>{s=e.finished,c=e.nextStartId,u=e.fromIndex,e.message&&i.value.push(...e.message)}))},p=e=>{const t=new Date(Number.parseInt(e.toString()));return`${t.getFullYear()}-${1===(t.getMonth()+1).toString().length?"0"+(t.getMonth()+1):(t.getMonth()+1).toString()}-${t.getDate()} ${t.getHours()}:${1===t.getMinutes().toString().length?"0"+t.getMinutes():t.getMinutes().toString()}:${1===t.getSeconds().toString().length?"0"+t.getSeconds():t.getSeconds().toString()}`};return(t,n)=>{const o=fn("a-flex"),l=fn("a-modal");return hr(),br(l,{open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),centered:"",width:"80%",footer:null,title:"日志详情",onCancel:a},{default:sn((()=>[Sr("div",o2,[Sr("div",r2,[Sr("div",i2,[l2,(hr(!0),vr(ar,null,io(i.value,((e,t)=>(hr(),vr("div",{key:e.time_stamp},[Sr("div",a2,X(t+1),1),s2])))),128))]),Sr("div",c2,[(hr(!0),vr(ar,null,io(e.modalValue,(e=>(hr(),vr("div",{class:"line",key:e.time_stamp},[Cr(o,{gap:"small"},{default:sn((()=>[Sr("div",u2,X(p(e.time_stamp)),1),Sr("div",{class:"text",style:_({color:Ct(J1)[e.level].color})},X(4===e.level.length?e.level+"\t":e.level),5),Sr("div",d2,"["+X(e.thread)+"]",1),Sr("div",p2,X(e.location),1),h2])),_:2},1024),Sr("div",f2,X(e.message),1)])))),128))])])])])),_:1},8,["open"])}}}),[["__scopeId","data-v-ab46a2e9"]]),v2={key:0},b2={style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},y2=(e=>(ln("data-v-87b57530"),e=e(),an(),e))((()=>Sr("span",{style:{"padding-left":"18px"}},"任务项列表",-1))),O2={style:{"padding-left":"6px"}},w2=["onClick"],x2={key:0},$2=g2(Ln({__name:"DetailCard",props:{id:T1(),ids:I1().def([]),open:P1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=fo().slots,i=Od.PRESENTED_IMAGE_SIMPLE,l=e1(),a=Ot(!1),s=Ot(!1),c=Ot(!1),u=Ot(!1),d=Ot(1),p=Ot({}),h=Ot([]),f=Ot({current:1,defaultPageSize:10,pageSize:10,total:0,showSizeChanger:!1,showQuickJumper:!1,showTotal:e=>`共 ${e} 条`});wn((()=>o.open),(e=>{a.value=e}),{immediate:!0});const g=Ot([]);Gn((()=>{o.ids.length>1&&(document.querySelector(".ant-pagination-prev").title="上一个",document.querySelector(".ant-pagination-next").title="下一个"),g.value=o.ids,o.ids.length>0?(y(o.ids[0]),O(o.ids[0])):o.id&&(g.value=[o.id],b(o.id),O(o.id))}));const m=()=>{n("update:open",!1)},b=e=>{c.value=!0,t1(`/job/${e}`).then((e=>{p.value=e,c.value=!1}))},y=e=>{c.value=!0,t1(`/job/batch/${e}`).then((e=>{p.value=e,c.value=!1}))},O=(e,t=1)=>{u.value=!0,t1(`/job/task/list?groupName=${l.GROUP_NAME}&taskBatchId=${e}&page=${t}`).then((e=>{f.value.total=e.total,h.value=e.data,u.value=!1}))},w=Ot({}),x=Ot([{title:"日志",dataIndex:"log",width:"5%"},{title:"ID",dataIndex:"id",width:"10%"},{title:"组名称",dataIndex:"groupName"},{title:"地址",dataIndex:"clientInfo"},{title:"参数",dataIndex:"argsStr",ellipsis:!0},{title:"结果",dataIndex:"resultMessage",ellipsis:!0},{title:"状态",dataIndex:"taskStatus"},{title:"重试次数",dataIndex:"retryCount"},{title:"开始执行时间",dataIndex:"createDt",sorter:!0,width:"12%"}]);return(t,n)=>{const o=fn("a-descriptions-item"),l=fn("a-tag"),b=fn("a-descriptions"),y=fn("a-spin"),$=fn("a-button"),S=fn("a-table"),C=fn("a-tab-pane"),k=fn("a-tabs"),P=fn("a-empty"),T=fn("a-pagination"),M=fn("a-drawer");return hr(),vr(ar,null,[Cr(M,{title:"任务批次详情",placement:"right",width:800,open:a.value,"onUpdate:open":n[2]||(n[2]=e=>a.value=e),"destroy-on-close":"",onClose:m},lo({default:sn((()=>[g.value&&g.value.length>0?(hr(),vr("div",v2,[Cr(k,{activeKey:d.value,"onUpdate:activeKey":n[0]||(n[0]=e=>d.value=e),animated:""},{renderTabBar:sn((()=>[])),default:sn((()=>[(hr(!0),vr(ar,null,io(g.value,((e,n)=>(hr(),br(C,{key:n+1,tab:e},{default:sn((()=>[Cr(y,{spinning:c.value},{default:sn((()=>[Cr(b,{bordered:"",column:2},{default:sn((()=>[Cr(o,{label:"组名称"},{default:sn((()=>[Pr(X(p.value.groupName),1)])),_:1}),p.value.jobName?(hr(),br(o,{key:0,label:"任务名称"},{default:sn((()=>[Pr(X(p.value.jobName),1)])),_:1})):Tr("",!0),p.value.nodeName?(hr(),br(o,{key:1,label:"节点名称"},{default:sn((()=>[Pr(X(p.value.nodeName),1)])),_:1})):Tr("",!0),Cr(o,{label:"状态"},{default:sn((()=>[null!=p.value.taskBatchStatus?(hr(),br(l,{key:0,color:Ct(t2)[p.value.taskBatchStatus].color},{default:sn((()=>[Pr(X(Ct(t2)[p.value.taskBatchStatus].name),1)])),_:1},8,["color"])):Tr("",!0),null!=p.value.jobStatus?(hr(),br(l,{key:1,color:Ct(e2)[p.value.jobStatus].color},{default:sn((()=>[Pr(X(Ct(e2)[p.value.jobStatus].name),1)])),_:1},8,["color"])):Tr("",!0)])),_:1}),Ct(r).default?Tr("",!0):(hr(),br(o,{key:2,label:"执行器类型"},{default:sn((()=>[p.value.executorType?(hr(),br(l,{key:0,color:Ct(G1)[p.value.executorType].color},{default:sn((()=>[Pr(X(Ct(G1)[p.value.executorType].name),1)])),_:1},8,["color"])):Tr("",!0)])),_:1})),Cr(o,{label:"操作原因"},{default:sn((()=>[void 0!==p.value.operationReason?(hr(),br(l,{key:0,color:Ct(U1)[p.value.operationReason].color,style:_(0===p.value.operationReason?{color:"#1e1e1e"}:{})},{default:sn((()=>[Pr(X(Ct(U1)[p.value.operationReason].name),1)])),_:1},8,["color","style"])):Tr("",!0)])),_:1}),Cr(o,{label:"开始执行时间",span:Ct(r).default?2:1},{default:sn((()=>[Pr(X(p.value.executionAt),1)])),_:1},8,["span"]),Ct(r).default?Tr("",!0):(hr(),br(o,{key:3,label:"执行器名称",span:2},{default:sn((()=>[Pr(X(p.value.executorInfo),1)])),_:1})),Cr(o,{label:"创建时间",span:2},{default:sn((()=>[Pr(X(p.value.createDt),1)])),_:1})])),_:1})])),_:1},8,["spinning"]),ao(t.$slots,"default",{},void 0,!0),Sr("div",b2,[y2,Sr("span",O2,[Cr($,{type:"text",icon:Kr(Ct(_J)),onClick:t=>O(e)},null,8,["icon","onClick"])])]),Cr(S,{dataSource:h.value,columns:x.value,loading:u.value,scroll:{x:1200},"row-key":"id",onChange:t=>{return n=e,o=t,f.value=o,void O(n,o.current);var n,o},pagination:f.value},{bodyCell:sn((({column:e,record:t,text:n})=>["log"===e.dataIndex?(hr(),vr("a",{key:0,onClick:e=>{return n=t,w.value=n,void(s.value=!0);var n}},"点击查看",8,w2)):Tr("",!0),"taskStatus"===e.dataIndex?(hr(),vr(ar,{key:1},[n?(hr(),br(l,{key:0,color:Ct(q1)[n].color},{default:sn((()=>[Pr(X(Ct(q1)[n].name),1)])),_:2},1032,["color"])):Tr("",!0)],64)):Tr("",!0),"clientInfo"===e.dataIndex?(hr(),vr(ar,{key:2},[Pr(X(""!==n?n.split("@")[1]:""),1)],64)):Tr("",!0)])),_:2},1032,["dataSource","columns","loading","onChange","pagination"])])),_:2},1032,["tab"])))),128))])),_:3},8,["activeKey"])])):(hr(),br(P,{key:1,class:"empty",image:Ct(i),description:"暂无数据"},null,8,["image"]))])),_:2},[e.ids&&e.ids.length>0?{name:"footer",fn:sn((()=>[Cr(T,{style:{"text-align":"center"},current:d.value,"onUpdate:current":n[1]||(n[1]=e=>d.value=e),total:e.ids.length,pageSize:1,hideOnSinglePage:""},{itemRender:sn((({page:e,type:t,originalElement:n})=>{return["page"===t?(hr(),vr("a",x2,X(e),1)):(hr(),br((o=n,v(o)?mn(hn,o,!1)||o:o||gn),{key:1}))];var o})),_:1},8,["current","total"])])),key:"0"}:void 0]),1032,["open"]),s.value&&w.value?(hr(),br(m2,{key:0,open:s.value,"onUpdate:open":n[3]||(n[3]=e=>s.value=e),record:w.value},null,8,["open","record"])):Tr("",!0)],64)}}}),[["__scopeId","data-v-87b57530"]]),S2=e=>(ln("data-v-74f467a1"),e=e(),an(),e),C2={class:"add-node-btn-box"},k2={class:"add-node-btn"},P2={class:"add-node-popover-body"},T2={class:"icon"},M2=S2((()=>Sr("p",null,"任务节点",-1))),I2=S2((()=>Sr("p",null,"决策节点",-1))),E2=S2((()=>Sr("p",null,"回调通知",-1))),A2=g2(Ln({__name:"AddNode",props:{modelValue:E1(),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=e=>{let t={};1===e?t={nodeName:"任务节点",nodeType:1,conditionNodes:[{nodeName:"任务1",failStrategy:1,priorityLevel:1,workflowNodeStatus:1,jobTask:{jobId:void 0}}],childNode:o.modelValue}:2===e?t={nodeName:"决策节点",nodeType:2,conditionNodes:[{nodeName:"条件1",priorityLevel:1,decision:{expressionType:1,nodeExpression:void 0,logicalCondition:1,defaultDecision:0}},{nodeName:"其他情况",priorityLevel:2,decision:{expressionType:1,nodeExpression:"#true",logicalCondition:1,defaultDecision:1}}],childNode:o.modelValue}:3===e&&(t={nodeName:"回调通知",nodeType:3,conditionNodes:[{nodeName:"回调通知",workflowNodeStatus:1,callback:{webhook:void 0,contentType:void 0,secret:void 0}}],childNode:o.modelValue}),n("update:modelValue",t)};return(t,n)=>{const o=fn("a-button"),i=fn("a-popover");return hr(),vr("div",C2,[Sr("div",k2,[e.disabled?Tr("",!0):(hr(),br(i,{key:0,placement:"rightTop",trigger:"click","overlay-style":{width:"296px"}},{content:sn((()=>[Sr("div",P2,[Sr("ul",T2,[Sr("li",null,[Cr(o,{shape:"circle",size:"large",onClick:n[0]||(n[0]=e=>r(1))},{default:sn((()=>[Cr(Ct(WJ),{style:{color:"#3296fa"}})])),_:1}),M2]),Sr("li",null,[Cr(o,{shape:"circle",size:"large",onClick:n[1]||(n[1]=e=>r(2))},{default:sn((()=>[Cr(Ct(MJ),{style:{color:"#15bc83"}})])),_:1}),I2]),Sr("li",null,[Cr(o,{shape:"circle",size:"large",onClick:n[2]||(n[2]=e=>r(3))},{default:sn((()=>[Cr(Ct(yL),{style:{color:"#935af6"}})])),_:1}),E2])])])])),default:sn((()=>[Cr(o,{type:"primary",icon:Kr(Ct(TI)),shape:"circle"},null,8,["icon"])])),_:1}))])])}}}),[["__scopeId","data-v-74f467a1"]]),R2=e=>{const t=[];for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=e[n];"number"==typeof o&&t.push({name:n,value:o})}return t},D2=Ln({__name:"TaskDrawer",props:{open:P1().def(!1),len:M1().def(0),modelValue:E1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=e1(),i=Ot(!1),l=Ot({}),a=Ot([]);Gn((()=>{a.value=r.JOB_LIST})),wn((()=>o.open),(e=>{i.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{l.value=e}),{immediate:!0,deep:!0});const s=()=>{n("update:modelValue",l.value)},c=Ot(),u=()=>{var e;null==(e=c.value)||e.validate().then((()=>{d(),n("save",l.value)})).catch((()=>{xB.warning("请检查表单信息")}))},d=()=>{n("update:open",!1),i.value=!1},p={failStrategy:[{required:!0,message:"请选择失败策略",trigger:"change"}],workflowNodeStatus:[{required:!0,message:"请选择工作流状态",trigger:"change"}]};return(t,n)=>{const o=fn("a-typography-paragraph"),r=fn("a-select-option"),h=fn("a-select"),f=fn("a-form-item"),g=fn("a-radio"),m=fn("a-radio-group"),v=fn("a-form"),b=fn("a-button"),y=fn("a-drawer");return hr(),br(y,{open:i.value,"onUpdate:open":n[5]||(n[5]=e=>i.value=e),"destroy-on-close":"",width:500,onClose:d},{title:sn((()=>[Cr(o,{style:{margin:"0",width:"412px"},ellipsis:"",content:l.value.nodeName,"onUpdate:content":n[0]||(n[0]=e=>l.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:s},null,8,["content"])])),extra:sn((()=>[Cr(h,{value:l.value.priorityLevel,"onUpdate:value":n[1]||(n[1]=e=>l.value.priorityLevel=e),style:{width:"110px"}},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.len,(e=>(hr(),br(r,{key:e,value:e},{default:sn((()=>[Pr("优先级 "+X(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),footer:sn((()=>[Cr(b,{type:"primary",onClick:u},{default:sn((()=>[Pr("保存")])),_:1}),Cr(b,{style:{"margin-left":"12px"},onClick:d},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(v,{ref_key:"formRef",ref:c,rules:p,layout:"vertical",model:l.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(f,{name:["jobTask","jobId"],label:"所属任务",placeholder:"请选择任务",rules:[{required:!0,message:"请选择任务",trigger:"change"}]},{default:sn((()=>[Cr(h,{value:l.value.jobTask.jobId,"onUpdate:value":n[2]||(n[2]=e=>l.value.jobTask.jobId=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(a.value,(e=>(hr(),br(r,{key:e.id,value:e.id},{default:sn((()=>[Pr(X(e.jobName),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(f,{name:"failStrategy",label:"失败策略"},{default:sn((()=>[Cr(m,{value:l.value.failStrategy,"onUpdate:value":n[3]||(n[3]=e=>l.value.failStrategy=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(V1)),(e=>(hr(),br(g,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(f,{name:"workflowNodeStatus",label:"节点状态"},{default:sn((()=>[Cr(m,{value:l.value.workflowNodeStatus,"onUpdate:value":n[4]||(n[4]=e=>l.value.workflowNodeStatus=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(Z1)),(e=>(hr(),br(g,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),j2=Ln({__name:"TaskDetail",props:{modelValue:E1().def({}),open:P1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=e1(),i=Ot(!1);wn((()=>o.open),(e=>{i.value=e}),{immediate:!0});const l=()=>{n("update:open",!1)},a=e=>{var t;return null==(t=r.JOB_LIST.find((t=>t.id===e)))?void 0:t.jobName};return(t,n)=>{const o=fn("a-descriptions-item"),r=fn("a-descriptions"),s=fn("a-drawer");return hr(),br(s,{title:"任务详情",placement:"right",width:500,open:i.value,"onUpdate:open":n[0]||(n[0]=e=>i.value=e),"destroy-on-close":"",onClose:l},{default:sn((()=>[Cr(r,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(o,{label:"节点名称"},{default:sn((()=>[Pr(X(e.modelValue.nodeName),1)])),_:1}),Cr(o,{label:"任务 ID"},{default:sn((()=>{var t;return[Pr(X(null==(t=e.modelValue.jobTask)?void 0:t.jobId),1)]})),_:1}),Cr(o,{label:"任务名称"},{default:sn((()=>{var t;return[Pr(X(a(null==(t=e.modelValue.jobTask)?void 0:t.jobId)),1)]})),_:1}),Cr(o,{label:"失败策略"},{default:sn((()=>[Pr(X(Ct(V1)[e.modelValue.failStrategy]),1)])),_:1}),Cr(o,{label:"工作流状态"},{default:sn((()=>[Pr(X(Ct(Z1)[e.modelValue.workflowNodeStatus]),1)])),_:1})])),_:1})])),_:1},8,["open"])}}}),B2=e=>(ln("data-v-c53370c6"),e=e(),an(),e),N2={class:"node-wrap"},z2={class:"branch-box"},_2={class:"condition-node"},L2={class:"condition-node-box"},Q2={class:"popover"},H2=B2((()=>Sr("span",null,"重试",-1))),F2=B2((()=>Sr("span",null,"忽略",-1))),W2=["onClick"],V2=["onClick"],Z2={class:"title"},X2={class:"text",style:{color:"#3296fa"}},Y2={class:"priority-title"},K2={class:"content",style:{"min-height":"81px"}},G2={key:0,class:"placeholder"},U2=B2((()=>Sr("span",{class:"content_label"},"任务ID: ",-1))),q2=B2((()=>Sr("span",{class:"content_label"},"失败策略: ",-1))),J2=B2((()=>Sr("div",null,".........",-1))),e3=["onClick"],t3={key:1,class:"top-left-cover-line"},n3={key:2,class:"bottom-left-cover-line"},o3={key:3,class:"top-right-cover-line"},r3={key:4,class:"bottom-right-cover-line"},i3=g2(Ln({__name:"TaskNode",props:{modelValue:E1().def({}),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=e1(),i=Ot({}),l=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{var e;const t=i.value.conditionNodes.length+1;null==(e=i.value.conditionNodes)||e.push({nodeName:"任务"+t,priorityLevel:t,failStrategy:1,workflowNodeStatus:1,jobTask:{jobId:void 0}}),n("update:modelValue",i.value)},s=(e,t)=>{e.childNode?s(e.childNode,t):e.childNode=t},c=(e,t=1)=>{var o;i.value.conditionNodes[e]=i.value.conditionNodes.splice(e+t,1,i.value.conditionNodes[e])[0],null==(o=i.value.conditionNodes)||o.map(((e,t)=>{e.priorityLevel=t+1})),n("update:modelValue",i.value)},u=Ot(0),d=Ot(!1),p=Ot({}),h=e=>{const t=i.value.conditionNodes[u.value].priorityLevel,o=e.priorityLevel;i.value.conditionNodes[u.value]=e,t!==o&&c(u.value,o-t),n("update:modelValue",i.value)},f=e=>o.disabled?2===r.TYPE?`node-error node-error-${e.taskBatchStatus&&K1[e.taskBatchStatus]?K1[e.taskBatchStatus].name:"default"}`:"node-error":"auto-judge-def auto-judge-hover",g=Ot(),m=Ot(),v=Ot(!1),b=Ot([]),y=(e,t)=>{var n,l,a,s;m.value=[],2===r.TYPE?(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=m.value)||t.push(e.id):e.jobId&&(g.value=e.jobId.toString())})),(null==(l=e.jobTask)?void 0:l.jobId)&&(g.value=null==(a=e.jobTask)?void 0:a.jobId.toString()),v.value=!0):1===r.TYPE?b.value[t]=!0:(s=t,o.disabled||(u.value=s,p.value=JSON.parse(JSON.stringify(i.value.conditionNodes[s])),d.value=!0))};return(t,o)=>{const u=fn("a-button"),O=fn("a-divider"),w=fn("a-badge"),x=fn("a-tooltip"),$=fn("a-popover");return hr(),vr("div",N2,[Sr("div",z2,[e.disabled?Tr("",!0):(hr(),br(u,{key:0,class:"add-branch",primary:"",onClick:a},{default:sn((()=>[Pr("添加任务")])),_:1})),(hr(!0),vr(ar,null,io(i.value.conditionNodes,((o,a)=>(hr(),vr("div",{class:"col-box",key:a},[Sr("div",_2,[Sr("div",L2,[Cr($,{open:l.value[a]&&2===Ct(r).TYPE,getPopupContainer:e=>e.parentNode,onOpenChange:e=>l.value[a]=e},{content:sn((()=>[Sr("div",Q2,[Cr(O,{type:"vertical"}),Cr(u,{type:"text",class:"popover-item"},{default:sn((()=>[Cr(Ct(yJ)),H2])),_:1}),Cr(O,{type:"vertical"}),Cr(u,{type:"text",class:"popover-item"},{default:sn((()=>[Cr(Ct(rJ)),F2])),_:1})])])),default:sn((()=>{var t,l,u;return[Sr("div",{class:W(["auto-judge",f(o)]),style:{cursor:"pointer"},onClick:e=>y(o,a)},[0!=a?(hr(),vr("div",{key:0,class:"sort-left",onClick:Vi((e=>c(a,-1)),["stop"])},[Cr(Ct(BR))],8,V2)):Tr("",!0),Sr("div",Z2,[Sr("span",X2,[Cr(w,{status:"processing",color:1===o.workflowNodeStatus?"#52c41a":"#ff4d4f"},null,8,["color"]),Pr(" "+X(o.nodeName),1)]),Sr("span",Y2,"优先级"+X(o.priorityLevel),1),e.disabled?Tr("",!0):(hr(),br(Ct(Jb),{key:0,class:"close",onClick:Vi((e=>(e=>{var t;1===i.value.conditionNodes.length?(i.value.childNode&&(i.value.conditionNodes[0].childNode?s(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Vt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))):null==(t=i.value.conditionNodes)||t.splice(e,1)})(a)),["stop"])},null,8,["onClick"]))]),Sr("div",K2,[(null==(t=o.jobTask)?void 0:t.jobId)?Tr("",!0):(hr(),vr("div",G2,"请选择任务")),(null==(l=o.jobTask)?void 0:l.jobId)?(hr(),vr(ar,{key:1},[Sr("div",null,[U2,Pr(" "+X(null==(u=o.jobTask)?void 0:u.jobId),1)]),Sr("div",null,[q2,Pr(X(Ct(V1)[o.failStrategy]),1)]),J2],64)):Tr("",!0)]),a!=i.value.conditionNodes.length-1?(hr(),vr("div",{key:1,class:"sort-right",onClick:Vi((e=>c(a)),["stop"])},[Cr(Ct(ok))],8,e3)):Tr("",!0),2===Ct(r).TYPE&&o.taskBatchStatus?(hr(),br(x,{key:2},{title:sn((()=>[Pr(X(Ct(K1)[o.taskBatchStatus].title),1)])),default:sn((()=>[Cr(Ct(Q1),{class:"error-tip",color:Ct(K1)[o.taskBatchStatus].color,size:"24px",onClick:Vi((()=>{}),["stop"]),"model-value":Ct(K1)[o.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):Tr("",!0)],10,W2)]})),_:2},1032,["open","getPopupContainer","onOpenChange"]),Cr(A2,{disabled:e.disabled,modelValue:o.childNode,"onUpdate:modelValue":e=>o.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),o.childNode?ao(t.$slots,"default",{key:0,node:o},void 0,!0):Tr("",!0),0==a?(hr(),vr("div",t3)):Tr("",!0),0==a?(hr(),vr("div",n3)):Tr("",!0),a==i.value.conditionNodes.length-1?(hr(),vr("div",o3)):Tr("",!0),a==i.value.conditionNodes.length-1?(hr(),vr("div",r3)):Tr("",!0),0!==Ct(r).type&&b.value[a]?(hr(),br(j2,{key:5,open:b.value[a],"onUpdate:open":e=>b.value[a]=e,modelValue:i.value.conditionNodes[a],"onUpdate:modelValue":e=>i.value.conditionNodes[a]=e},null,8,["open","onUpdate:open","modelValue","onUpdate:modelValue"])):Tr("",!0)])))),128))]),i.value.conditionNodes.length>1?(hr(),br(A2,{key:0,disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":o[0]||(o[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])):Tr("",!0),0===Ct(r).TYPE&&d.value?(hr(),br(D2,{key:1,open:d.value,"onUpdate:open":o[1]||(o[1]=e=>d.value=e),modelValue:p.value,"onUpdate:modelValue":o[2]||(o[2]=e=>p.value=e),len:i.value.conditionNodes.length,"onUpdate:len":o[3]||(o[3]=e=>i.value.conditionNodes.length=e),onSave:h},null,8,["open","modelValue","len"])):Tr("",!0),0!==Ct(r).TYPE&&v.value?(hr(),br(Ct($2),{key:2,open:v.value,"onUpdate:open":o[4]||(o[4]=e=>v.value=e),id:g.value,ids:m.value},null,8,["open","id","ids"])):Tr("",!0)])}}}),[["__scopeId","data-v-c53370c6"]]);class l3{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=g3(this,e,t);let o=[];return this.decompose(0,e,o,2),n.length&&n.decompose(0,n.length,o,3),this.decompose(t,this.length,o,1),s3.from(o,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=g3(this,e,t);let n=[];return this.decompose(e,t,n,0),s3.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),o=new d3(this),r=new d3(e);for(let i=t,l=t;;){if(o.next(i),r.next(i),i=0,o.lineBreak!=r.lineBreak||o.done!=r.done||o.value!=r.value)return!1;if(l+=o.value.length,o.done||l>=n)return!0}}iter(e=1){return new d3(this,e)}iterRange(e,t=this.length){return new p3(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let o=this.line(e).from;n=this.iterRange(o,Math.max(o,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new h3(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new a3(e):s3.from(a3.split(e,[])):l3.empty}}class a3 extends l3{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,o){for(let r=0;;r++){let i=this.text[r],l=o+i.length;if((t?n:l)>=e)return new f3(o,l,n,i);o=l+1,n++}}decompose(e,t,n,o){let r=e<=0&&t>=this.length?this:new a3(u3(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&o){let e=n.pop(),t=c3(r.text,e.text.slice(),0,r.length);if(t.length<=32)n.push(new a3(t,e.length+r.length));else{let e=t.length>>1;n.push(new a3(t.slice(0,e)),new a3(t.slice(e)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof a3))return super.replace(e,t,n);[e,t]=g3(this,e,t);let o=c3(this.text,c3(n.text,u3(this.text,0,e)),t),r=this.length+n.length-(t-e);return o.length<=32?new a3(o,r):s3.from(a3.split(o,[]),r)}sliceString(e,t=this.length,n="\n"){[e,t]=g3(this,e,t);let o="";for(let r=0,i=0;r<=t&&ie&&i&&(o+=n),er&&(o+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return o}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],o=-1;for(let r of e)n.push(r),o+=r.length+1,32==n.length&&(t.push(new a3(n,o)),n=[],o=-1);return o>-1&&t.push(new a3(n,o)),t}}class s3 extends l3{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,o){for(let r=0;;r++){let i=this.children[r],l=o+i.length,a=n+i.lines-1;if((t?a:l)>=e)return i.lineInner(e,t,n,o);o=l+1,n=a+1}}decompose(e,t,n,o){for(let r=0,i=0;i<=t&&r=i){let r=o&((i<=e?1:0)|(a>=t?2:0));i>=e&&a<=t&&!r?n.push(l):l.decompose(e-i,t-i,n,r)}i=a+1}}replace(e,t,n){if([e,t]=g3(this,e,t),n.lines=r&&t<=l){let a=i.replace(e-r,t-r,n),s=this.lines-i.lines+a.lines;if(a.lines>4&&a.lines>s>>6){let r=this.children.slice();return r[o]=a,new s3(r,this.length-(t-e)+n.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=g3(this,e,t);let o="";for(let r=0,i=0;re&&r&&(o+=n),ei&&(o+=l.sliceString(e-i,t-i,n)),i=a+1}return o}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof s3))return 0;let n=0,[o,r,i,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;o+=t,r+=t){if(o==i||r==l)return n;let a=this.children[o],s=e.children[r];if(a!=s)return n+a.scanIdentical(s,t);n+=a.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let n=0;for(let p of e)n+=p.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new a3(n,t)}let o=Math.max(32,n>>5),r=o<<1,i=o>>1,l=[],a=0,s=-1,c=[];function u(e){let t;if(e.lines>r&&e instanceof s3)for(let n of e.children)u(n);else e.lines>i&&(a>i||!a)?(d(),l.push(e)):e instanceof a3&&a&&(t=c[c.length-1])instanceof a3&&e.lines+t.lines<=32?(a+=e.lines,s+=e.length+1,c[c.length-1]=new a3(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>o&&d(),a+=e.lines,s+=e.length+1,c.push(e))}function d(){0!=a&&(l.push(1==c.length?c[0]:s3.from(c,s)),s=-1,a=c.length=0)}for(let p of e)u(p);return d(),1==l.length?l[0]:new s3(l,t)}}function c3(e,t,n=0,o=1e9){for(let r=0,i=0,l=!0;i=n&&(s>o&&(a=a.slice(0,o-r)),r0?1:(e instanceof a3?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,o=this.nodes[n],r=this.offsets[n],i=r>>1,l=o instanceof a3?o.text.length:o.children.length;if(i==(t>0?l:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(o instanceof a3){let r=o.text[i+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=o.children[i+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof a3?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class p3{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new d3(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:o}=this.cursor.next(e);return this.pos+=(o.length+e)*t,this.value=o.length<=n?o:t<0?o.slice(o.length-n):o.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class h3{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:o}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=o,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(l3.prototype[Symbol.iterator]=function(){return this.iter()},d3.prototype[Symbol.iterator]=p3.prototype[Symbol.iterator]=h3.prototype[Symbol.iterator]=function(){return this});class f3{constructor(e,t,n,o){this.from=e,this.to=t,this.number=n,this.text=o}get length(){return this.to-this.from}}function g3(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}let m3="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e=>e?parseInt(e,36):1));for(let jpe=1;jpee)return m3[t-1]<=e;return!1}function b3(e){return e>=127462&&e<=127487}function y3(e,t,n=!0,o=!0){return(n?O3:w3)(e,t,o)}function O3(e,t,n){if(t==e.length)return t;t&&x3(e.charCodeAt(t))&&$3(e.charCodeAt(t-1))&&t--;let o=S3(e,t);for(t+=k3(o);t=0&&b3(S3(e,o));)n++,o-=2;if(n%2==0)break;t+=2}}}return t}function w3(e,t,n){for(;t>0;){let o=O3(e,t-2,n);if(o=56320&&e<57344}function $3(e){return e>=55296&&e<56320}function S3(e,t){let n=e.charCodeAt(t);if(!$3(n)||t+1==e.length)return n;let o=e.charCodeAt(t+1);return x3(o)?o-56320+(n-55296<<10)+65536:n}function C3(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function k3(e){return e<65536?1:2}const P3=/\r\n?|\n/;var T3=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(T3||(T3={}));class M3{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-o);r+=l}else{if(n!=T3.Simple&&s>=e&&(n==T3.TrackDel&&oe||n==T3.TrackBefore&&oe))return null;if(s>e||s==e&&t<0&&!l)return e==o||t<0?r:r+a;r+=a}o=s}if(e>o)throw new RangeError(`Position ${e} is out of range for changeset of length ${o}`);return r}touchesRange(e,t=e){for(let n=0,o=0;n=0&&o<=t&&r>=e)return!(ot)||"cover";o=r}return!1}toString(){let e="";for(let t=0;t=0?":"+o:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new M3(e)}static create(e){return new M3(e)}}class I3 extends M3{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return R3(this,((t,n,o,r,i)=>e=e.replace(o,o+(n-t),i)),!1),e}mapDesc(e,t=!1){return D3(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let o=0,r=0;o=0){t[o]=l,t[o+1]=i;let a=o>>1;for(;n.length0&&A3(n,t,r.text),r.forward(e),l+=e}let s=e[i++];for(;l>1].toJSON()))}return e}static of(e,t,n){let o=[],r=[],i=0,l=null;function a(e=!1){if(!e&&!o.length)return;il||e<0||l>t)throw new RangeError(`Invalid change range ${e} to ${l} (in doc of length ${t})`);let u=c?"string"==typeof c?l3.of(c.split(n||P3)):c:l3.empty,d=u.length;if(e==l&&0==d)return;ei&&E3(o,e-i,-1),E3(o,l-e,d),A3(r,o,u),i=l}}(e),a(!l),l}static empty(e){return new I3(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let o=0;ot&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)t.push(r[0],0);else{for(;n.length=0&&n<=0&&n==e[r+1]?e[r]+=t:0==t&&0==e[r]?e[r+1]+=n:o?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function A3(e,t,n){if(0==n.length)return;let o=t.length-2>>1;if(o>1])),!(n||l==e.sections.length||e.sections[l+1]<0);)a=e.sections[l++],s=e.sections[l++];t(r,c,i,u,d),r=c,i=u}}}function D3(e,t,n,o=!1){let r=[],i=o?[]:null,l=new B3(e),a=new B3(t);for(let s=-1;;)if(-1==l.ins&&-1==a.ins){let e=Math.min(l.len,a.len);E3(r,e,-1),l.forward(e),a.forward(e)}else if(a.ins>=0&&(l.ins<0||s==l.i||0==l.off&&(a.len=0&&s=0)){if(l.done&&a.done)return i?I3.createSet(r,i):M3.create(r);throw new Error("Mismatched change set lengths")}{let e=0,t=l.len;for(;t;)if(-1==a.ins){let n=Math.min(t,a.len);e+=n,t-=n,a.forward(n)}else{if(!(0==a.ins&&a.lene||l.ins>=0&&l.len>e)&&(a||o.length>t),i.forward2(e),l.forward(e)}}else E3(o,0,l.ins,a),r&&A3(r,o,l.text),l.next()}}class B3{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?l3.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?l3.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class N3{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let n,o;return this.empty?n=o=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),o=e.mapPos(this.to,-1)),n==this.from&&o==this.to?this:new N3(n,o,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return z3.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return z3.range(this.anchor,n)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return z3.range(e.anchor,e.head)}static create(e,t,n){return new N3(e,t,n)}}class z3{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:z3.create(this.ranges.map((n=>n.map(e,t))),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON())),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new z3(e.ranges.map((e=>N3.fromJSON(e))),e.main)}static single(e,t=e){return new z3([z3.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,o=0;oe?8:0)|r)}static normalized(e,t=0){let n=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(n);for(let o=1;on.head?z3.range(l,i):z3.range(i,l))}}return new z3(e,t)}}function _3(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let L3=0;class Q3{constructor(e,t,n,o,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=o,this.id=L3++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new Q3(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:H3),!!e.static,e.enables)}of(e){return new F3([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new F3(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new F3(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(n=>t(n.field(e))))}}function H3(e,t){return e==t||e.length==t.length&&e.every(((e,n)=>e===t[n]))}class F3{constructor(e,t,n,o){this.dependencies=e,this.facet=t,this.type=n,this.value=o,this.id=L3++}dynamicSlot(e){var t;let n=this.value,o=this.facet.compareInput,r=this.id,i=e[r]>>1,l=2==this.type,a=!1,s=!1,c=[];for(let u of this.dependencies)"doc"==u?a=!0:"selection"==u?s=!0:0==(1&(null!==(t=e[u.id])&&void 0!==t?t:1))&&c.push(e[u.id]);return{create:e=>(e.values[i]=n(e),1),update(e,t){if(a&&t.docChanged||s&&(t.docChanged||t.selection)||V3(e,c)){let t=n(e);if(l?!W3(t,e.values[i],o):!o(t,e.values[i]))return e.values[i]=t,1}return 0},reconfigure:(e,t)=>{let a,s=t.config.address[r];if(null!=s){let r=l4(t,s);if(this.dependencies.every((n=>n instanceof Q3?t.facet(n)===e.facet(n):!(n instanceof Y3)||t.field(n,!1)==e.field(n,!1)))||(l?W3(a=n(e),r,o):o(a=n(e),r)))return e.values[i]=r,0}else a=n(e);return e.values[i]=a,1}}}}function W3(e,t,n){if(e.length!=t.length)return!1;for(let o=0;oe[t.id])),r=n.map((e=>e.type)),i=o.filter((e=>!(1&e))),l=e[t.id]>>1;function a(e){let n=[];for(let t=0;te===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(X3).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let o=e.values[t],r=this.updateF(o,n);return this.compareF(o,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,X3.of({field:this,create:e})]}get extension(){return this}}const K3=4,G3=3,U3=2,q3=1;function J3(e){return t=>new t4(t,e)}const e4={highest:J3(0),high:J3(q3),default:J3(U3),low:J3(G3),lowest:J3(K3)};class t4{constructor(e,t){this.inner=e,this.prec=t}}class n4{of(e){return new o4(this,e)}reconfigure(e){return n4.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class o4{constructor(e,t){this.compartment=e,this.inner=t}}class r4{constructor(e,t,n,o,r,i){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=o,this.staticValues=r,this.facets=i,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let o=[],r=Object.create(null),i=new Map;for(let d of function(e,t,n){let o=[[],[],[],[],[]],r=new Map;function i(e,l){let a=r.get(e);if(null!=a){if(a<=l)return;let t=o[a].indexOf(e);t>-1&&o[a].splice(t,1),e instanceof o4&&n.delete(e.compartment)}if(r.set(e,l),Array.isArray(e))for(let t of e)i(t,l);else if(e instanceof o4){if(n.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");let o=t.get(e.compartment)||e.inner;n.set(e.compartment,o),i(o,l)}else if(e instanceof t4)i(e.inner,e.prec);else if(e instanceof Y3)o[l].push(e),e.provides&&i(e.provides,l);else if(e instanceof F3)o[l].push(e),e.facet.extensions&&i(e.facet.extensions,U3);else{let t=e.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(t,l)}}return i(e,U3),o.reduce(((e,t)=>e.concat(t)))}(e,t,i))d instanceof Y3?o.push(d):(r[d.facet.id]||(r[d.facet.id]=[])).push(d);let l=Object.create(null),a=[],s=[];for(let d of o)l[d.id]=s.length<<1,s.push((e=>d.slot(e)));let c=null==n?void 0:n.config.facets;for(let d in r){let e=r[d],t=e[0].facet,o=c&&c[d]||[];if(e.every((e=>0==e.type)))if(l[t.id]=a.length<<1|1,H3(o,e))a.push(n.facet(t));else{let o=t.combine(e.map((e=>e.value)));a.push(n&&t.compare(o,n.facet(t))?n.facet(t):o)}else{for(let t of e)0==t.type?(l[t.id]=a.length<<1|1,a.push(t.value)):(l[t.id]=s.length<<1,s.push((e=>t.dynamicSlot(e))));l[t.id]=s.length<<1,s.push((n=>Z3(n,t,e)))}}let u=s.map((e=>e(l)));return new r4(e,i,u,l,a,r)}}function i4(e,t){if(1&t)return 2;let n=t>>1,o=e.status[n];if(4==o)throw new Error("Cyclic dependency between fields and/or facets");if(2&o)return o;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function l4(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const a4=Q3.define(),s4=Q3.define({combine:e=>e.some((e=>e)),static:!0}),c4=Q3.define({combine:e=>e.length?e[0]:void 0,static:!0}),u4=Q3.define(),d4=Q3.define(),p4=Q3.define(),h4=Q3.define({combine:e=>!!e.length&&e[0]});class f4{constructor(e,t){this.type=e,this.value=t}static define(){return new g4}}class g4{of(e){return new f4(this,e)}}class m4{constructor(e){this.map=e}of(e){return new v4(this,e)}}class v4{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new v4(this.type,t)}is(e){return this.type==e}static define(e={}){return new m4(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let o of e){let e=o.map(t);e&&n.push(e)}return n}}v4.reconfigure=v4.define(),v4.appendConfig=v4.define();class b4{constructor(e,t,n,o,r,i){this.startState=e,this.changes=t,this.selection=n,this.effects=o,this.annotations=r,this.scrollIntoView=i,this._doc=null,this._state=null,n&&_3(n,t.newLength),r.some((e=>e.type==b4.time))||(this.annotations=r.concat(b4.time.of(Date.now())))}static create(e,t,n,o,r,i){return new b4(e,t,n,o,r,i)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(b4.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function y4(e,t){let n=[];for(let o=0,r=0;;){let i,l;if(o=e[o]))i=e[o++],l=e[o++];else{if(!(r=0;r--){let i=n[r](e);i&&Object.keys(i).length&&(o=O4(o,w4(t,i,e.changes.newLength),!0))}return o==e?e:b4.create(t,e.changes,e.selection,o.effects,o.annotations,o.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let r of t.facet(u4)){let t=r(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:y4(n,t))}if(!0!==n){let o,r;if(!1===n)r=e.changes.invertedDesc,o=I3.empty(t.doc.length);else{let t=e.changes.filter(n);o=t.changes,r=t.filtered.mapDesc(t.changes).invertedDesc}e=b4.create(t,o,e.selection&&e.selection.map(r),v4.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let o=t.facet(d4);for(let r=o.length-1;r>=0;r--){let n=o[r](e);e=n instanceof b4?n:Array.isArray(n)&&1==n.length&&n[0]instanceof b4?n[0]:x4(t,S4(n),!1)}return e}(r):r)}b4.time=f4.define(),b4.userEvent=f4.define(),b4.addToHistory=f4.define(),b4.remote=f4.define();const $4=[];function S4(e){return null==e?$4:Array.isArray(e)?e:[e]}var C4=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(C4||(C4={}));const k4=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let P4;try{P4=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(Dpe){}function T4(e){return t=>{if(!/\S/.test(t))return C4.Space;if(function(e){if(P4)return P4.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||k4.test(n)))return!0}return!1}(t))return C4.Word;for(let n=0;n-1)return C4.Word;return C4.Other}}class M4{constructor(e,t,n,o,r,i){this.config=e,this.doc=t,this.selection=n,this.values=o,this.status=e.statusTemplate.slice(),this.computeSlot=r,i&&(i._state=this);for(let l=0;lr.set(t,e))),n=null),r.set(l.value.compartment,l.value.extension)):l.is(v4.reconfigure)?(n=null,o=l.value):l.is(v4.appendConfig)&&(n=null,o=S4(o).concat(l.value));n?t=e.startState.values.slice():(n=r4.resolve(o,r,this),t=new M4(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values);let i=e.startState.facet(s4)?e.newSelection:e.newSelection.asSingle();new M4(n,e.newDoc,i,t,((t,n)=>n.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:z3.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),o=this.changes(n.changes),r=[n.range],i=S4(n.effects);for(let l=1;lt.spec.fromJSON(i,e))))}return M4.create({doc:e.doc,selection:z3.fromJSON(e.selection),extensions:t.extensions?o.concat([t.extensions]):o})}static create(e={}){let t=r4.resolve(e.extensions||[],new Map),n=e.doc instanceof l3?e.doc:l3.of((e.doc||"").split(t.staticFacet(M4.lineSeparator)||P3)),o=e.selection?e.selection instanceof z3?e.selection:z3.single(e.selection.anchor,e.selection.head):z3.single(0);return _3(o,n.length),t.staticFacet(s4)||(o=o.asSingle()),new M4(t,n,o,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(M4.tabSize)}get lineBreak(){return this.facet(M4.lineSeparator)||"\n"}get readOnly(){return this.facet(h4)}phrase(e,...t){for(let n of this.facet(M4.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,((e,n)=>{if("$"==n)return"$";let o=+(n||1);return!o||o>t.length?e:t[o-1]}))),e}languageDataAt(e,t,n=-1){let o=[];for(let r of this.facet(a4))for(let i of r(this,t,n))Object.prototype.hasOwnProperty.call(i,e)&&o.push(i[e]);return o}charCategorizer(e){return T4(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:o}=this.doc.lineAt(e),r=this.charCategorizer(e),i=e-n,l=e-n;for(;i>0;){let e=y3(t,i,!1);if(r(t.slice(e,i))!=C4.Word)break;i=e}for(;le.length?e[0]:4}),M4.lineSeparator=c4,M4.readOnly=h4,M4.phrases=Q3.define({compare(e,t){let n=Object.keys(e),o=Object.keys(t);return n.length==o.length&&n.every((n=>e[n]==t[n]))}}),M4.languageData=a4,M4.changeFilter=u4,M4.transactionFilter=d4,M4.transactionExtender=p4,n4.reconfigure=v4.define();class E4{eq(e){return this==e}range(e,t=e){return A4.create(e,t,this)}}E4.prototype.startSide=E4.prototype.endSide=0,E4.prototype.point=!1,E4.prototype.mapMode=T3.TrackDel;let A4=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,o){return new e(t,n,o)}};function R4(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class D4{constructor(e,t,n,o){this.from=e,this.to=t,this.value=n,this.maxPoint=o}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,o=0){let r=n?this.to:this.from;for(let i=o,l=r.length;;){if(i==l)return i;let o=i+l>>1,a=r[o]-e||(n?this.value[o].endSide:this.value[o].startSide)-t;if(o==i)return a>=0?i:l;a>=0?l=o:i=o+1}}between(e,t,n,o){for(let r=this.findIndex(t,-1e9,!0),i=this.findIndex(n,1e9,!1,r);rc||s==c&&u.startSide>0&&u.endSide<=0)continue;(c-s||u.endSide-u.startSide)<0||(i<0&&(i=s),u.point&&(l=Math.max(l,c-s)),n.push(u),o.push(s-i),r.push(c-i))}return{mapped:n.length?new D4(o,r,n,l):null,pos:i}}}class j4{constructor(e,t,n,o){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=o}static create(e,t,n,o){return new j4(e,t,n,o)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:o=0,filterTo:r=this.length}=e,i=e.filter;if(0==t.length&&!i)return this;if(n&&(t=t.slice().sort(R4)),this.isEmpty)return t.length?j4.of(t):this;let l=new z4(this,null,-1).goto(0),a=0,s=[],c=new B4;for(;l.value||a=0){let e=t[a++];c.addInner(e.from,e.to,e.value)||s.push(e)}else 1==l.rangeIndex&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+i.length&&!1===i.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return _4.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return _4.from(e).goto(t)}static compare(e,t,n,o,r=-1){let i=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),l=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),a=N4(i,l,n),s=new Q4(i,a,r),c=new Q4(l,a,r);n.iterGaps(((e,t,n)=>H4(s,e,c,t,n,o))),n.empty&&0==n.length&&H4(s,0,c,0,0,o)}static eq(e,t,n=0,o){null==o&&(o=999999999);let r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),i=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(r.length!=i.length)return!1;if(!r.length)return!0;let l=N4(r,i),a=new Q4(r,l,0).goto(n),s=new Q4(i,l,0).goto(n);for(;;){if(a.to!=s.to||!F4(a.active,s.active)||a.point&&(!s.point||!a.point.eq(s.point)))return!1;if(a.to>o)return!0;a.next(),s.next()}}static spans(e,t,n,o,r=-1){let i=new Q4(e,null,r).goto(t),l=t,a=i.openStart;for(;;){let e=Math.min(i.to,n);if(i.point){let n=i.activeForPoint(i.to),r=i.pointFroml&&(o.span(l,e,i.active,a),a=i.openEnd(e));if(i.to>n)return a+(i.point&&i.to>n?1:0);l=i.to,i.next()}}static of(e,t=!1){let n=new B4;for(let o of e instanceof A4?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(R4);t=o}return e}(e):e)n.add(o.from,o.to,o.value);return n.finish()}static join(e){if(!e.length)return j4.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let o=e[n];o!=j4.empty;o=o.nextLayer)t=new j4(o.chunkPos,o.chunk,t,Math.max(o.maxPoint,t.maxPoint));return t}}j4.empty=new j4([],[],null,-1),j4.empty.nextLayer=j4.empty;class B4{finishChunk(e){this.chunks.push(new D4(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new B4)).add(e,t,n)}addInner(e,t,n){let o=e-this.lastTo||n.startSide-this.last.endSide;if(o<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(o<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(j4.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=j4.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function N4(e,t,n){let o=new Map;for(let i of e)for(let e=0;e=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&o.push(new z4(i,t,n,r));return 1==o.length?o[0]:new _4(o)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)L4(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)L4(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),L4(this.heap,0)}}}function L4(e,t){for(let n=e[t];;){let o=1+(t<<1);if(o>=e.length)break;let r=e[o];if(o+1=0&&(r=e[o+1],o++),n.compare(r)<0)break;e[o]=n,e[t]=r,t=o}}class Q4{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=_4.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){W4(this.active,e),W4(this.activeTo,e),W4(this.activeRank,e),this.minActive=Z4(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:o,rank:r}=this.cursor;for(;t0;)t++;V4(this.active,t,n),V4(this.activeTo,t,o),V4(this.activeRank,t,r),e&&V4(e,t,this.cursor.from),this.minActive=Z4(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let o=this.minActive;if(o>-1&&(this.activeTo[o]-this.cursor.from||this.active[o].endSide-this.cursor.startSide)<0){if(this.activeTo[o]>e){this.to=this.activeTo[o],this.endSide=this.active[o].endSide;break}this.removeActive(o),n&&W4(n,o)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[t]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function H4(e,t,n,o,r,i){e.goto(t),n.goto(o);let l=o+r,a=o,s=o-t;for(;;){let t=e.to+s-n.to||e.endSide-n.endSide,o=t<0?e.to+s:n.to,r=Math.min(o,l);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&F4(e.activeForPoint(e.to),n.activeForPoint(n.to))||i.comparePoint(a,r,e.point,n.point):r>a&&!F4(e.active,n.active)&&i.compareRange(a,r,e.active,n.active),o>l)break;a=o,t<=0&&e.next(),t>=0&&n.next()}}function F4(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;o--)e[o+1]=e[o];e[t]=n}function Z4(e,t){let n=-1,o=1e9;for(let r=0;r=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=y3(e,r)}return!0===o?-1:e.length}const K4="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),G4="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),U4="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class q4{constructor(e,t){this.rules=[];let{finish:n}=t||{};function o(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function r(e,t,i,l){let a=[],s=/^@(\w+)\b/.exec(e[0]),c=s&&"keyframes"==s[1];if(s&&null==t)return i.push(e[0]+";");for(let n in t){let l=t[n];if(/&/.test(n))r(n.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),l,i);else if(l&&"object"==typeof l){if(!s)throw new RangeError("The value of a property ("+n+") should be a primitive value.");r(o(n),l,a,c)}else null!=l&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+l+";")}(a.length||c)&&i.push((!n||s||l?e:e.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let i in e)r(o(i),e[i],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=U4[K4]||1;return U4[K4]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let o=e[G4],r=n&&n.nonce;o?r&&o.setNonce(r):o=new e5(e,r),o.mount(Array.isArray(t)?t:[t])}}let J4=new Map;class e5{constructor(e,t){let n=e.ownerDocument||e,o=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&o.CSSStyleSheet){let t=J4.get(n);if(t)return e.adoptedStyleSheets=[t.sheet,...e.adoptedStyleSheets],e[G4]=t;this.sheet=new o.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],J4.set(n,this)}else{this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let o=e.head||e;o.insertBefore(this.styleTag,o.firstChild)}this.modules=[],e[G4]=this}mount(e){let t=this.sheet,n=0,o=0;for(let r=0;r-1&&(this.modules.splice(l,1),o--,l=-1),-1==l){if(this.modules.splice(o++,0,i),t)for(let e=0;e",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},o5="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),r5="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),i5=0;i5<10;i5++)t5[48+i5]=t5[96+i5]=String(i5);for(i5=1;i5<=24;i5++)t5[i5+111]="F"+i5;for(i5=65;i5<=90;i5++)t5[i5]=String.fromCharCode(i5+32),n5[i5]=String.fromCharCode(i5);for(var l5 in t5)n5.hasOwnProperty(l5)||(n5[l5]=t5[l5]);function a5(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function s5(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function c5(e,t){if(!t.anchorNode)return!1;try{return s5(e,t.anchorNode)}catch(Dpe){return!1}}function u5(e){return 3==e.nodeType?x5(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function d5(e,t,n,o){return!!n&&(h5(e,t,n,o,-1)||h5(e,t,n,o,1))}function p5(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function h5(e,t,n,o,r){for(;;){if(e==n&&t==o)return!0;if(t==(r<0?0:f5(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=p5(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?f5(e):0}}}function f5(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function g5(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function m5(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function v5(e,t){let n=t.width/e.offsetWidth,o=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(o>.995&&o<1.005||!isFinite(o)||Math.abs(t.height-e.offsetHeight)<1)&&(o=1),{scaleX:n,scaleY:o}}class b5{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?f5(t):0),n,Math.min(e.focusOffset,n?f5(n):0))}set(e,t,n,o){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=o}}let y5,O5=null;function w5(e){if(e.setActive)return e.setActive();if(O5)return e.focus(O5);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==O5?{get preventScroll(){return O5={preventScroll:!0},!0}}:void 0),!O5){O5=!1;for(let e=0;eMath.max(1,e.scrollHeight-e.clientHeight-4)}class k5{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new k5(e.parentNode,p5(e),t)}static after(e,t){return new k5(e.parentNode,p5(e)+1,t)}}const P5=[];class T5{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(2&this.flags){let n,o=this.dom,r=null;for(let i of this.children){if(7&i.flags){if(!i.dom&&(n=r?r.nextSibling:o.firstChild)){let e=T5.get(n);(!e||!e.parent&&e.canReuseDOM(i))&&i.reuseDOM(n)}i.sync(e,t),i.flags&=-8}if(n=r?r.nextSibling:o.firstChild,t&&!t.written&&t.node==o&&n!=i.dom&&(t.written=!0),i.dom.parentNode==o)for(;n&&n!=i.dom;)n=M5(n);else o.insertBefore(i.dom,n);r=i.dom}for(n=r?r.nextSibling:o.firstChild,n&&t&&t.node==o&&(t.written=!0);n;)n=M5(n)}else if(1&this.flags)for(let n of this.children)7&n.flags&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let o=0==f5(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==this.dom)break;0==o&&t.firstChild!=t.lastChild&&(o=e==t.firstChild?-1:1),e=t}n=o<0?e:e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!T5.get(n);)n=n.nextSibling;if(!n)return this.length;for(let o=0,r=0;;o++){let e=this.children[o];if(e.dom==n)return r;r+=e.length+e.breakAfter}}domBoundsAround(e,t,n=0){let o=-1,r=-1,i=-1,l=-1;for(let a=0,s=n,c=n;at)return n.domBoundsAround(e,t,s);if(u>=e&&-1==o&&(o=a,r=s),s>t&&n.dom.parentNode==this.dom){i=a,l=c;break}c=u,s=u+n.breakAfter}return{from:r,to:l<0?n+this.length:l,startDOM:(o?this.children[o-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:i=0?this.children[i].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=P5){this.markDirty();for(let o=e;othis.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function E5(e,t,n,o,r,i,l,a,s){let{children:c}=e,u=c.length?c[t]:null,d=i.length?i[i.length-1]:null,p=d?d.breakAfter:l;if(!(t==o&&u&&!l&&!p&&i.length<2&&u.merge(n,r,i.length?d:null,0==n,a,s))){if(o0&&(!l&&i.length&&u.merge(n,u.length,i[0],!1,a,0)?u.breakAfter=i.shift().breakAfter:(n2);var W5={mac:F5||/Mac/.test(R5.platform),windows:/Win/.test(R5.platform),linux:/Linux|X11/.test(R5.platform),ie:z5,ie_version:B5?D5.documentMode||6:N5?+N5[1]:j5?+j5[1]:0,gecko:_5,gecko_version:_5?+(/Firefox\/(\d+)/.exec(R5.userAgent)||[0,0])[1]:0,chrome:!!L5,chrome_version:L5?+L5[1]:0,ios:F5,android:/Android\b/.test(R5.userAgent),webkit:Q5,safari:H5,webkit_version:Q5?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=D5.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class V5 extends T5{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,n){return!(8&this.flags||n&&(!(n instanceof V5)||this.length-(t-e)+n.length>256||8&n.flags)||(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),0))}split(e){let t=new V5(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new k5(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,n){let o=e.nodeValue.length;t>o&&(t=o);let r=t,i=t,l=0;0==t&&n<0||t==o&&n>=0?W5.chrome||W5.gecko||(t?(r--,l=1):i=0)?0:a.length-1];return W5.safari&&!l&&0==s.width&&(s=Array.prototype.find.call(a,(e=>e.width))||s),l?g5(s,l<0):s||null}(this.dom,e,t)}}class Z5 extends T5{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let o of t)o.setParent(this)}setAttrs(e){if(S5(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!(8&(this.flags|e.flags))}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof Z5&&n.mark.eq(this.mark))||e&&r<=0||te&&t.push(n=e&&(o=r),n=i,r++}let i=this.length-e;return this.length=e,o>-1&&(this.children.length=o,this.markDirty()),new Z5(this.mark,t,i)}domAtPos(e){return K5(this,e)}coordsAt(e,t){return U5(this,e,t)}}class X5 extends T5{static create(e,t,n){return new X5(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=X5.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof X5&&this.widget.compare(n.widget))||e>0&&r<=0||t0)?k5.before(this.dom):k5.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let o=this.dom.getClientRects(),r=null;if(!o.length)return null;let i=this.side?this.side<0:e>0;for(let l=i?o.length-1:0;r=o[l],!(e>0?0==l:l==o.length-1||r.top0?k5.before(this.dom):k5.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return l3.empty}get isHidden(){return!0}}function K5(e,t){let n=e.dom,{children:o}=e,r=0;for(let i=0;ri&&t0;i--){let e=o[i-1];if(e.dom.parentNode==n)return e.domAtPos(e.length)}for(let i=r;i0&&t instanceof Z5&&r.length&&(o=r[r.length-1])instanceof Z5&&o.mark.eq(t.mark)?G5(o,t.children[0],n-1):(r.push(t),t.setParent(e)),e.length+=t.length}function U5(e,t,n){let o=null,r=-1,i=null,l=-1;!function e(t,a){for(let s=0,c=0;s=a&&(u.children.length?e(u,a-c):(!i||i.isHidden&&n>0)&&(d>a||c==d&&u.getSide()>0)?(i=u,l=a-c):(c-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let i of o)if(i!=n&&(-1==r.indexOf(i)||e[i]!==t[i]))return!1;return!0}function t8(e,t,n){let o=!1;if(t)for(let r in t)n&&r in n||(o=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(o=!0,"style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return o}function n8(e){let t=Object.create(null);for(let n=0;n0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){e8(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){G5(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=q5(t,this.attrs||{})),n&&(this.attrs=q5({class:n},this.attrs||{}))}domAtPos(e){return K5(this,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?4&this.flags&&(S5(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(t8(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let o=this.dom.lastChild;for(;o&&T5.get(o)instanceof Z5;)o=o.lastChild;if(!(o&&this.length&&("BR"==o.nodeName||0!=(null===(n=T5.get(o))||void 0===n?void 0:n.isEditable)||W5.ios&&this.children.some((e=>e instanceof V5))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e,t=0;for(let n of this.children){if(!(n instanceof V5)||/[^ -~]/.test(n.text))return null;let o=u5(n.dom);if(1!=o.length)return null;t+=o[0].width,e=o[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(e,t){let n=U5(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:e}=this.parent.view.viewState,t=n.bottom-n.top;if(Math.abs(t-e.lineHeight)<2&&e.textHeight=t){if(r instanceof o8)return r;if(i>t)break}o=i+r.breakAfter}return null}}class r8 extends T5{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof r8&&this.widget.compare(n.widget))||e>0&&r<=0||t0)}}class i8{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var l8=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(l8||(l8={}));class a8 extends E4{constructor(e,t,n,o){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=o}get heightRelevant(){return!1}static mark(e){return new s8(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new u8(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,o=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:r,end:i}=d8(e,o);t=(r?o?-3e8:-1:5e8)-1,n=1+(i?o?2e8:1:-6e8)}return new u8(e,t,n,o,e.widget||null,!0)}static line(e){return new c8(e)}static set(e,t=!1){return j4.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}a8.none=j4.empty;class s8 extends a8{constructor(e){let{start:t,end:n}=d8(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof s8&&this.tagName==e.tagName&&(this.class||(null===(t=this.attrs)||void 0===t?void 0:t.class))==(e.class||(null===(n=e.attrs)||void 0===n?void 0:n.class))&&e8(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}s8.prototype.point=!1;class c8 extends a8{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof c8&&this.spec.class==e.spec.class&&e8(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}c8.prototype.mapMode=T3.TrackBefore,c8.prototype.point=!0;class u8 extends a8{constructor(e,t,n,o,r,i){super(t,n,r,e),this.block=o,this.isReplace=i,this.mapMode=o?t<=0?T3.TrackBefore:T3.TrackAfter:T3.TrackDel}get type(){return this.startSide!=this.endSide?l8.WidgetRange:this.startSide<=0?l8.WidgetBefore:l8.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof u8&&(t=this.widget,n=e.widget,t==n||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,n}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function d8(e,t=!1){let{inclusiveStart:n,inclusiveEnd:o}=e;return null==n&&(n=e.inclusive),null==o&&(o=e.inclusive),{start:null!=n?n:t,end:null!=o?o:t}}function p8(e,t,n,o=0){let r=n.length-1;r>=0&&n[r]+o>=e?n[r]=Math.max(n[r],t):n.push(e,t)}u8.prototype.point=!0;class h8{constructor(e,t,n,o){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=o,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof r8&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new o8),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(f8(new Y5(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||e&&this.content.length&&this.content[this.content.length-1]instanceof r8||this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:o}=this.cursor.next(this.skip);if(this.skip=0,o)throw new Error("Ran out of text content when drawing inline views");if(n){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}this.text=t,this.textOff=0}let o=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(f8(new V5(this.text.slice(this.textOff,this.textOff+o)),t),n),this.atCursorPos=!0,this.textOff+=o,e-=o,n=0}}span(e,t,n,o){this.buildText(t-e,n,o),this.pos=t,this.openStart<0&&(this.openStart=o)}point(e,t,n,o,r,i){if(this.disallowBlockEffectsFor[i]&&n instanceof u8){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(n instanceof u8)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new r8(n.widget||new g8("div"),l,n));else{let i=X5.create(n.widget||new g8("span"),l,l?0:n.startSide),a=this.atCursorPos&&!i.isEditable&&r<=o.length&&(e0),s=!i.isEditable&&(eo.length||n.startSide<=0),c=this.getLine();2!=this.pendingBuffer||a||i.isEditable||(this.pendingBuffer=0),this.flushBuffer(o),a&&(c.append(f8(new Y5(1),o),r),r=o.length+Math.max(0,r-o.length)),c.append(f8(i,o),r),this.atCursorPos=s,this.pendingBuffer=s?eo.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=o.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,o,r){let i=new h8(e,t,n,r);return i.openEnd=j4.spans(o,t,n,i),i.openStart<0&&(i.openStart=i.openEnd),i.finish(i.openEnd),i}}function f8(e,t){for(let n of t)e=new Z5(n,[e],e.length);return e}class g8 extends i8{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}var m8=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(m8||(m8={}));const v8=m8.LTR,b8=m8.RTL;function y8(e){let t=[];for(let n=0;n=t){if(l.level==n)return i;(r<0||(0!=o?o<0?l.fromt:e[r].level>l.level))&&(r=i)}}if(r<0)throw new RangeError("Index out of range");return r}}function P8(e,t){if(e.length!=t.length)return!1;for(let n=0;ns&&l.push(new k8(s,f.from,p)),I8(e,f.direction==v8!=!(p%2)?o+1:o,r,f.inner,f.from,f.to,l),s=f.to),h=f.to}else{if(h==n||(t?T8[h]!=a:T8[h]==a))break;h++}d?M8(e,s,h,o+1,r,d,l):st;){let n=!0,u=!1;if(!c||s>i[c-1].to){let e=T8[s-1];e!=a&&(n=!1,u=16==e)}let d=n||1!=a?null:[],p=n?o:o+1,h=s;e:for(;;)if(c&&h==i[c-1].to){if(u)break e;let f=i[--c];if(!n)for(let e=f.from,n=c;;){if(e==t)break e;if(!n||i[n-1].to!=e){if(T8[e-1]==a)break e;break}e=i[--n].from}d?d.push(f):(f.to=0;e-=3)if($8[e+1]==-n){let t=$8[e+2],n=2&t?r:4&t?1&t?i:r:0;n&&(T8[l]=T8[$8[e]]=n),a=e;break}}else{if(189==$8.length)break;$8[a++]=l,$8[a++]=t,$8[a++]=s}else if(2==(o=T8[l])||1==o){let e=o==r;s=e?0:1;for(let t=a-3;t>=0;t-=3){let n=$8[t+2];if(2&n)break;if(e)$8[t+2]|=2;else{if(4&n)break;$8[t+2]|=4}}}}}(e,r,i,o,a),function(e,t,n,o){for(let r=0,i=o;r<=n.length;r++){let l=r?n[r-1].to:e,a=rs;)t==i&&(t=n[--o].from,i=o?n[o-1].to:e),T8[--t]=u;s=l}else i=l,s++}}}(r,i,o,a),M8(e,r,i,t,n,o,l)}function E8(e){return[new k8(0,e,0)]}let A8="";function R8(e,t,n,o,r){var i;let l=o.head-e.from,a=k8.find(t,l,null!==(i=o.bidiLevel)&&void 0!==i?i:-1,o.assoc),s=t[a],c=s.side(r,n);if(l==c){let e=a+=r?1:-1;if(e<0||e>=t.length)return null;s=t[a=e],l=s.side(!r,n),c=s.side(r,n)}let u=y3(e.text,l,s.forward(r,n));(us.to)&&(u=c),A8=e.text.slice(Math.min(l,u),Math.max(l,u));let d=a==(r?t.length-1:0)?null:t[a+(r?1:-1)];return d&&u==c&&d.level+(r?0:1)e.some((e=>e))}),F8=Q3.define({combine:e=>e.some((e=>e))});class W8{constructor(e,t="nearest",n="nearest",o=5,r=5,i=!1){this.range=e,this.y=t,this.x=n,this.yMargin=o,this.xMargin=r,this.isSnapshot=i}map(e){return e.empty?this:new W8(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new W8(z3.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const V8=v4.define({map:(e,t)=>e.map(t)});function Z8(e,t,n){let o=e.facet(z8);o.length?o[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)}const X8=Q3.define({combine:e=>!e.length||e[0]});let Y8=0;const K8=Q3.define();class G8{constructor(e,t,n,o,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=o,this.extension=r(this)}static define(e,t){const{eventHandlers:n,eventObservers:o,provide:r,decorations:i}=t||{};return new G8(Y8++,e,n,o,(e=>{let t=[K8.of(e)];return i&&t.push(e6.of((t=>{let n=t.plugin(e);return n?i(n):a8.none}))),r&&t.push(r(e)),t}))}static fromClass(e,t){return G8.define((t=>new e(t)),t)}}class U8{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(Rpe){if(Z8(e.state,Rpe,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(Dpe){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(Rpe){Z8(e.state,Rpe,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(Rpe){Z8(e.state,Rpe,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const q8=Q3.define(),J8=Q3.define(),e6=Q3.define(),t6=Q3.define(),n6=Q3.define(),o6=Q3.define();function r6(e,t){let n=e.state.facet(o6);if(!n.length)return n;let o=n.map((t=>t instanceof Function?t(e):t)),r=[];return j4.spans(o,t.from,t.to,{point(){},span(e,n,o,i){let l=e-t.from,a=n-t.from,s=r;for(let r=o.length-1;r>=0;r--,i--){let e,n=o[r].spec.bidiIsolate;if(null==n&&(n=D8(t.text,l,a)),i>0&&s.length&&(e=s[s.length-1]).to==l&&e.direction==n)e.to=a,s=e.inner;else{let e={from:l,to:a,direction:n,inner:[]};s.push(e),s=e.inner}}}}),r}const i6=Q3.define();function l6(e){let t=0,n=0,o=0,r=0;for(let i of e.state.facet(i6)){let l=i(e);l&&(null!=l.left&&(t=Math.max(t,l.left)),null!=l.right&&(n=Math.max(n,l.right)),null!=l.top&&(o=Math.max(o,l.top)),null!=l.bottom&&(r=Math.max(r,l.bottom)))}return{left:t,right:n,top:o,bottom:r}}const a6=Q3.define();class s6{constructor(e,t,n,o){this.fromA=e,this.toA=t,this.fromB=n,this.toB=o}join(e){return new s6(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let o=e[t-1];if(!(o.fromA>n.toA)){if(o.toAc)break;r+=2}if(!a)return n;new s6(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),i=a.toA,l=a.toB}}}class c6{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=I3.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let o=[];this.changes.iterChangedRanges(((e,t,n,r)=>o.push(new s6(e,t,n,r)))),this.changedRanges=o}static create(e,t,n){return new c6(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class u6 extends T5{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new o8],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new s6(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every((({fromA:e,toA:t})=>tthis.minWidthTo))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let o=-1;this.view.inputState.composing>=0&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?o=this.domChanged.newSel.head:function(e,t){let n=!1;return t&&e.iterChangedRanges(((e,o)=>{et.from&&(n=!0)})),n}(e.changes,this.hasComposition)||e.selectionSet||(o=e.state.selection.main.head));let r=o>-1?function(e,t,n){let o=p6(e,n);if(!o)return null;let{node:r,from:i,to:l}=o,a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(o.from,o.to)!=a)return null;let s=t.invertedDesc,c=new s6(s.mapPos(i),s.mapPos(l),i,l),u=[];for(let d=r.parentNode;;d=d.parentNode){let t=T5.get(d);if(t instanceof Z5)u.push({node:d,deco:t.mark});else{if(t instanceof o8||"DIV"==d.nodeName&&d.parentNode==e.contentDOM)return{range:c,text:r,marks:u,line:d};if(d==e.contentDOM)return null;u.push({node:d,deco:new s8({inclusive:!0,attributes:n8(d),tagName:d.tagName.toLowerCase()})})}}}(this.view,e.changes,o):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:t,to:o}=this.hasComposition;n=new s6(t,o,e.changes.mapPos(t,-1),e.changes.mapPos(o,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(W5.ie||W5.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=function(e,t,n){let o=new f6;return j4.compare(e,t,n,o),o.changes}(this.decorations,this.updateDeco(),e.changes);return n=s6.extendWithRanges(n,i),!!(7&this.flags||0!=n.length)&&(this.updateInner(n,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:o}=this.view;o.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=W5.chrome||W5.ios?{node:o.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||o.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((e=>e.flags&=-9));let r=[];if(this.view.viewport.from||this.view.viewport.to=0?o[i]:null;if(!e)break;let t,l,a,s,{fromA:c,toA:u,fromB:d,toB:p}=e;if(n&&n.range.fromBd){let e=h8.build(this.view.state.doc,d,n.range.fromB,this.decorations,this.dynamicDecorationMap),o=h8.build(this.view.state.doc,n.range.toB,p,this.decorations,this.dynamicDecorationMap);l=e.breakAtStart,a=e.openStart,s=o.openEnd;let r=this.compositionView(n);o.breakAtStart?r.breakAfter=1:o.content.length&&r.merge(r.length,r.length,o.content[0],!1,o.openStart,0)&&(r.breakAfter=o.content[0].breakAfter,o.content.shift()),e.content.length&&r.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),t=e.content.concat(r).concat(o.content)}else({content:t,breakAtStart:l,openStart:a,openEnd:s}=h8.build(this.view.state.doc,d,p,this.decorations,this.dynamicDecorationMap));let{i:h,off:f}=r.findPos(u,1),{i:g,off:m}=r.findPos(c,-1);E5(this,g,m,h,f,t,l,a,s)}n&&this.fixCompositionDOM(n)}compositionView(e){let t=new V5(e.text.nodeValue);t.flags|=8;for(let{deco:o}of e.marks)t=new Z5(o,[t],t.length);let n=new o8;return n.append(t,0),n}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|(t.children.some((e=>7&e.flags))?1:0),this.markedForComposition.add(t);let n=T5.get(e);n&&n!=t&&(n.dom=null),t.setDOM(e)},n=this.childPos(e.range.fromB,1),o=this.children[n.i];t(e.line,o);for(let r=e.marks.length-1;r>=-1;r--)n=o.childPos(n.off,1),o=o.children[n.i],t(r>=0?e.marks[r].node:e.text,o)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let n=this.view.root.activeElement,o=n==this.dom,r=!o&&c5(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(o||t||r))return;let i=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),s=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(W5.gecko&&l.empty&&!this.hasComposition&&1==(c=a).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null))),a=s=new k5(e,0),i=!0}var c;let u=this.view.observer.selectionRange;!i&&u.focusNode&&(d5(a.node,a.offset,u.anchorNode,u.anchorOffset)&&d5(s.node,s.offset,u.focusNode,u.focusOffset)||this.suppressWidgetCursorChange(u,l))||(this.view.observer.ignore((()=>{W5.android&&W5.chrome&&this.dom.contains(u.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=a5(this.view.root);if(e)if(l.empty){if(W5.gecko){let e=(t=a.node,o=a.offset,1!=t.nodeType?0:(o&&"false"==t.childNodes[o-1].contentEditable?1:0)|(ol.head&&([a,s]=[s,a]),t.setEnd(s.node,s.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}var t,o;r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())})),this.view.observer.setSelectionRange(a,s)),this.impreciseAnchor=a.precise?null:new k5(u.anchorNode,u.anchorOffset),this.impreciseHead=s.precise?null:new k5(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&d5(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=a5(e.root),{anchorNode:o,anchorOffset:r}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let i=o8.find(this,t.head);if(!i)return;let l=i.posAtStart;if(t.head==l||t.head==l+i.length)return;let a=this.coordsAt(t.head,-1),s=this.coordsAt(t.head,1);if(!a||!s||a.bottom>s.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(o,r)}moveToLine(e){let t,n=this.dom;if(e.node!=n)return e;for(let o=e.offset;!t&&o=0;o--){let e=T5.get(n.childNodes[o]);e instanceof o8&&(t=e.domAtPos(e.length))}return t?new k5(t.node,t.offset,!0):e}nearest(e){for(let t=e;t;){let e=T5.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;i--){let l=this.children[i],a=r-l.breakAfter,s=a-l.length;if(ae||l.covers(1))&&(!n||l instanceof o8&&!(n instanceof o8&&t>=0))&&(n=l,o=s),r=s}return n?n.coordsAt(e-o,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),o=this.children[t];if(!(o instanceof o8))return null;for(;o.children.length;){let{i:e,off:t}=o.childPos(n,1);for(;;e++){if(e==o.children.length)return null;if((o=o.children[e]).length)break}n=t}if(!(o instanceof V5))return null;let r=y3(o.text,n);if(r==n)return null;let i=x5(o.dom,n,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==m8.LTR;for(let s=0,c=0;co)break;if(s>=n){let n=e.dom.getBoundingClientRect();if(t.push(n.height),i){let t=e.dom.lastChild,o=t?u5(t):[];if(o.length){let e=o[o.length-1],t=a?e.right-n.left:n.right-e.left;t>l&&(l=t,this.minWidth=r,this.minWidthFrom=s,this.minWidthTo=u)}}}s=u+e.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?m8.RTL:m8.LTR}measureTextSize(){for(let r of this.children)if(r instanceof o8){let e=r.measureTextSize();if(e)return e}let e,t,n,o=document.createElement("div");return o.className="cm-line",o.style.width="99999px",o.style.position="absolute",o.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(o);let r=u5(o.firstChild)[0];e=o.getBoundingClientRect().height,t=r?r.width/27:7,n=r?r.height:e,o.remove()})),{lineHeight:e,charWidth:t,textHeight:n}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new I5(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,o=0;;o++){let r=o==t.viewports.length?null:t.viewports[o],i=r?r.from-1:this.length;if(i>n){let o=(t.lineBlockAt(i).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(a8.replace({widget:new d6(o),block:!0,inclusive:!0,isBlockGap:!0}).range(n,i))}if(!r)break;n=r.to+1}return a8.set(e)}updateDeco(){let e=this.view.state.facet(e6).map(((e,t)=>(this.dynamicDecorationMap[t]="function"==typeof e)?e(this.view):e)),t=!1,n=this.view.state.facet(t6).map(((e,n)=>{let o="function"==typeof e;return o&&(t=!0),o?e(this.view):e}));n.length&&(this.dynamicDecorationMap[e.length]=t,e.push(j4.join(n)));for(let o=e.length;on.anchor?-1:1);if(!o)return;!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(o={left:Math.min(o.left,t.left),top:Math.min(o.top,t.top),right:Math.max(o.right,t.right),bottom:Math.max(o.bottom,t.bottom)});let r=l6(this.view),i={left:o.left-r.left,top:o.top-r.top,right:o.right+r.right,bottom:o.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;!function(e,t,n,o,r,i,l,a){let s=e.ownerDocument,c=s.defaultView||window;for(let u=e,d=!1;u&&!d;)if(1==u.nodeType){let e,p=u==s.body,h=1,f=1;if(p)e=m5(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:h,scaleY:f}=v5(u,t)),e={left:t.left,right:t.left+u.clientWidth*h,top:t.top,bottom:t.top+u.clientHeight*f}}let g=0,m=0;if("nearest"==r)t.top0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+m+l)):t.bottom>e.bottom&&(m=t.bottom-e.bottom+l,n<0&&t.top-m0&&t.right>e.right+g&&(g=t.right-e.right+g+i)):t.right>e.right&&(g=t.right-e.right+i,n<0&&t.left0))break;o=o.childNodes[r-1],r=f5(o)}if(n>=0)for(let o=e,r=t;;){if(3==o.nodeType)return{node:o,offset:r};if(!(1==o.nodeType&&r=0))break;o=o.childNodes[r],r=0}return null}let f6=class{constructor(){this.changes=[]}compareRange(e,t){p8(e,t,this.changes)}comparePoint(e,t){p8(e,t,this.changes)}};function g6(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function m6(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function v6(e,t){return e.topt.top+1}function b6(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function O6(e,t,n){let o,r,i,l,a,s,c,u,d=!1;for(let h=e.firstChild;h;h=h.nextSibling){let e=u5(h);for(let p=0;pm||l==m&&i>g){o=h,r=f,i=g,l=m;let a=m?n0?p0)}0==g?n>f.bottom&&(!c||c.bottomf.top)&&(s=h,u=f):c&&v6(c,f)?c=y6(c,f.bottom):u&&v6(u,f)&&(u=b6(u,f.top))}}if(c&&c.bottom>=n?(o=a,r=c):u&&u.top<=n&&(o=s,r=u),!o)return{node:e,offset:0};let p=Math.max(r.left,Math.min(r.right,t));return 3==o.nodeType?w6(o,p,n):d&&"false"!=o.contentEditable?O6(o,p,n):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,o)+(t>=(r.left+r.right)/2?1:0)}}function w6(e,t,n){let o=e.nodeValue.length,r=-1,i=1e9,l=0;for(let a=0;an?c.top-n:n-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&u=(c.left+c.right)/2,o=n;if((W5.chrome||W5.gecko)&&x5(e,a).getBoundingClientRect().left==c.right&&(o=!n),u<=0)return{node:e,offset:a+(o?1:0)};r=a+(o?1:0),i=u}}}return{node:e,offset:r>-1?r:l>0?e.nodeValue.length:0}}function x6(e,t,n,o=-1){var r,i;let l,a=e.contentDOM.getBoundingClientRect(),s=a.top+e.viewState.paddingTop,{docHeight:c}=e.viewState,{x:u,y:d}=t,p=d-s;if(p<0)return 0;if(p>c)return e.state.doc.length;for(let O=e.viewState.heightOracle.textHeight/2,w=!1;l=e.elementAtHeight(p),l.type!=l8.Text;)for(;p=o>0?l.bottom+O:l.top-O,!(p>=0&&p<=c);){if(w)return n?null:0;w=!0,o=-o}d=s+p;let h=l.from;if(he.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:$6(e,a,l,u,d);let f=e.dom.ownerDocument,g=e.root.elementFromPoint?e.root:f,m=g.elementFromPoint(u,d);m&&!e.contentDOM.contains(m)&&(m=null),m||(u=Math.max(a.left+1,Math.min(a.right-1,u)),m=g.elementFromPoint(u,d),m&&!e.contentDOM.contains(m)&&(m=null));let v,b=-1;if(m&&0!=(null===(r=e.docView.nearest(m))||void 0===r?void 0:r.isEditable))if(f.caretPositionFromPoint){let e=f.caretPositionFromPoint(u,d);e&&({offsetNode:v,offset:b}=e)}else if(f.caretRangeFromPoint){let t=f.caretRangeFromPoint(u,d);t&&(({startContainer:v,startOffset:b}=t),(!e.contentDOM.contains(v)||W5.safari&&function(e,t,n){let o;if(3!=e.nodeType||t!=(o=e.nodeValue.length))return!1;for(let r=e.nextSibling;r;r=r.nextSibling)if(1!=r.nodeType||"BR"!=r.nodeName)return!1;return x5(e,o-1,o).getBoundingClientRect().left>n}(v,b,u)||W5.chrome&&function(e,t,n){if(0!=t)return!1;for(let r=e;;){let e=r.parentNode;if(!e||1!=e.nodeType||e.firstChild!=r)return!1;if(e.classList.contains("cm-line"))break;r=e}let o=1==e.nodeType?e.getBoundingClientRect():x5(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect();return n-o.left>5}(v,b,u))&&(v=void 0))}if(!v||!e.docView.dom.contains(v)){let t=o8.find(e.docView,h);if(!t)return p>l.top+l.height/2?l.to:l.from;({node:v,offset:b}=O6(t.dom,u,d))}let y=e.docView.nearest(v);if(!y)return null;if(y.isWidget&&1==(null===(i=y.dom)||void 0===i?void 0:i.nodeType)){let e=y.dom.getBoundingClientRect();return t.y1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;i+=Math.floor((r-n.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let l=e.state.sliceDoc(n.from,n.to);return n.from+Y4(l,i,e.state.tabSize)}function S6(e,t){let n=e.lineBlockAt(t);if(Array.isArray(n.type))for(let o of n.type)if(o.to>t||o.to==t&&(o.to==n.to||o.type==l8.Text))return o;return n}function C6(e,t,n,o){let r=e.state.doc.lineAt(t.head),i=e.bidiSpans(r),l=e.textDirectionAt(r.from);for(let a=t,s=null;;){let t=R8(r,i,l,a,n),c=A8;if(!t){if(r.number==(n?e.state.doc.lines:1))return a;c="\n",r=e.state.doc.line(r.number+(n?1:-1)),i=e.bidiSpans(r),t=e.visualLineSide(r,!n)}if(s){if(!s(c))return a}else{if(!o)return t;s=o(c)}a=t}}function k6(e,t,n){for(;;){let o=0;for(let r of e)r.between(t-1,t+1,((e,r,i)=>{if(t>e&&tt(e))),n.from,t.head>n.from?-1:1);return o==n.from?n:z3.cursor(o,onull)),W5.gecko&&(t=e.contentDOM.ownerDocument,e7.has(t)||(e7.add(t),t.addEventListener("copy",(()=>{})),t.addEventListener("cut",(()=>{}))))}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,o=t.target;o!=e.contentDOM;o=o.parentNode)if(!o||11==o.nodeType||(n=T5.get(o))&&n.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let o of e){let e=o.spec;if(e&&e.domEventHandlers)for(let t in e.domEventHandlers){let r=e.domEventHandlers[t];r&&n(t).handlers.push(M6(o.value,r))}if(e&&e.domEventObservers)for(let t in e.domEventObservers){let r=e.domEventObservers[t];r&&n(t).observers.push(M6(o.value,r))}}for(let o in j6)n(o).handlers.push(j6[o]);for(let o in B6)n(o).observers.push(B6[o]);return t}(e),n=this.handlers,o=this.view.contentDOM;for(let r in t)if("scroll"!=r){let e=!t[r].handlers.length,i=n[r];i&&e!=!i.handlers.length&&(o.removeEventListener(r,this.handleEvent),i=null),i||o.addEventListener(r,this.handleEvent,{passive:e})}for(let r in n)"scroll"==r||t[r]||o.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&Date.now()t.keyCode==e.keyCode)))&&!e.ctrlKey||E6.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(){let e=this.pendingIOSKey;return!!e&&(this.pendingIOSKey=void 0,$5(this.view.contentDOM,e.key,e.keyCode))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(W5.safari&&!W5.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function M6(e,t){return(n,o)=>{try{return t.call(e,o,n)}catch(Rpe){Z8(n.state,Rpe)}}}const I6=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],E6="dthko",A6=[16,17,18,20,91,92,224,225];function R6(e){return.7*Math.max(0,e)+8}class D6{constructor(e,t,n,o){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=o,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=function(e){let t=e.ownerDocument;for(let n=e.parentNode;n&&n!=t.body;)if(1==n.nodeType){if(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else{if(11!=n.nodeType)break;n=n.host}return null}(e.contentDOM),this.atoms=e.state.facet(n6).map((t=>t(e)));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(M4.allowMultipleSelections)&&function(e,t){let n=e.state.facet(j8);return n.length?n[0](t):W5.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let o=a5(e.root);if(!o||0==o.rangeCount)return!0;let r=o.getRangeAt(0).getClientRects();for(let i=0;i=t.clientX&&e.top<=t.clientY&&e.bottom>=t.clientY)return!0}return!1}(e,t)||1!=Y6(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t,n,o;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(n=this.startEvent,o=e,Math.max(Math.abs(n.clientX-o.clientX),Math.abs(n.clientY-o.clientY))<10))return;this.select(this.lastEvent=e);let r=0,i=0,l=(null===(t=this.scrollParent)||void 0===t?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},a=l6(this.view);e.clientX-a.left<=l.left+6?r=-R6(l.left-e.clientX):e.clientX+a.right>=l.right-6&&(r=R6(e.clientX-l.right)),e.clientY-a.top<=l.top+6?i=-R6(l.top-e.clientY):e.clientY+a.bottom>=l.bottom-6&&(i=R6(e.clientY-l.bottom)),this.setScrollSpeed(r,i)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nthis.select(this.lastEvent)),20)}}const j6=Object.create(null),B6=Object.create(null),N6=W5.ie&&W5.ie_version<15||W5.ios&&W5.webkit_version<604;function z6(e,t){let n,{state:o}=e,r=1,i=o.toText(t),l=i.lines==o.selection.ranges.length;if(null!=G6&&o.selection.ranges.every((e=>e.empty))&&G6==i.toString()){let e=-1;n=o.changeByRange((n=>{let a=o.doc.lineAt(n.from);if(a.from==e)return{range:n};e=a.from;let s=o.toText((l?i.line(r++).text:t)+o.lineBreak);return{changes:{from:a.from,insert:s},range:z3.cursor(n.from+s.length)}}))}else n=l?o.changeByRange((e=>{let t=i.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:z3.cursor(e.from+t.length)}})):o.replaceSelection(i);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function _6(e,t,n,o){if(1==o)return z3.cursor(t,n);if(2==o)return function(e,t,n=1){let o=e.charCategorizer(t),r=e.doc.lineAt(t),i=t-r.from;if(0==r.length)return z3.cursor(t);0==i?n=1:i==r.length&&(n=-1);let l=i,a=i;n<0?l=y3(r.text,i,!1):a=y3(r.text,i);let s=o(r.text.slice(l,a));for(;l>0;){let e=y3(r.text,l,!1);if(o(r.text.slice(e,l))!=s)break;l=e}for(;a{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},j6.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&(e.inputState.lastEscPress=Date.now()),!1),B6.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},B6.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},j6.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let o of e.state.facet(N8))if(n=o(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=F6(e,t),o=Y6(t),r=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),r=r.map(e.changes))},get(t,i,l){let a,s=F6(e,t),c=_6(e,s.pos,s.bias,o);if(n.pos!=s.pos&&!i){let t=_6(e,n.pos,n.bias,o),r=Math.min(t.from,c.from),i=Math.max(t.to,c.to);c=r1&&(a=function(e,t){for(let n=0;n=t)return z3.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(r,s.pos))?a:l?r.addRange(c):z3.create([c])}}}(e,t)),n){let o=!e.hasFocus;e.inputState.startMouseSelection(new D6(e,t,n,o)),o&&e.observer.ignore((()=>w5(e.contentDOM)));let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}return!1};let L6=(e,t)=>e>=t.top&&e<=t.bottom,Q6=(e,t,n)=>L6(t,n)&&e>=n.left&&e<=n.right;function H6(e,t,n,o){let r=o8.find(e.docView,t);if(!r)return 1;let i=t-r.posAtStart;if(0==i)return 1;if(i==r.length)return-1;let l=r.coordsAt(i,-1);if(l&&Q6(n,o,l))return-1;let a=r.coordsAt(i,1);return a&&Q6(n,o,a)?1:l&&L6(o,l)?-1:1}function F6(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:H6(e,n,t.clientX,t.clientY)}}const W6=W5.ie&&W5.ie_version<=11;let V6=null,Z6=0,X6=0;function Y6(e){if(!W6)return e.detail;let t=V6,n=X6;return V6=e,X6=Date.now(),Z6=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Z6+1)%3:1}function K6(e,t,n,o){if(!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:i}=e.inputState,l=o&&i&&function(e,t){let n=e.state.facet(B8);return n.length?n[0](t):W5.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:i.from,to:i.to}:null,a={from:r,insert:n},s=e.state.changes(l?[l,a]:a);e.focus(),e.dispatch({changes:s,selection:{anchor:s.mapPos(r,-1),head:s.mapPos(r,1)},userEvent:l?"move.drop":"input.drop"}),e.inputState.draggedContent=null}j6.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let o=e.docView.nearest(t.target);if(o&&o.isWidget){let e=o.posAtStart,t=e+o.length;(e>=n.to||t<=n.from)&&(n=z3.range(e,t))}}let{inputState:o}=e;return o.mouseSelection&&(o.mouseSelection.dragging=!0),o.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove"),!1},j6.dragend=e=>(e.inputState.draggedContent=null,!1),j6.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let o=Array(n.length),r=0,i=()=>{++r==n.length&&K6(e,t,o.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(o[e]=t.result),i()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return K6(e,t,n,!0),!0}return!1},j6.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=N6?null:t.clipboardData;return n?(z6(e,n.getData("text/plain")||n.getData("text/uri-text")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((()=>{e.focus(),n.remove(),z6(e,n.value)}),50)}(e),!1)};let G6=null;j6.copy=j6.cut=(e,t)=>{let{text:n,ranges:o,linewise:r}=function(e){let t=[],n=[],o=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:o}of e.selection.ranges){let i=e.doc.lineAt(o);i.number>r&&(t.push(i.text),n.push({from:i.from,to:Math.min(e.doc.length,i.to+1)})),r=i.number}o=!0}return{text:t.join(e.lineBreak),ranges:n,linewise:o}}(e.state);if(!n&&!r)return!1;G6=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:o,scrollIntoView:!0,userEvent:"delete.cut"});let i=N6?null:t.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(function(e,t){let n=e.dom.parentNode;if(!n)return;let o=n.appendChild(document.createElement("textarea"));o.style.cssText="position: fixed; left: -10000px; top: 10px",o.value=t,o.focus(),o.selectionEnd=t.length,o.selectionStart=0,setTimeout((()=>{o.remove(),e.focus()}),50)}(e,n),!1)};const U6=f4.define();function q6(e,t){let n=[];for(let o of e.facet(Q8)){let r=o(e,t);r&&n.push(r)}return n?e.update({effects:n,annotations:U6.of(!0)}):null}function J6(e){setTimeout((()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=q6(e.state,t);n?e.dispatch(n):e.update([])}}),10)}B6.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),J6(e)},B6.blur=e=>{e.observer.clearSelectionRange(),J6(e)},B6.compositionstart=B6.compositionupdate=e=>{null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0)},B6.compositionend=e=>{e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,W5.chrome&&W5.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then((()=>e.observer.flush())):setTimeout((()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])}),50)},B6.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},j6.beforeinput=(e,t)=>{var n;let o;if(W5.chrome&&W5.android&&(o=I6.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(o.key,o.keyCode),"Backspace"==o.key||"Delete"==o.key)){let t=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}return!1};const e7=new Set,t7=["pre-wrap","normal","pre-line","break-spaces"];class n7{constructor(e){this.lineWrapping=e,this.doc=l3.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return t7.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=o,this.lineLength=r,a){this.heightSamples={};for(let e=0;e0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>l7&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return a7.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,o){let r=this,i=n.doc;for(let l=o.length-1;l>=0;l--){let{fromA:a,toA:s,fromB:c,toB:u}=o[l],d=r.lineAt(a,i7.ByPosNoHeight,n.setDoc(t),0,0),p=d.to>=s?d:r.lineAt(s,i7.ByPosNoHeight,n,0,0);for(u+=p.to-s,s=p.to;l>0&&d.from<=o[l-1].toA;)a=o[l-1].fromA,c=o[l-1].fromB,l--,a2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,o-=r.size}else{if(!(r>2*o))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,r-=t.size}}else if(o=r&&i(this.blockAt(0,n,o,r))}updateHeight(e,t=0,n=!1,o){return o&&o.from<=t&&o.more&&this.setHeight(e,o.heights[o.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class c7 extends s7{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,o){return new r7(o,this.length,n,this.height,this.breaks)}replace(e,t,n){let o=n[0];return 1==n.length&&(o instanceof c7||o instanceof u7&&4&o.flags)&&Math.abs(this.length-o.length)<10?(o instanceof u7?o=new c7(o.length,this.height):o.height=this.height,this.outdated||(o.outdated=!1),o):a7.of(n)}updateHeight(e,t=0,n=!1,o){return o&&o.from<=t&&o.more?this.setHeight(e,o.heights[o.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class u7 extends a7{constructor(e){super(e,0)}heightMetrics(e,t){let n,o=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-o+1,l=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);n=t/i,this.length>i+1&&(l=(this.height-t)/(this.length-i-1))}else n=this.height/i;return{firstLine:o,lastLine:r,perLine:n,perChar:l}}blockAt(e,t,n,o){let{firstLine:r,lastLine:i,perLine:l,perChar:a}=this.heightMetrics(t,o);if(t.lineWrapping){let r=o+Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length),i=t.doc.lineAt(r),s=l+i.length*a,c=Math.max(n,e-s/2);return new r7(i.from,i.length,c,s,0)}{let o=Math.max(0,Math.min(i-r,Math.floor((e-n)/l))),{from:a,length:s}=t.doc.line(r+o);return new r7(a,s,n+l*o,l,0)}}lineAt(e,t,n,o,r){if(t==i7.ByHeight)return this.blockAt(e,n,o,r);if(t==i7.ByPosNoHeight){let{from:t,to:o}=n.doc.lineAt(e);return new r7(t,o-t,0,0,0)}let{firstLine:i,perLine:l,perChar:a}=this.heightMetrics(n,r),s=n.doc.lineAt(e),c=l+s.length*a,u=s.number-i,d=o+l*u+a*(s.from-r-u);return new r7(s.from,s.length,Math.max(o,Math.min(d,o+this.height-c)),c,0)}forEachLine(e,t,n,o,r,i){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:s}=this.heightMetrics(n,r);for(let c=e,u=o;c<=t;){let t=n.doc.lineAt(c);if(c==e){let n=t.number-l;u+=a*n+s*(e-r-n)}let o=a+s*t.length;i(new r7(t.from,t.length,u,o,0)),u+=o,c=t.to+1}}replace(e,t,n){let o=this.length-t;if(o>0){let e=n[n.length-1];e instanceof u7?n[n.length-1]=new u7(e.length+o):n.push(null,new u7(o-1))}if(e>0){let t=n[0];t instanceof u7?n[0]=new u7(e+t.length):n.unshift(new u7(e-1),null)}return a7.of(n)}decomposeLeft(e,t){t.push(new u7(e-1),null)}decomposeRight(e,t){t.push(null,new u7(this.length-e-1))}updateHeight(e,t=0,n=!1,o){let r=t+this.length;if(o&&o.from<=t+this.length&&o.more){let n=[],i=Math.max(t,o.from),l=-1;for(o.from>t&&n.push(new u7(o.from-t-1).updateHeight(e,t));i<=r&&o.more;){let t=e.doc.lineAt(i).length;n.length&&n.push(null);let r=o.heights[o.index++];-1==l?l=r:Math.abs(r-l)>=l7&&(l=-2);let a=new c7(t,r);a.outdated=!1,n.push(a),i+=t+1}i<=r&&n.push(null,new u7(r-i).updateHeight(e,i));let a=a7.of(n);return(l<0||Math.abs(a.height-this.height)>=l7||Math.abs(l-this.heightMetrics(e,t).perLine)>=l7)&&(e.heightChanged=!0),a}return(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class d7 extends a7{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,o){let r=n+this.left.height;return el))return s;let c=t==i7.ByPosNoHeight?i7.ByPosNoHeight:i7.ByPos;return a?s.join(this.right.lineAt(l,c,n,i,l)):this.left.lineAt(l,c,n,o,r).join(s)}forEachLine(e,t,n,o,r,i){let l=o+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,l,a,i);else{let s=this.lineAt(a,i7.ByPos,n,o,r);e=e&&s.from<=t&&i(s),t>s.to&&this.right.forEachLine(s.to+1,t,n,l,a,i)}}replace(e,t,n){let o=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-o,t-o,n));let r=[];e>0&&this.decomposeLeft(e,r);let i=r.length;for(let l of n)r.push(l);if(e>0&&p7(r,i-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,o=n+this.break;if(e>=o)return this.right.decomposeRight(e-o,t);e2*t.size||t.size>2*e.size?a7.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,o){let{left:r,right:i}=this,l=t+r.length+this.break,a=null;return o&&o.from<=t+r.length&&o.more?a=r=r.updateHeight(e,t,n,o):r.updateHeight(e,t,n),o&&o.from<=l+i.length&&o.more?a=i=i.updateHeight(e,l,n,o):i.updateHeight(e,l,n),a?this.balanced(r,i):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function p7(e,t){let n,o;null==e[t]&&(n=e[t-1])instanceof u7&&(o=e[t+1])instanceof u7&&e.splice(t-1,3,new u7(n.length+1+o.length))}class h7{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof c7?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new c7(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=5)&&this.addLineDeco(o,r,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new c7(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new u7(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof c7)return e;let t=new c7(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let o=this.ensureLine();o.length+=n,o.collapsed+=n,o.widgetHeight=Math.max(o.widgetHeight,e),o.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof c7||this.isCovered?(this.writtenTot.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=n.overflow){let n=t.getBoundingClientRect();i=Math.max(i,n.left),l=Math.min(l,n.right),a=Math.max(a,n.top),s=c==e.parentNode?n.bottom:Math.min(s,n.bottom)}c="absolute"==n.position||"fixed"==n.position?t.offsetParent:t.parentNode}else{if(11!=c.nodeType)break;c=c.host}return{left:i-n.left,right:Math.max(i,l)-n.left,top:a-(n.top+t),bottom:Math.max(a,s)-(n.top+t)}}function m7(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class v7{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n"function"!=typeof e&&"cm-lineWrapping"==e.class));this.heightOracle=new n7(t),this.stateDeco=e.facet(e6).filter((e=>"function"!=typeof e)),this.heightMap=a7.empty().applyChanges(this.stateDeco,l3.empty,this.heightOracle.setDoc(e.doc),[new s6(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=a8.set(this.lineGaps.map((e=>e.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let o=n?t.head:t.anchor;if(!e.some((({from:e,to:t})=>o>=e&&o<=t))){let{from:t,to:n}=this.lineBlockAt(o);e.push(new O7(t,n))}}this.viewports=e.sort(((e,t)=>e.from-t.from)),this.scaler=this.heightMap.height<=7e6?S7:new C7(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(e=>{this.viewportLines.push(1==this.scaler.scale?e:k7(e,this.scaler))}))}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(e6).filter((e=>"function"!=typeof e));let o=e.changedRanges,r=s6.extendWithRanges(o,function(e,t,n){let o=new f7;return j4.compare(e,t,n,o,0),o.changes}(n,this.stateDeco,e?e.changes:I3.empty(this.state.doc.length))),i=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=i&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let s=!e.changes.empty||2&e.flags||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),s&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(F8)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),o=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?m8.RTL:m8.LTR;let i=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=i||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let s=0,c=0;if(l.width&&l.height){let{scaleX:e,scaleY:n}=v5(t,l);this.scaleX==e&&this.scaleY==n||(this.scaleX=e,this.scaleY=n,s|=8,i=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==d||(this.paddingTop=u,this.paddingBottom=d,s|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(o.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,s|=8);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=C5(e.scrollDOM);let h=(this.printing?m7:g7)(t,this.paddingTop),f=h.top-this.pixelViewport.top,g=h.bottom-this.pixelViewport.bottom;this.pixelViewport=h;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let v=l.width;if(this.contentDOMWidth==v&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,s|=8),a){let t=e.docView.measureVisibleLineHeights(this.viewport);if(o.mustRefreshForHeights(t)&&(i=!0),i||o.lineWrapping&&Math.abs(v-this.contentDOMWidth)>o.charWidth){let{lineHeight:n,charWidth:l,textHeight:a}=e.docView.measureTextSize();i=n>0&&o.refresh(r,n,l,a,v/l,t),i&&(e.docView.minWidth=0,s|=8)}f>0&&g>0?c=Math.max(f,g):f<0&&g<0&&(c=Math.min(f,g)),o.heightChanged=!1;for(let n of this.viewports){let r=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(i?a7.empty().applyChanges(this.stateDeco,l3.empty,this.heightOracle,[new s6(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(o,0,i,new o7(n.from,r))}o.heightChanged&&(s|=2)}let b=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(2&s||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(i?[]:this.lineGaps,e)),s|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),s}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),o=this.heightMap,r=this.heightOracle,{visibleTop:i,visibleBottom:l}=this,a=new O7(o.lineAt(i-1e3*n,i7.ByHeight,r,0,0).from,o.lineAt(l+1e3*(1-n),i7.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(ea.to){let n,i=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),l=o.lineAt(e,i7.ByPos,r,0,0);n="center"==t.y?(l.top+l.bottom)/2-i/2:"start"==t.y||"nearest"==t.y&&e=l+Math.max(10,Math.min(n,250)))&&o>i-2e3&&r>1,i=o<<1;if(this.defaultTextDirection!=m8.LTR&&!n)return[];let l=[],a=(o,i,s,c)=>{if(i-oo&&ee.from>=s.from&&e.to<=s.to&&Math.abs(e.from-o)e.fromt))));if(!p){if(ie.from<=i&&e.to>=i))){let e=t.moveToLineBoundary(z3.cursor(i),!1,!0).head;e>o&&(i=e)}p=new v7(o,i,this.gapSize(s,o,i,c))}l.push(p)};for(let s of this.viewportLines){if(s.lengths.from&&a(s.from,t,s,e),re.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];j4.spans(e,this.viewport.from,this.viewport.to,{span(e,n){t.push({from:e,to:n})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some(((e,n)=>e.from!=t[n].from||e.to!=t[n].to));return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||k7(this.heightMap.lineAt(e,i7.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return k7(this.heightMap.lineAt(this.scaler.fromDOM(e),i7.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return k7(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class O7{constructor(e,t){this.from=e,this.to=t}}function w7(e,t,n){let o=[],r=e,i=0;return j4.spans(n,e,t,{span(){},point(e,t){e>r&&(o.push({from:r,to:e}),i+=e-r),r=t}},20),r=1)return t[t.length-1].to;let o=Math.floor(e*n);for(let r=0;;r++){let{from:e,to:n}=t[r],i=n-e;if(o<=i)return e+o;o-=i}}function $7(e,t){let n=0;for(let{from:o,to:r}of e.ranges){if(t<=r){n+=t-o;break}n+=r-o}return n/e.total}const S7={toDOM:e=>e,fromDOM:e=>e,scale:1};class C7{constructor(e,t,n){let o=0,r=0,i=0;this.viewports=n.map((({from:n,to:r})=>{let i=t.lineAt(n,i7.ByPos,e,0,0).top,l=t.lineAt(r,i7.ByPos,e,0,0).bottom;return o+=l-i,{from:n,to:r,top:i,bottom:l,domTop:0,domBottom:0}})),this.scale=(7e6-o)/(t.height-o);for(let l of this.viewports)l.domTop=i+(l.top-r)*this.scale,i=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,n=0,o=0;;t++){let r=tk7(e,t))):e._content)}const P7=Q3.define({combine:e=>e.join(" ")}),T7=Q3.define({combine:e=>e.indexOf(!0)>-1}),M7=q4.newName(),I7=q4.newName(),E7=q4.newName(),A7={"&light":"."+I7,"&dark":"."+E7};function R7(e,t,n){return new q4(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]})):e+" "+t})}const D7=R7("."+M7,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},A7),j7="￿";class B7{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(M4.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=j7}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let o=e;;){this.findPointBefore(n,o);let e=this.text.length;this.readNode(o);let r=o.nextSibling;if(r==t)break;let i=T5.get(o),l=T5.get(r);(i&&l?i.breakAfter:(i?i.breakAfter:z7(o))||z7(r)&&("BR"!=o.nodeName||o.cmIgnore)&&this.text.length>e)&&this.lineBreak(),o=r}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,o=this.lineSeparator?null:/\r\n?|\n/g;;){let r,i=-1,l=1;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),l=this.lineSeparator.length):(r=o.exec(t))&&(i=r.index,l=r[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),l>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=l-1);n=i+l}}readNode(e){if(e.cmIgnore)return;let t=T5.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(N7(e,n.node,n.offset)?t:0))}}function N7(e,t,n){for(;;){if(!t||n-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let t=r||i?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}=e.observer.selectionRange;return n&&(t.push(new _7(n,o)),r==n&&i==o||t.push(new _7(r,i))),t}(e),n=new B7(t,e.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,o=2==e.length?e[1].pos:n;return n>-1&&o>-1?z3.single(n+t,o+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!s5(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),o=i&&i.node==t.anchorNode&&i.offset==t.anchorOffset||!s5(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),l=e.viewport;if(W5.ios&&e.state.selection.main.empty&&n!=o&&(l.from>0||l.toDate.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=r.from,s=null;(8===i||W5.android&&t.text.length0&&a>0&&e.charCodeAt(l-1)==t.charCodeAt(a-1);)l--,a--;return"end"==o&&(n-=l+Math.max(0,i-Math.min(l,a))-i),l=l?i-n:0,a=i+(a-l),l=i):a=a?i-n:0,l=i+(l-a),a=i),{from:i,toA:l,toB:a}}(e.state.doc.sliceString(o,l,j7),t.text,a-o,s);c&&(W5.chrome&&13==i&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==j7+j7&&c.toB--,n={from:o+c.from,to:o+c.toA,insert:l3.of(t.text.slice(c.from,c.toB).split(j7))})}else o&&(!e.hasFocus&&e.state.facet(X8)||o.main.eq(r))&&(o=null);if(!n&&!o)return!1;if(!n&&t.typeOver&&!r.empty&&o&&o.main.empty?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,r.to)}:n&&n.from>=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,r.to))}:(W5.mac||W5.android)&&n&&n.from==n.to&&n.from==r.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(o&&2==n.insert.length&&(o=z3.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:l3.of([" "])}):W5.chrome&&n&&n.from==n.to&&n.from==r.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(o&&(o=z3.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:l3.of([" "])}),n){if(W5.ios&&e.inputState.flushIOSKey())return!0;if(W5.android&&(n.from==r.from&&n.to==r.to&&1==n.insert.length&&2==n.insert.lines&&$5(e.contentDOM,"Enter",13)||(n.from==r.from-1&&n.to==r.to&&0==n.insert.length||8==i&&n.insert.lengthr.head)&&$5(e.contentDOM,"Backspace",8)||n.from==r.from&&n.to==r.to+1&&0==n.insert.length&&$5(e.contentDOM,"Delete",46)))return!0;let t,l=n.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>t||(t=function(e,t,n){let o,r=e.state,i=r.selection.main;if(t.from>=i.from&&t.to<=i.to&&t.to-t.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=i.fromt.to?r.sliceDoc(t.to,i.to):"";o=r.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+l))}else{let l=r.changes(t),a=n&&n.main.to<=l.newLength?n.main:void 0;if(r.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=i.to&&t.to>=i.to-10){let s,c=e.state.sliceDoc(t.from,t.to),u=n&&p6(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);s={from:u.from,to:u.to-e}}else s=e.state.doc.lineAt(i.head);let d=i.to-t.to,p=i.to-i.from;o=r.changeByRange((n=>{if(n.from==i.from&&n.to==i.to)return{changes:l,range:a||n.map(l)};let o=n.to-d,u=o-c.length;if(n.to-n.from!=p||e.state.sliceDoc(u,o)!=c||n.to>=s.from&&n.from<=s.to)return{range:n};let h=r.changes({from:u,to:o,insert:t.insert}),f=n.to-i.to;return{changes:h,range:a?z3.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):n.map(h)}}))}else o={changes:l,selection:a&&r.selection.replaceRange(a)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(o,{userEvent:l,scrollIntoView:!0})}(e,n,o));return e.state.facet(L8).some((t=>t(e,n.from,n.to,l,a)))||e.dispatch(a()),!0}if(o&&!o.main.eq(r)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:o,scrollIntoView:t,userEvent:n}),!0}return!1}const H7={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},F7=W5.ie&&W5.ie_version<=11;class W7{constructor(e){this.view=e,this.active=!1,this.selectionRange=new b5,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((t=>{for(let e of t)this.queue.push(e);(W5.ie&&W5.ie_version<=11||W5.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),F7&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some(((t,n)=>t!=e[n])))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,o=this.selectionRange;if(n.state.facet(X8)?n.root.activeElement!=this.dom:!c5(n.dom,o))return;let r=o.anchorNode&&n.docView.nearest(o.anchorNode);r&&r.ignoreEvent(e)?t||(this.selectionChanged=!1):(W5.ie&&W5.ie_version<=11||W5.android&&W5.chrome)&&!n.state.selection.main.empty&&o.focusNode&&d5(o.focusNode,o.focusOffset,o.anchorNode,o.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=W5.safari&&11==e.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e){let t=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",n,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),!t)return null;let o=t.startContainer,r=t.startOffset,i=t.endContainer,l=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor);return d5(a.node,a.offset,i,l)&&([o,r,i,l]=[i,l,o,r]),{anchorNode:o,anchorOffset:r,focusNode:i,focusOffset:l}}(this.view)||a5(e.root);if(!t||this.selectionRange.eq(t))return!1;let n=c5(this.dom,t);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&$5(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,o=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(o=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:o}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),o=this.selectionChanged&&c5(this.dom,this.selectionRange);if(e<0&&!o)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new L7(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,o=Q7(this.view,t);return this.view.state==n&&this.view.update([]),o}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){let n=V7(t,e.previousSibling||e.target.previousSibling,-1),o=V7(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:o?t.posBefore(o):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let o of this.scrollTargets)o.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function V7(e,t,n){for(;t;){let o=T5.get(t);if(o&&o.parent==e)return o;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}class Z7{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach((e=>t(e,this))))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new y7(e.state||M4.create(e)),e.scrollTo&&e.scrollTo.is(V8)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(K8).map((e=>new U8(e)));for(let n of this.plugins)n.update(this);this.observer=new W7(this),this.inputState=new T6(this),this.inputState.ensureHandlers(this.plugins),this.docView=new u6(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=1==e.length&&e[0]instanceof b4?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,o=!1,r=this.state;for(let d of e){if(d.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=d.state}if(this.destroyed)return void(this.viewState.state=r);let i=this.hasFocus,l=0,a=null;e.some((e=>e.annotation(U6)))?(this.inputState.notifiedFocused=i,l=1):i!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=i,a=q6(r,i),a||(l=1));let s=this.observer.delayedAndroidKey,c=null;if(s?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(M4.phrases)!=this.state.facet(M4.phrases))return this.setState(r);t=c6.create(this,r,e),t.flags|=l;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;u=new W8(e.empty?e:z3.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(V8)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=K7.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(a6)!=this.styleModules&&this.mountStyles(),o=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(P7)!=t.state.facet(P7)&&(this.viewState.mustMeasureContent=!0),(n||o||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!t.empty)for(let d of this.state.facet(_8))try{d(t)}catch(Rpe){Z8(this.state,Rpe,"update listener")}(a||c)&&Promise.resolve().then((()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Q7(this,c)&&s.force&&$5(this.contentDOM,s.key,s.keyCode)}))}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new y7(e),this.plugins=e.facet(K8).map((e=>new U8(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new u6(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(K8),n=e.state.facet(K8);if(t!=n){let o=[];for(let r of n){let n=t.indexOf(r);if(n<0)o.push(new U8(r));else{let t=this.plugins[n];t.mustUpdate=e,o.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=o,this.pluginMap.clear()}else for(let o of this.plugins)o.mustUpdate=e;for(let o=0;o-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,o=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:i}=this.viewState;Math.abs(o-this.viewState.scrollTop)>1&&(i=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(i<0)if(C5(n))r=-1,i=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(o);r=e.from,i=e.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5)break;let a=[];4&l||([this.measureRequests,a]=[a,this.measureRequests]);let s=a.map((e=>{try{return e.read(this)}catch(Rpe){return Z8(this.state,Rpe),Y7}})),c=c6.create(this,this.state,[]),u=!1;c.flags|=l,t?t.flags|=l:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c));for(let e=0;e1||e<-1){o+=e,n.scrollTop=o/this.scaleY,i=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(_8))l(t)}get themeClasses(){return M7+" "+(this.state.facet(T7)?E7:I7)+" "+this.state.facet(P7)}updateAttrs(){let e=G7(this,q8,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(X8)?"true":"false",class:"cm-content",style:`${W5.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),G7(this,J8,t);let n=this.observer.ignore((()=>{let n=t8(this.contentDOM,this.contentAttrs,t),o=t8(this.dom,this.editorAttrs,e);return n||o}));return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(Z7.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(a6);let e=this.state.facet(Z7.cspNonce);q4.mount(this.root,this.styleModules.concat(D7).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(let t=0;tt.spec==e))||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return P6(this,e,C6(this,e,t,n))}moveByGroup(e,t){return P6(this,e,C6(this,e,t,(t=>function(e,t,n){let o=e.state.charCategorizer(t),r=o(n);return e=>{let t=o(e);return r==C4.Space&&(r=t),r==t}}(this,e.head,t))))}visualLineSide(e,t){let n=this.bidiSpans(e),o=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return z3.cursor(r.side(t,o)+e.from,r.forward(!t,o)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,o){let r=S6(e,t.head),i=o&&r.type==l8.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(i){let t=e.dom.getBoundingClientRect(),o=e.textDirectionAt(r.from),l=e.posAtCoords({x:n==(o==m8.LTR)?t.right-1:t.left+1,y:(i.top+i.bottom)/2});if(null!=l)return z3.cursor(l,n?-1:1)}return z3.cursor(n?r.to:r.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return P6(this,e,function(e,t,n,o){let r=t.head,i=n?1:-1;if(r==(n?e.state.doc.length:0))return z3.cursor(r,t.assoc);let l,a=t.goalColumn,s=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(r,t.assoc||-1),u=e.documentTop;if(c)null==a&&(a=c.left-s.left),l=i<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(r);null==a&&(a=Math.min(s.right-s.left,e.defaultCharacterWidth*(r-t.from))),l=(i<0?t.top:t.bottom)+u}let d=s.left+a,p=null!=o?o:e.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let t=l+(p+h)*i,n=x6(e,{x:d,y:t},!1,i);if(ts.bottom||(i<0?nr)){let o=e.docView.coordsForChar(n),r=!o||t0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(H8)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>X7)return E8(e.length);let t,n=this.textDirectionAt(e.from);for(let r of this.bidiCache)if(r.from==e.from&&r.dir==n&&(r.fresh||P8(r.isolates,t=r6(this,e))))return r.order;t||(t=r6(this,e));let o=function(e,t,n){if(!e)return[new k8(0,0,t==b8?1:0)];if(t==v8&&!n.length&&!C8.test(e))return E8(e.length);if(n.length)for(;e.length>T8.length;)T8[T8.length]=256;let o=[],r=t==v8?0:1;return I8(e,r,r,n,0,e.length,o),o}(e.text,n,t);return this.bidiCache.push(new K7(e.from,e.to,n,t,!0,o)),o}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||W5.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{w5(this.contentDOM),this.docView.updateSelection()}))}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return V8.of(new W8("number"==typeof e?z3.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return V8.of(new W8(z3.cursor(n.from),"start","start",n.top-e,t,!0))}static domEventHandlers(e){return G8.define((()=>({})),{eventHandlers:e})}static domEventObservers(e){return G8.define((()=>({})),{eventObservers:e})}static theme(e,t){let n=q4.newName(),o=[P7.of(n),a6.of(R7(`.${n}`,e))];return t&&t.dark&&o.push(T7.of(!0)),o}static baseTheme(e){return e4.lowest(a6.of(R7("."+M7,e,A7)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),o=n&&T5.get(n)||T5.get(e);return(null===(t=null==o?void 0:o.rootView)||void 0===t?void 0:t.view)||null}}Z7.styleModule=a6,Z7.inputHandler=L8,Z7.focusChangeEffect=Q8,Z7.perLineTextDirection=H8,Z7.exceptionSink=z8,Z7.updateListener=_8,Z7.editable=X8,Z7.mouseSelectionStyle=N8,Z7.dragMovesSelection=B8,Z7.clickAddsSelectionRange=j8,Z7.decorations=e6,Z7.outerDecorations=t6,Z7.atomicRanges=n6,Z7.bidiIsolatedRanges=o6,Z7.scrollMargins=i6,Z7.darkTheme=T7,Z7.cspNonce=Q3.define({combine:e=>e.length?e[0]:""}),Z7.contentAttributes=J8,Z7.editorAttributes=q8,Z7.lineWrapping=Z7.contentAttributes.of({class:"cm-lineWrapping"}),Z7.announce=v4.define();const X7=4096,Y7={};class K7{constructor(e,t,n,o,r,i){this.from=e,this.to=t,this.dir=n,this.isolates=o,this.fresh=r,this.order=i}static update(e,t){if(t.empty&&!e.some((e=>e.fresh)))return e;let n=[],o=e.length?e[e.length-1].dir:m8.LTR;for(let r=Math.max(0,e.length-10);r=0;r--){let t=o[r],i="function"==typeof t?t(e):t;i&&q5(i,n)}return n}const U7=W5.mac?"mac":W5.windows?"win":W5.linux?"linux":"key";function q7(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const J7=e4.default(Z7.domEventHandlers({keydown:(e,t)=>r9(n9(t.state),e,t,"editor")})),e9=Q3.define({enables:J7}),t9=new WeakMap;function n9(e){let t=e.facet(e9),n=t9.get(t);return n||t9.set(t,n=function(e,t=U7){let n=Object.create(null),o=Object.create(null),r=(e,t)=>{let n=o[e];if(null==n)o[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},i=(e,o,i,l,a)=>{var s,c;let u=n[e]||(n[e]=Object.create(null)),d=o.split(/ (?!$)/).map((e=>function(e,t){const n=e.split(/-(?!$)/);let o,r,i,l,a=n[n.length-1];"Space"==a&&(a=" ");for(let s=0;s{let o=o9={view:t,prefix:n,scope:e};return setTimeout((()=>{o9==o&&(o9=null)}),4e3),!0}]})}let p=d.join(" ");r(p,!1);let h=u[p]||(u[p]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(s=u._any)||void 0===s?void 0:s.run)||void 0===c?void 0:c.slice())||[]});i&&h.run.push(i),l&&(h.preventDefault=!0),a&&(h.stopPropagation=!0)};for(let l of e){let e=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let t in e)e[t].run.push(l.any)}let o=l[t]||l.key;if(o)for(let t of e)i(t,o,l.run,l.preventDefault,l.stopPropagation),l.shift&&i(t,"Shift-"+o,l.shift,l.preventDefault,l.stopPropagation)}return n}(t.reduce(((e,t)=>e.concat(t)),[]))),n}let o9=null;function r9(e,t,n,o){let r=function(e){var t=!(o5&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||r5&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?n5:t5)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),i=k3(S3(r,0))==r.length&&" "!=r,l="",a=!1,s=!1,c=!1;o9&&o9.view==n&&o9.scope==o&&(l=o9.prefix+" ",A6.indexOf(t.keyCode)<0&&(s=!0,o9=null));let u,d,p=new Set,h=e=>{if(e){for(let o of e.run)if(!p.has(o)&&(p.add(o),o(n,t)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),s=!0)}return!1},f=e[o];return f&&(h(f[l+q7(r,t,!i)])?a=!0:i&&(t.altKey||t.metaKey||t.ctrlKey)&&!(W5.windows&&t.ctrlKey&&t.altKey)&&(u=t5[t.keyCode])&&u!=r?(h(f[l+q7(u,t,!0)])||t.shiftKey&&(d=n5[t.keyCode])!=r&&d!=u&&h(f[l+q7(d,t,!1)]))&&(a=!0):i&&t.shiftKey&&h(f[l+q7(r,t,!0)])&&(a=!0),!a&&h(f._any)&&(a=!0)),s&&(a=!0),a&&c&&t.stopPropagation(),a}class i9{constructor(e,t,n,o,r){this.className=e,this.left=t,this.top=n,this.width=o,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let o=e.coordsAtPos(n.head,n.assoc||1);if(!o)return[];let r=l9(e);return[new i9(t,o.left-r.left,o.top-r.top,null,o.bottom-o.top)]}return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let o=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),i=e.textDirection==m8.LTR,l=e.contentDOM,a=l.getBoundingClientRect(),s=l9(e),c=l.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),d=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),p=a.right-(u?parseInt(u.paddingRight):0),h=S6(e,o),f=S6(e,r),g=h.type==l8.Text?h:null,m=f.type==l8.Text?f:null;if(g&&(e.lineWrapping||h.widgetLineBreaks)&&(g=a9(e,o,g)),m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=a9(e,r,m)),g&&m&&g.from==m.from)return b(y(n.from,n.to,g));{let t=g?y(n.from,null,g):O(h,!1),o=m?y(null,n.to,m):O(f,!0),r=[];return(g||h).to<(m||f).from-(g&&m?1:0)||h.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2c&&i.from=r)break;a>o&&s(Math.max(e,o),null==t&&e<=c,Math.min(a,r),null==n&&a>=u,l.dir)}if(o=i.to+1,o>=r)break}return 0==a.length&&s(c,null==t,u,null==n,e.textDirection),{top:r,bottom:l,horizontal:a}}function O(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n)}}function l9(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==m8.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function a9(e,t,n){let o=z3.cursor(t);return{from:Math.max(n.from,e.moveToLineBoundary(o,!1,!0).from),to:Math.min(n.to,e.moveToLineBoundary(o,!0,!0).from),type:l8.Text}}class s9{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(c9)!=e.state.facet(c9)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,n=e.facet(c9);for(;t{return n=e,o=this.drawn[t],!(n.constructor==o.constructor&&n.eq(o));var n,o}))){let t=this.dom.firstChild,n=0;for(let o of e)o.update&&t&&o.constructor&&this.drawn[n].constructor&&o.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(o.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const c9=Q3.define();function u9(e){return[G8.define((t=>new s9(t,e))),c9.of(e)]}const d9=!W5.ios,p9=Q3.define({combine:e=>I4(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function h9(e={}){return[p9.of(e),g9,v9,y9,F8.of(!0)]}function f9(e){return e.startState.facet(p9)!=e.state.facet(p9)}const g9=u9({above:!0,markers(e){let{state:t}=e,n=t.facet(p9),o=[];for(let r of t.selection.ranges){let i=r==t.selection.main;if(r.empty?!i||d9:n.drawRangeCursor){let t=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=r.empty?r:z3.cursor(r.head,r.head>r.anchor?-1:1);for(let r of i9.forRange(e,t,n))o.push(r)}}return o},update(e,t){e.transactions.some((e=>e.selection))&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=f9(e);return n&&m9(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){m9(t.state,e)},class:"cm-cursorLayer"});function m9(e,t){t.style.animationDuration=e.facet(p9).cursorBlinkRate+"ms"}const v9=u9({above:!1,markers:e=>e.state.selection.ranges.map((t=>t.empty?[]:i9.forRange(e,"cm-selectionBackground",t))).reduce(((e,t)=>e.concat(t))),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||f9(e),class:"cm-selectionLayer"}),b9={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};d9&&(b9[".cm-line"].caretColor="transparent !important",b9[".cm-content"]={caretColor:"transparent !important"});const y9=e4.highest(Z7.theme(b9)),O9=v4.define({map:(e,t)=>null==e?null:t.mapPos(e)}),w9=Y3.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce(((e,t)=>t.is(O9)?t.value:e),e))}),x9=G8.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(w9);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(w9)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(w9),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let o=e.scrollDOM.getBoundingClientRect();return{left:n.left-o.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-o.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(w9)!=e&&this.view.dispatch({effects:O9.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function $9(e,t,n,o,r){t.lastIndex=0;for(let i,l=e.iterRange(n,o),a=n;!l.next().done;a+=l.value.length)if(!l.lineBreak)for(;i=t.exec(l.value);)r(a+i.index,i)}class S9{constructor(e){const{regexp:t,decoration:n,decorate:o,boundary:r,maxLength:i=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,o)this.addMatch=(e,t,n,r)=>o(r,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,o,r)=>{let i=n(e,t,o);i&&r(o,o+e[0].length,i)};else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(e,t,o,r)=>r(o,o+e[0].length,n)}this.boundary=r,this.maxLength=i}createDeco(e){let t=new B4,n=t.add.bind(t);for(let{from:o,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let o=[];for(let{from:r,to:i}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),i=Math.min(e.state.doc.lineAt(i).to,i+t),o.length&&o[o.length-1].to>=r?o[o.length-1].to=i:o.push({from:r,to:i});return o}(e,this.maxLength))$9(e.state.doc,this.regexp,o,r,((t,o)=>this.addMatch(o,e,t,n)));return t.finish()}updateDeco(e,t){let n=1e9,o=-1;return e.docChanged&&e.changes.iterChanges(((t,r,i,l)=>{l>e.view.viewport.from&&i1e3?this.createDeco(e.view):o>-1?this.updateRange(e.view,t.map(e.changes),n,o):t}updateRange(e,t,n,o){for(let r of e.visibleRanges){let i=Math.max(r.from,n),l=Math.min(r.to,o);if(l>i){let n=e.state.doc.lineAt(i),o=n.ton.from;i--)if(this.boundary.test(n.text[i-1-n.from])){a=i;break}for(;lu.push(n.range(e,t));if(n==o)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.indexthis.addMatch(n,e,t,d)));t=t.update({filterFrom:a,filterTo:s,filter:(e,t)=>es,add:u})}}return t}}const C9=null!=/x/.unicode?"gu":"g",k9=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",C9),P9={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let T9=null;const M9=Q3.define({combine(e){let t=I4(e,{render:null,specialChars:k9,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==T9&&"undefined"!=typeof document&&document.body){let t=document.body.style;T9=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return T9||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,C9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,C9)),t}});function I9(e={}){return[M9.of(e),E9||(E9=G8.fromClass(class{constructor(e){this.view=e,this.decorations=a8.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(M9)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new S9({regexp:e.specialChars,decoration:(t,n,o)=>{let{doc:r}=n.state,i=S3(t[0],0);if(9==i){let e=r.lineAt(o),t=n.state.tabSize,i=X4(e.text,t,o-e.from);return a8.replace({widget:new R9((t-i%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=a8.replace({widget:new A9(e,i)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(M9);e.startState.facet(M9)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}let E9=null;class A9 extends i8{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=(n=this.code)>=32?"•":10==n?"␤":String.fromCharCode(9216+n);var n;let o=e.state.phrase("Control character")+" "+(P9[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,o,t);if(r)return r;let i=document.createElement("span");return i.textContent=t,i.title=o,i.setAttribute("aria-label",o),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class R9 extends i8{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const D9=a8.line({class:"cm-activeLine"}),j9=G8.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let o of e.state.selection.ranges){let r=e.lineBlockAt(o.head);r.from>t&&(n.push(D9.range(r.from)),t=r.from)}return a8.set(n)}},{decorations:e=>e.decorations});class B9 extends i8{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?u5(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),o=g5(t[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return o.bottom-o.top>1.5*r?{left:o.left,right:o.right,top:o.top,bottom:o.top+r}:o}ignoreEvent(){return!1}}const N9=2e3;function z9(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(n),r=n-o.from,i=r>N9?-1:r==o.length?function(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):X4(o.text,e.state.tabSize,n-o.from);return{line:o.number,col:i,off:r}}function _9(e,t){let n=z9(e,t),o=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),r=e.state.doc.lineAt(t);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},o=o.map(e.changes)}},get(t,r,i){let l=z9(e,t);if(!l)return o;let a=function(e,t,n){let o=Math.min(t.line,n.line),r=Math.max(t.line,n.line),i=[];if(t.off>N9||n.off>N9||t.col<0||n.col<0){let l=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let t=o;t<=r;t++){let n=e.doc.line(t);n.length<=a&&i.push(z3.range(n.from+l,n.to+a))}}else{let l=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let t=o;t<=r;t++){let n=e.doc.line(t),o=Y4(n.text,l,e.tabSize,!0);if(o<0)i.push(z3.cursor(n.to));else{let t=Y4(n.text,a,e.tabSize);i.push(z3.range(n.from+o,n.from+t))}}}return i}(e.state,n,l);return a.length?i?z3.create(a.concat(o.ranges)):z3.create(a):o}}:null}function L9(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return Z7.mouseSelectionStyle.of(((e,n)=>t(n)?_9(e,n):null))}const Q9={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},H9={style:"cursor: crosshair"};function F9(e={}){let[t,n]=Q9[e.key||"Alt"],o=G8.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[o,Z7.contentAttributes.of((e=>{var t;return(null===(t=e.plugin(o))||void 0===t?void 0:t.isDown)?H9:null}))]}const W9="-10000px";class V9{constructor(e,t,n){this.facet=t,this.createTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e)),this.tooltipViews=this.tooltips.map(n)}update(e,t){var n;let o=e.state.facet(this.facet),r=o.filter((e=>e));if(o===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let i=[],l=t?[]:null;for(let a=0;at[n]=e)),t.length=l.length),this.input=o,this.tooltips=r,this.tooltipViews=i,!0}}function Z9(e){let{win:t}=e;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const X9=Q3.define({combine:e=>{var t,n,o;return{position:W5.ios?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find((e=>e.parent)))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(o=e.find((e=>e.tooltipSpace)))||void 0===o?void 0:o.tooltipSpace)||Z9}}}),Y9=new WeakMap,K9=G8.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(X9);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new V9(e,q9,(e=>this.createTooltip(e))),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,o=e.state.facet(X9);if(o.position!=this.position&&!this.madeAbsolute){this.position=o.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(o.parent!=this.parent){this.parent&&this.container.remove(),this.parent=o.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e){let t=e.create(this.view);if(t.dom.classList.add("cm-tooltip"),e.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",t.dom.appendChild(e)}return t.dom.style.position=this.position,t.dom.style.top=W9,t.dom.style.left="0px",this.container.appendChild(t.dom),t.mount&&t.mount(this.view),t}destroy(){var e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),null===(e=n.destroy)||void 0===e||e.call(n);this.parent&&this.container.remove(),null===(t=this.intersectionObserver)||void 0===t||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect(),t=1,n=1,o=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(W5.gecko)o=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==W9&&"0px"==e.style.left){let t=e.getBoundingClientRect();o=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(o||"absolute"==this.position)if(this.parent){let e=this.parent.getBoundingClientRect();e.width&&e.height&&(t=e.width/this.parent.offsetWidth,n=e.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:n}=this.view.viewState);return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map(((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(X9).tooltipSpace(this.view),scaleX:t,scaleY:n,makeAbsolute:o}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{editor:n,space:o,scaleX:r,scaleY:i}=e,l=[];for(let a=0;a=Math.min(n.bottom,o.bottom)||d.rightMath.min(n.right,o.right)+.1){u.style.top=W9;continue}let h=s.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,f=h?7:0,g=p.right-p.left,m=null!==(t=Y9.get(c))&&void 0!==t?t:p.bottom-p.top,v=c.offset||U9,b=this.view.textDirection==m8.LTR,y=p.width>o.right-o.left?b?o.left:o.right-p.width:b?Math.min(d.left-(h?14:0)+v.x,o.right-g):Math.max(o.left,d.left-g+(h?14:0)-v.x),O=this.above[a];!s.strictSide&&(O?d.top-(p.bottom-p.top)-v.yo.bottom)&&O==o.bottom-d.bottom>d.top-o.top&&(O=this.above[a]=!O);let w=(O?d.top-o.top:o.bottom-d.bottom)-f;if(wy&&e.topx&&(x=O?e.top-m-2-f:e.bottom+f+2);if("absolute"==this.position?(u.style.top=(x-e.parent.top)/i+"px",u.style.left=(y-e.parent.left)/r+"px"):(u.style.top=x/i+"px",u.style.left=y/r+"px"),h){let e=d.left+(b?v.x:-v.x)-(y+14-7);h.style.left=e/r+"px"}!0!==c.overlap&&l.push({left:y,top:x,right:$,bottom:x+m}),u.classList.toggle("cm-tooltip-above",O),u.classList.toggle("cm-tooltip-below",!O),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=W9}},{eventObservers:{scroll(){this.maybeMeasure()}}}),G9=Z7.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),U9={x:0,y:0},q9=Q3.define({enables:[K9,G9]}),J9=Q3.define();class eee{static create(e){return new eee(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new V9(e,J9,(e=>this.createHostedView(e)))}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let o=n[e];if(void 0!==o)if(void 0===t)t=o;else if(t!==o)return}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const tee=q9.compute([J9],(e=>{let t=e.facet(J9).filter((e=>e));return 0===t.length?null:{pos:Math.min(...t.map((e=>e.pos))),end:Math.max(...t.map((e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos}))),create:eee.create,above:t[0].above,arrow:t.some((e=>e.arrow))}}));class nee{constructor(e,t,n,o,r){this.view=e,this.source=t,this.field=n,this.setHover=o,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((()=>this.startHover()),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;en.bottom||t.xn.right+e.defaultCharacterWidth)return;let i=e.bidiSpans(e.state.doc.lineAt(o)).find((e=>e.from<=o&&e.to>=o)),l=i&&i.dir==m8.RTL?-1:1;r=t.x{this.pending==t&&(this.pending=null,n&&e.dispatch({effects:this.setHover.of(n)}))}),(t=>Z8(e.state,t,"hover tooltip")))}else i&&e.dispatch({effects:this.setHover.of(i)})}get tooltip(){let e=this.view.plugin(K9),t=e?e.manager.tooltips.findIndex((e=>e.create==eee.create)):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:n,tooltip:o}=this;if(n&&o&&!function(e,t){let n=e.getBoundingClientRect();return t.clientX>=n.left-4&&t.clientX<=n.right+4&&t.clientY>=n.top-4&&t.clientY<=n.bottom+4}(o.dom,e)||this.pending){let{pos:o}=n||this.pending,r=null!==(t=null==n?void 0:n.end)&&void 0!==t?t:o;(o==r?this.view.posAtCoords(this.lastMove)==o:function(e,t,n,o,r,i){let l=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(l.left>o||l.rightr||Math.min(l.bottom,a)=t&&s<=n}(this.view,o,r,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of(null)})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function oee(e,t={}){let n=v4.define(),o=Y3.define({create:()=>null,update(e,o){if(e&&(t.hideOnChange&&(o.docChanged||o.selection)||t.hideOn&&t.hideOn(o,e)))return null;if(e&&o.docChanged){let t=o.changes.mapPos(e.pos,-1,T3.TrackDel);if(null==t)return null;let n=Object.assign(Object.create(null),e);n.pos=t,null!=e.end&&(n.end=o.changes.mapPos(e.end)),e=n}for(let t of o.effects)t.is(n)&&(e=t.value),t.is(iee)&&(e=null);return e},provide:e=>J9.from(e)});return[o,G8.define((r=>new nee(r,e,o,n,t.hoverTime||300))),tee]}function ree(e,t){let n=e.plugin(K9);if(!n)return null;let o=n.manager.tooltips.indexOf(t);return o<0?null:n.manager.tooltipViews[o]}const iee=v4.define(),lee=Q3.define({combine(e){let t,n;for(let o of e)t=t||o.topContainer,n=n||o.bottomContainer;return{topContainer:t,bottomContainer:n}}});function aee(e,t){let n=e.plugin(see),o=n?n.specs.indexOf(t):-1;return o>-1?n.panels[o]:null}const see=G8.fromClass(class{constructor(e){this.input=e.state.facet(dee),this.specs=this.input.filter((e=>e)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(lee);this.top=new cee(e,!0,t.topContainer),this.bottom=new cee(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(lee);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new cee(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new cee(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(dee);if(n!=this.input){let t=n.filter((e=>e)),o=[],r=[],i=[],l=[];for(let n of t){let t,a=this.specs.indexOf(n);a<0?(t=n(e.view),l.push(t)):(t=this.panels[a],t.update&&t.update(e)),o.push(t),(t.top?r:i).push(t)}this.specs=t,this.panels=o,this.top.sync(r),this.bottom.sync(i);for(let e of l)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let o of this.panels)o.update&&o.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Z7.scrollMargins.of((t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}}))});class cee{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=uee(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=uee(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function uee(e){let t=e.nextSibling;return e.remove(),t}const dee=Q3.define({enables:see});class pee extends E4{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}pee.prototype.elementClass="",pee.prototype.toDOM=void 0,pee.prototype.mapMode=T3.TrackBefore,pee.prototype.startSide=pee.prototype.endSide=-1,pee.prototype.point=!0;const hee=Q3.define(),fee={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>j4.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},gee=Q3.define();function mee(e){return[bee(),gee.of(Object.assign(Object.assign({},fee),e))]}const vee=Q3.define({combine:e=>e.some((e=>e))});function bee(e){let t=[yee];return e&&!1===e.fixed&&t.push(vee.of(!0)),t}const yee=G8.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(gee).map((t=>new $ee(e,t)));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!e.state.facet(vee),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,o=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(o<.8*(n.to-n.from))}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(vee)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let n=j4.iter(this.view.state.facet(hee),this.view.viewport.from),o=[],r=this.gutters.map((e=>new xee(e,this.view.viewport,-this.view.documentPadding.top)));for(let i of this.view.viewportLineBlocks)if(o.length&&(o=[]),Array.isArray(i.type)){let e=!0;for(let t of i.type)if(t.type==l8.Text&&e){wee(n,o,t.from);for(let e of r)e.line(this.view,t,o);e=!1}else if(t.widget)for(let e of r)e.widget(this.view,t)}else if(i.type==l8.Text){wee(n,o,i.from);for(let e of r)e.line(this.view,i,o)}else if(i.widget)for(let e of r)e.widget(this.view,i);for(let i of r)i.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(gee),n=e.state.facet(gee),o=e.docChanged||e.heightChanged||e.viewportChanged||!j4.eq(e.startState.facet(hee),e.state.facet(hee),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(o=!0);else{o=!0;let r=[];for(let o of n){let n=t.indexOf(o);n<0?r.push(new $ee(this.view,o)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),r.indexOf(e)<0&&e.destroy();for(let e of r)this.dom.appendChild(e.dom);this.gutters=r}return o}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>Z7.scrollMargins.of((t=>{let n=t.plugin(e);return n&&0!=n.gutters.length&&n.fixed?t.textDirection==m8.LTR?{left:n.dom.offsetWidth*t.scaleX}:{right:n.dom.offsetWidth*t.scaleX}:null}))});function Oee(e){return Array.isArray(e)?e:[e]}function wee(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class xee{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=j4.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:o}=this,r=(t.top-this.height)/e.scaleY,i=t.height/e.scaleY;if(this.i==o.elements.length){let t=new See(e,i,r,n);o.elements.push(t),o.dom.appendChild(t.dom)}else o.elements[this.i].update(e,i,r,n);this.height=t.bottom,this.i++}line(e,t,n){let o=[];wee(this.cursor,o,t.from),n.length&&(o=o.concat(n));let r=this.gutter.config.lineMarker(e,t,o);r&&o.unshift(r);let i=this.gutter;(0!=o.length||i.config.renderEmptyElements)&&this.addElement(e,t,o)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class $ee{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,(o=>{let r,i=o.target;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();r=(e.top+e.bottom)/2}else r=o.clientY;let l=e.lineBlockAtHeight(r-e.documentTop);t.domEventHandlers[n](e,l,o)&&o.preventDefault()}));this.markers=Oee(t.markers(e)),t.initialSpacer&&(this.spacer=new See(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Oee(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!j4.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class See{constructor(e,t,n,o){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,o)}update(e,t,n,o){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;nI4(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let o in t){let e=n[o],r=t[o];n[o]=e?(t,n,o)=>e(t,n,o)||r(t,n,o):r}return n}})});class Pee extends pee{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Tee(e,t){return e.state.facet(kee).formatNumber(t,e.state)}const Mee=gee.compute([kee],(e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(Cee),lineMarker:(e,t,n)=>n.some((e=>e.toDOM))?null:new Pee(Tee(e,e.state.doc.lineAt(t.from).number)),widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(kee)!=e.state.facet(kee),initialSpacer:e=>new Pee(Tee(e,Eee(e.state.doc.lines))),updateSpacer(e,t){let n=Tee(t.view,Eee(t.view.state.doc.lines));return n==e.number?e:new Pee(n)},domEventHandlers:e.facet(kee).domEventHandlers})));function Iee(e={}){return[kee.of(e),bee(),Mee]}function Eee(e){let t=9;for(;t{let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.head).from;r>n&&(n=r,t.push(Aee.range(r)))}return j4.of(t)})),Dee=1024;let jee=0,Bee=class{constructor(e,t){this.from=e,this.to=t}};class Nee{constructor(e={}){this.id=jee++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=Lee.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}Nee.closedBy=new Nee({deserialize:e=>e.split(" ")}),Nee.openedBy=new Nee({deserialize:e=>e.split(" ")}),Nee.group=new Nee({deserialize:e=>e.split(" ")}),Nee.isolate=new Nee({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),Nee.contextHash=new Nee({perNode:!0}),Nee.lookAhead=new Nee({perNode:!0}),Nee.mounted=new Nee({perNode:!0});class zee{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Nee.mounted.id]}}const _ee=Object.create(null);class Lee{constructor(e,t,n,o=0){this.name=e,this.props=t,this.id=n,this.flags=o}static define(e){let t=e.props&&e.props.length?Object.create(null):_ee,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),o=new Lee(e.name||"",t,e.id,n);if(e.props)for(let r of e.props)if(Array.isArray(r)||(r=r(o)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}return o}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(Nee.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let o of n.split(" "))t[o]=e[n];return e=>{for(let n=e.prop(Nee.group),o=-1;o<(n?n.length:0);o++){let r=t[o<0?e.name:n[o]];if(r)return r}}}}Lee.none=new Lee("",Object.create(null),0,8);class Qee{constructor(e){this.types=e;for(let t=0;t=t){let l=new qee(e.tree,e.overlay[0].from+i.from,-1,i);(r||(r=[o])).push(Gee(l,t,n,!1))}}return r?ote(r):o}(this,e,t)}iterate(e){let{enter:t,leave:n,from:o=0,to:r=this.length}=e,i=e.mode||0,l=(i&Wee.IncludeAnonymous)>0;for(let a=this.cursor(i|Wee.IncludeAnonymous);;){let e=!1;if(a.from<=r&&a.to>=o&&(!l&&a.type.isAnonymous||!1!==t(a))){if(a.firstChild())continue;e=!0}for(;e&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;e=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:cte(Lee.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,n)=>new Zee(this.type,e,t,n,this.propValues)),e.makeTree||((e,t,n)=>new Zee(Lee.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:o,maxBufferLength:r=Dee,reused:i=[],minRepeatType:l=o.types.length}=e,a=Array.isArray(n)?new Xee(n,n.length):n,s=o.types,c=0,u=0;function d(e,t,n,b,y,O){let{id:w,start:x,end:$,size:S}=a,C=u;for(;S<0;){if(a.next(),-1==S){let t=i[w];return n.push(t),void b.push(x-e)}if(-3==S)return void(c=w);if(-4==S)return void(u=w);throw new RangeError(`Unrecognized record size: ${S}`)}let k,P,T=s[w],M=x-e;if($-x<=r&&(P=m(a.pos-t,y))){let t=new Uint16Array(P.size-P.skip),n=a.pos-P.size,r=t.length;for(;a.pos>n;)r=v(P.start,t,r);k=new Yee(t,$-P.start,o),M=P.start-e}else{let e=a.pos-S;a.next();let t=[],n=[],o=w>=l?w:-1,i=0,s=$;for(;a.pos>e;)o>=0&&a.id==o&&a.size>=0?(a.end<=s-r&&(f(t,n,x,i,a.end,s,o,C),i=t.length,s=a.end),a.next()):O>2500?p(x,e,t,n):d(x,e,t,n,o,O+1);if(o>=0&&i>0&&i-1&&i>0){let e=h(T);k=cte(T,t,n,0,t.length,0,$-x,e,e)}else k=g(T,t,n,$-x,C-$)}n.push(k),b.push(M)}function p(e,t,n,i){let l=[],s=0,c=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:o}=a;if(o>4)a.next();else{if(c>-1&&t=0;e-=3)t[n++]=l[e],t[n++]=l[e+1]-r,t[n++]=l[e+2]-r,t[n++]=n;n.push(new Yee(t,l[2]-r,o)),i.push(r-e)}}function h(e){return(t,n,o)=>{let r,i,l=0,a=t.length-1;if(a>=0&&(r=t[a])instanceof Zee){if(!a&&r.type==e&&r.length==o)return r;(i=r.prop(Nee.lookAhead))&&(l=n[a]+r.length+i)}return g(e,t,n,o,l)}}function f(e,t,n,r,i,l,a,s){let c=[],u=[];for(;e.length>r;)c.push(e.pop()),u.push(t.pop()+n-i);e.push(g(o.types[a],c,u,l-i,s-l)),t.push(i-n)}function g(e,t,n,o,r=0,i){if(c){let e=[Nee.contextHash,c];i=i?[e].concat(i):[e]}if(r>25){let e=[Nee.lookAhead,r];i=i?[e].concat(i):[e]}return new Zee(e,t,n,o,i)}function m(e,t){let n=a.fork(),o=0,i=0,s=0,c=n.end-r,u={size:0,start:0,skip:0};e:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=o,u.start=i,u.skip=s,s+=4,o+=4,n.next();continue}let a=n.pos-e;if(e<0||a=l?4:0,p=n.start;for(n.next();n.pos>a;){if(n.size<0){if(-3!=n.size)break e;d+=4}else n.id>=l&&(d+=4);n.next()}i=p,o+=e,s+=d}return(t<0||o==e)&&(u.size=o,u.start=i,u.skip=s),u.size>4?u:void 0}function v(e,t,n){let{id:o,start:r,end:i,size:s}=a;if(a.next(),s>=0&&o4){let o=a.pos-(s-4);for(;a.pos>o;)n=v(e,t,n)}t[--n]=l,t[--n]=i-e,t[--n]=r-e,t[--n]=o}else-3==s?c=o:-4==s&&(u=o);return n}let b=[],y=[];for(;a.pos>0;)d(e.start||0,e.bufferStart||0,b,y,-1,0);let O=null!==(t=e.length)&&void 0!==t?t:b.length?y[0]+b[0].length:0;return new Zee(s[e.topID],b.reverse(),y.reverse(),O)}(e)}}Zee.empty=new Zee(Lee.none,[],[],0);class Xee{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Xee(this.buffer,this.index)}}class Yee{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Lee.none}toString(){let e=[];for(let t=0;t0));a=i[a+3]);return l}slice(e,t,n){let o=this.buffer,r=new Uint16Array(t-e),i=0;for(let l=e,a=0;l=t&&nt;case 1:return n<=t&&o>t;case 2:return o>t;case 4:return!0}}function Gee(e,t,n,o){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;e!=s;e+=t){let s=l[e],c=a[e]+i.from;if(Kee(o,n,c,c+s.length))if(s instanceof Yee){if(r&Wee.ExcludeBuffers)continue;let l=s.findChild(0,s.buffer.length,t,n-c,o);if(l>-1)return new nte(new tte(i,s,e,c),null,l)}else if(r&Wee.IncludeAnonymous||!s.type.isAnonymous||lte(s)){let l;if(!(r&Wee.IgnoreMounts)&&(l=zee.get(s))&&!l.overlay)return new qee(l.tree,c,e,i);let a=new qee(s,c,e,i);return r&Wee.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?s.children.length-1:0,t,n,o)}}if(r&Wee.IncludeAnonymous||!i.type.isAnonymous)return null;if(e=i.index>=0?i.index+t:t<0?-1:i._parent._tree.children.length,i=i._parent,!i)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let o;if(!(n&Wee.IgnoreOverlays)&&(o=zee.get(this._tree))&&o.overlay){let n=e-this.from;for(let{from:e,to:r}of o.overlay)if((t>0?e<=n:e=n:r>n))return new qee(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Jee(e,t,n,o){let r=e.cursor(),i=[];if(!r.firstChild())return i;if(null!=n)for(;!r.type.is(n);)if(!r.nextSibling())return i;for(;;){if(null!=o&&r.type.is(o))return i;if(r.type.is(t)&&i.push(r.node),!r.nextSibling())return null==o?i:[]}}function ete(e,t,n=t.length-1){for(let o=e.parent;n>=0;o=o.parent){if(!o)return!1;if(!o.type.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}class tte{constructor(e,t,n,o){this.parent=e,this.buffer=t,this.index=n,this.start=o}}class nte extends Uee{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:o}=this.context,r=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new nte(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&Wee.ExcludeBuffers)return null;let{buffer:o}=this.context,r=o.findChild(this.index+4,o.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new nte(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new nte(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new nte(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,o=this.index+4,r=n.buffer[this.index+3];if(r>o){let i=n.buffer[this.index+1];e.push(n.slice(o,r,i)),t.push(0)}return new Zee(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ote(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;in.from||o.to0){if(this.index-1)for(let o=t+e,r=e<0?-1:n._tree.children.length;o!=r;o+=e){let e=n._tree.children[o];if(this.mode&Wee.IncludeAnonymous||e instanceof Yee||!e.type.isAnonymous||lte(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let i=e;i;i=i._parent)if(i.index==o){if(o==this.index)return i;t=i,n=r+1;break e}o=this.stack[--r]}for(let o=n;o=0;r--){if(r<0)return ete(this.node,e,o);let i=n[t.buffer[this.stack[r]]];if(!i.isAnonymous){if(e[o]&&e[o]!=i.name)return!1;o--}}return!0}}function lte(e){return e.children.some((e=>e instanceof Yee||!e.type.isAnonymous||lte(e)))}const ate=new WeakMap;function ste(e,t){if(!e.isAnonymous||t instanceof Yee||t.type!=e)return 1;let n=ate.get(t);if(null==n){n=1;for(let o of t.children){if(o.type!=e||!(o instanceof Zee)){n=1;break}n+=ste(e,o)}ate.set(t,n)}return n}function cte(e,t,n,o,r,i,l,a,s){let c=0;for(let h=o;h=u)break;f+=t}if(c==r+1){if(f>u){let e=n[r];t(e.children,e.positions,0,e.children.length,o[r]+a);continue}d.push(n[r])}else{let t=o[c-1]+n[c-1].length-h;d.push(cte(e,n,o,r,c,h,t,null,s))}p.push(h+a-i)}}(t,n,o,r,0),(a||s)(d,p,l)}class ute{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let o=this.map.get(e);o||this.map.set(e,o=new Map),o.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof nte?this.setBuffer(e.context.buffer,e.index,t):e instanceof qee&&this.map.set(e.tree,t)}get(e){return e instanceof nte?this.getBuffer(e.context.buffer,e.index):e instanceof qee?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class dte{constructor(e,t,n,o,r=!1,i=!1){this.from=e,this.to=t,this.tree=n,this.offset=o,this.open=(r?1:0)|(i?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let o=[new dte(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&o.push(r);return o}static applyChanges(e,t,n=128){if(!t.length)return e;let o=[],r=1,i=e.length?e[0]:null;for(let l=0,a=0,s=0;;l++){let c=l=n)for(;i&&i.from=t.from||u<=t.to||s){let e=Math.max(t.from,a)-s,n=Math.min(t.to,u)-s;t=e>=n?null:new dte(e,n,t.tree,t.offset+s,l>0,!!c)}if(t&&o.push(t),i.to>u)break;i=rnew Bee(e.from,e.to))):[new Bee(0,0)]:[new Bee(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let o=this.startParse(e,t,n);for(;;){let e=o.advance();if(e)return e}}}class hte{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new Nee({perNode:!0});let fte=0;class gte{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=fte++}static define(e){if(null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let t=new gte([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new vte;return t=>t.modified.indexOf(e)>-1?t:vte.get(t.base||t,t.modified.concat(e).sort(((e,t)=>e.id-t.id)))}}let mte=0;class vte{constructor(){this.instances=[],this.id=mte++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find((n=>{return n.base==e&&(o=t,r=n.modified,o.length==r.length&&o.every(((e,t)=>e==r[t])));var o,r}));if(n)return n;let o=[],r=new gte(o,e,t);for(let l of t)l.instances.push(r);let i=function(e){let t=[[]];for(let n=0;nt.length-e.length))}(t);for(let l of e.set)if(!l.modified.length)for(let e of i)o.push(vte.get(l,e));return r}}function bte(e){let t=Object.create(null);for(let n in e){let o=e[n];Array.isArray(o)||(o=[o]);for(let e of n.split(" "))if(e){let n=[],r=2,i=e;for(let t=0;;){if("..."==i&&t>0&&t+3==e.length){r=1;break}let o=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(i);if(!o)throw new RangeError("Invalid path: "+e);if(n.push("*"==o[0]?"":'"'==o[0][0]?JSON.parse(o[0]):o[0]),t+=o[0].length,t==e.length)break;let l=e[t++];if(t==e.length&&"!"==l){r=0;break}if("/"!=l)throw new RangeError("Invalid path: "+e);i=e.slice(t)}let l=n.length-1,a=n[l];if(!a)throw new RangeError("Invalid path: "+e);let s=new Ote(o,r,l>0?n.slice(0,l):null);t[a]=s.sort(t[a])}}return yte.add(t)}const yte=new Nee;class Ote{constructor(e,t,n,o){this.tags=e,this.mode=t,this.context=n,this.next=o}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth{let t=r;for(let o of e)for(let e of o.set){let o=n[e.id];if(o){t=t?t+" "+o:o;break}}return t},scope:o}}function xte(e,t,n,o=0,r=e.length){let i=new $te(o,Array.isArray(t)?t:[t],n);i.highlightRange(e.cursor(),o,r,"",i.highlighters),i.flush(r)}Ote.empty=new Ote([],2,null);class $te{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,o,r){let{type:i,from:l,to:a}=e;if(l>=n||a<=t)return;i.isTop&&(r=this.highlighters.filter((e=>!e.scope||e.scope(i))));let s=o,c=function(e){let t=e.type.prop(yte);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||Ote.empty,u=function(e,t){let n=null;for(let o of e){let e=o.style(t);e&&(n=n?n+" "+e:e)}return n}(r,c.tags);if(u&&(s&&(s+=" "),s+=u,1==c.mode&&(o+=(o?" ":"")+u)),this.startSpan(Math.max(t,l),s),c.opaque)return;let d=e.tree&&e.tree.prop(Nee.mounted);if(d&&d.overlay){let i=e.node.enter(d.overlay[0].from+l,1),c=this.highlighters.filter((e=>!e.scope||e.scope(d.tree.type))),u=e.firstChild();for(let p=0,h=l;;p++){let f=p=g)&&e.nextSibling()););if(!f||g>n)break;h=f.to+l,h>t&&(this.highlightRange(i.cursor(),Math.max(t,f.from+l),Math.min(n,h),"",c),this.startSpan(Math.min(n,h),s))}u&&e.parent()}else if(e.firstChild()){d&&(o="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,o,r),this.startSpan(Math.min(n,e.to),s)}}while(e.nextSibling());e.parent()}}}const Ste=gte.define,Cte=Ste(),kte=Ste(),Pte=Ste(kte),Tte=Ste(kte),Mte=Ste(),Ite=Ste(Mte),Ete=Ste(Mte),Ate=Ste(),Rte=Ste(Ate),Dte=Ste(),jte=Ste(),Bte=Ste(),Nte=Ste(Bte),zte=Ste(),_te={comment:Cte,lineComment:Ste(Cte),blockComment:Ste(Cte),docComment:Ste(Cte),name:kte,variableName:Ste(kte),typeName:Pte,tagName:Ste(Pte),propertyName:Tte,attributeName:Ste(Tte),className:Ste(kte),labelName:Ste(kte),namespace:Ste(kte),macroName:Ste(kte),literal:Mte,string:Ite,docString:Ste(Ite),character:Ste(Ite),attributeValue:Ste(Ite),number:Ete,integer:Ste(Ete),float:Ste(Ete),bool:Ste(Mte),regexp:Ste(Mte),escape:Ste(Mte),color:Ste(Mte),url:Ste(Mte),keyword:Dte,self:Ste(Dte),null:Ste(Dte),atom:Ste(Dte),unit:Ste(Dte),modifier:Ste(Dte),operatorKeyword:Ste(Dte),controlKeyword:Ste(Dte),definitionKeyword:Ste(Dte),moduleKeyword:Ste(Dte),operator:jte,derefOperator:Ste(jte),arithmeticOperator:Ste(jte),logicOperator:Ste(jte),bitwiseOperator:Ste(jte),compareOperator:Ste(jte),updateOperator:Ste(jte),definitionOperator:Ste(jte),typeOperator:Ste(jte),controlOperator:Ste(jte),punctuation:Bte,separator:Ste(Bte),bracket:Nte,angleBracket:Ste(Nte),squareBracket:Ste(Nte),paren:Ste(Nte),brace:Ste(Nte),content:Ate,heading:Rte,heading1:Ste(Rte),heading2:Ste(Rte),heading3:Ste(Rte),heading4:Ste(Rte),heading5:Ste(Rte),heading6:Ste(Rte),contentSeparator:Ste(Ate),list:Ste(Ate),quote:Ste(Ate),emphasis:Ste(Ate),strong:Ste(Ate),link:Ste(Ate),monospace:Ste(Ate),strikethrough:Ste(Ate),inserted:Ste(),deleted:Ste(),changed:Ste(),invalid:Ste(),meta:zte,documentMeta:Ste(zte),annotation:Ste(zte),processingInstruction:Ste(zte),definition:gte.defineModifier(),constant:gte.defineModifier(),function:gte.defineModifier(),standard:gte.defineModifier(),local:gte.defineModifier(),special:gte.defineModifier()};var Lte;wte([{tag:_te.link,class:"tok-link"},{tag:_te.heading,class:"tok-heading"},{tag:_te.emphasis,class:"tok-emphasis"},{tag:_te.strong,class:"tok-strong"},{tag:_te.keyword,class:"tok-keyword"},{tag:_te.atom,class:"tok-atom"},{tag:_te.bool,class:"tok-bool"},{tag:_te.url,class:"tok-url"},{tag:_te.labelName,class:"tok-labelName"},{tag:_te.inserted,class:"tok-inserted"},{tag:_te.deleted,class:"tok-deleted"},{tag:_te.literal,class:"tok-literal"},{tag:_te.string,class:"tok-string"},{tag:_te.number,class:"tok-number"},{tag:[_te.regexp,_te.escape,_te.special(_te.string)],class:"tok-string2"},{tag:_te.variableName,class:"tok-variableName"},{tag:_te.local(_te.variableName),class:"tok-variableName tok-local"},{tag:_te.definition(_te.variableName),class:"tok-variableName tok-definition"},{tag:_te.special(_te.variableName),class:"tok-variableName2"},{tag:_te.definition(_te.propertyName),class:"tok-propertyName tok-definition"},{tag:_te.typeName,class:"tok-typeName"},{tag:_te.namespace,class:"tok-namespace"},{tag:_te.className,class:"tok-className"},{tag:_te.macroName,class:"tok-macroName"},{tag:_te.propertyName,class:"tok-propertyName"},{tag:_te.operator,class:"tok-operator"},{tag:_te.comment,class:"tok-comment"},{tag:_te.meta,class:"tok-meta"},{tag:_te.invalid,class:"tok-invalid"},{tag:_te.punctuation,class:"tok-punctuation"}]);const Qte=new Nee;function Hte(e){return Q3.define({combine:e?t=>t.concat(e):void 0})}const Fte=new Nee;class Wte{constructor(e,t,n=[],o=""){this.data=e,this.name=o,M4.prototype.hasOwnProperty("tree")||Object.defineProperty(M4.prototype,"tree",{get(){return Xte(this)}}),this.parser=t,this.extension=[nne.of(this),M4.languageData.of(((e,t,n)=>{let o=Vte(e,t,n),r=o.type.prop(Qte);if(!r)return[];let i=e.facet(r),l=o.type.prop(Fte);if(l){let r=o.resolve(t-o.from,n);for(let t of l)if(t.test(r,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(i)}}return i}))].concat(n)}isActiveAt(e,t,n=-1){return Vte(e,t,n).type.prop(Qte)==this.data}findRegions(e){let t=e.facet(nne);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],o=(e,t)=>{if(e.prop(Qte)==this.data)return void n.push({from:t,to:t+e.length});let r=e.prop(Nee.mounted);if(r){if(r.tree.prop(Qte)==this.data){if(r.overlay)for(let e of r.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(r.overlay){let e=n.length;if(o(r.tree,r.overlay[0].from+t),n.length>e)return}}for(let n=0;ne.isTop?t:void 0))]}),e.name)}configure(e,t){return new Zte(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Xte(e){let t=e.field(Wte.state,!1);return t?t.tree:Zee.empty}class Yte{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Kte=null;class Gte{constructor(e,t,n=[],o,r,i,l,a){this.parser=e,this.state=t,this.fragments=n,this.tree=o,this.treeLen=r,this.viewport=i,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new Gte(e,t,[],Zee.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Yte(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=Zee.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((()=>{for(;!(t=this.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(dte.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Kte;Kte=this;try{return e()}finally{Kte=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Ute(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:o,treeLen:r,viewport:i,skipped:l}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,n,o,r)=>t.push({fromA:e,toA:n,fromB:o,toB:r}))),n=dte.applyChanges(n,t),o=Zee.empty,r=0,i={from:e.mapPos(i.from,-1),to:e.mapPos(i.to,1)},this.skipped.length){l=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),o=e.mapPos(t.to,-1);ne.from&&(this.fragments=Ute(this.fragments,t,o),this.skipped.splice(n--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends pte{createParse(t,n,o){let r=o[0].from,i=o[o.length-1].to;return{parsedPos:r,advance(){let t=Kte;if(t){for(let e of o)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=i,new Zee(Lee.none,[],[],i-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return Kte}}function Ute(e,t,n){return dte.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class qte{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new qte(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=Gte.create(e.facet(nne).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new qte(n)}}Wte.state=Y3.define({create:qte.init,update(e,t){for(let n of t.effects)if(n.is(Wte.setState))return n.value;return t.startState.facet(nne)!=t.state.facet(nne)?qte.init(t.state):e.apply(t)}});let Jte=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(Jte=e=>{let t=-1,n=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const ene="undefined"!=typeof navigator&&(null===(Lte=navigator.scheduling)||void 0===Lte?void 0:Lte.isInputPending)?()=>navigator.scheduling.isInputPending():null,tne=G8.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Wte.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Wte.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=Jte(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndo+1e3,a=r.context.work((()=>ene&&ene()||Date.now()>i),o+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Wte.setState.of(new qte(r.context))})),this.chunkBudget>0&&(!a||l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>Z8(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),nne=Q3.define({combine:e=>e.length?e[0]:null,enables:e=>[Wte.state,tne,Z7.contentAttributes.compute([e],(t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}}))]});class one{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const rne=Q3.define(),ine=Q3.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some((e=>e!=t[0])))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function lne(e){let t=e.facet(ine);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function ane(e,t){let n="",o=e.tabSize,r=e.facet(ine)[0];if("\t"==r){for(;t>=o;)n+="\t",t-=o;r=" "}for(let i=0;i=t?function(e,t,n){let o=t.resolveStack(n),r=o.node.enterUnfinishedNodesBefore(n);if(r!=o.node){let e=[];for(let t=r;t!=o.node;t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)o={node:e[t],next:o}}return dne(o,e,n)}(e,n,t):null}class cne{constructor(e,t={}){this.state=e,this.options=t,this.unit=lne(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:o,simulateDoubleBreak:r}=this.options;return null!=o&&o>=n.from&&o<=n.to?r&&o==e?{text:"",from:e}:(t<0?o-1&&(r+=i-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return X4(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:o}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(o);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const une=new Nee;function dne(e,t,n){for(let o=e;o;o=o.next){let e=pne(o.node);if(e)return e(fne.create(t,n,o))}return 0}function pne(e){let t=e.type.prop(une);if(t)return t;let n,o=e.firstChild;if(o&&(n=o.type.prop(Nee.closedBy))){let t=e.lastChild,o=t&&n.indexOf(t.name)>-1;return e=>vne(e,!0,1,void 0,o&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?hne:null}function hne(){return 0}class fne extends cne{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new fne(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(gne(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return dne(this.context.next,this.base,this.pos)}}function gne(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function mne({closing:e,align:t=!0,units:n=1}){return o=>vne(o,t,n,e)}function vne(e,t,n,o,r){let i=e.textAfter,l=i.match(/^\s*/)[0].length,a=o&&i.slice(l,l+o.length)==o||r==e.pos+l,s=t?function(e){let t=e.node,n=t.childAfter(t.from),o=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,i=e.state.doc.lineAt(n.from),l=null==r||r<=i.from?i.to:Math.min(i.to,r);for(let a=n.to;;){let e=t.childAfter(a);if(!e||e==o)return null;if(!e.type.isSkipped)return e.from{let o=e&&e.test(n.textAfter);return n.baseIndent+(o?0:t*n.unit)}}const yne=Q3.define(),One=new Nee;function wne(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function xne(e,t,n){for(let o of e.facet(yne)){let r=o(e,t,n);if(r)return r}return function(e,t,n){let o=Xte(e);if(o.lengthn)continue;if(r&&l.from=t&&o.to>n&&(r=o)}}return r}(e,t,n)}function $ne(e,t){let n=t.mapPos(e.from,1),o=t.mapPos(e.to,-1);return n>=o?void 0:{from:n,to:o}}const Sne=v4.define({map:$ne}),Cne=v4.define({map:$ne});function kne(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some((e=>e.from<=n&&e.to>=n))||t.push(e.lineBlockAt(n));return t}const Pne=Y3.define({create:()=>a8.none,update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(Sne)&&!Mne(e,n.value.from,n.value.to)){let{preparePlaceholder:o}=t.state.facet(Dne),r=o?a8.replace({widget:new zne(o(t.state,n.value))}):Nne;e=e.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(Cne)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:o}=t.selection.main;e.between(o,o,((e,t)=>{eo&&(n=!0)})),n&&(e=e.update({filterFrom:o,filterTo:o,filter:(e,t)=>t<=o||e>=o}))}return e},provide:e=>Z7.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,((e,t)=>{n.push(e,t)})),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{(!r||r.from>e)&&(r={from:e,to:t})})),r}function Mne(e,t,n){let o=!1;return e.between(t,t,((e,r)=>{e==t&&r==n&&(o=!0)})),o}function Ine(e,t){return e.field(Pne,!1)?t:t.concat(v4.appendConfig.of(jne()))}function Ene(e,t,n=!0){let o=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return Z7.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${o} ${e.state.phrase("to")} ${r}.`)}const Ane=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of kne(e)){let n=xne(e.state,t.from,t.to);if(n)return e.dispatch({effects:Ine(e.state,[Sne.of(n),Ene(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(Pne,!1))return!1;let t=[];for(let n of kne(e)){let o=Tne(e.state,n.from,n.to);o&&t.push(Cne.of(o),Ene(e,o,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let o=0;o{let t=e.state.field(Pne,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,((e,t)=>{n.push(Cne.of({from:e,to:t}))})),e.dispatch({effects:n}),!0}}],Rne={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Dne=Q3.define({combine:e=>I4(e,Rne)});function jne(e){let t=[Pne,Hne];return e&&t.push(Dne.of(e)),t}function Bne(e,t){let{state:n}=e,o=n.facet(Dne),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),o=Tne(e.state,n.from,n.to);o&&e.dispatch({effects:Cne.of(o)}),t.preventDefault()};if(o.placeholderDOM)return o.placeholderDOM(e,r,t);let i=document.createElement("span");return i.textContent=o.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=r,i}const Nne=a8.replace({widget:new class extends i8{toDOM(e){return Bne(e,null)}}});class zne extends i8{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Bne(e,this.value)}}const _ne={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Lne extends pee{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function Qne(e={}){let t=Object.assign(Object.assign({},_ne),e),n=new Lne(t,!0),o=new Lne(t,!1),r=G8.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(nne)!=e.state.facet(nne)||e.startState.field(Pne,!1)!=e.state.field(Pne,!1)||Xte(e.startState)!=Xte(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new B4;for(let r of e.viewportLineBlocks){let i=Tne(e.state,r.from,r.to)?o:xne(e.state,r.from,r.to)?n:null;i&&t.add(r.from,r.from,i)}return t.finish()}}),{domEventHandlers:i}=t;return[r,mee({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.markers)||j4.empty},initialSpacer:()=>new Lne(t,!1),domEventHandlers:Object.assign(Object.assign({},i),{click:(e,t,n)=>{if(i.click&&i.click(e,t,n))return!0;let o=Tne(e.state,t.from,t.to);if(o)return e.dispatch({effects:Cne.of(o)}),!0;let r=xne(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:Sne.of(r)}),!0)}})}),jne()]}const Hne=Z7.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Fne{constructor(e,t){let n;function o(e){let t=q4.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const r="string"==typeof t.all?t.all:t.all?o(t.all):void 0,i=t.scope;this.scope=i instanceof Wte?e=>e.prop(Qte)==i.data:i?e=>e==i:void 0,this.style=wte(e.map((e=>({tag:e.tag,class:e.class||o(Object.assign({},e,{tag:null}))}))),{all:r}).style,this.module=n?new q4(n):null,this.themeType=t.themeType}static define(e,t){return new Fne(e,t||{})}}const Wne=Q3.define(),Vne=Q3.define({combine:e=>e.length?[e[0]]:null});function Zne(e){let t=e.facet(Wne);return t.length?t:e.facet(Vne)}function Xne(e,t){let n,o=[Kne];return e instanceof Fne&&(e.module&&o.push(Z7.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?o.push(Vne.of(e)):n?o.push(Wne.computeN([Z7.darkTheme],(t=>t.facet(Z7.darkTheme)==("dark"==n)?[e]:[]))):o.push(Wne.of(e)),o}class Yne{constructor(e){this.markCache=Object.create(null),this.tree=Xte(e.state),this.decorations=this.buildDeco(e,Zne(e.state))}update(e){let t=Xte(e.state),n=Zne(e.state),o=n!=Zne(e.startState);t.length{n.add(e,t,this.markCache[o]||(this.markCache[o]=a8.mark({class:o})))}),o,r);return n.finish()}}const Kne=e4.high(G8.fromClass(Yne,{decorations:e=>e.decorations})),Gne=Fne.define([{tag:_te.meta,color:"#404740"},{tag:_te.link,textDecoration:"underline"},{tag:_te.heading,textDecoration:"underline",fontWeight:"bold"},{tag:_te.emphasis,fontStyle:"italic"},{tag:_te.strong,fontWeight:"bold"},{tag:_te.strikethrough,textDecoration:"line-through"},{tag:_te.keyword,color:"#708"},{tag:[_te.atom,_te.bool,_te.url,_te.contentSeparator,_te.labelName],color:"#219"},{tag:[_te.literal,_te.inserted],color:"#164"},{tag:[_te.string,_te.deleted],color:"#a11"},{tag:[_te.regexp,_te.escape,_te.special(_te.string)],color:"#e40"},{tag:_te.definition(_te.variableName),color:"#00f"},{tag:_te.local(_te.variableName),color:"#30a"},{tag:[_te.typeName,_te.namespace],color:"#085"},{tag:_te.className,color:"#167"},{tag:[_te.special(_te.variableName),_te.macroName],color:"#256"},{tag:_te.definition(_te.propertyName),color:"#00c"},{tag:_te.comment,color:"#940"},{tag:_te.invalid,color:"#f00"}]),Une=Z7.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),qne="()[]{}",Jne=Q3.define({combine:e=>I4(e,{afterCursor:!0,brackets:qne,maxScanDistance:1e4,renderMatch:noe})}),eoe=a8.mark({class:"cm-matchingBracket"}),toe=a8.mark({class:"cm-nonmatchingBracket"});function noe(e){let t=[],n=e.matched?eoe:toe;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const ooe=[Y3.define({create:()=>a8.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],o=t.state.facet(Jne);for(let r of t.state.selection.ranges){if(!r.empty)continue;let e=soe(t.state,r.head,-1,o)||r.head>0&&soe(t.state,r.head-1,1,o)||o.afterCursor&&(soe(t.state,r.head,1,o)||r.headZ7.decorations.from(e)}),Une];function roe(e={}){return[Jne.of(e),ooe]}const ioe=new Nee;function loe(e,t,n){let o=e.prop(t<0?Nee.openedBy:Nee.closedBy);if(o)return o;if(1==e.name.length){let o=n.indexOf(e.name);if(o>-1&&o%2==(t<0?1:0))return[n[o+t]]}return null}function aoe(e){let t=e.type.prop(ioe);return t?t(e.node):e}function soe(e,t,n,o={}){let r=o.maxScanDistance||1e4,i=o.brackets||qne,l=Xte(e),a=l.resolveInner(t,n);for(let s=a;s;s=s.parent){let e=loe(s.type,n,i);if(e&&s.from0?t>=o.from&&to.from&&t<=o.to))return coe(0,0,n,s,o,e,i)}}return function(e,t,n,o,r,i,l){let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),s=l.indexOf(a);if(s<0||s%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let p=0;!u.next().done&&p<=i;){let e=u.value;n<0&&(p+=e.length);let i=t+p*n;for(let t=n>0?0:e.length-1,a=n>0?e.length:-1;t!=a;t+=n){let a=l.indexOf(e[t]);if(!(a<0||o.resolveInner(i+t,1).type!=r))if(a%2==0==n>0)d++;else{if(1==d)return{start:c,end:{from:i+t,to:i+t+1},matched:a>>1==s>>1};d--}}n>0&&(p+=e.length)}return u.done?{start:c,matched:!1}:null}(e,t,n,l,a.type,r,i)}function coe(e,t,n,o,r,i,l){let a=o.parent,s={from:r.from,to:r.to},c=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(o.from):u.childAfter(o.to)))do{if(n<0?u.to<=o.from:u.from>=o.to){if(0==c&&i.indexOf(u.type.name)>-1&&u.from-1||poe.push(e)}function moe(e,t){let n=[];for(let a of t.split(" ")){let t=[];for(let n of a.split(".")){let o=e[n]||_te[n];o?"function"==typeof o?t.length?t=t.map(o):goe(n):t.length?goe(n):t=Array.isArray(o)?o:[o]:goe(n)}for(let e of t)n.push(e)}if(!n.length)return 0;let o=t.replace(/ /g,"_"),r=o+" "+n.map((e=>e.id)),i=hoe[r];if(i)return i.id;let l=hoe[r]=Lee.define({id:doe.length,name:o,props:[bte({[o]:n})]});return doe.push(l),l.id}function voe(e,t){return({state:n,dispatch:o})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(o(n.update(r)),!0)}}m8.RTL,m8.LTR;const boe=voe($oe,0),yoe=voe(xoe,0),Ooe=voe(((e,t)=>xoe(e,t,function(e){let t=[];for(let n of e.selection.ranges){let o=e.doc.lineAt(n.from),r=n.to<=o.to?o:e.doc.lineAt(n.to),i=t.length-1;i>=0&&t[i].to>o.from?t[i].to=r.to:t.push({from:o.from+/^\s*/.exec(o.text)[0].length,to:r.to})}return t}(t))),0);function woe(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function xoe(e,t,n=t.selection.ranges){let o=n.map((e=>woe(t,e.from).block));if(!o.every((e=>e)))return null;let r=n.map(((e,n)=>function(e,{open:t,close:n},o,r){let i,l,a=e.sliceDoc(o-50,o),s=e.sliceDoc(r,r+50),c=/\s*$/.exec(a)[0].length,u=/^\s*/.exec(s)[0].length,d=a.length-c;if(a.slice(d-t.length,d)==t&&s.slice(u,u+n.length)==n)return{open:{pos:o-c,margin:c&&1},close:{pos:r+u,margin:u&&1}};r-o<=100?i=l=e.sliceDoc(o,r):(i=e.sliceDoc(o,o+50),l=e.sliceDoc(r-50,r));let p=/^\s*/.exec(i)[0].length,h=/\s*$/.exec(l)[0].length,f=l.length-h-n.length;return i.slice(p,p+t.length)==t&&l.slice(f,f+n.length)==n?{open:{pos:o+p+t.length,margin:/\s/.test(i.charAt(p+t.length))?1:0},close:{pos:r-h-n.length,margin:/\s/.test(l.charAt(f-1))?1:0}}:null}(t,o[n],e.from,e.to)));if(2!=e&&!r.every((e=>e)))return{changes:t.changes(n.map(((e,t)=>r[t]?[]:[{from:e.from,insert:o[t].open+" "},{from:e.to,insert:" "+o[t].close}])))};if(1!=e&&r.some((e=>e))){let e=[];for(let t,n=0;nr&&(i==l||l>s.from)){r=s.from;let e=/^\s*/.exec(s.text)[0].length,t=e==s.length,i=s.text.slice(e,e+a.length)==a?e:-1;ee.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:r,indent:i,empty:l,single:a}of o)!a&&l||e.push({from:t.from+i,insert:r+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&o.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:n,token:r}of o)if(n>=0){let o=t.from+n,i=o+r.length;" "==t.text[i-t.from]&&i++,e.push({from:o,to:i})}return{changes:e}}return null}const Soe=f4.define(),Coe=f4.define(),koe=Q3.define(),Poe=Q3.define({combine:e=>I4(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,o)=>e(n,o)||t(n,o)})}),Toe=Y3.define({create:()=>Woe.empty,update(e,t){let n=t.state.facet(Poe),o=t.annotation(Soe);if(o){let r=joe.fromTransaction(t,o.selection),i=o.side,l=0==i?e.undone:e.done;return l=r?Boe(l,l.length,n.minDepth,r):_oe(l,t.startState.selection),new Woe(0==i?o.rest:l,0==i?l:o.rest)}let r=t.annotation(Coe);if("full"!=r&&"before"!=r||(e=e.isolate()),!1===t.annotation(b4.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let i=joe.fromTransaction(t),l=t.annotation(b4.time),a=t.annotation(b4.userEvent);return i?e=e.addChanges(i,l,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,a,n.newGroupDelay)),"full"!=r&&"after"!=r||(e=e.isolate()),e},toJSON:e=>({done:e.done.map((e=>e.toJSON())),undone:e.undone.map((e=>e.toJSON()))}),fromJSON:e=>new Woe(e.done.map(joe.fromJSON),e.undone.map(joe.fromJSON))});function Moe(e={}){return[Toe,Poe.of(e),Z7.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?Eoe:"historyRedo"==e.inputType?Aoe:null;return!!n&&(e.preventDefault(),n(t))}})]}function Ioe(e,t){return function({state:n,dispatch:o}){if(!t&&n.readOnly)return!1;let r=n.field(Toe,!1);if(!r)return!1;let i=r.pop(e,n,t);return!!i&&(o(i),!0)}}const Eoe=Ioe(0,!1),Aoe=Ioe(1,!1),Roe=Ioe(0,!0),Doe=Ioe(1,!0);class joe{constructor(e,t,n,o,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=o,this.selectionsAfter=r}setSelAfter(e){return new joe(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((e=>e.toJSON()))}}static fromJSON(e){return new joe(e.changes&&I3.fromJSON(e.changes),[],e.mapped&&M3.fromJSON(e.mapped),e.startSelection&&z3.fromJSON(e.startSelection),e.selectionsAfter.map(z3.fromJSON))}static fromTransaction(e,t){let n=zoe;for(let o of e.startState.facet(koe)){let t=o(e);t.length&&(n=n.concat(t))}return!n.length&&e.changes.empty?null:new joe(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,zoe)}static selection(e){return new joe(void 0,zoe,void 0,void 0,e)}}function Boe(e,t,n,o){let r=t+1>n+20?t-n-1:0,i=e.slice(r,t);return i.push(o),i}function Noe(e,t){return e.length?t.length?e.concat(t):e:t}const zoe=[];function _oe(e,t){if(e.length){let n=e[e.length-1],o=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return o.length&&o[o.length-1].eq(t)?e:(o.push(t),Boe(e,e.length-1,1e9,n.setSelAfter(o)))}return[joe.selection([t])]}function Loe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Qoe(e,t){if(!e.length)return e;let n=e.length,o=zoe;for(;n;){let r=Hoe(e[n-1],t,o);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,o=r.selectionsAfter}return o.length?[joe.selection(o)]:zoe}function Hoe(e,t,n){let o=Noe(e.selectionsAfter.length?e.selectionsAfter.map((e=>e.map(t))):zoe,n);if(!e.changes)return joe.selection(o);let r=e.changes.map(t),i=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(i):i;return new joe(r,v4.mapEffects(e.effects,t),l,e.startSelection.map(i),o)}const Foe=/^(input\.type|delete)($|\.)/;class Woe{constructor(e,t,n=0,o=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=o}isolate(){return this.prevTime?new Woe(this.done,this.undone):this}addChanges(e,t,n,o,r){let i=this.done,l=i[i.length-1];return i=l&&l.changes&&!l.changes.empty&&e.changes&&(!n||Foe.test(n))&&(!l.selectionsAfter.length&&t-this.prevTimen.push(e,t))),t.iterChangedRanges(((e,t,r,i)=>{for(let l=0;l=e&&r<=t&&(o=!0)}})),o}(l.changes,e.changes))||"input.type.compose"==n)?Boe(i,i.length-1,o.minDepth,new joe(e.changes.compose(l.changes),Noe(e.effects,l.effects),l.mapped,l.startSelection,zoe)):Boe(i,i.length,o.minDepth,e),new Woe(i,zoe,t,n)}addSelection(e,t,n,o){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:zoe;return r.length>0&&t-this.prevTimee.empty!=l.ranges[t].empty)).length)?this:new Woe(_oe(this.done,e),this.undone,t,n);var i,l}addMapping(e){return new Woe(Qoe(this.done,e),Qoe(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let o=0==e?this.done:this.undone;if(0==o.length)return null;let r=o[o.length-1],i=r.selectionsAfter[0]||t.selection;if(n&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:Soe.of({side:e,rest:Loe(o),selection:i}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let n=1==o.length?zoe:o.slice(0,o.length-1);return r.mapped&&(n=Qoe(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:Soe.of({side:e,rest:n,selection:i}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}Woe.empty=new Woe(zoe,zoe);const Voe=[{key:"Mod-z",run:Eoe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Aoe,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Aoe,preventDefault:!0},{key:"Mod-u",run:Roe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Doe,preventDefault:!0}];function Zoe(e,t){return z3.create(e.ranges.map(t),e.mainIndex)}function Xoe(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Yoe({state:e,dispatch:t},n){let o=Zoe(e.selection,n);return!o.eq(e.selection,!0)&&(t(Xoe(e,o)),!0)}function Koe(e,t){return z3.cursor(t?e.to:e.from)}function Goe(e,t){return Yoe(e,(n=>n.empty?e.moveByChar(n,t):Koe(n,t)))}function Uoe(e){return e.textDirectionAt(e.state.selection.main.head)==m8.LTR}const qoe=e=>Goe(e,!Uoe(e)),Joe=e=>Goe(e,Uoe(e));function ere(e,t){return Yoe(e,(n=>n.empty?e.moveByGroup(n,t):Koe(n,t)))}function tre(e,t,n){if(t.type.prop(n))return!0;let o=t.to-t.from;return o&&(o>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function nre(e,t,n){let o,r,i=Xte(e).resolveInner(t.head),l=n?Nee.closedBy:Nee.openedBy;for(let a=t.head;;){let t=n?i.childAfter(a):i.childBefore(a);if(!t)break;tre(e,t,l)?i=t:a=n?t.to:t.from}return r=i.type.prop(l)&&(o=n?soe(e,i.from,1):soe(e,i.to,-1))&&o.matched?n?o.end.to:o.end.from:n?i.to:i.from,z3.cursor(r,n?-1:1)}function ore(e,t){return Yoe(e,(n=>{if(!n.empty)return Koe(n,t);let o=e.moveVertically(n,t);return o.head!=n.head?o:e.moveToLineBoundary(n,t)}))}const rre=e=>ore(e,!1),ire=e=>ore(e,!0);function lre(e){let t,n=e.scrollDOM.clientHeightn.empty?e.moveVertically(n,t,o.height):Koe(n,t)));if(i.eq(r.selection))return!1;if(o.selfScroll){let t=e.coordsAtPos(r.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),a=l.top+o.marginTop,s=l.bottom-o.marginBottom;t&&t.top>a&&t.bottomare(e,!1),cre=e=>are(e,!0);function ure(e,t,n){let o=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?o.to:o.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==o.from&&o.length){let n=/^\s*/.exec(e.state.sliceDoc(o.from,Math.min(o.from+100,o.to)))[0].length;n&&t.head!=o.from+n&&(r=z3.cursor(o.from+n))}return r}function dre(e,t){let n=Zoe(e.state.selection,(e=>{let n=t(e);return z3.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)}));return!n.eq(e.state.selection)&&(e.dispatch(Xoe(e.state,n)),!0)}function pre(e,t){return dre(e,(n=>e.moveByChar(n,t)))}const hre=e=>pre(e,!Uoe(e)),fre=e=>pre(e,Uoe(e));function gre(e,t){return dre(e,(n=>e.moveByGroup(n,t)))}function mre(e,t){return dre(e,(n=>e.moveVertically(n,t)))}const vre=e=>mre(e,!1),bre=e=>mre(e,!0);function yre(e,t){return dre(e,(n=>e.moveVertically(n,t,lre(e).height)))}const Ore=e=>yre(e,!1),wre=e=>yre(e,!0),xre=({state:e,dispatch:t})=>(t(Xoe(e,{anchor:0})),!0),$re=({state:e,dispatch:t})=>(t(Xoe(e,{anchor:e.doc.length})),!0),Sre=({state:e,dispatch:t})=>(t(Xoe(e,{anchor:e.selection.main.anchor,head:0})),!0),Cre=({state:e,dispatch:t})=>(t(Xoe(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function kre(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:o}=e,r=o.changeByRange((o=>{let{from:r,to:i}=o;if(r==i){let l=t(o);lr&&(n="delete.forward",l=Pre(e,l,!0)),r=Math.min(r,l),i=Math.max(i,l)}else r=Pre(e,r,!1),i=Pre(e,i,!0);return r==i?{range:o}:{changes:{from:r,to:i},range:z3.cursor(r,rt(e))))o.between(t,t,((e,o)=>{et&&(t=n?o:e)}));return t}const Tre=(e,t)=>kre(e,(n=>{let o,r,i=n.from,{state:l}=e,a=l.doc.lineAt(i);if(!t&&i>a.from&&iTre(e,!1),Ire=e=>Tre(e,!0),Ere=(e,t)=>kre(e,(n=>{let o=n.head,{state:r}=e,i=r.doc.lineAt(o),l=r.charCategorizer(o);for(let e=null;;){if(o==(t?i.to:i.from)){o==n.head&&i.number!=(t?r.doc.lines:1)&&(o+=t?1:-1);break}let a=y3(i.text,o-i.from,t)+i.from,s=i.text.slice(Math.min(o,a)-i.from,Math.max(o,a)-i.from),c=l(s);if(null!=e&&c!=e)break;" "==s&&o==n.head||(e=c),o=a}return o})),Are=e=>Ere(e,!1);function Rre(e){let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.from),i=e.doc.lineAt(o.to);if(o.empty||o.to!=i.from||(i=e.doc.lineAt(o.to-1)),n>=r.number){let e=t[t.length-1];e.to=i.to,e.ranges.push(o)}else t.push({from:r.from,to:i.to,ranges:[o]});n=i.number+1}return t}function Dre(e,t,n){if(e.readOnly)return!1;let o=[],r=[];for(let i of Rre(e)){if(n?i.to==e.doc.length:0==i.from)continue;let t=e.doc.lineAt(n?i.to+1:i.from-1),l=t.length+1;if(n){o.push({from:i.to,to:t.to},{from:i.from,insert:t.text+e.lineBreak});for(let t of i.ranges)r.push(z3.range(Math.min(e.doc.length,t.anchor+l),Math.min(e.doc.length,t.head+l)))}else{o.push({from:t.from,to:i.from},{from:i.to,insert:e.lineBreak+t.text});for(let e of i.ranges)r.push(z3.range(e.anchor-l,e.head-l))}}return!!o.length&&(t(e.update({changes:o,scrollIntoView:!0,selection:z3.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function jre(e,t,n){if(e.readOnly)return!1;let o=[];for(let r of Rre(e))n?o.push({from:r.from,insert:e.doc.slice(r.from,r.to)+e.lineBreak}):o.push({from:r.to,insert:e.lineBreak+e.doc.slice(r.from,r.to)});return t(e.update({changes:o,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Bre=Nre(!1);function Nre(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let o=t.changeByRange((n=>{let{from:o,to:r}=n,i=t.doc.lineAt(o),l=!e&&o==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,o=Xte(e).resolveInner(t),r=o.childBefore(t),i=o.childAfter(t);return r&&i&&r.to<=t&&i.from>=t&&(n=r.type.prop(Nee.closedBy))&&n.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,o);e&&(o=r=(r<=i.to?i:t.doc.lineAt(r)).to);let a=new cne(t,{simulateBreak:o,simulateDoubleBreak:!!l}),s=sne(a,o);for(null==s&&(s=X4(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));ri.from&&o{let r=[];for(let l=o.from;l<=o.to;){let i=e.doc.lineAt(l);i.number>n&&(o.empty||o.to>i.from)&&(t(i,r,o),n=i.number),l=i.to+1}let i=e.changes(r);return{changes:r,range:z3.range(i.mapPos(o.anchor,1),i.mapPos(o.head,1))}}))}const _re=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(zre(e,((t,n)=>{n.push({from:t.from,insert:e.facet(ine)})})),{userEvent:"input.indent"})),!0),Lre=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(zre(e,((t,n)=>{let o=/^\s*/.exec(t.text)[0];if(!o)return;let r=X4(o,e.tabSize),i=0,l=ane(e,Math.max(0,r-lne(e)));for(;iYoe(e,(t=>nre(e.state,t,!Uoe(e)))),shift:e=>dre(e,(t=>nre(e.state,t,!Uoe(e))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>Yoe(e,(t=>nre(e.state,t,Uoe(e)))),shift:e=>dre(e,(t=>nre(e.state,t,Uoe(e))))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>Dre(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>jre(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>Dre(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>jre(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,o=null;return n.ranges.length>1?o=z3.create([n.main]):n.main.empty||(o=z3.create([z3.cursor(n.main.head)])),!!o&&(t(Xoe(e,o)),!0)}},{key:"Mod-Enter",run:Nre(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=Rre(e).map((({from:t,to:n})=>z3.range(t,Math.min(n+1,e.doc.length))));return t(e.update({selection:z3.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=Zoe(e.selection,(t=>{var n;for(let o=Xte(e).resolveStack(t.from,1);o;o=o.next){let{node:e}=o;if((e.from=t.to||e.to>t.to&&e.from<=t.from)&&(null===(n=e.parent)||void 0===n?void 0:n.parent))return z3.range(e.to,e.from)}return t}));return t(Xoe(e,n)),!0},preventDefault:!0},{key:"Mod-[",run:Lre},{key:"Mod-]",run:_re},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),o=new cne(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=zre(e,((t,r,i)=>{let l=sne(o,t.from);if(null==l)return;/\S/.test(t.text)||(l=0);let a=/^\s*/.exec(t.text)[0],s=ane(e,l);(a!=s||i.from{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Rre(t).map((({from:e,to:n})=>(e>0?e--:ne.moveVertically(t,!0))).map(n);return e.dispatch({changes:n,selection:o,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,n){let o=!1,r=Zoe(e.selection,(t=>{let r=soe(e,t.head,-1)||soe(e,t.head,1)||t.head>0&&soe(e,t.head-1,1)||t.head{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),o=woe(e.state,n.from);return o.line?boe(e):!!o.block&&Ooe(e)}},{key:"Alt-A",run:yoe}].concat([{key:"ArrowLeft",run:qoe,shift:hre,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>ere(e,!Uoe(e)),shift:e=>gre(e,!Uoe(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>Yoe(e,(t=>ure(e,t,!Uoe(e)))),shift:e=>dre(e,(t=>ure(e,t,!Uoe(e)))),preventDefault:!0},{key:"ArrowRight",run:Joe,shift:fre,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>ere(e,Uoe(e)),shift:e=>gre(e,Uoe(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>Yoe(e,(t=>ure(e,t,Uoe(e)))),shift:e=>dre(e,(t=>ure(e,t,Uoe(e)))),preventDefault:!0},{key:"ArrowUp",run:rre,shift:vre,preventDefault:!0},{mac:"Cmd-ArrowUp",run:xre,shift:Sre},{mac:"Ctrl-ArrowUp",run:sre,shift:Ore},{key:"ArrowDown",run:ire,shift:bre,preventDefault:!0},{mac:"Cmd-ArrowDown",run:$re,shift:Cre},{mac:"Ctrl-ArrowDown",run:cre,shift:wre},{key:"PageUp",run:sre,shift:Ore},{key:"PageDown",run:cre,shift:wre},{key:"Home",run:e=>Yoe(e,(t=>ure(e,t,!1))),shift:e=>dre(e,(t=>ure(e,t,!1))),preventDefault:!0},{key:"Mod-Home",run:xre,shift:Sre},{key:"End",run:e=>Yoe(e,(t=>ure(e,t,!0))),shift:e=>dre(e,(t=>ure(e,t,!0))),preventDefault:!0},{key:"Mod-End",run:$re,shift:Cre},{key:"Enter",run:Bre},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Mre,shift:Mre},{key:"Delete",run:Ire},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Are},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>Ere(e,!0)},{mac:"Mod-Backspace",run:e=>kre(e,(t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}))},{mac:"Mod-Delete",run:e=>kre(e,(t=>{let n=e.moveToLineBoundary(t,!0).head;return t.headYoe(e,(t=>z3.cursor(e.lineBlockAt(t.head).from,1))),shift:e=>dre(e,(t=>z3.cursor(e.lineBlockAt(t.head).from)))},{key:"Ctrl-e",run:e=>Yoe(e,(t=>z3.cursor(e.lineBlockAt(t.head).to,-1))),shift:e=>dre(e,(t=>z3.cursor(e.lineBlockAt(t.head).to)))},{key:"Ctrl-d",run:Ire},{key:"Ctrl-h",run:Mre},{key:"Ctrl-k",run:e=>kre(e,(t=>{let n=e.lineBlockAt(t.head).to;return t.head{if(e.readOnly)return!1;let n=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:l3.of(["",""])},range:z3.cursor(e.from)})));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,o=e.doc.lineAt(n),r=n==o.from?n-1:y3(o.text,n-o.from,!1)+o.from,i=n==o.to?n+1:y3(o.text,n-o.from,!0)+o.from;return{changes:{from:r,to:i,insert:e.doc.slice(n,i).append(e.doc.slice(r,n))},range:z3.cursor(i)}}));return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:cre}].map((e=>({mac:e.key,run:e.run,shift:e.shift}))))),Hre={key:"Tab",run:_re,shift:Lre};function Fre(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)){var r=n[o];"string"==typeof r?e.setAttribute(o,r):null!=r&&(e[o]=r)}t++}for(;te.normalize("NFKD"):e=>e;class Zre{constructor(e,t,n=0,o=e.length,r,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,o),this.bufferStart=n,this.normalize=r?e=>r(Vre(e)):Vre,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return S3(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=C3(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=k3(e);let o=this.normalize(t);for(let r=0,i=n;;r++){let e=o.charCodeAt(r),l=this.match(e,i);if(r==o.length-1){if(l)return this.value=l,this;break}i==n&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,o=n+t[0].length;if(this.matchPos=Jre(this.text,o+(n==o?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,o,t)))return this.value={from:n,to:o,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=n||o.to<=t){let o=new Ure(t,e.sliceString(t,n));return Gre.set(e,o),o}if(o.from==t&&o.to==n)return o;let{text:r,from:i}=o;return i>t&&(r=e.sliceString(t,i)+r,i=t),o.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=Jre(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ure.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Jre(e,t){if(t>=e.length)return t;let n,o=e.lineAt(t);for(;t=56320&&n<57344;)t++;return t}function eie(e){let t=Fre("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:o}=e,r=o.doc.lineAt(o.selection.main.head),[,i,l,a,s]=n,c=a?+a.slice(1):0,u=l?+l:r.number;if(l&&s){let e=u/100;i&&(e=e*("-"==i?-1:1)+r.number/o.doc.lines),u=Math.round(o.doc.lines*e)}else l&&i&&(u=u*("-"==i?-1:1)+r.number);let d=o.doc.line(Math.max(1,Math.min(o.doc.lines,u))),p=z3.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[tie.of(!1),Z7.scrollIntoView(p.from,{y:"center"})],selection:p}),e.focus()}return{dom:Fre("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:tie.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},Fre("label",e.state.phrase("Go to line"),": ",t)," ",Fre("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(Kre.prototype[Symbol.iterator]=qre.prototype[Symbol.iterator]=function(){return this});const tie=v4.define(),nie=Y3.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(tie)&&(e=n.value);return e},provide:e=>dee.from(e,(e=>e?eie:null))}),oie=Z7.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),rie={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},iie=Q3.define({combine:e=>I4(e,rie,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})});function lie(e){let t=[die,uie];return e&&t.push(iie.of(e)),t}const aie=a8.mark({class:"cm-selectionMatch"}),sie=a8.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function cie(e,t,n,o){return!(0!=n&&e(t.sliceDoc(n-1,n))==C4.Word||o!=t.doc.length&&e(t.sliceDoc(o,o+1))==C4.Word)}const uie=G8.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(iie),{state:n}=e,o=n.selection;if(o.ranges.length>1)return a8.none;let r,i=o.main,l=null;if(i.empty){if(!t.highlightWordAroundCursor)return a8.none;let e=n.wordAt(i.head);if(!e)return a8.none;l=n.charCategorizer(i.head),r=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e200)return a8.none;if(t.wholeWords){if(r=n.sliceDoc(i.from,i.to),l=n.charCategorizer(i.head),!cie(l,n,i.from,i.to)||!function(e,t,n,o){return e(t.sliceDoc(n,n+1))==C4.Word&&e(t.sliceDoc(o-1,o))==C4.Word}(l,n,i.from,i.to))return a8.none}else if(r=n.sliceDoc(i.from,i.to).trim(),!r)return a8.none}let a=[];for(let s of e.visibleRanges){let e=new Zre(n.doc,r,s.from,s.to);for(;!e.next().done;){let{from:o,to:r}=e.value;if((!l||cie(l,n,o,r))&&(i.empty&&o<=i.from&&r>=i.to?a.push(sie.range(o,r)):(o>=i.to||r<=i.from)&&a.push(aie.range(o,r)),a.length>t.maxMatches))return a8.none}}return a8.set(a)}},{decorations:e=>e.decorations}),die=Z7.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),pie=Q3.define({combine:e=>I4(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Qie(e),scrollToMatch:e=>Z7.scrollIntoView(e)})});class hie{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,Yre),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"))}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Oie(this):new mie(this)}getCursor(e,t=0,n){let o=e.doc?e:M4.create({doc:e});return null==n&&(n=o.doc.length),this.regexp?vie(this,o,t,n):gie(this,o,t,n)}}class fie{constructor(e){this.spec=e}}function gie(e,t,n,o){return new Zre(t.doc,e.unquoted,n,o,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(r=t.doc,i=t.charCategorizer(t.selection.main.head),(e,t,n,o)=>((o>e||o+n.length=t)return null;o.push(n.value)}return o}highlight(e,t,n,o){let r=gie(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)o(r.value.from,r.value.to)}}function vie(e,t,n,o){return new Kre(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(r=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(r(bie(n.input,n.index))!=C4.Word||r(yie(n.input,n.index))!=C4.Word)&&(r(yie(n.input,n.index+n[0].length))!=C4.Word||r(bie(n.input,n.index+n[0].length))!=C4.Word)):void 0},n,o);var r}function bie(e,t){return e.slice(y3(e,t,!1),t)}function yie(e,t){return e.slice(t,y3(e,t))}class Oie extends fie{nextMatch(e,t,n){let o=vie(this.spec,e,n,e.doc.length).next();return o.done&&(o=vie(this.spec,e,0,t).next()),o.done?null:o.value}prevMatchInRange(e,t,n){for(let o=1;;o++){let r=Math.max(t,n-1e4*o),i=vie(this.spec,e,r,n),l=null;for(;!i.next().done;)l=i.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,((t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n=t)return null;o.push(n.value)}return o}highlight(e,t,n,o){let r=vie(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)o(r.value.from,r.value.to)}}const wie=v4.define(),xie=v4.define(),$ie=Y3.define({create:e=>new Sie(jie(e).create(),null),update(e,t){for(let n of t.effects)n.is(wie)?e=new Sie(n.value.create(),e.panel):n.is(xie)&&(e=new Sie(e.query,n.value?Die:null));return e},provide:e=>dee.from(e,(e=>e.panel))});class Sie{constructor(e,t){this.query=e,this.panel=t}}const Cie=a8.mark({class:"cm-searchMatch"}),kie=a8.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Pie=G8.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field($ie))}update(e){let t=e.state.field($ie);(t!=e.startState.field($ie)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return a8.none;let{view:n}=this,o=new B4;for(let r=0,i=n.visibleRanges,l=i.length;ri[r+1].from-500;)a=i[++r].to;e.highlight(n.state,t,a,((e,t)=>{let r=n.state.selection.ranges.some((n=>n.from==e&&n.to==t));o.add(e,t,r?kie:Cie)}))}return o.finish()}},{decorations:e=>e.decorations});function Tie(e){return t=>{let n=t.state.field($ie,!1);return n&&n.query.spec.valid?e(t,n):zie(t)}}const Mie=Tie(((e,{query:t})=>{let{to:n}=e.state.selection.main,o=t.nextMatch(e.state,n,n);if(!o)return!1;let r=z3.single(o.from,o.to),i=e.state.facet(pie);return e.dispatch({selection:r,effects:[Wie(e,o),i.scrollToMatch(r.main,e)],userEvent:"select.search"}),Nie(e),!0})),Iie=Tie(((e,{query:t})=>{let{state:n}=e,{from:o}=n.selection.main,r=t.prevMatch(n,o,o);if(!r)return!1;let i=z3.single(r.from,r.to),l=e.state.facet(pie);return e.dispatch({selection:i,effects:[Wie(e,r),l.scrollToMatch(i.main,e)],userEvent:"select.search"}),Nie(e),!0})),Eie=Tie(((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:z3.create(n.map((e=>z3.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),Aie=Tie(((e,{query:t})=>{let{state:n}=e,{from:o,to:r}=n.selection.main;if(n.readOnly)return!1;let i=t.nextMatch(n,o,o);if(!i)return!1;let l,a,s=[],c=[];if(i.from==o&&i.to==r&&(a=n.toText(t.getReplacement(i)),s.push({from:i.from,to:i.to,insert:a}),i=t.nextMatch(n,i.from,i.to),c.push(Z7.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(o).number)+"."))),i){let t=0==s.length||s[0].from>=i.to?0:i.to-i.from-a.length;l=z3.single(i.from-t,i.to-t),c.push(Wie(e,i)),c.push(n.facet(pie).scrollToMatch(l.main,e))}return e.dispatch({changes:s,selection:l,effects:c,userEvent:"input.replace"}),!0})),Rie=Tie(((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map((e=>{let{from:n,to:o}=e;return{from:n,to:o,insert:t.getReplacement(e)}}));if(!n.length)return!1;let o=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Z7.announce.of(o),userEvent:"input.replace.all"}),!0}));function Die(e){return e.state.facet(pie).createPanel(e)}function jie(e,t){var n,o,r,i,l;let a=e.selection.main,s=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!s)return t;let c=e.facet(pie);return new hie({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?s:s.replace(/\n/g,"\\n"),caseSensitive:null!==(o=null==t?void 0:t.caseSensitive)&&void 0!==o?o:c.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:c.literal,regexp:null!==(i=null==t?void 0:t.regexp)&&void 0!==i?i:c.regexp,wholeWord:null!==(l=null==t?void 0:t.wholeWord)&&void 0!==l?l:c.wholeWord})}function Bie(e){let t=aee(e,Die);return t&&t.dom.querySelector("[main-field]")}function Nie(e){let t=Bie(e);t&&t==e.root.activeElement&&t.select()}const zie=e=>{let t=e.state.field($ie,!1);if(t&&t.panel){let n=Bie(e);if(n&&n!=e.root.activeElement){let o=jie(e.state,t.query.spec);o.valid&&e.dispatch({effects:wie.of(o)}),n.focus(),n.select()}}else e.dispatch({effects:[xie.of(!0),t?wie.of(jie(e.state,t.query.spec)):v4.appendConfig.of(Zie)]});return!0},_ie=e=>{let t=e.state.field($ie,!1);if(!t||!t.panel)return!1;let n=aee(e,Die);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:xie.of(!1)}),!0},Lie=[{key:"Mod-f",run:zie,scope:"editor search-panel"},{key:"F3",run:Mie,shift:Iie,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Mie,shift:Iie,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:_ie,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:o,to:r}=n.main,i=[],l=0;for(let a=new Zre(e.doc,e.sliceDoc(o,r));!a.next().done;){if(i.length>1e3)return!1;a.value.from==o&&(l=i.length),i.push(z3.range(a.value.from,a.value.to))}return t(e.update({selection:z3.create(i,l),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=aee(e,eie);if(!t){let n=[tie.of(!0)];null==e.state.field(nie,!1)&&n.push(v4.appendConfig.of([nie,oie])),e.dispatch({effects:n}),t=aee(e,eie)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some((e=>e.from===e.to)))return(({state:e,dispatch:t})=>{let{selection:n}=e,o=z3.create(n.ranges.map((t=>e.wordAt(t.head)||z3.cursor(t.head))),n.mainIndex);return!o.eq(n)&&(t(e.update({selection:o})),!0)})({state:e,dispatch:t});let o=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some((t=>e.sliceDoc(t.from,t.to)!=o)))return!1;let r=function(e,t){let{main:n,ranges:o}=e.selection,r=e.wordAt(n.head),i=r&&r.from==n.from&&r.to==n.to;for(let l=!1,a=new Zre(e.doc,t,o[o.length-1].to);;){if(a.next(),!a.done){if(l&&o.some((e=>e.from==a.value.from)))continue;if(i){let t=e.wordAt(a.value.from);if(!t||t.from!=a.value.from||t.to!=a.value.to)continue}return a.value}if(l)return null;a=new Zre(e.doc,t,0,Math.max(0,o[o.length-1].from-1)),l=!0}}(e,o);return!!r&&(t(e.update({selection:e.selection.addRange(z3.range(r.from,r.to),!1),effects:Z7.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class Qie{constructor(e){this.view=e;let t=this.query=e.state.field($ie).query.spec;function n(e,t,n){return Fre("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=Fre("input",{value:t.search,placeholder:Hie(e,"Find"),"aria-label":Hie(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Fre("input",{value:t.replace,placeholder:Hie(e,"Replace"),"aria-label":Hie(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Fre("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Fre("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Fre("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=Fre("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",(()=>Mie(e)),[Hie(e,"next")]),n("prev",(()=>Iie(e)),[Hie(e,"previous")]),n("select",(()=>Eie(e)),[Hie(e,"all")]),Fre("label",null,[this.caseField,Hie(e,"match case")]),Fre("label",null,[this.reField,Hie(e,"regexp")]),Fre("label",null,[this.wordField,Hie(e,"by word")]),...e.state.readOnly?[]:[Fre("br"),this.replaceField,n("replace",(()=>Aie(e)),[Hie(e,"replace")]),n("replaceAll",(()=>Rie(e)),[Hie(e,"replace all")])],Fre("button",{name:"close",onclick:()=>_ie(e),"aria-label":Hie(e,"close"),type:"button"},["×"])])}commit(){let e=new hie({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:wie.of(e)}))}keydown(e){var t,n,o;t=this.view,n=e,o="search-panel",r9(n9(t.state),n,t,o)?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Iie:Mie)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),Aie(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(wie)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(pie).top}}function Hie(e,t){return e.state.phrase(t)}const Fie=/[\s\.,:;?!]/;function Wie(e,{from:t,to:n}){let o=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,i=Math.max(o.from,t-30),l=Math.min(r,n+30),a=e.state.sliceDoc(i,l);if(i!=o.from)for(let s=0;s<30;s++)if(!Fie.test(a[s+1])&&Fie.test(a[s])){a=a.slice(s);break}if(l!=r)for(let s=a.length-1;s>a.length-30;s--)if(!Fie.test(a[s-1])&&Fie.test(a[s])){a=a.slice(0,s);break}return Z7.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${o.number}.`)}const Vie=Z7.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Zie=[$ie,e4.low(Pie),Vie];class Xie{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=Xte(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),o=t.text.slice(n-t.from,this.pos-t.from),r=o.search(qie(e,!1));return r<0?null:{from:n+r,to:this.pos,text:o.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function Yie(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function Kie(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[n,o]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e{let r=e.matchBefore(o);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}class Gie{constructor(e,t,n,o){this.completion=e,this.source=t,this.match=n,this.score=o}}function Uie(e){return e.selection.main.from}function qie(e,t){var n;let{source:o}=e,r=t&&"^"!=o[0],i="$"!=o[o.length-1];return r||i?new RegExp(`${r?"^":""}(?:${o})${i?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const Jie=f4.define(),ele=new WeakMap;function tle(e){if(!Array.isArray(e))return e;let t=ele.get(e);return t||ele.set(e,t=Kie(e)),t}const nle=v4.define(),ole=v4.define();class rle{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&o<=57||o>=97&&o<=122?2:o>=65&&o<=90?1:0:(s=C3(o))!=s.toLowerCase()?1:s!=s.toUpperCase()?2:0;(!v||1==b&&g||0==y&&0!=b)&&(t[u]==o||n[u]==o&&(d=!0)?i[u++]=v:i.length&&(m=!1)),y=b,v+=k3(o)}return u==a&&0==i[0]&&m?this.result((d?-200:0)-100,i,e):p==a&&0==h?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):p==a?this.ret(-900-e.length,[h,f]):u==a?this.result((d?-200:0)-100-700+(m?0:-1100),i,e):2!=t.length&&this.result((o[0]?-700:0)-200-1100,o,e)}result(e,t,n){let o=[],r=0;for(let i of t){let e=i+(this.astral?k3(S3(n,i)):1);r&&o[r-1]==i?o[r-1]=e:(o[r++]=i,o[r++]=e)}return this.ret(e-n.length,o)}}const ile=Q3.define({combine:e=>I4(e,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:ale,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>lle(e(n),t(n)),optionClass:(e,t)=>n=>lle(e(n),t(n)),addToOptions:(e,t)=>e.concat(t)})});function lle(e,t){return e?t?e+" "+t:e:t}function ale(e,t,n,o,r,i){let l,a,s=e.textDirection==m8.RTL,c=s,u=!1,d="top",p=t.left-r.left,h=r.right-t.right,f=o.right-o.left,g=o.bottom-o.top;if(c&&p=g||e>t.top?l=n.bottom-t.top:(d="bottom",l=t.bottom-n.top)}return{style:`${d}: ${l/((t.bottom-t.top)/i.offsetHeight)}px; max-width: ${a/((t.right-t.left)/i.offsetWidth)}px`,class:"cm-completionInfo-"+(u?s?"left-narrow":"right-narrow":c?"left":"right")}}function sle(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let o=Math.floor((e-t)/n);return{from:e-(o+1)*n,to:e-o*n}}class cle{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let o=e.state.field(t),{options:r,selected:i}=o.open,l=e.state.facet(ile);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map((e=>"cm-completionIcon-"+e))),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,o){let r=document.createElement("span");r.className="cm-completionLabel";let i=e.displayLabel||e.label,l=0;for(let a=0;al&&r.appendChild(document.createTextNode(i.slice(l,e)));let n=r.appendChild(document.createElement("span"));n.appendChild(document.createTextNode(i.slice(e,t))),n.className="cm-completionMatchedText",l=t}return le.position-t.position)).map((e=>e.render))}(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=sle(r.length,i,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",(n=>{let{options:o}=e.state.field(t).open;for(let t,r=n.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(t=/-(\d+)$/.exec(r.id))&&+t[1]{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(ile).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:ole.of(null)})})),this.showOptions(r,o.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(e){var t;let n=e.state.field(this.stateField),o=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=o){let{options:r,selected:i,disabled:l}=n.open;o.open&&o.open.options==r||(this.range=sle(r.length,i,e.state.facet(ile).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),l!=(null===(t=o.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=sle(t.options.length,t.selected,this.view.state.facet(ile).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:o}=n;if(!o)return;let r="string"==typeof o?document.createTextNode(o):o(n);if(!r)return;"then"in r?r.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)})).catch((e=>Z8(this.view.state,e,"completion info"))):this.addInfoPane(r,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:o}=e;n.appendChild(t),this.infoDestroy=o||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,o=this.range.from;n;n=n.nextSibling,o++)"LI"==n.nodeName&&n.id?o==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected"):o--;return t&&function(e,t){let n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.height/e.offsetHeight;o.topn.bottom&&(e.scrollTop+=(o.bottom-n.bottom)/r)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),o=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:e.innerWidth,bottom:e.innerHeight}}return o.top>Math.min(r.bottom,t.bottom)-10||o.bottomn.from||0==n.from)&&(r=e,"string"!=typeof s&&s.header?o.appendChild(s.header(s)):o.appendChild(document.createElement("completion-section")).textContent=e)}const c=o.appendChild(document.createElement("li"));c.id=t+"-"+i,c.setAttribute("role","option");let u=this.optionClass(l);u&&(c.className=u);for(let e of this.optionContent){let t=e(l,this.view.state,this.view,a);t&&c.appendChild(t)}}return n.from&&o.classList.add("cm-completionListIncompleteTop"),n.tonew cle(n,e,t)}function dle(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class ple{constructor(e,t,n,o,r,i){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=o,this.selected=r,this.disabled=i}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new ple(this.options,gle(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,o,r){let i=function(e,t){let n=[],o=null,r=e=>{n.push(e);let{section:t}=e.completion;if(t){o||(o=[]);let e="string"==typeof t?t:t.name;o.some((t=>t.name==e))||o.push("string"==typeof t?{name:e}:t)}};for(let s of e)if(s.hasResult()){let e=s.result.getMatch;if(!1===s.result.filter)for(let t of s.result.options)r(new Gie(t,s.source,e?e(t):[],1e9-n.length));else{let n=new rle(t.sliceDoc(s.from,s.to));for(let t of s.result.options)if(n.match(t.label)){let o=t.displayLabel?e?e(t,n.matched):[]:n.matched;r(new Gie(t,s.source,o,n.score+(t.boost||0)))}}}if(o){let e=Object.create(null),t=0,r=(e,t)=>{var n,o;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(o=t.rank)&&void 0!==o?o:1e9)||(e.namet.score-e.score||a(e.completion,t.completion)))){let e=s.completion;!l||l.label!=e.label||l.detail!=e.detail||null!=l.type&&null!=e.type&&l.type!=e.type||l.apply!=e.apply||l.boost!=e.boost?i.push(s):dle(s.completion)>dle(l)&&(i[i.length-1]=s),l=s.completion}return i}(e,t);if(!i.length)return o&&e.some((e=>1==e.state))?new ple(o.options,o.attrs,o.tooltip,o.timestamp,o.selected,!0):null;let l=t.facet(ile).selectOnOpen?0:-1;if(o&&o.selected!=l&&-1!=o.selected){let e=o.options[o.selected].completion;for(let t=0;tt.hasResult()?Math.min(e,t.from):e),1e8),create:Sle,above:r.aboveCursor},o?o.timestamp:Date.now(),l,!1)}map(e){return new ple(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class hle{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new hle(mle,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(ile),o=(n.override||t.languageDataAt("autocomplete",Uie(t)).map(tle)).map((t=>(this.active.find((e=>e.source==t))||new ble(t,this.active.some((e=>0!=e.state))?1:0)).update(e,n)));o.length==this.active.length&&o.every(((e,t)=>e==this.active[t]))&&(o=this.active);let r=this.open;r&&e.docChanged&&(r=r.map(e.changes)),e.selection||o.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let n=0,o=0;;){for(;n1==e.state))&&(r=null),!r&&o.every((e=>1!=e.state))&&o.some((e=>e.hasResult()))&&(o=o.map((e=>e.hasResult()?new ble(e.source,0):e)));for(let i of e.effects)i.is(wle)&&(r=r&&r.setSelected(i.value,this.id));return o==this.active&&r==this.open?this:new hle(o,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:fle}}const fle={"aria-autocomplete":"list"};function gle(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const mle=[];function vle(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class ble{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=vle(e),o=this;n?o=o.handleUserEvent(e,n,t):e.docChanged?o=o.handleChange(e):e.selection&&0!=o.state&&(o=new ble(o.source,0));for(let r of e.effects)if(r.is(nle))o=new ble(o.source,1,r.value?Uie(e.state):-1);else if(r.is(ole))o=new ble(o.source,0);else if(r.is(Ole))for(let e of r.value)e.source==o.source&&(o=e);return o}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new ble(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(Uie(e.startState))?new ble(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new ble(this.source,this.state,e.mapPos(this.explicitPos))}}class yle extends ble{constructor(e,t,n,o,r){super(e,2,t),this.result=n,this.from=o,this.to=r}hasResult(){return!0}handleUserEvent(e,t,n){var o;let r=e.changes.mapPos(this.from),i=e.changes.mapPos(this.to,1),l=Uie(e.state);if((this.explicitPos<0?l<=r:li||"delete"==t&&Uie(e.startState)==this.from)return new ble(this.source,"input"==t&&n.activateOnTyping?1:0);let a,s=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,n,o){if(!e)return!1;let r=t.sliceDoc(n,o);return"function"==typeof e?e(r,n,o,t):qie(e,!0).test(r)}(this.result.validFor,e.state,r,i)?new yle(this.source,s,this.result,r,i):this.result.update&&(a=this.result.update(this.result,r,i,new Xie(e.state,l,s>=0)))?new yle(this.source,s,a,a.from,null!==(o=a.to)&&void 0!==o?o:Uie(e.state)):new ble(this.source,1,s)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new ble(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new yle(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}const Ole=v4.define({map:(e,t)=>e.map((e=>e.map(t)))}),wle=v4.define(),xle=Y3.define({create:()=>hle.start(),update:(e,t)=>e.update(t),provide:e=>[q9.from(e,(e=>e.tooltip)),Z7.contentAttributes.from(e,(e=>e.attrs))]});function $le(e,t){const n=t.completion.apply||t.completion.label;let o=e.state.field(xle).active.find((e=>e.source==t.source));return o instanceof yle&&("string"==typeof n?e.dispatch(Object.assign(Object.assign({},function(e,t,n,o){let{main:r}=e.selection,i=n-r.from,l=o-r.from;return Object.assign(Object.assign({},e.changeByRange((a=>a!=r&&n!=o&&e.sliceDoc(a.from+i,a.from+l)!=e.sliceDoc(n,o)?{range:a}:{changes:{from:a.from+i,to:o==r.from?a.to:a.from+l,insert:t},range:z3.cursor(a.from+i+t.length)}))),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,n,o.from,o.to)),{annotations:Jie.of(t.completion)})):n(e,t.completion,o.from,o.to),!0)}const Sle=ule(xle,$le);function Cle(e,t="option"){return n=>{let o=n.state.field(xle,!1);if(!o||!o.open||o.open.disabled||Date.now()-o.open.timestamp-1?o.open.selected+i*(e?1:-1):e?0:l-1;return a<0?a="page"==t?0:l-1:a>=l&&(a="page"==t?l-1:0),n.dispatch({effects:wle.of(a)}),!0}}class kle{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Ple=G8.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let t of e.state.field(xle).active)1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(xle);if(!e.selectionSet&&!e.docChanged&&e.startState.field(xle)==t)return;let n=e.transactions.some((e=>(e.selection||e.docChanged)&&!vle(e)));for(let o=0;o50&&Date.now()-t.time>1e3){for(let e of t.context.abortListeners)try{e()}catch(Rpe){Z8(this.view.state,Rpe)}t.context.abortListeners=null,this.running.splice(o--,1)}else t.updates.push(...e.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=t.active.some((e=>1==e.state&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),50):-1,0!=this.composing)for(let o of e.transactions)"input"==vle(o)?this.composing=2:2==this.composing&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:e}=this.view,t=e.field(xle);for(let n of t.active)1!=n.state||this.running.some((e=>e.active.source==n.source))||this.startQuery(n)}startQuery(e){let{state:t}=this.view,n=Uie(t),o=new Xie(t,n,e.explicitPos==n),r=new kle(e,o);this.running.push(r),Promise.resolve(e.source(o)).then((e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())}),(e=>{this.view.dispatch({effects:ole.of(null)}),Z8(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(ile).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(ile);for(let o=0;oe.source==r.active.source));if(i&&1==i.state)if(null==r.done){let e=new ble(r.active.source,0);for(let t of r.updates)e=e.update(t,n);1!=e.state&&t.push(e)}else this.startQuery(i)}t.length&&this.view.dispatch({effects:Ole.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(xle,!1);if(t&&t.tooltip&&this.view.state.facet(ile).closeOnBlur){let n=t.open&&ree(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||this.view.dispatch({effects:ole.of(null)})}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:nle.of(!1)})),20),this.composing=0}}}),Tle=Z7.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Mle{constructor(e,t,n,o){this.field=e,this.line=t,this.from=n,this.to=o}}class Ile{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,T3.TrackDel),n=e.mapPos(this.to,1,T3.TrackDel);return null==t||null==n?null:new Ile(this.field,t,n)}}class Ele{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],o=[t],r=e.doc.lineAt(t),i=/^\s*/.exec(r.text)[0];for(let l of this.lines){if(n.length){let n=i,r=/^\t*/.exec(l)[0].length;for(let t=0;tnew Ile(e.field,o[e.line]+e.from,o[e.line]+e.to)))}}static parse(e){let t,n=[],o=[],r=[];for(let i of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(i);){let e=t[1]?+t[1]:null,l=t[2]||t[3]||"",a=-1;for(let t=0;t=a&&e.field++}r.push(new Mle(a,o.length,t.index,t.index+l.length)),i=i.slice(0,t.index)+l+i.slice(t.index+t[0].length)}for(let e;e=/\\([{}])/.exec(i);){i=i.slice(0,e.index)+e[1]+i.slice(e.index+e[0].length);for(let t of r)t.line==o.length&&t.from>e.index&&(t.from--,t.to--)}o.push(i)}return new Ele(o,r)}}let Ale=a8.widget({widget:new class extends i8{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),Rle=a8.mark({class:"cm-snippetField"});class Dle{constructor(e,t){this.ranges=e,this.active=t,this.deco=a8.set(e.map((e=>(e.from==e.to?Ale:Rle).range(e.from,e.to))))}map(e){let t=[];for(let n of this.ranges){let o=n.map(e);if(!o)return null;t.push(o)}return new Dle(t,this.active)}selectionInsideField(e){return e.ranges.every((e=>this.ranges.some((t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))))}}const jle=v4.define({map:(e,t)=>e&&e.map(t)}),Ble=v4.define(),Nle=Y3.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(jle))return n.value;if(n.is(Ble)&&e)return new Dle(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Z7.decorations.from(e,(e=>e?e.deco:a8.none))});function zle(e,t){return z3.create(e.filter((e=>e.field==t)).map((e=>z3.range(e.from,e.to))))}function _le(e){let t=Ele.parse(e);return(e,n,o,r)=>{let{text:i,ranges:l}=t.instantiate(e.state,o),a={changes:{from:o,to:r,insert:l3.of(i)},scrollIntoView:!0,annotations:n?Jie.of(n):void 0};if(l.length&&(a.selection=zle(l,0)),l.length>1){let t=new Dle(l,0),n=a.effects=[jle.of(t)];void 0===e.state.field(Nle,!1)&&n.push(v4.appendConfig.of([Nle,Fle,Vle,Tle]))}e.dispatch(e.state.update(a))}}function Lle(e){return({state:t,dispatch:n})=>{let o=t.field(Nle,!1);if(!o||e<0&&0==o.active)return!1;let r=o.active+e,i=e>0&&!o.ranges.some((t=>t.field==r+e));return n(t.update({selection:zle(o.ranges,r),effects:jle.of(i?null:new Dle(o.ranges,r)),scrollIntoView:!0})),!0}}const Qle=[{key:"Tab",run:Lle(1),shift:Lle(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(Nle,!1)&&(t(e.update({effects:jle.of(null)})),!0)}],Hle=Q3.define({combine:e=>e.length?e[0]:Qle}),Fle=e4.highest(e9.compute([Hle],(e=>e.facet(Hle))));function Wle(e,t){return Object.assign(Object.assign({},t),{apply:_le(e)})}const Vle=Z7.domEventHandlers({mousedown(e,t){let n,o=t.state.field(Nle,!1);if(!o||null==(n=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let r=o.ranges.find((e=>e.from<=n&&e.to>=n));return!(!r||r.field==o.active||(t.dispatch({selection:zle(o.ranges,r.field),effects:jle.of(o.ranges.some((e=>e.field>r.field))?new Dle(o.ranges,r.field):null),scrollIntoView:!0}),0))}}),Zle={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Xle=v4.define({map(e,t){let n=t.mapPos(e,-1,T3.TrackAfter);return null==n?void 0:n}}),Yle=new class extends E4{};Yle.startSide=1,Yle.endSide=-1;const Kle=Y3.define({create:()=>j4.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(Xle)&&(e=e.update({add:[Yle.range(n.value,n.value+1)]}));return e}}),Gle="()[]{}<>";function Ule(e){for(let t=0;t<8;t+=2)if(Gle.charCodeAt(t)==e)return Gle.charAt(t+1);return C3(e<128?e:e+1)}function qle(e,t){return e.languageDataAt("closeBrackets",t)[0]||Zle}const Jle="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),eae=Z7.inputHandler.of(((e,t,n,o)=>{if((Jle?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(o.length>2||2==o.length&&1==k3(S3(o,0))||t!=r.from||n!=r.to)return!1;let i=function(e,t){let n=qle(e,e.selection.main.head),o=n.brackets||Zle.brackets;for(let r of o){let i=Ule(S3(r,0));if(t==r)return i==r?lae(e,r,o.indexOf(r+r+r)>-1,n):rae(e,r,i,n.before||Zle.before);if(t==i&&nae(e,e.selection.main.from))return iae(e,0,i)}return null}(e.state,o);return!!i&&(e.dispatch(i),!0)})),tae=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=qle(e,e.selection.main.head).brackets||Zle.brackets,o=null,r=e.changeByRange((t=>{if(t.empty){let o=function(e,t){let n=e.sliceString(t-2,t);return k3(S3(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let r of n)if(r==o&&oae(e.doc,t.head)==Ule(S3(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:z3.cursor(t.head-r.length)}}return{range:o=t}}));return o||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!o}}];function nae(e,t){let n=!1;return e.field(Kle).between(0,e.doc.length,(e=>{e==t&&(n=!0)})),n}function oae(e,t){let n=e.sliceString(t,t+2);return n.slice(0,k3(S3(n,0)))}function rae(e,t,n,o){let r=null,i=e.changeByRange((i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:n,from:i.to}],effects:Xle.of(i.to+t.length),range:z3.range(i.anchor+t.length,i.head+t.length)};let l=oae(e.doc,i.head);return!l||/\s/.test(l)||o.indexOf(l)>-1?{changes:{insert:t+n,from:i.head},effects:Xle.of(i.head+t.length),range:z3.cursor(i.head+t.length)}:{range:r=i}}));return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function iae(e,t,n){let o=null,r=e.changeByRange((t=>t.empty&&oae(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:z3.cursor(t.head+n.length)}:o={range:t}));return o?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function lae(e,t,n,o){let r=o.stringPrefixes||Zle.stringPrefixes,i=null,l=e.changeByRange((o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:t,from:o.to}],effects:Xle.of(o.to+t.length),range:z3.range(o.anchor+t.length,o.head+t.length)};let l,a=o.head,s=oae(e.doc,a);if(s==t){if(aae(e,a))return{changes:{insert:t+t,from:a},effects:Xle.of(a+t.length),range:z3.cursor(a+t.length)};if(nae(e,a)){let o=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+o.length,insert:o},range:z3.cursor(a+o.length)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(l=sae(e,a-2*t.length,r))>-1&&aae(e,l))return{changes:{insert:t+t+t+t,from:a},effects:Xle.of(a+t.length),range:z3.cursor(a+t.length)};if(e.charCategorizer(a)(s)!=C4.Word&&sae(e,a,r)>-1&&!function(e,t,n,o){let r=Xte(e).resolveInner(t,-1),i=o.reduce(((e,t)=>Math.max(e,t.length)),0);for(let l=0;l<5;l++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+i)),a=l.indexOf(n);if(!a||a>-1&&o.indexOf(l.slice(0,a))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let s=r.to==t&&r.parent;if(!s)break;r=s}return!1}(e,a,t,r))return{changes:{insert:t+t,from:a},effects:Xle.of(a+t.length),range:z3.cursor(a+t.length)}}return{range:i=o}}));return i?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function aae(e,t){let n=Xte(e).resolveInner(t+1);return n.parent&&n.from==t}function sae(e,t,n){let o=e.charCategorizer(t);if(o(e.sliceDoc(t-1,t))!=C4.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&o(e.sliceDoc(n-1,n))!=C4.Word)return n}return-1}function cae(e={}){return[xle,ile.of(e),Ple,dae,Tle]}const uae=[{key:"Ctrl-Space",run:e=>!!e.state.field(xle,!1)&&(e.dispatch({effects:nle.of(!0)}),!0)},{key:"Escape",run:e=>{let t=e.state.field(xle,!1);return!(!t||!t.active.some((e=>0!=e.state))||(e.dispatch({effects:ole.of(null)}),0))}},{key:"ArrowDown",run:Cle(!0)},{key:"ArrowUp",run:Cle(!1)},{key:"PageDown",run:Cle(!0,"page")},{key:"PageUp",run:Cle(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(xle,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.facet(ile).defaultKeymap?[uae]:[])));class pae{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class hae{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let o=e,r=n.facet(Pae).markerFilter;r&&(o=r(o));let i=a8.set(o.map((e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?a8.widget({widget:new Aae(e),diagnostic:e}).range(e.from):a8.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity+(e.markClass?" "+e.markClass:"")},diagnostic:e}).range(e.from,e.to))),!0);return new hae(i,t,fae(i))}}function fae(e,t=null,n=0){let o=null;return e.between(n,1e9,((e,n,{spec:r})=>{if(!t||r.diagnostic==t)return o=new pae(e,n,r.diagnostic),!1})),o}function gae(e,t){let n=e.startState.doc.lineAt(t.pos);return!(!e.effects.some((e=>e.is(vae)))&&!e.changes.touchesRange(n.from,n.to))}function mae(e,t){return e.field(Oae,!1)?t:t.concat(v4.appendConfig.of(Zae))}const vae=v4.define(),bae=v4.define(),yae=v4.define(),Oae=Y3.define({create:()=>new hae(a8.none,null,null),update(e,t){if(t.docChanged){let n=e.diagnostics.map(t.changes),o=null;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);o=fae(n,e.selected.diagnostic,r)||fae(n,null,r)}e=new hae(n,e.panel,o)}for(let n of t.effects)n.is(vae)?e=hae.init(n.value,e.panel,t.state):n.is(bae)?e=new hae(e.diagnostics,n.value?Dae.open:null,e.selected):n.is(yae)&&(e=new hae(e.diagnostics,e.panel,n.value));return e},provide:e=>[dee.from(e,(e=>e.panel)),Z7.decorations.from(e,(e=>e.diagnostics))]}),wae=a8.mark({class:"cm-lintRange cm-lintRange-active"});function xae(e,t,n){let{diagnostics:o}=e.state.field(Oae),r=[],i=2e8,l=0;o.between(t-(n<0?1:0),t+(n>0?1:0),((e,o,{spec:a})=>{t>=e&&t<=o&&(e==o||(t>e||n>0)&&(t({dom:$ae(e,r)})}:null}function $ae(e,t){return Fre("ul",{class:"cm-tooltip-lint"},t.map((t=>Eae(e,t,!1))))}const Sae=e=>{let t=e.state.field(Oae,!1);return!(!t||!t.panel||(e.dispatch({effects:bae.of(!1)}),0))},Cae=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(Oae,!1);t&&t.panel||e.dispatch({effects:mae(e.state,[bae.of(!0)])});let n=aee(e,Dae.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(Oae,!1);if(!t)return!1;let n=e.state.selection.main,o=t.diagnostics.iter(n.to+1);return!(!o.value&&(o=t.diagnostics.iter(0),!o.value||o.from==n.from&&o.to==n.to)||(e.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0}),0))}}],kae=G8.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(Pae);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){let e=Date.now();if(ePromise.resolve(e(this.view))))).then((t=>{let n=t.reduce(((e,t)=>e.concat(t)));this.view.state.doc==e.doc&&this.view.dispatch(function(e,t){return{effects:mae(e,[vae.of(t)])}}(this.view.state,n))}),(e=>{Z8(this.view.state,e)}))}}update(e){let t=e.state.facet(Pae);(e.docChanged||t!=e.startState.facet(Pae)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Pae=Q3.define({combine:e=>Object.assign({sources:e.map((e=>e.source))},I4(e.map((e=>e.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function Tae(e,t={}){return[Pae.of({source:e,config:t}),kae,Zae]}function Mae(e){let t=e.plugin(kae);t&&t.force()}function Iae(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;ee.toLowerCase()==o.toLowerCase()))){t.push(o);continue e}}t.push("")}return t}function Eae(e,t,n){var o;let r=n?Iae(t.actions):[];return Fre("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Fre("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage():t.message),null===(o=t.actions)||void 0===o?void 0:o.map(((n,o)=>{let i=!1,l=o=>{if(o.preventDefault(),i)return;i=!0;let r=fae(e.state.field(Oae).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:a}=n,s=r[o]?a.indexOf(r[o]):-1,c=s<0?a:[a.slice(0,s),Fre("u",a.slice(s,s+1)),a.slice(s+1)];return Fre("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${a}${s<0?"":` (access key "${r[o]})"`}.`},c)})),t.source&&Fre("div",{class:"cm-diagnosticSource"},t.source))}class Aae extends i8{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Fre("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Rae{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=Eae(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Dae{constructor(e){this.view=e,this.items=[],this.list=Fre("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)Sae(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],o=Iae(n.actions);for(let r=0;r{for(let t=0;tSae(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Oae).selected;if(!e)return-1;for(let t=0;t{let a,s=-1;for(let t=n;tn&&(this.items.splice(n,s-n),o=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),r=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}));n({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.topt.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=fae(this.view.state.field(Oae).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:yae.of(t)})}static open(e){return new Dae(e)}}function jae(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function Bae(e){return jae(``,'width="6" height="3"')}const Nae=Z7.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Bae("#d11")},".cm-lintRange-warning":{backgroundImage:Bae("orange")},".cm-lintRange-info":{backgroundImage:Bae("#999")},".cm-lintRange-hint":{backgroundImage:Bae("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function zae(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}class _ae extends pee{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce(((e,t)=>zae(e)function(e,t,n){function o(){let o=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(o.from)&&e.dispatch({effects:Fae.of({pos:o.from,above:!1,create:()=>({dom:$ae(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,function(e,t){let n=o=>{let r=t.getBoundingClientRect();if(!(o.clientX>r.left-10&&o.clientXr.top-10&&o.clientY{clearTimeout(i),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(i),i=setTimeout(o,r)}}(e,t,n)),t}}function Lae(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let o=[];for(let r in n)o.push(new _ae(n[r]).range(+r));return j4.of(o,!0)}const Qae=mee({class:"cm-gutter-lint",markers:e=>e.state.field(Hae)}),Hae=Y3.define({create:()=>j4.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(Xae).markerFilter;for(let o of t.effects)if(o.is(vae)){let r=o.value;n&&(r=n(r||[])),e=Lae(t.state.doc,r.slice(0))}return e}}),Fae=v4.define(),Wae=Y3.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=gae(t,e)?null:Object.assign(Object.assign({},e),{pos:t.changes.mapPos(e.pos)})),t.effects.reduce(((e,t)=>t.is(Fae)?t.value:e),e)),provide:e=>q9.from(e)}),Vae=Z7.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:jae('')},".cm-lint-marker-warning":{content:jae('')},".cm-lint-marker-error":{content:jae('')}}),Zae=[Oae,Z7.decorations.compute([Oae],(e=>{let{selected:t,panel:n}=e.field(Oae);return t&&n&&t.from!=t.to?a8.set([wae.range(t.from,t.to)]):a8.none})),oee(xae,{hideOn:gae}),Nae],Xae=Q3.define({combine:e=>I4(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});function Yae(e={}){return[Xae.of(e),Hae,Qae,Vae,Wae]}const Kae=(()=>[Iee(),Ree,I9(),Moe(),Qne(),h9(),[w9,x9],M4.allowMultipleSelections.of(!0),M4.transactionFilter.of((e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:o}=e.newSelection.main,r=n.lineAt(o);if(o>r.from+200)return e;let i=n.sliceString(r.from,o);if(!t.some((e=>e.test(i))))return e;let{state:l}=e,a=-1,s=[];for(let{head:c}of l.selection.ranges){let e=l.doc.lineAt(c);if(e.from==a)continue;a=e.from;let t=sne(l,e.from);if(null==t)continue;let n=/^\s*/.exec(e.text)[0],o=ane(l,t);n!=o&&s.push({from:e.from,to:e.from+n.length,insert:o})}return s.length?[e,{changes:s,sequential:!0}]:e})),Xne(Gne,{fallback:!0}),roe(),[eae,Kle],cae(),L9(),F9(),j9,lie(),e9.of([...tae,...Qre,...Lie,...Voe,...Ane,...uae,...Cae])])(),Gae=(()=>[I9(),Moe(),h9(),Xne(Gne,{fallback:!0}),e9.of([...Qre,...Voe])])();function Uae(e,t={},n){const{props:o,domProps:r,on:i,...l}=t,a=i?(e=>e?Object.entries(e).reduce(((e,[t,n])=>({...e,[t=`on${t=t.charAt(0).toUpperCase()+t.slice(1)}`]:n})),{}):{})(i):{};return Kr(e,{...l,...o,...r,...a},n)}var qae=Ln({name:"CodeMirror",model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,default:""},theme:{type:Object,default:()=>{}},dark:{type:Boolean,default:!1},basic:{type:Boolean,default:!1},minimal:{type:Boolean,default:!1},placeholder:{type:String,default:void 0},wrap:{type:Boolean,default:!1},tab:{type:Boolean,default:!1},allowMultipleSelections:{type:Boolean,default:!1},tabSize:{type:Number,default:void 0},lineSeparator:{type:String,default:void 0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},extensions:{type:Array,default:()=>[]},phrases:{type:Object,default:()=>{}},lang:{type:Object,default:()=>{}},linter:{type:Function,default:void 0},linterConfig:{type:Object,default:()=>({})},forceLinting:{type:Boolean,default:!1},gutter:{type:Boolean,defalt:!1},gutterConfig:{type:Object,default:()=>{}},tag:{type:String,default:"div"}},emits:{"update:modelValue":e=>!0,update:e=>!0,ready:e=>!0,focus:e=>!0,change:e=>!0,destroy:()=>!0},setup(e,t){const n=Ot(),o=Ot(e.modelValue),r=wt(new Z7),i=Yr({get:()=>r.value.hasFocus,set:e=>{e&&r.value.focus()}}),l=Yr({get:()=>r.value.state.selection,set:e=>r.value.dispatch({selection:e})}),a=Yr({get:()=>r.value.state.selection.main.head,set:e=>r.value.dispatch({selection:{anchor:e}})}),s=Yr({get:()=>r.value.state.toJSON(),set:e=>r.value.setState(M4.fromJSON(e))}),c=Ot(0),u=Ot(0),d=Yr((()=>{const n=new n4,o=new n4;return[e.basic?Kae:void 0,e.minimal&&!e.basic?Gae:void 0,Z7.updateListener.of((n=>{t.emit("focus",r.value.hasFocus),c.value=r.value.state.doc.length,!n.changes.empty&&n.docChanged&&(e.linter&&(e.forceLinting&&Mae(r.value),u.value=e.linter(r.value).length),t.emit("update",n))})),Z7.theme(e.theme,{dark:e.dark}),e.wrap?Z7.lineWrapping:void 0,e.tab?e9.of([Hre]):void 0,M4.allowMultipleSelections.of(e.allowMultipleSelections),e.tabSize?o.of(M4.tabSize.of(e.tabSize)):void 0,e.phrases?M4.phrases.of(e.phrases):void 0,M4.readOnly.of(e.readonly),Z7.editable.of(!e.disabled),e.lineSeparator?M4.lineSeparator.of(e.lineSeparator):void 0,e.lang?n.of(e.lang):void 0,e.linter?Tae(e.linter,e.linterConfig):void 0,e.linter&&e.gutter?Yae(e.gutterConfig):void 0,e.placeholder?(i=e.placeholder,G8.fromClass(class{constructor(e){this.view=e,this.placeholder=i?a8.set([a8.widget({widget:new B9(i),side:1}).range(0)]):a8.none}get decorations(){return this.view.state.doc.length?a8.none:this.placeholder}},{decorations:e=>e.decorations})):void 0,...e.extensions].filter((e=>!!e));var i}));wn(d,(e=>{var t;null==(t=r.value)||t.dispatch({effects:v4.reconfigure.of(e)})}),{immediate:!0}),wn((()=>e.modelValue),(async t=>{r.value.composing||r.value.state.doc.toJSON().join(e.lineSeparator??"\n")===t||r.value.dispatch({changes:{from:0,to:r.value.state.doc.length,insert:t},selection:r.value.state.selection,scrollIntoView:!0})}),{immediate:!0}),Gn((async()=>{let e=o.value;n.value&&(n.value.childNodes[0]&&(o.value,e=n.value.childNodes[0].innerText.trim()),r.value=new Z7({parent:n.value,state:M4.create({doc:e,extensions:d.value}),dispatch:e=>{r.value.update([e]),!e.changes.empty&&e.docChanged&&(t.emit("update:modelValue",e.state.doc.toString()),t.emit("change",e.state))}}),await Vt(),t.emit("ready",{view:r.value,state:r.value.state,container:n.value}))})),eo((()=>{r.value.destroy(),t.emit("destroy")}));const p={editor:n,view:r,cursor:a,selection:l,focus:i,length:c,json:s,diagnosticCount:u,dom:r.value.contentDOM,lint:()=>{!e.linter||!r.value||(e.forceLinting&&Mae(r.value),u.value=function(e){let t=e.field(Oae,!1);return t?t.diagnostics.size:0}(r.value.state))},forceReconfigure:()=>{var e,t;null==(e=r.value)||e.dispatch({effects:v4.reconfigure.of([])}),null==(t=r.value)||t.dispatch({effects:v4.appendConfig.of(d.value)})},getRange:(e,t)=>r.value.state.sliceDoc(e,t),getLine:e=>r.value.state.doc.line(e+1).text,lineCount:()=>r.value.state.doc.lines,getCursor:()=>r.value.state.selection.main.head,listSelections:()=>{let e;return null!==(e=r.value.state.selection.ranges)&&void 0!==e?e:[]},getSelection:()=>{let e;return null!==(e=r.value.state.sliceDoc(r.value.state.selection.main.from,r.value.state.selection.main.to))&&void 0!==e?e:""},getSelections:()=>{const e=r.value.state;return e?e.selection.ranges.map((t=>e.sliceDoc(t.from,t.to))):[]},somethingSelected:()=>r.value.state.selection.ranges.some((e=>!e.empty)),replaceRange:(e,t,n)=>r.value.dispatch({changes:{from:t,to:n,insert:e}}),replaceSelection:e=>r.value.dispatch(r.value.state.replaceSelection(e)),setCursor:e=>r.value.dispatch({selection:{anchor:e}}),setSelection:(e,t)=>r.value.dispatch({selection:{anchor:e,head:t}}),setSelections:(e,t)=>r.value.dispatch({selection:z3.create(e,t)}),extendSelectionsBy:e=>r.value.dispatch({selection:z3.create(l.value.ranges.map((t=>t.extend(e(t)))))})};return t.expose(p),p},render(){return Uae(this.$props.tag,{ref:"editor",class:"vue-codemirror"},this.$slots.default?Uae("aside",{style:"display: none;","aria-hidden":"true"},"function"==typeof(e=this.$slots.default)?e():e):void 0);var e}});const Jae="#e06c75",ese="#abb2bf",tse="#7d8799",nse="#d19a66",ose="#2c313a",rse="#282c34",ise="#353a42",lse="#528bff",ase=[Z7.theme({"&":{color:ese,backgroundColor:rse},".cm-content":{caretColor:lse},".cm-cursor, .cm-dropCursor":{borderLeftColor:lse},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:ese},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:rse,color:tse,border:"none"},".cm-activeLineGutter":{backgroundColor:ose},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ise},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ise,borderBottomColor:ise},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:ose,color:ese}}},{dark:!0}),Xne(Fne.define([{tag:_te.keyword,color:"#c678dd"},{tag:[_te.name,_te.deleted,_te.character,_te.propertyName,_te.macroName],color:Jae},{tag:[_te.function(_te.variableName),_te.labelName],color:"#61afef"},{tag:[_te.color,_te.constant(_te.name),_te.standard(_te.name)],color:nse},{tag:[_te.definition(_te.name),_te.separator],color:ese},{tag:[_te.typeName,_te.className,_te.number,_te.changed,_te.annotation,_te.modifier,_te.self,_te.namespace],color:"#e5c07b"},{tag:[_te.operator,_te.operatorKeyword,_te.url,_te.escape,_te.regexp,_te.link,_te.special(_te.string)],color:"#56b6c2"},{tag:[_te.meta,_te.comment],color:tse},{tag:_te.strong,fontWeight:"bold"},{tag:_te.emphasis,fontStyle:"italic"},{tag:_te.strikethrough,textDecoration:"line-through"},{tag:_te.link,color:tse,textDecoration:"underline"},{tag:_te.heading,fontWeight:"bold",color:Jae},{tag:[_te.atom,_te.bool,_te.special(_te.variableName)],color:nse},{tag:[_te.processingInstruction,_te.string,_te.inserted],color:"#98c379"},{tag:_te.invalid,color:"#ffffff"}]))];var sse={};class cse{constructor(e,t,n,o,r,i,l,a,s,c=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=o,this.pos=r,this.score=i,this.buffer=l,this.bufferBase=a,this.curContext=s,this.lookAhead=c,this.parent=u}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let o=e.parser.context;return new cse(e,[],t,n,n,0,[],0,o?new use(o,o.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,o=65535&e,{parser:r}=this.p,i=r.dynamicPrecedence(o);if(i&&(this.score+=i),0==n)return this.pushState(r.getGoto(this.state,o,!0),this.reducePos),o=2e3&&!(null===(t=this.p.parser.nodeSet.types[o])||void 0===t?void 0:t.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=s):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(o,a)}storeNode(e,t,n,o=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[o-4]&&e.buffer[o-1]>-1){if(t==n)return;if(e.buffer[o-2]>=t)return void(e.buffer[o-2]=n)}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,o>4&&(o-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=n,this.buffer[r+3]=o}else this.buffer.push(e,t,n,o)}shift(e,t,n,o){if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:i}=this.p;(o>this.pos||t<=i.maxNode)&&(this.pos=o,i.stateFlag(r,1)||(this.reducePos=o)),this.pushState(r,n),this.shiftContext(t,n),t<=i.maxNode&&this.buffer.push(t,n,o,4)}else this.pos=o,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,o,4)}apply(e,t,n,o){65536&e?this.reduce(e):this.shift(e,t,n,o)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let o=this.pos;this.reducePos=this.pos=o+e.length,this.pushState(t,o),this.buffer.push(n,o,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),o=e.bufferBase+t;for(;e&&o==e.bufferBase;)e=e.parent;return new cse(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,o,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new dse(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if(0==(65536&n))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let o,r=0;r1&t&&e==o))||n.push(t[e],o)}t=n}let n=[];for(let o=0;o>19,o=65535&t,r=this.stack.length-3*n;if(r<0||e.getGoto(this.stack[r],o,!1)<0){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(o,r)=>{if(!t.includes(o))return t.push(o),e.allActions(o,(t=>{if(393216&t);else if(65536&t){let n=(t>>19)-r;if(n>1){let o=65535&t,r=this.stack.length-3*n;if(r>=0&&e.getGoto(this.stack[r],o,!1)>=0)return n<<19|65536|o}}else{let e=n(t,r+1);if(null!=e)return e}}))};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class use{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class dse{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let o=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=o}}class pse{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new pse(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new pse(this.stack,this.pos,this.index)}}function hse(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let o=0,r=0;o=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,n=!0),i+=r,n)break;i*=46}n?n[r++]=i:n=new t(i)}return n}class fse{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const gse=new fse;class mse{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=gse,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,o=this.rangeIndex,r=this.pos+e;for(;rn.to:r>=n.to;){if(o==this.ranges.length-1)return null;let e=this.ranges[++o];r+=e.from-n.to,n=e}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t,n,o=this.chunkOff+e;if(o>=0&&o=this.chunk2Pos&&to.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=gse,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let o of this.ranges){if(o.from>=t)break;o.to>e&&(n+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}return n}}class vse{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Ose(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}vse.prototype.contextual=vse.prototype.fallback=vse.prototype.extend=!1;class bse{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?hse(e):e}token(e,t){let n=e.pos,o=0;for(;;){let n=e.next<0,r=e.resolveOffset(1,1);if(Ose(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(n||o++,null==r)break;e.reset(r,e.token)}o&&(e.reset(n,e.token),e.acceptToken(this.elseToken,o))}}bse.prototype.contextual=vse.prototype.fallback=vse.prototype.extend=!1;class yse{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ose(e,t,n,o,r,i){let l=0,a=1<0){let n=e[d];if(s.allows(n)&&(-1==t.token.value||t.token.value==n||xse(n,t.token.value,r,i))){t.acceptToken(n);break}}let o=t.next,c=0,u=e[l+2];if(!(t.next<0&&u>c&&65535==e[n+3*u-3])){for(;c>1,i=n+r+(r<<1),a=e[i],s=e[i+1]||65536;if(o=s)){l=e[i+2],t.advance();continue e}c=r+1}}break}l=e[n+3*u-1]}}function wse(e,t,n){for(let o,r=t;65535!=(o=e[r]);r++)if(o==n)return r-t;return-1}function xse(e,t,n,o){let r=wse(n,o,t);return r<0||wse(n,o,e)t)&&!o.type.isError)return n<0?Math.max(0,Math.min(o.to-1,t-25)):Math.min(e.length,Math.max(o.from+1,t+25));if(n<0?o.prevSibling():o.nextSibling())break;if(!o.parent())return n<0?0:e.length}}class kse{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Cse(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Cse(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=i,null;if(r instanceof Zee){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+r.length}}}class Pse{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new fse))}getActions(e){let t=0,n=null,{parser:o}=e.p,{tokenizers:r}=o,i=o.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let s=0;sc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let r=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!o.extend&&(n=c,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||(n=new fse,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new fse,{pos:n,p:o}=e;return t.start=n,t.end=Math.min(n+1,o.stream.end),t.value=n==o.stream.end?o.parser.eofTerm:0,t}updateCachedToken(e,t,n){let o=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(o,e),n),e.value>-1){let{parser:t}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(o+1)}putAction(e,t,n,o){for(let r=0;r4*e.bufferLength?new kse(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,o=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;io)r.push(l);else{if(this.advanceStack(l,r,n))continue;{e||(e=[],t=[]),e.push(l);let n=this.tokens.getMainToken(l);t.push(n.value,n.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(n)return this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>o))&&this.recovering--}else if(r.length>1){e:for(let e=0;e500&&o.buffer.length>500){if(!((t.score-o.score||t.buffer.length-o.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(n--,1)}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let i=1;ithis.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let i=this.fragments.nodeAt(o);i;){let o=this.parser.nodeSet.types[i.type.id]==i.type?r.getGoto(e.state,i.type.id):-1;if(o>-1&&i.length&&(!t||(i.prop(Nee.contextHash)||0)==n))return e.useNode(i,o),!0;if(!(i instanceof Zee)||0==i.children.length||i.positions[0]>0)break;let l=i.children[0];if(!(l instanceof Zee&&0==i.positions[0]))break;i=l}}let i=r.stateSlot(e.state,4);if(i>0)return e.reduce(i),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let a=0;ao?t.push(u):n.push(u)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Mse(e,t),!0}}runRecovery(e,t,n){let o=null,r=!1;for(let i=0;i ":"";if(l.deadEnd){if(r)continue;if(r=!0,l.restart(),this.advanceFully(l,n))continue}let u=l.split(),d=c;for(let e=0;u.forceReduce()&&e<10&&!this.advanceFully(u,n);e++)$se&&(d=this.stackID(u)+" -> ");for(let e of l.recoverByInsert(a))this.advanceFully(e,n);this.stream.end>l.pos?(s==l.pos&&(s++,a=0),l.recoverByDelete(a,s),Mse(l,n)):(!o||o.scoree;class Ase extends pte{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[t][1])),o=[];for(let l=0;l=0)r(n,e,l[t++]);else{let o=l[t+-n];for(let i=-n;i>0;i--)r(l[t++],e,o);t++}}}this.nodeSet=new Qee(t.map(((t,r)=>Lee.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:o[r],top:n.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Dee;let i=hse(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l"number"==typeof e?new vse(i,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let o=new Tse(this,e,t,n);for(let r of this.wrappers)o=r(o,e,t,n);return o}getGoto(e,t,n=!1){let o=this.goto;if(t>=o[0])return-1;for(let r=o[t+1];;){let t=o[r++],i=1&t,l=o[r++];if(i&&n)return l;for(let n=r+(t>>1);r0}validAction(e,t){return!!this.allActions(e,(e=>e==t||null))}allActions(e,t){let n=this.stateSlot(e,4),o=n?t(n):void 0;for(let r=this.stateSlot(e,1);null==o;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=Rse(this.data,r+2)}o=t(Rse(this.data,r+1))}return o}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=Rse(this.data,n+2)}if(0==(1&this.data[n+2])){let e=this.data[n+1];t.some(((t,n)=>1&n&&t==e))||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(Ase.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map((t=>{let n=e.tokenizers.find((e=>e.from==t));return n?n.to:t}))),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map(((n,o)=>{let r=e.specializers.find((e=>e.from==n.external));if(!r)return n;let i=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[o]=Dse(i),i}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map((()=>!1));if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let o=null;for(let r=0;re.external(n,o)<<1|t}return e.get}const jse=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Bse=new class{constructor(e){this.start=e.start,this.shift=e.shift||Ese,this.reduce=e.reduce||Ese,this.reuse=e.reuse||Ese,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}({start:!1,shift:(e,t)=>4==t||5==t||312==t?e:313==t,strict:!1}),Nse=new yse(((e,t)=>{let{next:n}=e;(125==n||-1==n||t.context)&&e.acceptToken(310)}),{contextual:!0,fallback:!0}),zse=new yse(((e,t)=>{let n,{next:o}=e;jse.indexOf(o)>-1||(47!=o||47!=(n=e.peek(1))&&42!=n)&&(125==o||59==o||-1==o||t.context||e.acceptToken(309))}),{contextual:!0}),_se=new yse(((e,t)=>{let{next:n}=e;if((43==n||45==n)&&(e.advance(),n==e.next)){e.advance();let n=!t.context&&t.canShift(1);e.acceptToken(n?1:2)}}),{contextual:!0});function Lse(e,t){return e>=65&&e<=90||e>=97&&e<=122||95==e||e>=192||!t&&e>=48&&e<=57}const Qse=new yse(((e,t)=>{if(60!=e.next||!t.dialectEnabled(0))return;if(e.advance(),47==e.next)return;let n=0;for(;jse.indexOf(e.next)>-1;)e.advance(),n++;if(Lse(e.next,!0)){for(e.advance(),n++;Lse(e.next,!1);)e.advance(),n++;for(;jse.indexOf(e.next)>-1;)e.advance(),n++;if(44==e.next)return;for(let t=0;;t++){if(7==t){if(!Lse(e.next,!0))return;break}if(e.next!="extends".charCodeAt(t))break;e.advance(),n++}}e.acceptToken(3,-n)})),Hse=bte({"get set async static":_te.modifier,"for while do if else switch try catch finally return throw break continue default case":_te.controlKeyword,"in of await yield void typeof delete instanceof":_te.operatorKeyword,"let var const using function class extends":_te.definitionKeyword,"import export from":_te.moduleKeyword,"with debugger as new":_te.keyword,TemplateString:_te.special(_te.string),super:_te.atom,BooleanLiteral:_te.bool,this:_te.self,null:_te.null,Star:_te.modifier,VariableName:_te.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":_te.function(_te.variableName),VariableDefinition:_te.definition(_te.variableName),Label:_te.labelName,PropertyName:_te.propertyName,PrivatePropertyName:_te.special(_te.propertyName),"CallExpression/MemberExpression/PropertyName":_te.function(_te.propertyName),"FunctionDeclaration/VariableDefinition":_te.function(_te.definition(_te.variableName)),"ClassDeclaration/VariableDefinition":_te.definition(_te.className),PropertyDefinition:_te.definition(_te.propertyName),PrivatePropertyDefinition:_te.definition(_te.special(_te.propertyName)),UpdateOp:_te.updateOperator,"LineComment Hashbang":_te.lineComment,BlockComment:_te.blockComment,Number:_te.number,String:_te.string,Escape:_te.escape,ArithOp:_te.arithmeticOperator,LogicOp:_te.logicOperator,BitOp:_te.bitwiseOperator,CompareOp:_te.compareOperator,RegExp:_te.regexp,Equals:_te.definitionOperator,Arrow:_te.function(_te.punctuation),": Spread":_te.punctuation,"( )":_te.paren,"[ ]":_te.squareBracket,"{ }":_te.brace,"InterpolationStart InterpolationEnd":_te.special(_te.brace),".":_te.derefOperator,", ;":_te.separator,"@":_te.meta,TypeName:_te.typeName,TypeDefinition:_te.definition(_te.typeName),"type enum interface implements namespace module declare":_te.definitionKeyword,"abstract global Privacy readonly override":_te.modifier,"is keyof unique infer":_te.operatorKeyword,JSXAttributeValue:_te.attributeValue,JSXText:_te.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":_te.angleBracket,"JSXIdentifier JSXNameSpacedName":_te.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":_te.attributeName,"JSXBuiltin/JSXIdentifier":_te.standard(_te.tagName)}),Fse={__proto__:null,export:18,as:23,from:31,default:34,async:39,function:40,extends:52,this:56,true:64,false:64,null:76,void:80,typeof:84,super:102,new:136,delete:152,yield:161,await:165,class:170,public:227,private:227,protected:227,readonly:229,instanceof:248,satisfies:251,in:252,const:254,import:286,keyof:339,unique:343,infer:349,is:385,abstract:405,implements:407,type:409,let:412,var:414,using:417,interface:423,enum:427,namespace:433,module:435,declare:439,global:443,for:462,of:471,while:474,with:478,do:482,if:486,else:488,switch:492,case:498,try:504,catch:508,finally:512,return:516,throw:520,break:524,continue:528,debugger:532},Wse={__proto__:null,async:123,get:125,set:127,declare:187,public:189,private:189,protected:189,static:191,abstract:193,override:195,readonly:201,accessor:203,new:389},Vse={__proto__:null,"<":143},Zse=Ase.deserialize({version:14,states:"$RQWO'#CdO>cQWO'#H[O>kQWO'#HbO>kQWO'#HdO`Q^O'#HfO>kQWO'#HhO>kQWO'#HkO>pQWO'#HqO>uQ07iO'#HwO%[Q^O'#HyO?QQ07iO'#H{O?]Q07iO'#H}O9kQ07hO'#IPO?hQ08SO'#ChO@jQ`O'#DiQOQWOOO%[Q^O'#EPOAQQWO'#ESO:RQ7[O'#EjOA]QWO'#EjOAhQpO'#FbOOQU'#Cf'#CfOOQ07`'#Dn'#DnOOQ07`'#Jm'#JmO%[Q^O'#JmOOQO'#Jq'#JqOOQO'#Ib'#IbOBhQ`O'#EcOOQ07`'#Eb'#EbOCdQ07pO'#EcOCnQ`O'#EVOOQO'#Jp'#JpODSQ`O'#JqOEaQ`O'#EVOCnQ`O'#EcPEnO!0LbO'#CaPOOO)CDu)CDuOOOO'#IX'#IXOEyO!bO,59TOOQ07b,59T,59TOOOO'#IY'#IYOFXO#tO,59TO%[Q^O'#D`OOOO'#I['#I[OFgO?MpO,59xOOQ07b,59x,59xOFuQ^O'#I]OGYQWO'#JkOI[QrO'#JkO+}Q^O'#JkOIcQWO,5:OOIyQWO'#ElOJWQWO'#JyOJcQWO'#JxOJcQWO'#JxOJkQWO,5;YOJpQWO'#JwOOQ07f,5:Z,5:ZOJwQ^O,5:ZOLxQ08SO,5:eOMiQWO,5:mONSQ07hO'#JvONZQWO'#JuO9ZQWO'#JuONoQWO'#JuONwQWO,5;XON|QWO'#JuO!#UQrO'#JjOOQ07b'#Ch'#ChO%[Q^O'#ERO!#tQpO,5:rOOQO'#Jr'#JrOOQO-EmOOQU'#J`'#J`OOQU,5>n,5>nOOQU-EpQWO'#HQO9aQWO'#HSO!CgQWO'#HSO:RQ7[O'#HUO!ClQWO'#HUOOQU,5=j,5=jO!CqQWO'#HVO!DSQWO'#CnO!DXQWO,59OO!DcQWO,59OO!FhQ^O,59OOOQU,59O,59OO!FxQ07hO,59OO%[Q^O,59OO!ITQ^O'#H^OOQU'#H_'#H_OOQU'#H`'#H`O`Q^O,5=vO!IkQWO,5=vO`Q^O,5=|O`Q^O,5>OO!IpQWO,5>QO`Q^O,5>SO!IuQWO,5>VO!IzQ^O,5>]OOQU,5>c,5>cO%[Q^O,5>cO9kQ07hO,5>eOOQU,5>g,5>gO!NUQWO,5>gOOQU,5>i,5>iO!NUQWO,5>iOOQU,5>k,5>kO!NZQ`O'#D[O%[Q^O'#JmO!NxQ`O'#JmO# gQ`O'#DjO# xQ`O'#DjO#$ZQ^O'#DjO#$bQWO'#JlO#$jQWO,5:TO#$oQWO'#EpO#$}QWO'#JzO#%VQWO,5;ZO#%[Q`O'#DjO#%iQ`O'#EUOOQ07b,5:n,5:nO%[Q^O,5:nO#%pQWO,5:nO>pQWO,5;UO!@}Q`O,5;UO!AVQ7[O,5;UO:RQ7[O,5;UO#%xQWO,5@XO#%}Q$ISO,5:rOOQO-E<`-E<`O#'TQ07pO,5:}OCnQ`O,5:qO#'_Q`O,5:qOCnQ`O,5:}O!@rQ07hO,5:qOOQ07`'#Ef'#EfOOQO,5:},5:}O%[Q^O,5:}O#'lQ07hO,5:}O#'wQ07hO,5:}O!@}Q`O,5:qOOQO,5;T,5;TO#(VQ07hO,5:}POOO'#IV'#IVP#(kO!0LbO,58{POOO,58{,58{OOOO-EwO+}Q^O,5>wOOQO,5>},5>}O#)VQ^O'#I]OOQO-EpQ08SO1G0{O#>wQ08SO1G0{O#@oQ08SO1G0{O#CoQ(CYO'#ChO#EmQ(CYO1G1^O#EtQ(CYO'#JjO!,lQWO1G1dO#FUQ08SO,5?TOOQ07`-EkQWO1G3lO$2^Q^O1G3nO$6bQ^O'#HmOOQU1G3q1G3qO$6oQWO'#HsO>pQWO'#HuOOQU1G3w1G3wO$6wQ^O1G3wO9kQ07hO1G3}OOQU1G4P1G4POOQ07`'#GY'#GYO9kQ07hO1G4RO9kQ07hO1G4TO$;OQWO,5@XO!*fQ^O,5;[O9ZQWO,5;[O>pQWO,5:UO!*fQ^O,5:UO!@}Q`O,5:UO$;TQ(CYO,5:UOOQO,5;[,5;[O$;_Q`O'#I^O$;uQWO,5@WOOQ07b1G/o1G/oO$;}Q`O'#IdO$pQWO1G0pO!@}Q`O1G0pO!AVQ7[O1G0pOOQ07`1G5s1G5sO!@rQ07hO1G0]OOQO1G0i1G0iO%[Q^O1G0iO$wO$>TQWO1G5qO$>]QWO1G6OO$>eQrO1G6PO9ZQWO,5>}O$>oQ08SO1G5|O%[Q^O1G5|O$?PQ07hO1G5|O$?bQWO1G5{O$?bQWO1G5{O9ZQWO1G5{O$?jQWO,5?QO9ZQWO,5?QOOQO,5?Q,5?QO$@OQWO,5?QO$'TQWO,5?QOOQO-EXOOQU,5>X,5>XO%[Q^O'#HnO%7^QWO'#HpOOQU,5>_,5>_O9ZQWO,5>_OOQU,5>a,5>aOOQU7+)c7+)cOOQU7+)i7+)iOOQU7+)m7+)mOOQU7+)o7+)oO%7cQ`O1G5sO%7wQ(CYO1G0vO%8RQWO1G0vOOQO1G/p1G/pO%8^Q(CYO1G/pO>pQWO1G/pO!*fQ^O'#DjOOQO,5>x,5>xOOQO-E<[-E<[OOQO,5?O,5?OOOQO-EpQWO7+&[O!@}Q`O7+&[OOQO7+%w7+%wO$=gQ08SO7+&TOOQO7+&T7+&TO%[Q^O7+&TO%8hQ07hO7+&TO!@rQ07hO7+%wO!@}Q`O7+%wO%8sQ07hO7+&TO%9RQ08SO7++hO%[Q^O7++hO%9cQWO7++gO%9cQWO7++gOOQO1G4l1G4lO9ZQWO1G4lO%9kQWO1G4lOOQO7+%|7+%|O#%sQWO<tQ08SO1G2ZO%AVQ08SO1G2mO%CbQ08SO1G2oO%EmQ7[O,5>yOOQO-E<]-E<]O%EwQrO,5>zO%[Q^O,5>zOOQO-E<^-E<^O%FRQWO1G5uOOQ07b<YOOQU,5>[,5>[O&5cQWO1G3yO9ZQWO7+&bO!*fQ^O7+&bOOQO7+%[7+%[O&5hQ(CYO1G6PO>pQWO7+%[OOQ07b<pQWO<pQWO7+)eO'&gQWO<}AN>}O%[Q^OAN?ZOOQO<eQ(CYOG26}O!*fQ^O'#DyO1PQWO'#EWO'@ZQrO'#JiO!*fQ^O'#DqO'@bQ^O'#D}O'@iQrO'#ChO'CPQrO'#ChO!*fQ^O'#EPO'CaQ^O,5;VO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O'#IiO'EdQWO,5a#@O#@^#@d#Ax#BW#Cr#DQ#DW#D^#Dd#Dn#Dt#Dz#EU#Eh#EnPPPPPPPPPP#EtPPPPPPP#Fi#Ip#KP#KW#K`PPPP$!d$%Z$+r$+u$+x$,q$,t$,w$-O$-WPP$-^$-b$.Y$/X$/]$/qPP$/u$/{$0PP$0S$0W$0Z$1P$1h$2P$2T$2W$2Z$2a$2d$2h$2lR!{RoqOXst!Z#c%j&m&o&p&r,h,m1w1zY!uQ'Z-Y1[5]Q%pvQ%xyQ&P|Q&e!VS'R!e-QQ'a!iS'g!r!xS*c$|*hQ+f%yQ+s&RQ,X&_Q-W'YQ-b'bQ-j'hQ/|*jQ1f,YR;Y:g%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%j%p%}&f&i&m&o&p&r&v'O']'m'}(P(V(^(r(v(z)y+O+S,e,h,m-^-f-t-z.l.s0[0a0q1_1o1p1r1t1w1z1|2m2s3Z5Y5d5t5u5x6]7w7|8]8gS#p]:d!r)[$[$m'S)n,y,|.{2]3p5W6S9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]Q*u%ZQ+k%{Q,Z&bQ,b&jQ.c;QQ0h+^Q0l+`Q0w+lQ1n,`Q2{.[Q4v0rQ5k1gQ6i3PQ6u;RQ7h4wR8m6j&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%j%p%}&f&i&j&m&o&p&r&v'O'S']'m'}(P(V(^(r(v(z)n)y+O+S+^,e,h,m,y,|-^-f-t-z.[.l.s.{0[0a0q1_1o1p1r1t1w1z1|2]2m2s3P3Z3p5W5Y5d5t5u5x6S6]6j7w7|8]8g9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]t!nQ!r!u!x!y'R'Y'Z'g'h'i-Q-W-Y-j1[5]5_$v$si#u#w$c$d$x${%O%Q%[%]%a)u){)}*P*R*Y*`*p*q+]+`+w+z.Z.i/Z/j/k/m0Q0S0^1R1U1^3O3x4S4[4f4n4p5c6g7T7^7y8j8w9[9n:O:W:y:z:|:};O;P;S;T;U;V;W;X;_;`;a;b;c;d;g;h;i;j;k;l;m;n;q;r < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:371,context:Bse,nodeProps:[["isolate",-8,4,5,13,33,35,48,50,52,""],["group",-26,8,16,18,65,201,205,209,210,212,215,218,228,230,236,238,240,242,245,251,257,259,261,263,265,267,268,"Statement",-32,12,13,28,31,32,38,48,51,52,54,59,67,75,79,81,83,84,106,107,116,117,134,137,139,140,141,142,144,145,164,165,167,"Expression",-23,27,29,33,37,39,41,168,170,172,173,175,176,177,179,180,181,183,184,185,195,197,199,200,"Type",-3,87,99,105,"ClassItem"],["openedBy",22,"<",34,"InterpolationStart",53,"[",57,"{",72,"(",157,"JSXStartCloseTag"],["closedBy",23,">",36,"InterpolationEnd",47,"]",58,"}",73,")",162,"JSXEndTag"]],propSources:[Hse],skippedNodes:[0,4,5,271],repeatNodeCount:37,tokenData:"$Fj(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Ns!`!a$#_!a!b$(l!b!c$,k!c!}Er!}#O$-u#O#P$/P#P#Q$4h#Q#R$5r#R#SEr#S#T$7P#T#o$8Z#o#p$q#r#s$?}#s$f%Z$f$g+g$g#BYEr#BY#BZ$AX#BZ$ISEr$IS$I_$AX$I_$I|Er$I|$I}$Dd$I}$JO$Dd$JO$JTEr$JT$JU$AX$JU$KVEr$KV$KW$AX$KW&FUEr&FU&FV$AX&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AX?HUOEr(n%d_$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$f&j(OpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(OpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Op(R!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$f&j(Op(R!b't(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST(P#S$f&j'u(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$f&j(Op(R!b'u(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$f&j!o$Ip(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/|3l_'}$(n$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$f&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$a`$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$a``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$a`$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(R!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$a`(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k#%|:hh$f&j(Op(R!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXVS$f&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSVSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWVS(R!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]VS$f&j(OpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWVS(OpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYVS(Op(R!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$f&j!USOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$f&j!USO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!USOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!US#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$f&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$f&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$f&j(R!b!USOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ(R!b!USOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb(R!b!USOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX(R!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$f&j(R!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#Fse[e]||-1},{term:334,get:e=>Wse[e]||-1},{term:70,get:e=>Vse[e]||-1}],tokenPrec:14626}),Xse=[Wle("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),Wle("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),Wle("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Wle("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Wle("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),Wle("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),Wle("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),Wle("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),Wle("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),Wle('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Wle('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Yse=Xse.concat([Wle("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Wle("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Wle("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Kse=new ute,Gse=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Use(e){return(t,n)=>{let o=t.node.getChild("VariableDefinition");return o&&n(o,e),!0}}const qse=["FunctionDeclaration"],Jse={FunctionDeclaration:Use("function"),ClassDeclaration:Use("class"),ClassExpression:()=>!0,EnumDeclaration:Use("constant"),TypeAliasDeclaration:Use("type"),NamespaceDeclaration:Use("namespace"),VariableDefinition(e,t){e.matchContext(qse)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function ece(e,t){let n=Kse.get(t);if(n)return n;let o=[],r=!0;function i(t,n){let r=e.sliceString(t.from,t.to);o.push({label:r,type:n})}return t.cursor(Wee.IncludeAnonymous).iterate((t=>{if(r)r=!1;else if(t.name){let e=Jse[t.name];if(e&&e(t,i)||Gse.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of ece(e,t.node))o.push(n);return!1}})),Kse.set(t,o),o}const tce=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,nce=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function oce(e){let t=Xte(e.state).resolveInner(e.pos,-1);if(nce.indexOf(t.name)>-1)return null;let n="VariableName"==t.name||t.to-t.from<20&&tce.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let o=[];for(let r=t;r;r=r.parent)Gse.has(r.name)&&(o=o.concat(ece(e.state.doc,r)));return{options:o,from:n?t.from:e.pos,validFor:tce}}const rce=Zte.define({name:"javascript",parser:Zse.configure({props:[une.add({IfStatement:bne({except:/^\s*({|else\b)/}),TryStatement:bne({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:e=>e.baseIndent,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),o=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:o?1:2)*e.unit},Block:mne({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":bne({except:/^{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag":e=>e.column(e.node.from)+e.unit}),One.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to({from:e.from+2,to:e.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),ice={test:e=>/^JSX/.test(e.name),facet:Hte({commentTokens:{block:{open:"{/*",close:"*/}"}}})},lce=rce.configure({dialect:"ts"},"typescript"),ace=rce.configure({dialect:"jsx",props:[Fte.add((e=>e.isTop?[ice]:void 0))]}),sce=rce.configure({dialect:"jsx ts",props:[Fte.add((e=>e.isTop?[ice]:void 0))]},"typescript");let cce=e=>({label:e,type:"keyword"});const uce="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(cce),dce=uce.concat(["declare","implements","private","protected","public"].map(cce));function pce(e={}){let t=e.jsx?e.typescript?sce:ace:e.typescript?lce:rce,n=e.typescript?Yse.concat(dce):Xse.concat(uce);return new one(t,[rce.data.of({autocomplete:(o=nce,r=Kie(n),e=>{for(let t=Xte(e.state).resolveInner(e.pos,-1);t;t=t.parent){if(o.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return r(e)})}),rce.data.of({autocomplete:oce}),e.jsx?gce:[]]);var o,r}function hce(e,t,n=e.length){for(let o=null==t?void 0:t.firstChild;o;o=o.nextSibling)if("JSXIdentifier"==o.name||"JSXBuiltin"==o.name||"JSXNamespacedName"==o.name||"JSXMemberExpression"==o.name)return e.sliceString(o.from,Math.min(o.to,n));return""}const fce="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),gce=Z7.inputHandler.of(((e,t,n,o,r)=>{if((fce?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||">"!=o&&"/"!=o||!rce.isActiveAt(e.state,t,-1))return!1;let i=r(),{state:l}=i,a=l.changeByRange((e=>{var t;let n,{head:r}=e,i=Xte(l).resolveInner(r-1,-1);if("JSXStartTag"==i.name&&(i=i.parent),l.doc.sliceString(r-1,r)!=o||"JSXAttributeValue"==i.name&&i.to>r);else{if(">"==o&&"JSXFragmentTag"==i.name)return{range:e,changes:{from:r,insert:""}};if("/"==o&&"JSXStartCloseTag"==i.name){let e=i.parent,o=e.parent;if(o&&e.from==r-2&&((n=hce(l.doc,o.firstChild,r))||"JSXFragmentTag"==(null===(t=o.firstChild)||void 0===t?void 0:t.name))){let e=`${n}>`;return{range:z3.cursor(r+e.length,-1),changes:{from:r,insert:e}}}}else if(">"==o){let t=function(e){for(;;){if("JSXOpenTag"==e.name||"JSXSelfClosingTag"==e.name||"JSXFragmentTag"==e.name)return e;if("JSXEscape"==e.name||!e.parent)return null;e=e.parent}}(i);if(t&&!/^\/?>|^<\//.test(l.doc.sliceString(r,r+2))&&(n=hce(l.doc,t,r)))return{range:e,changes:{from:r,insert:``}}}}return{range:e}}));return!a.changes.empty&&(e.dispatch([i,l.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),mce=g2(Ln({__name:"BranchDrawer",props:{open:P1().def(!1),len:M1().def(0),modelValue:E1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1),i=Ot({}),l=Ot({".cm-line":{fontSize:"18px"},".cm-scroller":{height:"500px",overflowY:"auto",overflowX:"hidden"}});wn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{n("update:modelValue",i.value)},s=Ot(),c=()=>{var e;null==(e=s.value)||e.validate().then((()=>{u(),n("save",i.value)})).catch((()=>{xB.warning("请检查表单信息")}))},u=()=>{n("update:open",!1),r.value=!1};return(t,n)=>{const o=fn("a-typography-paragraph"),d=fn("a-select-option"),p=fn("a-select"),h=fn("a-radio"),f=fn("a-radio-group"),g=fn("a-form-item"),m=fn("a-form"),v=fn("a-button"),b=fn("a-drawer");return hr(),br(b,{open:r.value,"onUpdate:open":n[5]||(n[5]=e=>r.value=e),"destroy-on-close":"",width:500,onClose:u},{title:sn((()=>[Cr(o,{style:{margin:"0",width:"412px"},ellipsis:"",content:i.value.nodeName,"onUpdate:content":n[0]||(n[0]=e=>i.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:a},{editableEnterIcon:sn((()=>[Pr(X(null))])),_:1},8,["content"])])),extra:sn((()=>[Cr(p,{value:i.value.priorityLevel,"onUpdate:value":n[1]||(n[1]=e=>i.value.priorityLevel=e),style:{width:"110px"}},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.len-1,(e=>(hr(),br(d,{key:e,value:e},{default:sn((()=>[Pr("优先级 "+X(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),footer:sn((()=>[Cr(v,{type:"primary",onClick:c},{default:sn((()=>[Pr("保存")])),_:1}),Cr(v,{style:{"margin-left":"12px"},onClick:u},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(m,{layout:"vertical",ref_key:"formRef",ref:s,model:i.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(g,{name:["decision","logicalCondition"],label:"判定逻辑",rules:[{required:!0,message:"请选择判定逻辑",trigger:"change"}]},{default:sn((()=>[Cr(f,{value:i.value.decision.logicalCondition,"onUpdate:value":n[2]||(n[2]=e=>i.value.decision.logicalCondition=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(X1)),(e=>(hr(),br(h,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(g,{name:["decision","expressionType"],label:"表达式类型",rules:[{required:!0,message:"请选择表达式类型",trigger:"change"}]},{default:sn((()=>[Cr(f,{value:i.value.decision.expressionType,"onUpdate:value":n[3]||(n[3]=e=>i.value.decision.expressionType=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(H1)),(e=>(hr(),br(h,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(g,{name:["decision","nodeExpression"],label:"条件表达式",rules:[{required:!0,message:"请填写条件表达式",trigger:"change"}]},{default:sn((()=>[Cr(Ct(qae),{modelValue:i.value.decision.nodeExpression,"onUpdate:modelValue":n[4]||(n[4]=e=>i.value.decision.nodeExpression=e),theme:l.value,basic:"",lang:Ct(pce)(),extensions:[Ct(ase)]},null,8,["modelValue","theme","lang","extensions"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),[["__scopeId","data-v-5d000a58"]]),vce=g2(Ln({__name:"BranchDesc",props:{modelValue:E1().def({})},setup(e){const t=e,n=Ot("");Gn((()=>{var e;Vt((()=>{r()})),(null==(e=t.modelValue.decision)?void 0:e.nodeExpression)&&(n.value=t.modelValue.decision.nodeExpression)}));const o=Ot({".cm-line":{fontSize:"18px"},".cm-scroller":{height:"520px",overflowY:"auto",overflowX:"hidden"}}),r=()=>{const e=document.getElementById("branch-desc"),t=null==e?void 0:e.querySelector(".ant-descriptions-view"),n=null==t?void 0:t.querySelector("tbody"),o=document.createElement("tr");o.className="ant-descriptions-row";const r=document.createElement("th");r.className="ant-descriptions-item-label",r.innerHTML="条件表达式",r.setAttribute("colspan","4"),o.appendChild(r),null==n||n.insertBefore(o,null==n?void 0:n.childNodes[3]);const i=(null==n?void 0:n.getElementsByClassName("ant-descriptions-row"))[3];i.childNodes[2].remove();const l=i.querySelector(".ant-descriptions-item-content");l.setAttribute("style","padding: 0"),null==l||l.setAttribute("colspan","4")};return(t,r)=>{const i=fn("a-descriptions-item"),l=fn("a-descriptions");return hr(),br(l,{id:"branch-desc",column:2,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(i,{label:"节点名称",span:2},{default:sn((()=>[Pr(X(e.modelValue.nodeName),1)])),_:1}),Cr(i,{label:"判定逻辑"},{default:sn((()=>{var t;return[Pr(X(Ct(X1)[null==(t=e.modelValue.decision)?void 0:t.logicalCondition]),1)]})),_:1}),Cr(i,{label:"表达式类型"},{default:sn((()=>{var t;return[Pr(X(Ct(H1)[null==(t=e.modelValue.decision)?void 0:t.expressionType]),1)]})),_:1}),Cr(i,{label:"条件表达式",span:2},{default:sn((()=>[Cr(Ct(qae),{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=e=>n.value=e),readonly:"",disabled:"",theme:o.value,basic:"",lang:Ct(pce)(),extensions:[Ct(ase)]},null,8,["modelValue","theme","lang","extensions"])])),_:1})])),_:1})}}}),[["__scopeId","data-v-dc9046db"]]),bce=Ln({__name:"BranchDetail",props:{modelValue:E1().def({}),open:P1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=fn("a-drawer");return hr(),br(o,{title:"决策详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:sn((()=>[Cr(vce,{"model-value":e.modelValue},null,8,["model-value"])])),_:1},8,["open"])}}}),yce={class:"branch-wrap"},Oce={class:"branch-box-wrap"},wce={class:"branch-box"},xce={class:"condition-node"},$ce={class:"condition-node-box"},Sce=["onClick"],Cce=["onClick"],kce={class:"title"},Pce={class:"node-title"},Tce={class:"priority-title"},Mce={class:"content"},Ice=["innerHTML"],Ece={key:1,class:"placeholder"},Ace=["onClick"],Rce={key:1,class:"top-left-cover-line"},Dce={key:2,class:"bottom-left-cover-line"},jce={key:3,class:"top-right-cover-line"},Bce={key:4,class:"bottom-right-cover-line"},Nce=(e=>(ln("data-v-affb0f89"),e=e(),an(),e))((()=>Sr("div",{style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[Sr("span",{style:{"padding-left":"18px"}},"决策节点详情")],-1))),zce=g2(Ln({__name:"BranchNode",props:{modelValue:E1().def({}),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=e1(),i=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{const e=i.value.conditionNodes.length;i.value.conditionNodes.splice(-1,0,{nodeName:"条件"+e,priorityLevel:e,decision:{expressionType:1,nodeExpression:void 0,logicalCondition:1}}),i.value.conditionNodes[e].priorityLevel=e+1},a=(e,t)=>{e.childNode?a(e.childNode,t):e.childNode=t},s=(e,t=1)=>{var o;i.value.conditionNodes[e]=i.value.conditionNodes.splice(e+t,1,i.value.conditionNodes[e])[0],null==(o=i.value.conditionNodes)||o.map(((e,t)=>{e.priorityLevel=t+1})),n("update:modelValue",i.value)},c=(e,t)=>{const{nodeName:n,decision:o}=e.conditionNodes[t],{logicalCondition:r,expressionType:i,nodeExpression:l}=o;return l?"其他情况"!==n?`${X1[r]}\n${H1[i]}\n${l}`:"如存在未满足其他分支条件的情况,则进入此分支":"其他情况"===n?"如存在未满足其他分支条件的情况,则进入此分支":void 0},u=Ot(0),d=Ot(!1),p=Ot([]),h=Ot({}),f=e=>{const t=i.value.conditionNodes[u.value].priorityLevel,o=e.priorityLevel;i.value.conditionNodes[u.value]=e,t!==o&&s(u.value,o-t),n("update:modelValue",i.value)},g=Ot([]),m=Ot(""),v=Ot([]),b=(e,t)=>{var n,l;if(v.value=[],"其他情况"!==e.nodeName)if(2===r.TYPE){if(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=v.value)||t.push(e.id):e.jobId&&(m.value=e.jobId.toString())})),0===v.value.length)return void(p.value[t]=!0);g.value[t]=!0}else 1===r.TYPE?p.value[t]=!0:(l=t,o.disabled||l===i.value.conditionNodes.length-1?0!==r.TYPE&&(p.value[l]=!0):(u.value=l,h.value=JSON.parse(JSON.stringify(i.value.conditionNodes[l])),d.value=!0))},y=e=>o.disabled?2===r.TYPE?"其他情况"===e.nodeName?`node-disabled node-error node-error-${e.taskBatchStatus?K1[e.taskBatchStatus].name:"default"}`:`node-error node-error-${e.taskBatchStatus?K1[e.taskBatchStatus].name:"default"}`:"其他情况"===e.nodeName?"node-disabled":"node-error":"其他情况"===e.nodeName?"node-disabled":"auto-judge-def auto-judge-hover";return(t,o)=>{const u=fn("a-button"),O=fn("a-badge"),w=fn("a-tooltip");return hr(),vr("div",yce,[Sr("div",Oce,[Sr("div",wce,[e.disabled?Tr("",!0):(hr(),br(u,{key:0,class:"add-branch",primary:"",onClick:l},{default:sn((()=>[Pr("添加条件")])),_:1})),(hr(!0),vr(ar,null,io(i.value.conditionNodes,((o,l)=>(hr(),vr("div",{class:"col-box",key:l},[Sr("div",xce,[Sr("div",$ce,[Sr("div",{class:W(["auto-judge",y(o)]),onClick:e=>b(o,l)},[0!==l?(hr(),vr("div",{key:0,class:"sort-left",onClick:Vi((e=>s(l,-1)),["stop"])},[Cr(Ct(BR))],8,Cce)):Tr("",!0),Sr("div",kce,[Sr("span",Pce,[Cr(O,{status:"processing",color:"#52c41a"}),Pr(" "+X(o.nodeName)+" ",1),"其他情况"===o.nodeName?(hr(),br(w,{key:0},{title:sn((()=>[Pr(" 该分支为系统默认创建,与其他分支互斥。只有当其他分支都无法运行时,才会运行该分支。 ")])),default:sn((()=>[Cr(Ct(m$),{style:{"margin-left":"3px"}})])),_:1})):Tr("",!0)]),Sr("span",Tce,"优先级"+X(o.priorityLevel),1),e.disabled?Tr("",!0):(hr(),br(Ct(Jb),{key:0,class:"close",onClick:Vi((e=>{return t=l,null==(o=i.value.conditionNodes)||o.splice(t,1),void(1===i.value.conditionNodes.length&&(i.value.childNode&&(i.value.conditionNodes[0].childNode?a(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Vt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))));var t,o}),["stop"])},null,8,["onClick"]))]),Sr("div",Mce,[c(i.value,l)?(hr(),vr("span",{key:0,innerHTML:c(i.value,l)},null,8,Ice)):(hr(),vr("span",Ece," 请设置条件 "))]),l!==i.value.conditionNodes.length-2?(hr(),vr("div",{key:1,class:"sort-right",onClick:Vi((e=>s(l)),["stop"])},[Cr(Ct(ok))],8,Ace)):Tr("",!0),2===Ct(r).TYPE&&o.taskBatchStatus?(hr(),br(w,{key:2},{title:sn((()=>[Pr(X(Ct(K1)[o.taskBatchStatus].title),1)])),default:sn((()=>[Cr(Ct(Q1),{class:"error-tip",color:Ct(K1)[o.taskBatchStatus].color,size:"24px",onClick:Vi((()=>{}),["stop"]),"model-value":Ct(K1)[o.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):Tr("",!0)],10,Sce),Cr(A2,{disabled:e.disabled,modelValue:o.childNode,"onUpdate:modelValue":e=>o.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),o.childNode?ao(t.$slots,"default",{key:0,node:o},void 0,!0):Tr("",!0),0==l?(hr(),vr("div",Rce)):Tr("",!0),0==l?(hr(),vr("div",Dce)):Tr("",!0),l==i.value.conditionNodes.length-1?(hr(),vr("div",jce)):Tr("",!0),l==i.value.conditionNodes.length-1?(hr(),vr("div",Bce)):Tr("",!0),0!==Ct(r).type&&p.value[l]?(hr(),br(bce,{key:5,open:p.value[l],"onUpdate:open":e=>p.value[l]=e,modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["open","onUpdate:open","modelValue","onUpdate:modelValue"])):Tr("",!0),0!==Ct(r).TYPE&&g.value[l]?(hr(),br(Ct($2),{key:6,open:g.value[l],"onUpdate:open":e=>g.value[l]=e,id:m.value,ids:v.value},{default:sn((()=>[Nce,Cr(vce,{modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["open","onUpdate:open","id","ids"])):Tr("",!0)])))),128))]),Cr(A2,{disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":o[0]||(o[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])]),Cr(mce,{open:d.value,"onUpdate:open":o[1]||(o[1]=e=>d.value=e),modelValue:h.value,"onUpdate:modelValue":o[2]||(o[2]=e=>h.value=e),len:i.value.conditionNodes.length,"onUpdate:len":o[3]||(o[3]=e=>i.value.conditionNodes.length=e),onSave:f},null,8,["open","modelValue","len"])])}}}),[["__scopeId","data-v-affb0f89"]]),_ce=Ln({__name:"CallbackDrawer",props:{open:P1().def(!1),len:M1().def(0),modelValue:E1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1),i=Ot({});wn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{n("update:modelValue",i.value)},a=Ot(),s=()=>{var e;null==(e=a.value)||e.validate().then((()=>{c(),n("save",i.value)})).catch((()=>{xB.warning("请检查表单信息")}))},c=()=>{n("update:open",!1),r.value=!1};return(e,t)=>{const n=fn("a-typography-paragraph"),o=fn("a-input"),u=fn("a-form-item"),d=fn("a-select-option"),p=fn("a-select"),h=fn("a-radio"),f=fn("a-radio-group"),g=fn("a-form"),m=fn("a-button"),v=fn("a-drawer");return hr(),br(v,{open:r.value,"onUpdate:open":t[5]||(t[5]=e=>r.value=e),"destroy-on-close":"",width:500,onClose:c},{title:sn((()=>[Cr(n,{style:{margin:"0",width:"412px"},ellipsis:"",content:i.value.nodeName,"onUpdate:content":t[0]||(t[0]=e=>i.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:l},null,8,["content"])])),footer:sn((()=>[Cr(m,{type:"primary",onClick:s},{default:sn((()=>[Pr("保存")])),_:1}),Cr(m,{style:{"margin-left":"12px"},onClick:c},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(g,{ref_key:"formRef",ref:a,layout:"vertical",model:i.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(u,{name:["callback","webhook"],label:"webhook",rules:[{required:!0,message:"请输入 webhook",trigger:"change"}]},{default:sn((()=>[Cr(o,{value:i.value.callback.webhook,"onUpdate:value":t[1]||(t[1]=e=>i.value.callback.webhook=e),placeholder:"请输入 webhook"},null,8,["value"])])),_:1}),Cr(u,{name:["callback","contentType"],label:"请求类型",rules:[{required:!0,message:"请选择请求类型",trigger:"change"}]},{default:sn((()=>[Cr(p,{value:i.value.callback.contentType,"onUpdate:value":t[2]||(t[2]=e=>i.value.callback.contentType=e),placeholder:"请选择请求类型"},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(Y1)),(e=>(hr(),br(d,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(u,{name:["callback","secret"],label:"秘钥",rules:[{required:!0,message:"请输入秘钥",trigger:"change"}]},{default:sn((()=>[Cr(o,{value:i.value.callback.secret,"onUpdate:value":t[3]||(t[3]=e=>i.value.callback.secret=e),placeholder:"请输入秘钥"},null,8,["value"])])),_:1}),Cr(u,{name:"workflowNodeStatus",label:"工作流状态",rules:[{required:!0,message:"请选择工作流状态",trigger:"change"}]},{default:sn((()=>[Cr(f,{value:i.value.workflowNodeStatus,"onUpdate:value":t[4]||(t[4]=e=>i.value.workflowNodeStatus=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(Z1)),(e=>(hr(),br(h,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),Lce=Ln({__name:"CallbackDetail",props:{modelValue:E1().def({}),open:P1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=fn("a-descriptions-item"),l=fn("a-descriptions"),a=fn("a-drawer");return hr(),br(a,{title:"决策详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:sn((()=>[Cr(l,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(o,{label:"节点名称"},{default:sn((()=>[Pr(X(e.modelValue.nodeName),1)])),_:1}),Cr(o,{label:"webhook"},{default:sn((()=>{var t;return[Pr(X(null==(t=e.modelValue.callback)?void 0:t.webhook),1)]})),_:1}),Cr(o,{label:"请求类型"},{default:sn((()=>{var t;return[Pr(X(Ct(Y1)[null==(t=e.modelValue.callback)?void 0:t.contentType]),1)]})),_:1}),Cr(o,{label:"密钥"},{default:sn((()=>{var t;return[Pr(X(null==(t=e.modelValue.callback)?void 0:t.secret),1)]})),_:1})])),_:1})])),_:1},8,["open"])}}}),Qce=e=>(ln("data-v-714c9e92"),e=e(),an(),e),Hce={class:"node-wrap"},Fce={class:"branch-box"},Wce={class:"condition-node",style:{"min-height":"230px"}},Vce={class:"condition-node-box",style:{"padding-top":"0"}},Zce={class:"popover"},Xce=Qce((()=>Sr("span",null,"重试",-1))),Yce=Qce((()=>Sr("span",null,"忽略",-1))),Kce=["onClick"],Gce={class:"title"},Uce={class:"text",style:{color:"#935af6"}},qce={class:"content",style:{"min-height":"81px"}},Jce={key:0,class:"placeholder"},eue={style:{display:"flex","justify-content":"space-between"}},tue=Qce((()=>Sr("span",{class:"content_label"},"Webhook:",-1))),nue=Qce((()=>Sr("span",{class:"content_label"},"请求类型: ",-1))),oue=Qce((()=>Sr("div",null,".........",-1))),rue={key:1,class:"top-left-cover-line"},iue={key:2,class:"bottom-left-cover-line"},lue={key:3,class:"top-right-cover-line"},aue={key:4,class:"bottom-right-cover-line"},sue=Qce((()=>Sr("div",{style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[Sr("span",{style:{"padding-left":"18px"}},"回调节点详情")],-1))),cue=g2(Ln({__name:"CallbackNode",props:{modelValue:E1().def({}),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=e1(),i=Ot({}),l=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{i.value.childNode&&(i.value.conditionNodes[0].childNode?s(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Vt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))},s=(e,t)=>{e.childNode?s(e.childNode,t):e.childNode=t},c=Ot(0),u=Ot(!1),d=Ot(!1),p=Ot({}),h=e=>{i.value.conditionNodes[c.value]=e,n("update:modelValue",i.value)},f=Ot(!1),g=Ot(""),m=Ot([]),v=(e,t)=>{var n,o;if(m.value=[],2===r.TYPE){if(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=m.value)||t.push(e.id):e.jobId&&(g.value=e.jobId.toString())})),0===m.value.length)return void(d.value=!0);f.value=!0}else 1===r.TYPE?d.value=!0:(o=t,0===r.TYPE?(c.value=o,p.value=JSON.parse(JSON.stringify(i.value.conditionNodes[o])),u.value=!0):d.value=!0)},b=e=>o.disabled?2===r.TYPE?`node-error node-error-${e.taskBatchStatus?K1[e.taskBatchStatus].name:"default"}`:"node-error":"auto-judge-def auto-judge-hover";return(t,n)=>{const o=fn("a-divider"),s=fn("a-button"),c=fn("a-badge"),y=fn("a-typography-text"),O=fn("a-tooltip"),w=fn("a-popover"),x=fn("a-descriptions-item"),$=fn("a-descriptions");return hr(),vr("div",Hce,[Sr("div",Fce,[(hr(!0),vr(ar,null,io(i.value.conditionNodes,((n,u)=>(hr(),vr("div",{class:"col-box",key:u},[Sr("div",Wce,[Sr("div",Vce,[Cr(w,{open:l.value[u]&&2===Ct(r).TYPE,getPopupContainer:e=>e.parentNode,onOpenChange:e=>l.value[u]=e},{content:sn((()=>[Sr("div",Zce,[Cr(o,{type:"vertical"}),Cr(s,{type:"text",class:"popover-item"},{default:sn((()=>[Cr(Ct(yJ)),Xce])),_:1}),Cr(o,{type:"vertical"}),Cr(s,{type:"text",class:"popover-item"},{default:sn((()=>[Cr(Ct(rJ)),Yce])),_:1})])])),default:sn((()=>{var t,o;return[Sr("div",{class:W(["auto-judge",b(n)]),onClick:e=>v(n,u)},[Sr("div",Gce,[Sr("span",Uce,[Cr(c,{status:"processing",color:1===n.workflowNodeStatus?"#52c41a":"#ff4d4f"},null,8,["color"]),Pr(" "+X(n.nodeName),1)]),e.disabled?Tr("",!0):(hr(),br(Ct(Jb),{key:0,class:"close",onClick:Vi(a,["stop"])}))]),Sr("div",qce,[(null==(t=n.callback)?void 0:t.webhook)?Tr("",!0):(hr(),vr("div",Jce,"请配置回调通知")),(null==(o=n.callback)?void 0:o.webhook)?(hr(),vr(ar,{key:1},[Sr("div",eue,[tue,Cr(y,{style:{width:"116px"},ellipsis:"",content:n.callback.webhook},null,8,["content"])]),Sr("div",null,[nue,Pr(" "+X(Ct(Y1)[n.callback.contentType]),1)]),oue],64)):Tr("",!0)]),2===Ct(r).TYPE&&n.taskBatchStatus?(hr(),br(O,{key:0},{title:sn((()=>[Pr(X(Ct(K1)[n.taskBatchStatus].title),1)])),default:sn((()=>[Cr(Ct(Q1),{class:"error-tip",color:Ct(K1)[n.taskBatchStatus].color,size:"24px",onClick:Vi((()=>{}),["stop"]),"model-value":Ct(K1)[n.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):Tr("",!0)],10,Kce)]})),_:2},1032,["open","getPopupContainer","onOpenChange"]),Cr(A2,{disabled:e.disabled,modelValue:n.childNode,"onUpdate:modelValue":e=>n.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),n.childNode?ao(t.$slots,"default",{key:0,node:n},void 0,!0):Tr("",!0),0==u?(hr(),vr("div",rue)):Tr("",!0),0==u?(hr(),vr("div",iue)):Tr("",!0),u==i.value.conditionNodes.length-1?(hr(),vr("div",lue)):Tr("",!0),u==i.value.conditionNodes.length-1?(hr(),vr("div",aue)):Tr("",!0)])))),128))]),i.value.conditionNodes.length>1?(hr(),br(A2,{key:0,disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":n[0]||(n[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])):Tr("",!0),0!==Ct(r).type?(hr(),br(Lce,{key:1,open:d.value,"onUpdate:open":n[1]||(n[1]=e=>d.value=e),modelValue:i.value.conditionNodes[0],"onUpdate:modelValue":n[2]||(n[2]=e=>i.value.conditionNodes[0]=e)},null,8,["open","modelValue"])):Tr("",!0),Cr(_ce,{open:u.value,"onUpdate:open":n[3]||(n[3]=e=>u.value=e),modelValue:p.value,"onUpdate:modelValue":n[4]||(n[4]=e=>p.value=e),onSave:h},null,8,["open","modelValue"]),0!==Ct(r).TYPE&&f.value?(hr(),br(Ct($2),{key:2,open:f.value,"onUpdate:open":n[5]||(n[5]=e=>f.value=e),id:g.value,ids:m.value},{default:sn((()=>[sue,Cr($,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(x,{label:"节点名称"},{default:sn((()=>[Pr(X(i.value.conditionNodes[0].nodeName),1)])),_:1}),Cr(x,{label:"webhook"},{default:sn((()=>{var e;return[Pr(X(null==(e=i.value.conditionNodes[0].callback)?void 0:e.webhook),1)]})),_:1}),Cr(x,{label:"请求类型"},{default:sn((()=>{var e;return[Pr(X(Ct(Y1)[null==(e=i.value.conditionNodes[0].callback)?void 0:e.contentType]),1)]})),_:1}),Cr(x,{label:"密钥"},{default:sn((()=>{var e;return[Pr(X(null==(e=i.value.conditionNodes[0].callback)?void 0:e.secret),1)]})),_:1})])),_:1})])),_:1},8,["open","id","ids"])):Tr("",!0)])}}}),[["__scopeId","data-v-714c9e92"]]),uue=Ln({__name:"NodeWrap",props:{modelValue:E1().def({}),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=Ot({});return wn((()=>o.modelValue),(e=>{r.value=e}),{immediate:!0,deep:!0}),wn((()=>r.value),(e=>{n("update:modelValue",e)})),(t,n)=>{const o=fn("node-wrap",!0);return hr(),vr(ar,null,[1==r.value.nodeType?(hr(),br(i3,{key:0,modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),disabled:e.disabled},{default:sn((t=>[t.node?(hr(),br(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):Tr("",!0)])),_:1},8,["modelValue","disabled"])):Tr("",!0),2==r.value.nodeType?(hr(),br(zce,{key:1,modelValue:r.value,"onUpdate:modelValue":n[1]||(n[1]=e=>r.value=e),disabled:e.disabled},{default:sn((t=>[t.node?(hr(),br(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):Tr("",!0)])),_:1},8,["modelValue","disabled"])):Tr("",!0),3==r.value.nodeType?(hr(),br(cue,{key:2,modelValue:r.value,"onUpdate:modelValue":n[2]||(n[2]=e=>r.value=e),disabled:e.disabled},{default:sn((t=>[t.node?(hr(),br(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):Tr("",!0)])),_:1},8,["modelValue","disabled"])):Tr("",!0),r.value.childNode?(hr(),br(o,{key:3,modelValue:r.value.childNode,"onUpdate:modelValue":n[3]||(n[3]=e=>r.value.childNode=e),disabled:e.disabled},null,8,["modelValue","disabled"])):Tr("",!0)],64)}}}),due="*",pue="/",hue="-",fue=",",gue="?",mue="L",vue="W",bue="#",yue="",Oue="LW",wue=(new Date).getFullYear();function xue(e){return"number"==typeof e||/^\d+(\.\d+)?$/.test(e)}const{hasOwnProperty:$ue}=Object.prototype;function Sue(e,t){return Object.keys(t).forEach((n=>{!function(e,t,n){const o=t[n];(function(e){return null!=e})(o)&&($ue.call(e,n)&&function(e){return null!==e&&"object"==typeof e}(o)?e[n]=Sue(Object(e[n]),t[n]):e[n]=o)}(e,t,n)})),e}const Cue={common:{from:"从",fromThe:"从第",start:"开始",every:"每",between:"在",and:"到",end:"之间的",specified:"固定的",symbolTip:"通配符支持",valTip:"值为",nearest:"最近的",current:"本",nth:"第",index:"个",placeholder:"请选择",placeholderMulti:"请选择(支持多选)",help:"帮助",wordNumError:"格式不正确,必须有6或7位",reverse:"反向解析",reset:"重置",tagError:"表达式不正确",numError:"含有非法数字",use:"使用",inputPlaceholder:"Cron表达式"},custom:{unspecified:"不固定",workDay:"工作日",lastTh:"倒数第",lastOne:"最后一个",latestWorkday:"最后一个工作日",empty:"不配置"},second:{title:"秒",val:"0 1 2...59"},minute:{title:"分",val:"0 1 2...59"},hour:{title:"时",val:"0 1 2...23"},dayOfMonth:{timeUnit:"日",title:"日",val:"1 2...31"},month:{title:"月",val:"1 2...12,或12个月的缩写(JAN ... DEC)"},dayOfWeek:{timeUnit:"日",title:"周",val:"1 2...7或星期的缩写(SUN ... SAT)",SUN:"星期天",MON:"星期一",TUE:"星期二",WED:"星期三",THU:"星期四",FRI:"星期五",SAT:"星期六"},year:{title:"年",val:wue+" ... 2099"},period:{startError:"开始格式不符",cycleError:"循环格式不符"},range:{lowerError:"下限格式不符",upperError:"上限格式不符",lowerBiggerThanUpperError:"下限不能比上限大"},weekDay:{weekDayNumError:"周数格式不符",nthError:"天数格式不符"},app:{title:"基于Vue&Element-ui实现的Cron表达式生成器",next10FireTimes:"最近10次执行时刻"},daysOfWeekOptions:[{label:"星期天",value:1},{label:"星期一",value:2},{label:"星期二",value:3},{label:"星期三",value:4},{label:"星期四",value:5},{label:"星期五",value:6},{label:"星期六",value:7}]},kue=Ot("zh-CN"),Pue=it({"zh-CN":Cue}),Tue={messages:()=>Pue[kue.value],use(e,t){kue.value=e,this.add({[e]:t})},add(e={}){Sue(Pue,e)}},Mue=Tue.messages(),Iue={class:"cron-body-row"},Eue={class:"symbol"},Aue=g2(Ln({components:{Radio:EM},props:{timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:due},tag:{type:String,default:due},onChange:{type:Function}},setup:e=>({Message:Mue,change:function(){e.onChange&&e.onChange({tag:due,type:due})},EVERY:due})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",Iue,[Cr(l,{checked:e.type===e.EVERY,onClick:e.change},{default:sn((()=>[Sr("span",Eue,X(e.EVERY),1),Pr(X(e.Message.common.every)+X(e.timeUnit),1)])),_:1},8,["checked","onClick"])])}]]),Rue=Tue.messages(),Due={class:"cron-body-row"},jue={class:"symbol"},Bue=g2(Ln({components:{Radio:EM,InputNumber:pQ},props:{startConfig:{type:Object,default:null},cycleConfig:{type:Object,default:null},timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:pue},tag:{type:String,default:pue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(0);n.value`${n.value}${pue}${o.value}`));function i(t){if(e.type!==pue)return;const r=t.split(pue);2===r.length?(r[0]===due&&(r[0]=0),!xue(r[0])||parseInt(r[0])e.startConfig.max?xB.error(`${Rue.period.startError}:${r[0]}`):!xue(r[1])||parseInt(r[1])e.cycleConfig.max?xB.error(`${Rue.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1]))):xB.error(`${Rue.common.tagError}:${t}`)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Rue,type_:t,start:n,cycle:o,tag_:r,PERIOD:pue,change:function(){e.onChange&&e.onChange({type:pue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("InputNumber"),a=fn("Radio");return hr(),vr("div",Due,[Cr(a,{checked:e.type===e.PERIOD,onChange:e.change},{default:sn((()=>[Sr("span",jue,X(e.tag_),1),Pr(" "+X(e.Message.common.fromThe)+" ",1),Cr(l,{size:"small",value:e.start,"onUpdate:value":t[0]||(t[0]=t=>e.start=t),min:e.startConfig.min,step:e.startConfig.step,max:e.startConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.start)+X(e.Message.common.every)+" ",1),Cr(l,{size:"small",value:e.cycle,"onUpdate:value":t[1]||(t[1]=t=>e.cycle=t),min:e.cycleConfig.min,step:e.cycleConfig.step,max:e.cycleConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),Nue=Tue.messages(),zue={class:"cron-body-row"},_ue={class:"symbol"},Lue=g2(Ln({components:{Radio:EM,InputNumber:pQ},props:{upper:{type:Number,default:1},lowerConfig:{type:Object,default:null},upperConfig:{type:Object,default:null},timeUnit:{type:String,default:null},type:{type:String,default:hue},tag:{type:String,default:hue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(0);o.value`${o.value}${hue}${n.value}`));function l(t){if(e.type!==hue)return;const r=t.split(hue);2===r.length&&(r[0]===hue&&(r[0]=0),!xue(r[0])||parseInt(r[0])e.lowerConfig.max||!xue(r[1])||parseInt(r[1])e.upperConfig.max||(o.value=parseInt(r[0]),n.value=parseInt(r[1])))}return Gn((()=>{l(e.tag)})),wn((()=>e.tag),(e=>{l(e)}),{deep:!0}),wn((()=>e.type),(()=>{l(e.tag)}),{deep:!0}),{Message:Nue,type_:t,lower:o,cycle:r,tag_:i,upper_:n,RANGE:hue,change:function(){e.onChange&&e.onChange({type:hue,tag:i.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("InputNumber"),a=fn("Radio");return hr(),vr("div",zue,[Cr(a,{checked:e.type===e.RANGE,onChange:e.change},{default:sn((()=>[Sr("span",_ue,X(e.tag_),1),Pr(" "+X(e.Message.common.between)+" ",1),Cr(l,{size:"small",value:e.lower,"onUpdate:value":t[0]||(t[0]=t=>e.lower=t),min:e.lowerConfig.min,step:e.lowerConfig.step,max:e.upper_,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.and)+" ",1),Cr(l,{size:"small",value:e.upper_,"onUpdate:value":t[1]||(t[1]=t=>e.upper_=t),min:e.lower,step:e.upperConfig.step,max:e.upperConfig.max,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.Message.common.end)+X(e.Message.common.every)+X(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),Que=Tue.messages(),Hue=Ln({components:{Radio:EM,ASelect:Vx,Tooltip:$S},props:{nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:fue},tag:{type:String,default:fue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Yr((()=>{let e="";if(o.value&&o.value.length){o.value.sort();for(let t=0;t{xue(t)&&parseInt(t)>=parseInt(e.nums[0].value)&&parseInt(t)<=parseInt(e.nums[e.nums.length-1].value)&&o.value.push(parseInt(t))}))}}return Gn((()=>{i()})),wn((()=>e.tag),(()=>i()),{deep:!0}),wn((()=>e.type),(()=>i()),{deep:!0}),{Message:Que,type_:t,tag_:n,open:r,FIXED:fue,change:function(){e.onChange&&e.onChange({type:fue,tag:n.value||fue})},numArray:o,changeTag:i}}}),Fue={class:"cron-body-row"},Wue=Sr("span",{class:"symbol"},",",-1),Vue=g2(Hue,[["render",function(e,t,n,o,r,i){const l=fn("Tooltip"),a=fn("Radio"),s=fn("ASelect");return hr(),vr("div",Fue,[Cr(a,{checked:e.type===e.FIXED,onChange:e.change},{default:sn((()=>[Cr(l,{title:e.tag_},{default:sn((()=>[Wue])),_:1},8,["title"]),Pr(" "+X(e.Message.common.specified),1)])),_:1},8,["checked","onChange"]),Cr(s,{size:"small",mode:"tags",placeholder:e.Message.common.placeholder,style:{width:"300px"},options:e.nums,disabled:e.type!==e.FIXED,value:e.numArray,"onUpdate:value":t[0]||(t[0]=t=>e.numArray=t),onChange:e.change},null,8,["placeholder","options","disabled","value","onChange"])])}]]),Zue={watch:{tag(e){this.resolveTag(e)}},mounted(){this.resolveTag(this.tag)},methods:{resolveTag(e){null==e&&(e=yue);let t=null;(e=this.resolveCustom(e))===yue?t=yue:e===gue?t=gue:e===due?t=due:e===Oue&&(t=Oue),null==t&&(t=e.startsWith("L-")||e.endsWith(mue)?mue:e.endsWith(vue)&&e.length>1?vue:e.indexOf(bue)>0?bue:e.indexOf(pue)>0?pue:e.indexOf(hue)>0?hue:fue),this.type_=t,this.tag_=e},resolveCustom:e=>e}},Xue=Tue.messages(),Yue=g2(Ln({components:{Every:Aue,Period:Bue,Range:Lue,Fixed:Vue},mixins:[Zue],props:{tag:{type:String,default:due},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:59},n={min:1,step:1,max:59},o={min:0,step:1,max:59},r={min:0,step:1,max:59},i=[];for(let s=0;s<60;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(due),a=Ot(e.tag);return{Message:Xue,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.second.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),Kue=Tue.messages(),Gue=g2(Ln({components:{Every:Aue,Period:Bue,Range:Lue,Fixed:Vue},mixins:[Zue],props:{tag:{type:String,default:due},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:59},n={min:1,step:1,max:59},o={min:0,step:1,max:59},r={min:0,step:1,max:59},i=[];for(let s=0;s<60;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(due),a=Ot(e.tag);return{Message:Kue,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.minute.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),Uue=Tue.messages(),que=g2(Ln({components:{Every:Aue,Period:Bue,Range:Lue,Fixed:Vue},mixins:[Zue],props:{tag:{type:String,default:due},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:23},n={min:1,step:1,max:23},o={min:0,step:1,max:23},r={min:0,step:1,max:23},i=[];for(let s=0;s<24;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(due),a=Ot(e.tag);return{Message:Uue,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.hour.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),Jue=Tue.messages(),ede={class:"cron-body-row"},tde={class:"symbol"},nde=g2(Ln({components:{Radio:EM},props:{type:{type:String,default:gue},tag:{type:String,default:gue},onChange:{type:Function}},setup:e=>({Message:Jue,change:function(){e.onChange&&e.onChange({tag:gue,type:gue})},UNFIXED:gue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",ede,[Cr(l,{checked:e.type===e.UNFIXED,onClick:e.change},{default:sn((()=>[Sr("span",tde,X(e.UNFIXED),1),Pr(X(e.Message.custom.unspecified),1)])),_:1},8,["checked","onClick"])])}]]),ode=Tue.messages(),rde={class:"cron-body-row"},ide={class:"symbol"},lde=g2(Ln({components:{Radio:EM,InputNumber:pQ},props:{lastConfig:{type:Object,default:null},targetTimeUnit:{type:String,default:null},timeUnit:{type:String,default:null},type:{type:String,default:mue},tag:{type:String,default:mue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Yr((()=>1===n.value?mue:"L-"+(n.value-1)));function r(t){if(e.type!==mue)return;if(t===mue)return void(n.value=1);const o=t.substring(2);xue(o)&&parseInt(o)>=e.lastConfig.min&&parseInt(o)<=e.lastConfig.max?n.value=parseInt(o)+1:xB.error(ode.common.numError+":"+o)}return Gn((()=>{r(e.tag)})),wn((()=>e.tag),(e=>{r(e)}),{deep:!0}),wn((()=>e.type),(()=>{r(e.tag)}),{deep:!0}),{Message:ode,type_:t,tag_:o,LAST:mue,lastNum:n,change:function(){e.onChange&&e.onChange({type:mue,tag:o.value})},changeTag:r}}}),[["render",function(e,t,n,o,r,i){const l=fn("InputNumber"),a=fn("Radio");return hr(),vr("div",rde,[Cr(a,{checked:e.type===e.LAST,onChange:e.change},{default:sn((()=>[Sr("span",ide,X(e.tag_),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.custom.lastTh)+" ",1),Cr(l,{size:"small",value:e.lastNum,"onUpdate:value":t[0]||(t[0]=t=>e.lastNum=t),min:e.lastConfig.min,step:e.lastConfig.step,max:e.lastConfig.max,disabled:e.type!==e.LAST,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),ade=Tue.messages(),sde={class:"cron-body-row"},cde={class:"symbol"},ude=g2(Ln({components:{Radio:EM,InputNumber:pQ},props:{targetTimeUnit:{type:String,default:null},startDateConfig:{type:Object,default:null},nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:vue},tag:{type:String,default:""},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(1),r=Yr((()=>`${n.value}${vue}`));function i(t){if(e.type!==vue)return;const o=t.substring(0,t.length-1);!xue(o)||parseInt(o)e.startDateConfig.max?xB.error(`${ade.common.numError}:${o}`):n.value=parseInt(o)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:ade,type_:t,startDate:n,weekDayNum:o,tag_:r,WORK_DAY:vue,change:function(){e.onChange&&e.onChange({type:vue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("InputNumber");return hr(),vr("div",sde,[Cr(l,{checked:e.type===e.WORK_DAY,onChange:e.change},{default:sn((()=>[Sr("span",cde,X(e.tag_),1),Pr(" "+X(e.Message.common.every)+X(e.targetTimeUnit),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",value:e.startDate,"onUpdate:value":t[0]||(t[0]=t=>e.startDate=t),min:e.startDateConfig.min,step:e.startDateConfig.step,max:e.startDateConfig.max,disabled:e.type!==e.WORK_DAY,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.nearest)+X(e.Message.custom.workDay),1)])}]]),dde=Tue.messages(),pde={class:"cron-body-row"},hde={class:"symbol"},fde=g2(Ln({components:{Radio:EM},props:{targetTimeUnit:{type:String,default:null},type:{type:String,default:Oue},tag:{type:String,default:Oue},onChange:{type:Function}},setup:e=>({Message:dde,change:function(){e.onChange&&e.onChange({tag:Oue,type:Oue})},LAST_WORK_DAY:Oue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",pde,[Cr(l,{checked:e.type===e.LAST_WORK_DAY,onClick:e.change},{default:sn((()=>[Sr("span",hde,X(e.LAST_WORK_DAY),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.custom.latestWorkday),1)])),_:1},8,["checked","onClick"])])}]]),gde=Tue.messages(),mde=31,vde=g2(Ln({components:{Every:Aue,Period:Bue,Range:Lue,Fixed:Vue,UnFixed:nde,Last:lde,WorkDay:ude,LastWorkDay:fde},mixins:[Zue],props:{tag:{type:String,default:due},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:mde},n={min:1,step:1,max:mde},o={min:1,step:1,max:mde},r={min:1,step:1,max:mde},i={min:1,step:1,max:mde},l=[];for(let c=1;c<32;c++){const e={label:c.toString(),value:c};l.push(e)}const a=Ot(due),s=Ot(e.tag);return{Message:gde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,lastConfig:i,nums:l,type_:a,tag_:s,change:function(t){a.value=t.type,s.value=t.tag,e.onChange&&e.onChange({type:a.value,tag:s.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed"),u=fn("UnFixed"),d=fn("Last"),p=fn("WorkDay"),h=fn("LastWorkDay");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Cr(u,{type:e.type_,nums:e.nums,onChange:e.change},null,8,["type","nums","onChange"]),Cr(d,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"last-config":e.lastConfig,onChange:e.change},null,8,["time-unit","type","tag","target-time-unit","last-config","onChange"]),Cr(p,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"start-date-config":e.startConfig,onChange:e.change},null,8,["time-unit","type","tag","target-time-unit","start-date-config","onChange"]),Cr(h,{type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"start-date-config":e.startConfig,onChange:e.change},null,8,["type","tag","target-time-unit","start-date-config","onChange"])],64)}]]),bde=Tue.messages(),yde=g2(Ln({components:{Every:Aue,Period:Bue,Range:Lue,Fixed:Vue},mixins:[Zue],props:{tag:{type:String,default:due},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:12},n={min:1,step:1,max:12},o={min:1,step:1,max:12},r={min:1,step:1,max:12},i=[];for(let s=1;s<13;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(due),a=Ot(e.tag);return{Message:bde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.month.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),Ode=Tue.messages(),wde={class:"cron-body-row"},xde={class:"symbol"},$de=g2(Ln({components:{Radio:EM},props:{timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:yue},tag:{type:String,default:yue},onChange:{type:Function}},setup:e=>({Message:Ode,change:function(){e.onChange&&e.onChange({tag:yue,type:yue})},EMPTY:yue})}),[["render",function(e,t,n,o,r,i){const l=fn("Radio");return hr(),vr("div",wde,[Cr(l,{checked:e.type===e.EMPTY,onClick:e.change},{default:sn((()=>[Sr("span",xde,X(e.Message.custom.empty),1)])),_:1},8,["checked","onClick"])])}]]),Sde=Tue.messages(),Cde=wue,kde=2099,Pde=g2(Ln({components:{Every:Aue,Period:Bue,Range:Lue,Fixed:Vue,Empty:$de},mixins:[Zue],props:{tag:{type:String,default:yue},onChange:{type:Function}},setup(e){const t={min:Cde,step:1,max:kde},n={min:1,step:1,max:kde},o={min:Cde,step:1,max:kde},r={min:Cde,step:1,max:kde},i=[];for(let s=Cde;s<2100;s++){const e={label:s.toString(),value:s};i.push(e)}const l=Ot(yue),a=Ot(e.tag);return{Message:Sde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed"),u=fn("Empty");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.year.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Cr(u,{type:e.type_,tag:e.tag_,onChange:e.change},null,8,["type","tag","onChange"])],64)}]]),Tde=Tue.messages(),Mde={class:"cron-body-row"},Ide={class:"symbol"},Ede=g2(Ln({components:{Radio:EM,InputNumber:pQ,ASelect:Vx},props:{nums:{type:Array,default:null},startConfig:{type:Object,default:null},cycleConfig:{type:Object,default:null},timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:pue},tag:{type:String,default:pue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(1),r=Yr((()=>`${n.value}${pue}${o.value}`));function i(t){if(e.type!==pue)return;const r=t.split(pue);2===r.length?!xue(r[0])||parseInt(r[0])e.startConfig.max?xB.error(`${Tde.period.startError}:${r[0]}`):!xue(r[1])||parseInt(r[1])e.cycleConfig.max?xB.error(`${Tde.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1])):xB.error(`${Tde.common.tagError}:${t}`)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Tde,type_:t,start:n,cycle:o,tag_:r,PERIOD:pue,change:function(){e.onChange&&e.onChange({type:pue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("ASelect"),s=fn("InputNumber");return hr(),vr("div",Mde,[Cr(l,{checked:e.type===e.PERIOD,onChange:e.change},{default:sn((()=>[Sr("span",Ide,X(e.tag_),1),Pr(" "+X(e.Message.common.from),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",style:{width:"100px"},value:e.start,"onUpdate:value":t[0]||(t[0]=t=>e.start=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"]),Pr(" "+X(e.Message.common.start)+X(e.Message.common.every)+" ",1),Cr(s,{size:"small",value:e.cycle,"onUpdate:value":t[1]||(t[1]=t=>e.cycle=t),min:e.cycleConfig.min,step:e.cycleConfig.step,max:e.cycleConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Pr(" "+X(e.timeUnit),1)])}]]),Ade=Tue.messages(),Rde=Vx.Option,Dde={class:"cron-body-row"},jde={class:"symbol"},Bde=g2(Ln({components:{Radio:EM,ASelect:Vx,AOption:Rde},props:{nums:{type:Array,default:null},upper:{type:Number,default:1},lowerConfig:{type:Object,default:null},upperConfig:{type:Object,default:null},timeUnit:{type:String,default:null},type:{type:String,default:hue},tag:{type:String,default:hue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(0);o.value`${o.value}${hue}${n.value}`));function l(t){if(e.type!==hue)return;const r=t.split(hue);2===r.length&&(r[0]===hue&&(r[0]=0),!xue(r[0])||parseInt(r[0])e.lowerConfig.max||!xue(r[1])||parseInt(r[1])e.upperConfig.max||(o.value=parseInt(r[0]),n.value=parseInt(r[1])))}return Gn((()=>{l(e.tag)})),wn((()=>e.tag),(e=>{l(e)}),{deep:!0}),wn((()=>e.type),(()=>{l(e.tag)}),{deep:!0}),{Message:Ade,type_:t,lower:o,cycle:r,tag_:i,upper_:n,RANGE:hue,change:function(){e.onChange&&e.onChange({type:hue,tag:i.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("AOption"),s=fn("ASelect");return hr(),vr("div",Dde,[Cr(l,{checked:e.type===e.RANGE,onChange:e.change},{default:sn((()=>[Sr("span",jde,X(e.tag_),1),Pr(" "+X(e.Message.common.between),1)])),_:1},8,["checked","onChange"]),Cr(s,{size:"small",style:{width:"100px"},value:e.lower,"onUpdate:value":t[0]||(t[0]=t=>e.lower=t),placeholder:e.Message.common.placeholder,disabled:e.type!==e.RANGE,onChange:e.change},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.nums,(t=>(hr(),br(a,{key:t.value,value:t.value,disabled:Number(t.value)>e.upper_},{default:sn((()=>[Pr(X(t.label),1)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value","placeholder","disabled","onChange"]),Pr(" "+X(e.timeUnit)+X(e.Message.common.and)+" ",1),Cr(s,{size:"small",style:{width:"100px"},value:e.upper_,"onUpdate:value":t[1]||(t[1]=t=>e.upper_=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"]),Pr(" "+X(e.Message.common.end)+X(e.Message.common.every)+X(e.timeUnit),1)])}]]),Nde=Tue.messages(),zde={class:"cron-body-row"},_de={class:"symbol"},Lde=g2(Ln({components:{Radio:EM,ASelect:Vx},props:{nums:{type:Array,default:null},targetTimeUnit:{type:String,default:null},timeUnit:{type:String,default:null},type:{type:String,default:mue},tag:{type:String,default:mue},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Yr((()=>(n.value>=1&&n.value<7?n.value:"")+mue));function r(t){if(e.type!==mue)return;if(t===mue)return void(n.value=7);const o=t.substring(0,t.length-1);xue(o)&&parseInt(o)>=parseInt(e.nums[0].value)&&parseInt(o)<=parseInt(e.nums[e.nums.length-1].value)?n.value=parseInt(o):xB.error(Nde.common.numError+":"+o)}return Gn((()=>{r(e.tag)})),wn((()=>e.tag),(e=>{r(e)}),{deep:!0}),wn((()=>e.type),(()=>{r(e.tag)}),{deep:!0}),{Message:Nde,type_:t,tag_:o,LAST:mue,lastNum:n,change:function(){e.onChange&&e.onChange({type:mue,tag:o.value})},changeTag:r}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("ASelect");return hr(),vr("div",zde,[Cr(l,{checked:e.type===e.LAST,onChange:e.change},{default:sn((()=>[Sr("span",_de,X(e.tag_),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.custom.lastTh),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",style:{width:"100px"},value:e.lastNum,"onUpdate:value":t[0]||(t[0]=t=>e.lastNum=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.LAST,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"])])}]]),Qde=Tue.messages(),Hde={class:"cron-body-row"},Fde={class:"symbol"},Wde=g2(Ln({components:{Radio:EM,InputNumber:pQ,ASelect:Vx},props:{targetTimeUnit:{type:String,default:null},nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:bue},tag:{type:String,default:""},onChange:{type:Function}},setup(e){const t=Ot(e.type),n=Ot(1),o=Ot(1),r=Yr((()=>`${n.value}${bue}${o.value}`));function i(t){if(e.type!==bue)return;const r=t.split(bue);2===r.length?!xue(r[0])||parseInt(r[0])parseInt(e.nums[e.nums.length-1].value)?xB.error(`${Qde.period.startError}:${r[0]}`):!xue(r[1])||parseInt(r[1])<1||parseInt(r[1])>5?xB.error(`${Qde.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1])):xB.error(`${Qde.common.tagError}:${t}`)}return Gn((()=>{i(e.tag)})),wn((()=>e.tag),(e=>{i(e)}),{deep:!0}),wn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Qde,type_:t,nth:n,weekDayNum:o,tag_:r,WEEK_DAY:bue,change:function(){e.onChange&&e.onChange({type:bue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=fn("Radio"),a=fn("InputNumber"),s=fn("ASelect");return hr(),vr("div",Hde,[Cr(l,{checked:e.type===e.WEEK_DAY,onChange:e.change},{default:sn((()=>[Sr("span",Fde,X(e.tag_),1),Pr(" "+X(e.Message.common.current)+X(e.targetTimeUnit)+X(e.Message.common.nth),1)])),_:1},8,["checked","onChange"]),Cr(a,{size:"small",value:e.nth,"onUpdate:value":t[0]||(t[0]=t=>e.nth=t),min:1,step:1,max:5,disabled:e.type!==e.WEEK_DAY,onChange:e.change},null,8,["value","disabled","onChange"]),Pr(" "+X(e.Message.common.index)+" ",1),Cr(s,{size:"small",style:{width:"100px"},value:e.weekDayNum,"onUpdate:value":t[1]||(t[1]=t=>e.weekDayNum=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.WEEK_DAY,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"])])}]]),Vde=Tue.messages(),Zde=g2(Ln({components:{Every:Aue,Period:Ede,Range:Bde,Fixed:Vue,UnFixed:nde,Last:Lde,WeekDay:Wde},mixins:[Zue],props:{tag:{type:String,default:gue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:7},n={min:1,step:1,max:7},o={min:1,step:1,max:7},r={min:1,step:1,max:7},i={min:1,step:1,max:7},l=Vde.daysOfWeekOptions,a=Ot(due),s=Ot(e.tag);return{Message:Vde,startConfig:t,cycleConfig:o,lowerConfig:r,upperConfig:i,startDateConfig:n,nums:l,type_:a,tag_:s,change:function(t){a.value=t.type,s.value=t.tag,e.onChange&&e.onChange({type:a.value,tag:s.value})}}}}),[["render",function(e,t,n,o,r,i){const l=fn("Every"),a=fn("Period"),s=fn("Range"),c=fn("Fixed"),u=fn("UnFixed"),d=fn("Last"),p=fn("WeekDay");return hr(),vr(ar,null,[Cr(l,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Cr(a,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","nums","start-config","cycle-config","onChange"]),Cr(s,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","nums","lower-config","upper-config","onChange"]),Cr(c,{"time-unit":e.Message.dayOfWeek.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Cr(u,{type:e.type_,nums:e.nums,onChange:e.change},null,8,["type","nums","onChange"]),Cr(d,{"time-unit":e.Message.dayOfWeek.title,"target-time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,"last-config":e.startDateConfig,onChange:e.change},null,8,["time-unit","target-time-unit","type","tag","nums","last-config","onChange"]),Cr(p,{"time-unit":e.Message.dayOfWeek.title,"target-time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","target-time-unit","type","tag","nums","onChange"])],64)}]]),Xde=Tue.messages(),Yde=Ln({name:"VueCron",components:{AInput:Uz,Popover:TS,Card:CE,Seconds:Yue,Minutes:Gue,Hours:que,Days:vde,Months:yde,Years:Pde,WeekDays:Zde,CalendarOutlined:fN},props:{value:{type:String,default:"* * * * * ? *"}},setup(e,{emit:t}){const n=Ot(""),o=Ot([]),r=[{key:"seconds",tab:Xde.second.title},{key:"minutes",tab:Xde.minute.title},{key:"hours",tab:Xde.hour.title},{key:"days",tab:Xde.dayOfMonth.title},{key:"months",tab:Xde.month.title},{key:"weekdays",tab:Xde.dayOfWeek.title},{key:"years",tab:Xde.year.title}],i=it({second:due,minute:due,hour:due,dayOfMonth:due,month:due,dayOfWeek:gue,year:yue}),l=Ot("seconds");function a(e){const o=e.trim().split(" ");if(!e||e.trim().length<11||6!==o.length&&7!==o.length){const e="* * * * * ?";return n.value=e,s(e),xB.error(Xde.common.tagError),t("update:value",e),void t("change",e)}s(e),i.second=o[0],i.minute=o[1],i.hour=o[2],i.dayOfMonth=o[3],i.month=o[4],i.dayOfWeek=o[5],i.year=7===o.length?o[6]:""}function s(e){t1(`/job/cron?cron=${e}`).then((e=>{if(o.value=e,0===o.value.length){const e="* * * * * ?";n.value=e,s(e),t("update:value",e),t("change",e)}}))}return wn((()=>e.value),(e=>{a(e),n.value=e}),{immediate:!0}),{cronStr:n,list:o,tabList:r,activeTabKey:l,tag:i,changeTime:a,timeChange:function(e,n){const o={...i};o[e]=n,"dayOfWeek"===e&&"*"!==n&&"?"!==n?o.dayOfMonth="?":"dayOfMonth"===e&&"*"!==n&&"?"!==n&&(o.dayOfWeek="?");let r=[];r.push(o.second),r.push(o.minute),r.push(o.hour),r.push(o.dayOfMonth),r.push(o.month),r.push(o.dayOfWeek),r.push(o.year),s(r.join(" ").trim()),t("update:value",r.join(" ").trim()),t("change",r.join(" ").trim())}}}}),Kde={key:0},Gde={key:1},Ude={key:2},qde={key:3},Jde={key:4},epe={key:5},tpe={key:6},npe={style:{display:"flex","align-items":"center","justify-content":"space-between"}},ope=Sr("span",{style:{width:"150px","font-weight":"600"}},"CRON 表达式: ",-1),rpe=Sr("div",{style:{margin:"20px 0","border-left":"#1677ff 5px solid","font-size":"medium","font-weight":"bold"}},"    近5次的运行时间: ",-1),ipe=g2(Yde,[["render",function(e,t,n,o,r,i){const l=fn("AInput"),a=fn("CalendarOutlined"),s=fn("Seconds"),c=fn("Minutes"),u=fn("Hours"),d=fn("Days"),p=fn("Months"),h=fn("WeekDays"),f=fn("Years"),g=fn("a-tab-pane"),m=fn("a-tabs"),v=fn("a-divider"),b=fn("a-input"),y=fn("a-button"),O=fn("Card"),w=fn("Popover");return hr(),br(w,{placement:"bottom",trigger:"click"},{content:sn((()=>[Cr(O,{size:"small"},{default:sn((()=>[Cr(m,{activeKey:e.activeTabKey,"onUpdate:activeKey":t[7]||(t[7]=t=>e.activeTabKey=t),type:"card"},{default:sn((()=>[(hr(!0),vr(ar,null,io(e.tabList,(n=>(hr(),br(g,{key:n.key},{tab:sn((()=>[Sr("span",null,[Cr(a),Pr(" "+X(n.tab),1)])])),default:sn((()=>["seconds"===e.activeTabKey?(hr(),vr("div",Kde,[Cr(s,{tag:e.tag.second,onChange:t[0]||(t[0]=t=>e.timeChange("second",t.tag))},null,8,["tag"])])):"minutes"===e.activeTabKey?(hr(),vr("div",Gde,[Cr(c,{tag:e.tag.minute,onChange:t[1]||(t[1]=t=>e.timeChange("minute",t.tag))},null,8,["tag"])])):"hours"===e.activeTabKey?(hr(),vr("div",Ude,[Cr(u,{tag:e.tag.hour,onChange:t[2]||(t[2]=t=>e.timeChange("hour",t.tag))},null,8,["tag"])])):"days"===e.activeTabKey?(hr(),vr("div",qde,[Cr(d,{tag:e.tag.dayOfMonth,onChange:t[3]||(t[3]=t=>e.timeChange("dayOfMonth",t.tag))},null,8,["tag"])])):"months"===e.activeTabKey?(hr(),vr("div",Jde,[Cr(p,{tag:e.tag.month,onChange:t[4]||(t[4]=t=>e.timeChange("month",t.tag))},null,8,["tag"])])):"weekdays"===e.activeTabKey?(hr(),vr("div",epe,[Cr(h,{tag:e.tag.dayOfWeek,onChange:t[5]||(t[5]=t=>e.timeChange("dayOfWeek",t.tag))},null,8,["tag"])])):"years"===e.activeTabKey?(hr(),vr("div",tpe,[Cr(f,{tag:e.tag.year,onChange:t[6]||(t[6]=t=>e.timeChange("year",t.tag))},null,8,["tag"])])):Tr("",!0)])),_:2},1024)))),128))])),_:1},8,["activeKey"]),Cr(v),Sr("div",npe,[ope,Cr(b,{value:e.cronStr,"onUpdate:value":t[8]||(t[8]=t=>e.cronStr=t)},null,8,["value"]),Cr(y,{type:"primary",style:{"margin-left":"16px"},onClick:t[9]||(t[9]=t=>e.changeTime(e.cronStr))},{default:sn((()=>[Pr("保存")])),_:1})]),Cr(v),rpe,(hr(!0),vr(ar,null,io(e.list,((e,t)=>(hr(),vr("div",{key:e,style:{"margin-top":"10px"}},"第"+X(t+1)+"次: "+X(e),1)))),128))])),_:1})])),default:sn((()=>[Cr(l,{readonly:"",value:e.value},null,8,["value"])])),_:1})}]]),lpe=Ln({__name:"StartDrawer",props:{open:P1().def(!1),modelValue:E1().def({})},emits:["update:open","save"],setup(e,{emit:t}){const n=t,o=e;let r="";const i=Ot(!1),l=Ot({}),a=Ot([]);wn((()=>o.open),(e=>{i.value=e}),{immediate:!0}),wn((()=>o.modelValue),(e=>{l.value=e,r=e.workflowName?e.workflowName:e.groupName?e.groupName:"请选择组"}),{immediate:!0,deep:!0});const s=Ot(),c=()=>{var e;null==(e=s.value)||e.validate().then((()=>{u(),n("save",l.value)})).catch((()=>{xB.warning("请检查表单信息")}))},u=()=>{n("update:open",!1),i.value=!1};Gn((()=>{Vt((()=>{d()}))}));const d=()=>{t1("/group/all/group-name/list").then((e=>{a.value=e}))},p=e=>{1===e?l.value.triggerInterval="* * * * * ?":2===e&&(l.value.triggerInterval="60")},h={groupName:[{required:!0,message:"请选择组",trigger:"change"}],triggerType:[{required:!0,message:"请选择触发类型",trigger:"change"}],triggerInterval:[{required:!0,message:"请输入触发间隔",trigger:"change"}],executorTimeout:[{required:!0,message:"请输入执行超时时间",trigger:"change"}],blockStrategy:[{required:!0,message:"请选择阻塞策略",trigger:"change"}],workflowStatus:[{required:!0,message:"请选择工作流状态",trigger:"change"}]};return(e,t)=>{const n=fn("a-input"),o=fn("a-form-item"),d=fn("a-select-option"),f=fn("a-select"),g=fn("a-col"),m=fn("a-input-number"),v=fn("a-form-item-rest"),b=fn("a-row"),y=fn("a-radio"),O=fn("a-radio-group"),w=fn("a-textarea"),x=fn("a-form"),$=fn("a-button"),S=fn("a-drawer");return hr(),br(S,{open:i.value,"onUpdate:open":t[9]||(t[9]=e=>i.value=e),title:Ct(r),"destroy-on-close":"",width:610,onClose:u},{footer:sn((()=>[Cr($,{type:"primary",onClick:c},{default:sn((()=>[Pr("保存")])),_:1}),Cr($,{style:{"margin-left":"12px"},onClick:u},{default:sn((()=>[Pr("取消")])),_:1})])),default:sn((()=>[Cr(x,{ref_key:"formRef",ref:s,layout:"vertical",model:l.value,rules:h,"label-align":"left","label-col":{style:{width:"100px"}}},{default:sn((()=>[Cr(o,{name:"workflowName",label:"工作流名称"},{default:sn((()=>[Cr(n,{value:l.value.workflowName,"onUpdate:value":t[0]||(t[0]=e=>l.value.workflowName=e),placeholder:"请输入工作流名称"},null,8,["value"])])),_:1}),Cr(o,{name:"groupName",label:"组名称"},{default:sn((()=>[Cr(f,{ref:"select",value:l.value.groupName,"onUpdate:value":t[1]||(t[1]=e=>l.value.groupName=e),placeholder:"请选择组"},{default:sn((()=>[(hr(!0),vr(ar,null,io(a.value,(e=>(hr(),br(d,{key:e,value:e},{default:sn((()=>[Pr(X(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(b,{gutter:24},{default:sn((()=>[Cr(g,{span:8},{default:sn((()=>[Cr(o,{name:"triggerType",label:"触发类型"},{default:sn((()=>[Cr(f,{ref:"select",value:l.value.triggerType,"onUpdate:value":t[2]||(t[2]=e=>l.value.triggerType=e),placeholder:"请选择触发类型",onChange:p},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(F1)),(e=>(hr(),br(d,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1}),Cr(g,{span:16},{default:sn((()=>[Cr(o,{name:"triggerInterval",label:"触发间隔"},{default:sn((()=>[Cr(v,null,{default:sn((()=>[1===l.value.triggerType?(hr(),br(Ct(ipe),{key:0,value:l.value.triggerInterval,"onUpdate:value":t[3]||(t[3]=e=>l.value.triggerInterval=e)},null,8,["value"])):(hr(),br(m,{key:1,addonAfter:"秒",style:{width:"-webkit-fill-available"},value:l.value.triggerInterval,"onUpdate:value":t[4]||(t[4]=e=>l.value.triggerInterval=e),placeholder:"请输入触发间隔"},null,8,["value"]))])),_:1})])),_:1})])),_:1})])),_:1}),Cr(b,{gutter:24},{default:sn((()=>[Cr(g,{span:8},{default:sn((()=>[Cr(o,{name:"executorTimeout",label:"执行超时时间"},{default:sn((()=>[Cr(m,{addonAfter:"秒",value:l.value.executorTimeout,"onUpdate:value":t[5]||(t[5]=e=>l.value.executorTimeout=e),placeholder:"请输入超时时间"},null,8,["value"])])),_:1})])),_:1}),Cr(g,{span:16},{default:sn((()=>[Cr(o,{name:"blockStrategy",label:"阻塞策略"},{default:sn((()=>[Cr(O,{value:l.value.blockStrategy,"onUpdate:value":t[6]||(t[6]=e=>l.value.blockStrategy=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(W1)),(e=>(hr(),br(y,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1})])),_:1}),Cr(o,{name:"workflowStatus",label:"节点状态"},{default:sn((()=>[Cr(O,{value:l.value.workflowStatus,"onUpdate:value":t[7]||(t[7]=e=>l.value.workflowStatus=e)},{default:sn((()=>[(hr(!0),vr(ar,null,io(Ct(R2)(Ct(Z1)),(e=>(hr(),br(y,{key:e.value,value:e.value},{default:sn((()=>[Pr(X(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Cr(o,{name:"description",label:"描述"},{default:sn((()=>[Cr(w,{value:l.value.description,"onUpdate:value":t[8]||(t[8]=e=>l.value.description=e),"auto-size":{minRows:5},placeholder:"请输入描述"},null,8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open","title"])}}}),ape=Ln({__name:"StartDetail",props:{modelValue:E1().def({}),open:P1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=Ot(!1);wn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=fn("a-descriptions-item"),l=fn("a-descriptions"),a=fn("a-drawer");return hr(),br(a,{title:"工作流详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:sn((()=>[Cr(l,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:sn((()=>[Cr(o,{label:"工作流名称"},{default:sn((()=>[Pr(X(e.modelValue.workflowName),1)])),_:1}),Cr(o,{label:"组名称"},{default:sn((()=>[Pr(X(e.modelValue.groupName),1)])),_:1}),Cr(o,{label:"触发类型"},{default:sn((()=>[Pr(X(Ct(F1)[e.modelValue.triggerType]),1)])),_:1}),Cr(o,{label:"触发间隔"},{default:sn((()=>[Pr(X(e.modelValue.triggerInterval)+" "+X(2===e.modelValue.triggerType?"秒":null),1)])),_:1}),Cr(o,{label:"执行超时时间"},{default:sn((()=>[Pr(X(e.modelValue.executorTimeout)+" 秒 ",1)])),_:1}),Cr(o,{label:"阻塞策略"},{default:sn((()=>[Pr(X(Ct(W1)[e.modelValue.blockStrategy]),1)])),_:1}),Cr(o,{label:"工作流状态"},{default:sn((()=>[Pr(X(Ct(Z1)[e.modelValue.workflowStatus]),1)])),_:1})])),_:1})])),_:1},8,["open"])}}}),spe=e=>(ln("data-v-c07f8c3a"),e=e(),an(),e),cpe={class:"node-wrap"},upe={class:"title",style:{background:"#ffffff"}},dpe={class:"text",style:{color:"#ff943e"}},ppe={key:0,class:"content"},hpe=spe((()=>Sr("span",{class:"content_label"},"组名称: ",-1))),fpe=spe((()=>Sr("span",{class:"content_label"},"阻塞策略: ",-1))),gpe=spe((()=>Sr("div",null,".........",-1))),mpe={key:1,class:"content"},vpe=[spe((()=>Sr("span",{class:"placeholder"}," 请配置工作流 ",-1)))],bpe=g2(Ln({__name:"StartNode",props:{modelValue:E1().def({}),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=Ot({}),i=Ot({});wn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0}),wn((()=>i.value),(e=>{n("update:modelValue",e)}));const l=e1();wn((()=>i.value.groupName),(e=>{e&&(l.setGroupName(e),t1(`/job/list?groupName=${e}`).then((e=>{l.setJobList(e)})))}),{immediate:!0});const a=Ot(!1),s=Ot(!1),c=e=>{i.value=e},u=()=>{0===l.TYPE?(r.value=JSON.parse(JSON.stringify(i.value)),a.value=!0):s.value=!0};return(t,n)=>{const o=fn("a-badge"),d=fn("a-typography-text"),p=fn("a-tooltip");return hr(),vr("div",cpe,[Sr("div",{class:W([e.disabled?"start-node-disabled":"node-wrap-box-hover","node-wrap-box start-node node-error-success"]),onClick:u},[Sr("div",upe,[Sr("span",dpe,[Cr(o,{status:"processing",color:1===i.value.workflowStatus?"#52c41a":"#ff000d"},null,8,["color"]),Pr(" "+X(i.value.workflowName?i.value.workflowName:"请选择组"),1)])]),i.value.groupName?(hr(),vr("div",ppe,[Sr("div",null,[hpe,Cr(d,{style:{width:"135px"},ellipsis:"",content:i.value.groupName},null,8,["content"])]),Sr("div",null,[fpe,Pr(X(Ct(W1)[i.value.blockStrategy]),1)]),gpe])):(hr(),vr("div",mpe,vpe)),2===Ct(l).TYPE?(hr(),br(p,{key:2},{title:sn((()=>[Pr(X(Ct(K1)[3].title),1)])),default:sn((()=>[Cr(Ct(Q1),{class:"error-tip",color:Ct(K1)[3].color,size:"24px",onClick:Vi((()=>{}),["stop"]),"model-value":Ct(K1)[3].icon},null,8,["color","model-value"])])),_:1})):Tr("",!0)],2),Cr(A2,{disabled:e.disabled,modelValue:i.value.nodeConfig,"onUpdate:modelValue":n[0]||(n[0]=e=>i.value.nodeConfig=e)},null,8,["disabled","modelValue"]),0!==Ct(l).TYPE?(hr(),br(ape,{key:0,open:s.value,"onUpdate:open":n[1]||(n[1]=e=>s.value=e),modelValue:i.value,"onUpdate:modelValue":n[2]||(n[2]=e=>i.value=e)},null,8,["open","modelValue"])):Tr("",!0),Cr(lpe,{open:a.value,"onUpdate:open":n[3]||(n[3]=e=>a.value=e),modelValue:r.value,"onUpdate:modelValue":n[4]||(n[4]=e=>r.value=e),onSave:c},null,8,["open","modelValue"])])}}}),[["__scopeId","data-v-c07f8c3a"]]),ype={class:"workflow-design"},Ope={class:"box-scale"},wpe=Sr("div",{class:"end-node"},[Sr("div",{class:"end-node-circle"}),Sr("div",{class:"end-node-text"},"流程结束")],-1),xpe=Ln({__name:"WorkFlow",props:{modelValue:E1().def({}),disabled:P1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=Ot({});return wn((()=>o.modelValue),(e=>{r.value=e}),{immediate:!0,deep:!0}),wn((()=>r.value),(e=>{n("update:modelValue",e)})),(t,n)=>(hr(),vr("div",ype,[Sr("div",Ope,[Cr(bpe,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),disabled:e.disabled},null,8,["modelValue","disabled"]),r.value.nodeConfig?(hr(),br(uue,{key:0,modelValue:r.value.nodeConfig,"onUpdate:modelValue":n[1]||(n[1]=e=>r.value.nodeConfig=e),disabled:e.disabled},null,8,["modelValue","disabled"])):Tr("",!0),wpe])]))}}),$pe={style:{width:"calc(100vw - 16px)",height:"calc(100vh - 48px)"}},Spe={class:"buttons"},Cpe={style:{overflow:"auto",width:"100vw",height:"calc(100vh - 48px)"}},kpe=g2(Ln({__name:"App",setup(e){const t=e=>{const t={},n=window.location.href.split("?")[1];return n&&n.split("&").forEach((e=>{const n=e.split("=")[1],o=e.split("=")[0];t[o]=n})),t[e]},n=e1(),o=t("id"),r=localStorage.getItem("Access-Token"),i=localStorage.getItem("app_namespace"),l="xkjIc2ZHZ0"===t("x1c2Hdd6"),a="kaxC8Iml"===t("x1c2Hdd6")||l;Gn((()=>{if(n.clear(),!["D7Rzd7Oe","kaxC8Iml","xkjIc2ZHZ0"].includes(t("x1c2Hdd6")))return s.value=!0,void xB.error({content:"未知错误,请联系管理员",duration:0});n.setId(o),n.setToken(r),n.setNameSpaceId(i),n.setType(a?l?2:1:0),c.value=a,o&&"undefined"!==o&&(l?f():h())}));const s=Ot(!1),c=Ot(!1),u=Ot({workflowStatus:1,blockStrategy:1,description:void 0,executorTimeout:60}),d=()=>{"undefined"===o?t1("/workflow","post",u.value).then((()=>{window.parent.postMessage({code:"SV5ucvLBhvFkOftb",data:JSON.stringify(u.value)})})):t1("/workflow","put",u.value).then((()=>{window.parent.postMessage({code:"8Rr3XPtVVAHfduQg",data:JSON.stringify(u.value)})}))},p=()=>{window.parent.postMessage({code:"kb4DO9h6WIiqFhbp"})},h=()=>{s.value=!0,t1(`/workflow/${o}`).then((e=>{u.value=e})).finally((()=>{s.value=!1}))},f=()=>{s.value=!0,t1(`/workflow/batch/${o}`).then((e=>{u.value=e})).finally((()=>{s.value=!1}))};return(e,t)=>{const n=fn("a-button"),o=fn("a-affix"),r=fn("a-spin");return hr(),vr("div",$pe,[c.value?Tr("",!0):(hr(),br(o,{key:0,"offset-top":0},{default:sn((()=>[Sr("div",Spe,[Cr(n,{type:"primary",siz:"large",onClick:d},{default:sn((()=>[Pr("保存")])),_:1}),Cr(n,{siz:"large",style:{"margin-left":"16px"},onClick:p},{default:sn((()=>[Pr("取消")])),_:1})])])),_:1})),Sr("div",Cpe,[Cr(r,{spinning:s.value},{default:sn((()=>[Cr(Ct(xpe),{class:"work-flow",modelValue:u.value,"onUpdate:modelValue":t[0]||(t[0]=e=>u.value=e),disabled:c.value},null,8,["modelValue","disabled"])])),_:1},8,["spinning"])])])}}}),[["__scopeId","data-v-633f102f"]]);function Ppe(e,t){var n;return e="object"==typeof(n=e)&&null!==n?e:Object.create(null),new Proxy(e,{get:(e,n,o)=>"key"===n?Reflect.get(e,n,o):Reflect.get(e,n,o)||Reflect.get(t,n,o)})}function Tpe(e,{storage:t,serializer:n,key:o,debug:r}){try{const r=null==t?void 0:t.getItem(o);r&&e.$patch(null==n?void 0:n.deserialize(r))}catch(Rpe){}}function Mpe(e,{storage:t,serializer:n,key:o,paths:r,debug:i}){try{const i=Array.isArray(r)?function(e,t){return t.reduce(((t,n)=>{const o=n.split(".");return function(e,t,n){return t.slice(0,-1).reduce(((e,t)=>/^(__proto__)$/.test(t)?{}:e[t]=e[t]||{}),e)[t[t.length-1]]=n,e}(t,o,function(e,t){return t.reduce(((e,t)=>null==e?void 0:e[t]),e)}(e,o))}),{})}(e,r):e;t.setItem(o,n.serialize(i))}catch(Rpe){}}var Ipe=function(e={}){return t=>{const{auto:n=!1}=e,{options:{persist:o=n},store:r,pinia:i}=t;if(!o)return;if(!(r.$id in i.state.value)){const e=i._s.get(r.$id.replace("__hot:",""));return void(e&&Promise.resolve().then((()=>e.$persist())))}const l=(Array.isArray(o)?o.map((t=>Ppe(t,e))):[Ppe(o,e)]).map(function(e,t){return n=>{var o;try{const{storage:r=localStorage,beforeRestore:i,afterRestore:l,serializer:a={serialize:JSON.stringify,deserialize:JSON.parse},key:s=t.$id,paths:c=null,debug:u=!1}=n;return{storage:r,beforeRestore:i,afterRestore:l,serializer:a,key:(null!=(o=e.key)?o:e=>e)("string"==typeof s?s:s(t.$id)),paths:c,debug:u}}catch(Rpe){return n.debug,null}}}(e,r)).filter(Boolean);r.$persist=()=>{l.forEach((e=>{Mpe(r.$state,e)}))},r.$hydrate=({runHooks:e=!0}={})=>{l.forEach((n=>{const{beforeRestore:o,afterRestore:i}=n;e&&(null==o||o(t)),Tpe(r,n),e&&(null==i||i(t))}))},l.forEach((e=>{const{beforeRestore:n,afterRestore:o}=e;null==n||n(t),Tpe(r,e),null==o||o(t),r.$subscribe(((t,n)=>{Mpe(n,e)}),{detached:!0})}))}}();const Epe=function(){const e=J(!0),t=e.run((()=>Ot({})));let n=[],o=[];const r=ht({install(e){qi(r),r._a=e,e.provide(Ji,r),e.config.globalProperties.$pinia=r,o.forEach((e=>n.push(e))),o=[]},use(e){return this._a?n.push(e):o.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return r}();Epe.use(Ipe);const Ape=Gi(kpe);Ape.use(J0),Ape.use(Epe),Ape.mount("#app")}},function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports});export default o(); diff --git a/frontend/public/lib/assets/vhU7tY2l.css b/frontend/public/lib/assets/yQfA4Ykm.css similarity index 99% rename from frontend/public/lib/assets/vhU7tY2l.css rename to frontend/public/lib/assets/yQfA4Ykm.css index ebc64d10e..2003f160f 100644 --- a/frontend/public/lib/assets/vhU7tY2l.css +++ b/frontend/public/lib/assets/yQfA4Ykm.css @@ -1 +1 @@ -.log[data-v-ab46a2e9]{height:80vh;color:#abb2bf;background-color:#282c34;position:relative!important;box-sizing:border-box;display:flex!important;flex-direction:column}.log .scroller[data-v-ab46a2e9]{height:100%;overflow:auto;display:flex!important;align-items:flex-start!important;font-family:monospace;line-height:1.4;position:relative;z-index:0}.log .scroller .gutters[data-v-ab46a2e9]{min-height:108px;position:sticky;background-color:#1e1f22;color:#7d8799;border:none;flex-shrink:0;display:flex;flex-direction:column;height:100%;box-sizing:border-box;inset-inline-start:0;z-index:200}.log .scroller .gutters .gutter-element[data-v-ab46a2e9]{height:25px;font-size:14px;padding:0 8px 0 5px;min-width:20px;text-align:right;white-space:nowrap;box-sizing:border-box;color:#7d8799;display:flex;align-items:center;justify-content:flex-end}.log .scroller .content[data-v-ab46a2e9]{-moz-tab-size:4;tab-size:4;caret-color:transparent!important;margin:0;flex-grow:2;flex-shrink:0;white-space:pre;word-wrap:normal;box-sizing:border-box;min-height:100%;padding:4px 8px;outline:none;color:#bcbec4}.log .scroller .content .line[data-v-ab46a2e9]{height:25px;caret-color:transparent!important;font-size:16px;display:contents;padding:0 2px 0 6px}.log .scroller .content .line .text[data-v-ab46a2e9]{font-size:16px;height:25px}.empty[data-v-11227e3a]{display:flex;justify-content:center;align-items:center;height:calc(100% - 88px)}.icon[data-v-74f467a1]{margin:0;padding:0;display:flex;flex-wrap:wrap}.icon .anticon[data-v-74f467a1]{font-size:22px;justify-content:center;align-items:center}.icon p[data-v-74f467a1]{margin-bottom:0}.popover[data-v-c53370c6]{display:flex;align-items:center;justify-content:space-around}.popover .popover-item[data-v-c53370c6]{height:42px;display:flex;font-size:13px;align-items:center;justify-content:center;flex-direction:column;text-align:center}.popover .popover-item span[data-v-c53370c6]{margin-inline-start:0}.popover .popover-item .anticon[data-v-c53370c6]{font-size:22px;justify-content:center;align-items:center}.drawer-title[data-v-5d000a58]{display:flex;align-items:center;justify-content:space-between}.cm-scroller::-webkit-scrollbar{width:8px;height:8px}.cm-scroller::-webkit-scrollbar-thumb{background:#9c9c9c9c;-webkit-box-shadow:inset 0 0 3px rgba(0,0,0,.3)}.cm-scroller::-webkit-scrollbar-track{background:#282c34}.th[data-v-dc9046db],.th[data-v-affb0f89]{padding:16px 24px;color:#000000e0;font-weight:400;font-size:14px;line-height:1.57142857;text-align:start;box-sizing:border-box;background-color:#00000005;border-inline-end:1px solid rgba(5,5,5,.06)}.auto-judge[data-v-affb0f89]{white-space:pre}.top-tips[data-v-affb0f89]{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;color:#646a73}.or-branch-link-tip[data-v-affb0f89]{margin:10px 0;color:#646a73}.condition-group-editor[data-v-affb0f89]{-webkit-user-select:none;user-select:none;border-radius:4px;border:1px solid #e4e5e7;position:relative;margin-bottom:16px}.condition-group-editor .branch-delete-icon[data-v-affb0f89]{font-size:18px}.condition-group-editor .header[data-v-affb0f89]{background-color:#f4f6f8;padding:0 12px;font-size:14px;color:#171e31;height:36px;display:flex;align-items:center}.condition-group-editor .header span[data-v-affb0f89]{flex:1}.condition-group-editor .main-content[data-v-affb0f89]{padding:0 12px}.condition-group-editor .main-content .condition-relation[data-v-affb0f89]{color:#9ca2a9;align-items:center;height:36px;display:flex;justify-content:space-between;padding:0 2px}.condition-group-editor .main-content .condition-content-box[data-v-affb0f89]{display:flex;justify-content:space-between;align-items:center}.condition-group-editor .main-content .condition-content-box div[data-v-affb0f89]{width:100%;min-width:120px}.condition-group-editor .main-content .condition-content-box div[data-v-affb0f89]:not(:first-child){margin-left:16px}.condition-group-editor .main-content .cell-box div[data-v-affb0f89]{padding:16px 0;width:100%;min-width:120px;color:#909399;font-size:14px;font-weight:600;text-align:center}.condition-group-editor .main-content .condition-content[data-v-affb0f89]{display:flex;flex-direction:column}.condition-group-editor .main-content .condition-content[data-v-affb0f89] .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.condition-group-editor .main-content .condition-content .content[data-v-affb0f89]{flex:1;padding:0 0 4px;display:flex;align-items:center;min-height:31.6px;flex-wrap:wrap}.condition-group-editor .sub-content[data-v-affb0f89]{padding:12px}.node-disabled[data-v-affb0f89]{color:#8f959e}.node-disabled .content[data-v-affb0f89]{white-space:normal;word-break:break-word}.node-disabled .title .node-title[data-v-affb0f89]{color:#8f959e!important}.node-disabled[data-v-affb0f89]:hover{cursor:default}.popover[data-v-714c9e92]{display:flex;align-items:center;justify-content:space-around}.popover .popover-item[data-v-714c9e92]{height:42px;display:flex;font-size:13px;align-items:center;justify-content:center;flex-direction:column;text-align:center}.popover .popover-item span[data-v-714c9e92]{margin-inline-start:0}.popover .popover-item .anticon[data-v-714c9e92]{font-size:22px;justify-content:center;align-items:center}.cron-body-row{margin-bottom:8px}.cron-body-row .symbol{color:#1677ff;margin-right:6px}.content[data-v-c07f8c3a]{line-height:136%}.workflow-design{width:100%}.workflow-design .box-scale{display:inline-block;position:relative;width:100%;align-items:flex-start;justify-content:center;flex-wrap:wrap;min-width:min-content}.content_label{font-weight:700}.workflow-design .node-wrap{display:inline-flex;width:100%;flex-flow:column wrap;justify-content:flex-start;align-items:center;padding:0;position:relative;z-index:1}.workflow-design .node-wrap-box{display:inline-flex;flex-direction:column;position:relative;width:220px;min-height:72px;flex-shrink:0;background:#fff;border-radius:4px;cursor:pointer;box-shadow:0 2px 5px #0000001a}.workflow-design .node-wrap-box:before{content:"";position:absolute;top:-12px;left:50%;transform:translate(-50%);width:0px;border-style:solid;border-width:8px 6px 4px;border-color:#cacaca transparent transparent}.workflow-design .start-node-disabled{border:1px solid #00000036;box-shadow:0 2px 5px #00000036}.workflow-design .node-wrap-box.start-node:before{content:none}.workflow-design .node-wrap-box .title{height:24px;line-height:24px;margin-top:8px;padding-left:16px;padding-right:30px;border-radius:4px 4px 0 0;position:relative;display:flex;align-items:center}.workflow-design .node-wrap-box .title .text{padding-left:5px;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap}.workflow-design .node-wrap-box .title .icon{margin-right:5px}.workflow-design .node-wrap-box .title .close{font-size:15px;position:absolute;top:50%;transform:translateY(-50%);right:10px;display:none}.workflow-design .node-wrap-box .content{position:relative;padding:13px 15px 15px}.workflow-design .node-wrap-box .content .placeholder{color:#999}.workflow-design .node-wrap-box-hover:hover .close{display:block}.workflow-design .add-node-btn-box{width:240px;display:inline-flex;flex-shrink:0;position:relative;z-index:1}.workflow-design .add-node-btn-box:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;margin:auto;width:2px;height:100%;background-color:#cacaca}.workflow-design .add-node-btn{-webkit-user-select:none;user-select:none;width:240px;padding:32px 0;display:flex;justify-content:center;flex-shrink:0;flex-grow:1}.workflow-design .add-branch{justify-content:center;padding:0 10px;position:absolute;top:-16px;left:50%;transform:translate(-50%);transform-origin:center center;z-index:1;display:inline-flex;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:500;font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;border-radius:20px;padding:8px 15px!important;color:#67c23a;background-color:#f0f9eb;border:1px solid #dcdfe6;border-color:#b3e19d}.workflow-design .add-branch:hover{color:#fff;border-color:#b3e19d;background-color:#67c23a}.workflow-design .branch-wrap{display:inline-flex;width:100%}.workflow-design .branch-box-wrap{display:flex;flex-flow:column wrap;align-items:center;min-height:270px;width:100%;flex-shrink:0}.workflow-design .col-box{display:inline-flex;flex-direction:column;align-items:center;position:relative}.workflow-design .branch-box{display:flex;overflow:visible;min-height:180px;height:auto;border-bottom:2px solid #ccc;border-top:2px solid #ccc;position:relative}.workflow-design .branch-box .col-box{background-color:#f0f2f5}.workflow-design .branch-box .col-box:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:0;margin:auto;width:2px;height:100%;background-color:#cacaca}.workflow-design .condition-node{display:inline-flex;flex-direction:column;min-height:280px}.workflow-design .condition-node-box{padding-top:30px;padding-right:50px;padding-left:50px;justify-content:center;align-items:center;flex-grow:1;position:relative;display:inline-flex;flex-direction:column}.workflow-design .condition-node-box:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;width:2px;height:100%;background-color:#cacaca}.workflow-design .auto-judge{position:relative;width:220px;min-height:72px;background:#fff;border-radius:4px;padding:15px;cursor:pointer;box-shadow:0 2px 5px #0000001a}.workflow-design .auto-judge:before{content:"";position:absolute;top:-12px;left:50%;transform:translate(-50%);width:0px;border-style:solid;border-width:8px 6px 4px;border-color:#cacaca transparent transparent;background:#efefef}.workflow-design .auto-judge .title{line-height:16px}.workflow-design .auto-judge .title .text{width:139px;display:block;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap}.workflow-design .auto-judge .title .node-title{width:130px;color:#15bc83;display:block;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap}.workflow-design .auto-judge .title .close{font-size:15px;position:absolute;top:15px;right:15px;color:#999;display:none}.workflow-design .auto-judge .title .priority-title{position:absolute;top:15px;right:15px;color:#999}.workflow-design .auto-judge .content{line-height:136%;position:relative;padding-top:15px;min-height:59px}.workflow-design .auto-judge .content .placeholder{color:#999}.workflow-design .auto-judge-hover:hover .close{display:block}.workflow-design .auto-judge-hover:hover .priority-title{display:none}.workflow-design .top-left-cover-line,.workflow-design .top-right-cover-line{position:absolute;height:3px;width:50%;background-color:#f0f2f5;top:-2px}.workflow-design .bottom-left-cover-line,.workflow-design .bottom-right-cover-line{position:absolute;height:3px;width:50%;background-color:#f0f2f5;bottom:-2px}.workflow-design .top-left-cover-line{left:-1px}.workflow-design .top-right-cover-line{right:-1px}.workflow-design .bottom-left-cover-line{left:-1px}.workflow-design .bottom-right-cover-line{right:-1px}.workflow-design .end-node{border-radius:50%;font-size:14px;color:#191f2566;text-align:left}.workflow-design .end-node-circle{width:10px;height:10px;margin:auto;border-radius:50%;background:#ccc}.workflow-design .end-node-text{margin-top:5px;text-align:center}.workflow-design .auto-judge-hover:hover .sort-left,.workflow-design .auto-judge-hover:hover .sort-right{display:flex}.workflow-design .auto-judge .sort-left{position:absolute;top:0;bottom:0;z-index:1;left:0;display:none;justify-content:center;align-items:center;flex-direction:column}.workflow-design .auto-judge .sort-right{position:absolute;top:0;bottom:0;z-index:1;right:0;display:none;justify-content:center;align-items:center;flex-direction:column}.workflow-design .auto-judge .sort-left:hover,.workflow-design .auto-judge .sort-right:hover{background:#eee}.workflow-design .auto-judge:after{pointer-events:none;content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;border-radius:4px;transition:all .1s}.workflow-design .auto-judge-def:hover:after{border:1px solid #3296fa;box-shadow:0 0 6px #3296fa4d}.workflow-design .node-wrap-box:after{pointer-events:none;content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;border-radius:4px;transition:all .1s}.workflow-design .node-wrap-box-hover:hover:after{border:1px solid #3296fa;box-shadow:0 0 6px #3296fa4d}.workflow-design .node-error-skip:after,.workflow-design .node-error-default:after{border:1px solid #00000036;box-shadow:0 0 10px #00000069}.workflow-design .node-error-waiting:after{border:1px solid #64a6ea;box-shadow:0 0 6px #64a6ea}.workflow-design .node-error-running:after{border:1px solid #1b7ee5;box-shadow:0 0 6px #1b7ee5}.workflow-design .node-error-success:after{border:1px solid #087da1;box-shadow:0 0 6px #087da1}.workflow-design .node-error-fail:after{border:1px solid #f52d80;box-shadow:0 0 6px #f52d80}.workflow-design .node-error-stop:after{border:1px solid #ac2df5;box-shadow:0 0 6px #ac2df5}.workflow-design .node-error-cancel:after{border:1px solid #f5732d;box-shadow:0 0 6px #f5732d}.workflow-design .error-tip{cursor:default;position:absolute;top:0;right:0;transform:translate(150%);font-size:24px}.tags-list{margin-top:15px;width:100%}.add-node-popover-body li{display:inline-block;width:80px;text-align:center;padding:10px 0}.add-node-popover-body li i{border:1px solid var(--el-border-color-light);width:40px;height:40px;border-radius:50%;text-align:center;line-height:38px;font-size:18px;cursor:pointer}.add-node-popover-body li i:hover{border:1px solid #3296fa;background:#3296fa;color:#fff!important}.add-node-popover-body li p{font-size:12px;margin-top:5px}.node-wrap-drawer__title{padding-right:40px}.node-wrap-drawer__title label{cursor:pointer}.node-wrap-drawer__title label:hover{border-bottom:1px dashed #409eff}.node-wrap-drawer__title .node-wrap-drawer__title-edit{color:#409eff;margin-left:10px;vertical-align:middle}.dark .workflow-design .node-wrap-box,.dark .workflow-design .auto-judge{background:#2b2b2b}.dark .workflow-design .col-box{background:var(--el-bg-color)}.dark .workflow-design .top-left-cover-line,.dark .workflow-design .top-right-cover-line,.dark .workflow-design .bottom-left-cover-line,.dark .workflow-design .bottom-right-cover-line{background-color:var(--el-bg-color)}.dark .workflow-design .node-wrap-box:before,.dark .workflow-design .auto-judge:before{background-color:var(--el-bg-color)}.dark .workflow-design .branch-box .add-branch{background:var(--el-bg-color)}.dark .workflow-design .end-node .end-node-text{color:#ccc}.dark .workflow-design .auto-judge .sort-left:hover,.dark .workflow-design .auto-judge .sort-right:hover{background:var(--el-bg-color)}.buttons[data-v-633f102f]{width:100vw;box-shadow:0 1px 4px #00152914;background-color:#fff;box-sizing:border-box;text-align:right;padding:8px}body{background-color:#f0f2f5}body .work-flow{margin-top:16px}html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6} +.log[data-v-ab46a2e9]{height:80vh;color:#abb2bf;background-color:#282c34;position:relative!important;box-sizing:border-box;display:flex!important;flex-direction:column}.log .scroller[data-v-ab46a2e9]{height:100%;overflow:auto;display:flex!important;align-items:flex-start!important;font-family:monospace;line-height:1.4;position:relative;z-index:0}.log .scroller .gutters[data-v-ab46a2e9]{min-height:108px;position:sticky;background-color:#1e1f22;color:#7d8799;border:none;flex-shrink:0;display:flex;flex-direction:column;height:100%;box-sizing:border-box;inset-inline-start:0;z-index:200}.log .scroller .gutters .gutter-element[data-v-ab46a2e9]{height:25px;font-size:14px;padding:0 8px 0 5px;min-width:20px;text-align:right;white-space:nowrap;box-sizing:border-box;color:#7d8799;display:flex;align-items:center;justify-content:flex-end}.log .scroller .content[data-v-ab46a2e9]{-moz-tab-size:4;tab-size:4;caret-color:transparent!important;margin:0;flex-grow:2;flex-shrink:0;white-space:pre;word-wrap:normal;box-sizing:border-box;min-height:100%;padding:4px 8px;outline:none;color:#bcbec4}.log .scroller .content .line[data-v-ab46a2e9]{height:25px;caret-color:transparent!important;font-size:16px;display:contents;padding:0 2px 0 6px}.log .scroller .content .line .text[data-v-ab46a2e9]{font-size:16px;height:25px}.empty[data-v-87b57530]{display:flex;justify-content:center;align-items:center;height:calc(100% - 88px)}.icon[data-v-74f467a1]{margin:0;padding:0;display:flex;flex-wrap:wrap}.icon .anticon[data-v-74f467a1]{font-size:22px;justify-content:center;align-items:center}.icon p[data-v-74f467a1]{margin-bottom:0}.popover[data-v-c53370c6]{display:flex;align-items:center;justify-content:space-around}.popover .popover-item[data-v-c53370c6]{height:42px;display:flex;font-size:13px;align-items:center;justify-content:center;flex-direction:column;text-align:center}.popover .popover-item span[data-v-c53370c6]{margin-inline-start:0}.popover .popover-item .anticon[data-v-c53370c6]{font-size:22px;justify-content:center;align-items:center}.drawer-title[data-v-5d000a58]{display:flex;align-items:center;justify-content:space-between}.cm-scroller::-webkit-scrollbar{width:8px;height:8px}.cm-scroller::-webkit-scrollbar-thumb{background:#9c9c9c9c;-webkit-box-shadow:inset 0 0 3px rgba(0,0,0,.3)}.cm-scroller::-webkit-scrollbar-track{background:#282c34}.th[data-v-dc9046db],.th[data-v-affb0f89]{padding:16px 24px;color:#000000e0;font-weight:400;font-size:14px;line-height:1.57142857;text-align:start;box-sizing:border-box;background-color:#00000005;border-inline-end:1px solid rgba(5,5,5,.06)}.auto-judge[data-v-affb0f89]{white-space:pre}.top-tips[data-v-affb0f89]{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;color:#646a73}.or-branch-link-tip[data-v-affb0f89]{margin:10px 0;color:#646a73}.condition-group-editor[data-v-affb0f89]{-webkit-user-select:none;user-select:none;border-radius:4px;border:1px solid #e4e5e7;position:relative;margin-bottom:16px}.condition-group-editor .branch-delete-icon[data-v-affb0f89]{font-size:18px}.condition-group-editor .header[data-v-affb0f89]{background-color:#f4f6f8;padding:0 12px;font-size:14px;color:#171e31;height:36px;display:flex;align-items:center}.condition-group-editor .header span[data-v-affb0f89]{flex:1}.condition-group-editor .main-content[data-v-affb0f89]{padding:0 12px}.condition-group-editor .main-content .condition-relation[data-v-affb0f89]{color:#9ca2a9;align-items:center;height:36px;display:flex;justify-content:space-between;padding:0 2px}.condition-group-editor .main-content .condition-content-box[data-v-affb0f89]{display:flex;justify-content:space-between;align-items:center}.condition-group-editor .main-content .condition-content-box div[data-v-affb0f89]{width:100%;min-width:120px}.condition-group-editor .main-content .condition-content-box div[data-v-affb0f89]:not(:first-child){margin-left:16px}.condition-group-editor .main-content .cell-box div[data-v-affb0f89]{padding:16px 0;width:100%;min-width:120px;color:#909399;font-size:14px;font-weight:600;text-align:center}.condition-group-editor .main-content .condition-content[data-v-affb0f89]{display:flex;flex-direction:column}.condition-group-editor .main-content .condition-content[data-v-affb0f89] .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.condition-group-editor .main-content .condition-content .content[data-v-affb0f89]{flex:1;padding:0 0 4px;display:flex;align-items:center;min-height:31.6px;flex-wrap:wrap}.condition-group-editor .sub-content[data-v-affb0f89]{padding:12px}.node-disabled[data-v-affb0f89]{color:#8f959e}.node-disabled .content[data-v-affb0f89]{white-space:normal;word-break:break-word}.node-disabled .title .node-title[data-v-affb0f89]{color:#8f959e!important}.node-disabled[data-v-affb0f89]:hover{cursor:default}.popover[data-v-714c9e92]{display:flex;align-items:center;justify-content:space-around}.popover .popover-item[data-v-714c9e92]{height:42px;display:flex;font-size:13px;align-items:center;justify-content:center;flex-direction:column;text-align:center}.popover .popover-item span[data-v-714c9e92]{margin-inline-start:0}.popover .popover-item .anticon[data-v-714c9e92]{font-size:22px;justify-content:center;align-items:center}.cron-body-row{margin-bottom:8px}.cron-body-row .symbol{color:#1677ff;margin-right:6px}.content[data-v-c07f8c3a]{line-height:136%}.workflow-design{width:100%}.workflow-design .box-scale{display:inline-block;position:relative;width:100%;align-items:flex-start;justify-content:center;flex-wrap:wrap;min-width:min-content}.content_label{font-weight:700}.workflow-design .node-wrap{display:inline-flex;width:100%;flex-flow:column wrap;justify-content:flex-start;align-items:center;padding:0;position:relative;z-index:1}.workflow-design .node-wrap-box{display:inline-flex;flex-direction:column;position:relative;width:220px;min-height:72px;flex-shrink:0;background:#fff;border-radius:4px;cursor:pointer;box-shadow:0 2px 5px #0000001a}.workflow-design .node-wrap-box:before{content:"";position:absolute;top:-12px;left:50%;transform:translate(-50%);width:0px;border-style:solid;border-width:8px 6px 4px;border-color:#cacaca transparent transparent}.workflow-design .start-node-disabled{border:1px solid #00000036;box-shadow:0 2px 5px #00000036}.workflow-design .node-wrap-box.start-node:before{content:none}.workflow-design .node-wrap-box .title{height:24px;line-height:24px;margin-top:8px;padding-left:16px;padding-right:30px;border-radius:4px 4px 0 0;position:relative;display:flex;align-items:center}.workflow-design .node-wrap-box .title .text{padding-left:5px;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap}.workflow-design .node-wrap-box .title .icon{margin-right:5px}.workflow-design .node-wrap-box .title .close{font-size:15px;position:absolute;top:50%;transform:translateY(-50%);right:10px;display:none}.workflow-design .node-wrap-box .content{position:relative;padding:13px 15px 15px}.workflow-design .node-wrap-box .content .placeholder{color:#999}.workflow-design .node-wrap-box-hover:hover .close{display:block}.workflow-design .add-node-btn-box{width:240px;display:inline-flex;flex-shrink:0;position:relative;z-index:1}.workflow-design .add-node-btn-box:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;margin:auto;width:2px;height:100%;background-color:#cacaca}.workflow-design .add-node-btn{-webkit-user-select:none;user-select:none;width:240px;padding:32px 0;display:flex;justify-content:center;flex-shrink:0;flex-grow:1}.workflow-design .add-branch{justify-content:center;padding:0 10px;position:absolute;top:-16px;left:50%;transform:translate(-50%);transform-origin:center center;z-index:1;display:inline-flex;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:500;font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;border-radius:20px;padding:8px 15px!important;color:#67c23a;background-color:#f0f9eb;border:1px solid #dcdfe6;border-color:#b3e19d}.workflow-design .add-branch:hover{color:#fff;border-color:#b3e19d;background-color:#67c23a}.workflow-design .branch-wrap{display:inline-flex;width:100%}.workflow-design .branch-box-wrap{display:flex;flex-flow:column wrap;align-items:center;min-height:270px;width:100%;flex-shrink:0}.workflow-design .col-box{display:inline-flex;flex-direction:column;align-items:center;position:relative}.workflow-design .branch-box{display:flex;overflow:visible;min-height:180px;height:auto;border-bottom:2px solid #ccc;border-top:2px solid #ccc;position:relative}.workflow-design .branch-box .col-box{background-color:#f0f2f5}.workflow-design .branch-box .col-box:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:0;margin:auto;width:2px;height:100%;background-color:#cacaca}.workflow-design .condition-node{display:inline-flex;flex-direction:column;min-height:280px}.workflow-design .condition-node-box{padding-top:30px;padding-right:50px;padding-left:50px;justify-content:center;align-items:center;flex-grow:1;position:relative;display:inline-flex;flex-direction:column}.workflow-design .condition-node-box:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;width:2px;height:100%;background-color:#cacaca}.workflow-design .auto-judge{position:relative;width:220px;min-height:72px;background:#fff;border-radius:4px;padding:15px;cursor:pointer;box-shadow:0 2px 5px #0000001a}.workflow-design .auto-judge:before{content:"";position:absolute;top:-12px;left:50%;transform:translate(-50%);width:0px;border-style:solid;border-width:8px 6px 4px;border-color:#cacaca transparent transparent;background:#efefef}.workflow-design .auto-judge .title{line-height:16px}.workflow-design .auto-judge .title .text{width:139px;display:block;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap}.workflow-design .auto-judge .title .node-title{width:130px;color:#15bc83;display:block;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap}.workflow-design .auto-judge .title .close{font-size:15px;position:absolute;top:15px;right:15px;color:#999;display:none}.workflow-design .auto-judge .title .priority-title{position:absolute;top:15px;right:15px;color:#999}.workflow-design .auto-judge .content{line-height:136%;position:relative;padding-top:15px;min-height:59px}.workflow-design .auto-judge .content .placeholder{color:#999}.workflow-design .auto-judge-hover:hover .close{display:block}.workflow-design .auto-judge-hover:hover .priority-title{display:none}.workflow-design .top-left-cover-line,.workflow-design .top-right-cover-line{position:absolute;height:3px;width:50%;background-color:#f0f2f5;top:-2px}.workflow-design .bottom-left-cover-line,.workflow-design .bottom-right-cover-line{position:absolute;height:3px;width:50%;background-color:#f0f2f5;bottom:-2px}.workflow-design .top-left-cover-line{left:-1px}.workflow-design .top-right-cover-line{right:-1px}.workflow-design .bottom-left-cover-line{left:-1px}.workflow-design .bottom-right-cover-line{right:-1px}.workflow-design .end-node{border-radius:50%;font-size:14px;color:#191f2566;text-align:left}.workflow-design .end-node-circle{width:10px;height:10px;margin:auto;border-radius:50%;background:#ccc}.workflow-design .end-node-text{margin-top:5px;text-align:center}.workflow-design .auto-judge-hover:hover .sort-left,.workflow-design .auto-judge-hover:hover .sort-right{display:flex}.workflow-design .auto-judge .sort-left{position:absolute;top:0;bottom:0;z-index:1;left:0;display:none;justify-content:center;align-items:center;flex-direction:column}.workflow-design .auto-judge .sort-right{position:absolute;top:0;bottom:0;z-index:1;right:0;display:none;justify-content:center;align-items:center;flex-direction:column}.workflow-design .auto-judge .sort-left:hover,.workflow-design .auto-judge .sort-right:hover{background:#eee}.workflow-design .auto-judge:after{pointer-events:none;content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;border-radius:4px;transition:all .1s}.workflow-design .auto-judge-def:hover:after{border:1px solid #3296fa;box-shadow:0 0 6px #3296fa4d}.workflow-design .node-wrap-box:after{pointer-events:none;content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;border-radius:4px;transition:all .1s}.workflow-design .node-wrap-box-hover:hover:after{border:1px solid #3296fa;box-shadow:0 0 6px #3296fa4d}.workflow-design .node-error-skip:after,.workflow-design .node-error-default:after{border:1px solid #00000036;box-shadow:0 0 10px #00000069}.workflow-design .node-error-waiting:after{border:1px solid #64a6ea;box-shadow:0 0 6px #64a6ea}.workflow-design .node-error-running:after{border:1px solid #1b7ee5;box-shadow:0 0 6px #1b7ee5}.workflow-design .node-error-success:after{border:1px solid #087da1;box-shadow:0 0 6px #087da1}.workflow-design .node-error-fail:after{border:1px solid #f52d80;box-shadow:0 0 6px #f52d80}.workflow-design .node-error-stop:after{border:1px solid #ac2df5;box-shadow:0 0 6px #ac2df5}.workflow-design .node-error-cancel:after{border:1px solid #f5732d;box-shadow:0 0 6px #f5732d}.workflow-design .error-tip{cursor:default;position:absolute;top:0;right:0;transform:translate(150%);font-size:24px}.tags-list{margin-top:15px;width:100%}.add-node-popover-body li{display:inline-block;width:80px;text-align:center;padding:10px 0}.add-node-popover-body li i{border:1px solid var(--el-border-color-light);width:40px;height:40px;border-radius:50%;text-align:center;line-height:38px;font-size:18px;cursor:pointer}.add-node-popover-body li i:hover{border:1px solid #3296fa;background:#3296fa;color:#fff!important}.add-node-popover-body li p{font-size:12px;margin-top:5px}.node-wrap-drawer__title{padding-right:40px}.node-wrap-drawer__title label{cursor:pointer}.node-wrap-drawer__title label:hover{border-bottom:1px dashed #409eff}.node-wrap-drawer__title .node-wrap-drawer__title-edit{color:#409eff;margin-left:10px;vertical-align:middle}.dark .workflow-design .node-wrap-box,.dark .workflow-design .auto-judge{background:#2b2b2b}.dark .workflow-design .col-box{background:var(--el-bg-color)}.dark .workflow-design .top-left-cover-line,.dark .workflow-design .top-right-cover-line,.dark .workflow-design .bottom-left-cover-line,.dark .workflow-design .bottom-right-cover-line{background-color:var(--el-bg-color)}.dark .workflow-design .node-wrap-box:before,.dark .workflow-design .auto-judge:before{background-color:var(--el-bg-color)}.dark .workflow-design .branch-box .add-branch{background:var(--el-bg-color)}.dark .workflow-design .end-node .end-node-text{color:#ccc}.dark .workflow-design .auto-judge .sort-left:hover,.dark .workflow-design .auto-judge .sort-right:hover{background:var(--el-bg-color)}.buttons[data-v-633f102f]{width:100vw;box-shadow:0 1px 4px #00152914;background-color:#fff;box-sizing:border-box;text-align:right;padding:8px}body{background-color:#f0f2f5}body .work-flow{margin-top:16px}html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6} diff --git a/frontend/public/lib/index.html b/frontend/public/lib/index.html index c27e20da4..b25427e10 100644 --- a/frontend/public/lib/index.html +++ b/frontend/public/lib/index.html @@ -5,8 +5,8 @@ Easy Retry - - + +